Skip to content

Build your personal knowledge base with Trilium Notes

docs(user): network access flag

Elian Doranc0a84bfe7ed0
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.html
index eaaee1340f..85edddf6f6 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.html
@@ -1,24 +1,55 @@
-<p>The Trilium desktop app opens a TCP port (usually <code spellcheck="false">37840</code>)
- for the following reasons:</p>
-<ul>
- <li>Integration with the&nbsp;<a class="reference-link" href="#root/_help_MtPxeAWVAzMg">Web Clipper</a>.</li>
- <li>Desktop-to-desktop&nbsp;<a class="reference-link" href="#root/_help_cbkrhQjrkKrh">Synchronization</a>.</li>
- <li>Making Trilium accessible over the web, similar to a&nbsp;<a class="reference-link"
- href="#root/_help_WOcw2SLH6tbX">Server Installation</a>. See&nbsp;<a class="reference-link"
- href="#root/_help_nRqcgfTb97uV">Using the desktop application as a server</a>.</li>
-</ul>
-<h2>Enabling access on the LAN</h2>
-<p>Before v0.104.0, this port was open for the entire local network. After
- v0.104.0 the port is open only on <code spellcheck="false">localhost</code> (127.0.0.1).
- This prevents other devices on the same network — and websites you open
- in another browser on the same machine — from reaching the Trilium API.
- If you don't use the desktop as a sync source, remote server, you don't
- need to change anything.</p>
-<p>To open the port on all networks, modify <a href="#root/_help_Gzjqa934BdH4">config.ini</a>&nbsp;as
- follows:</p><pre><code class="language-text-x-trilium-auto">[Network]
-host=0.0.0.0</code></pre>
-<aside class="admonition note">
- <p>If you use the&nbsp;<a class="reference-link" href="#root/_help_MtPxeAWVAzMg">Web Clipper</a>&nbsp;on
- the same device as the one running the desktop application, there is no
- need to enable access on the LAN.</p>
-</aside>
\ No newline at end of file
+<p>Prior to v0.104.0, the <a href="#root/_help_poXkQfguuA0U">desktop application</a> would
+ also open a network port so that it can offer access to&nbsp;<a class="reference-link"
+ href="#root/_help_pgxEVkzLl1OP">ETAPI (REST API)</a>&nbsp;or even use it as a
+ web server (see&nbsp;<a class="reference-link" href="#root/_help_nRqcgfTb97uV">Using the desktop application as a server</a>).</p>
+<p>In order to reduce the attack surface, Trilium now enables these services
+ only for the local device (e.g. <code spellcheck="false">localhost</code>)
+ instead of serving them over the LAN.</p>
+<p>To better understand what is affected, refer to the following table:</p>
+<figure
+class="table">
+ <table>
+ <thead>
+ <tr>
+ <th>Feature</th>
+ <th>Network access OFF</th>
+ <th>Network access ON</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><a class="reference-link" href="#root/_help_MtPxeAWVAzMg">Web Clipper</a>
+ </td>
+ <td>🔒️ <code spellcheck="false">localhost</code> only (still accessible to
+ the browser extension on the same device)</td>
+ <td>🌐 <code spellcheck="false">localhost</code> + LAN</td>
+ </tr>
+ <tr>
+ <td><a class="reference-link" href="#root/_help_pgxEVkzLl1OP">ETAPI (REST API)</a>
+ </td>
+ <td>🔒️ <code spellcheck="false">localhost</code> only</td>
+ <td>🌐 <code spellcheck="false">localhost</code> + LAN</td>
+ </tr>
+ <tr>
+ <td><a href="#root/_help_GBBMSlVSOIGP">LLM MCP</a> (only if enabled in settings)</td>
+ <td>🔒️ <code spellcheck="false">localhost</code> only (never LAN as a security
+ measure)</td>
+ <td>🔒️ <code spellcheck="false">localhost</code> only (never LAN as a security
+ measure)</td>
+ </tr>
+ <tr>
+ <td><a href="#root/_help_nRqcgfTb97uV">Web app</a>
+ </td>
+ <td>❌️ completely disabled (403), only the desktop app is usable.</td>
+ <td>🌐 <code spellcheck="false">localhost</code> + LAN</td>
+ </tr>
+ <tr>
+ <td><a class="reference-link" href="#root/_help_R9pX4DGra2Vt">Sharing</a>&nbsp;notes</td>
+ <td>❌️ completely disabled (403), if you are using&nbsp;<a class="reference-link"
+ href="#root/_help_cbkrhQjrkKrh">Synchronization</a>&nbsp;this will still work
+ as part of the <a href="#root/pOsGYCXsbNQG/Otzi9La2YAUX/_help_WOcw2SLH6tbX">server</a>.</td>
+ <td>🌐 <code spellcheck="false">localhost</code> + LAN</td>
+ </tr>
+ </tbody>
+ </table>
+ </figure>
\ No newline at end of file
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.html
index fff91e80f0..8dd9d998ae 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.html
@@ -1,7 +1,11 @@
<p>Sometimes, setting up a <a href="#root/_help_WOcw2SLH6tbX">dedicated server installation</a> is
not feasible. The desktop application ships with a fully functional server
instance by default.</p>
-<p>You can access this web interface locally by navigating to <a href="http://localhost:37840/login">http://localhost:37840/login</a>.</p>
+<p>For security reasons, this feature is <strong>not enabled</strong> by default.
+ To enable it, enable <em>Network access</em> in&nbsp;<a class="reference-link"
+ href="#root/_help_fiHicjpHjIRJ">Security</a>.</p>
+<p>After enabling network access and restarting the application, you can
+ access this web interface locally by navigating to <a href="http://localhost:37840/login">http://localhost:37840/login</a>.</p>
<aside
class="admonition note">
<p>The server embedded in the desktop application will only run as long as
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/To-do Lists.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/To-do Lists.html
index 3ac0496f08..a9ff07a2d8 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/To-do Lists.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/To-do Lists.html
@@ -8,7 +8,7 @@
or <em>cancelled</em> ("won't do"), thus giving a more accurate picture of
where things actually stand.</p>
<p>Right-click the checkbox and select the desired state. Alternatively,
- press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter </kbd>to cycle through
+ press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter </kbd> to cycle through
the task states. Tapping or left-clicking the checkbox will always toggle
between "None" and "Done".</p>
<p>Task states are fully preserved when converting between&nbsp;<a class="reference-link"
@@ -28,7 +28,7 @@
</ul>
<p>Extended task states are supported as well, using its corresponding <em>Markdown symbol</em>.
These are the defaults but they can be changed if needed (see&nbsp;<a class="reference-link"
- href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_i16PM6A7GXdU">Customizing to-do task states</a>):</p>
+ href="#root/_help_i16PM6A7GXdU">Customizing to-do task states</a>):</p>
<ul>
<li><code spellcheck="false">[/]</code> for “Doing”.</li>
<li><code spellcheck="false">[?]</code> for “Maybe”.</li>
@@ -38,9 +38,7 @@
To reorder multiple items, select them first.</p>
<h2>See also</h2>
<ul>
- <li>
- <p>To-do lists are meant for small task lists. For more complicated, day-to-day
- task tracking consider using a&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/GTwFsgaA0lCt/_help_CtBQqbwXDx1w">Kanban Board</a>&nbsp;collection
- instead.</p>
- </li>
+ <li>To-do lists are meant for small task lists. For more complicated, day-to-day
+ task tracking consider using a&nbsp;<a class="reference-link" href="#root/_help_CtBQqbwXDx1w">Kanban Board</a>&nbsp;collection
+ instead.</li>
</ul>
\ No newline at end of file
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Security.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Security.html
index f138c72ef8..11e58229e7 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Security.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Security.html
@@ -7,8 +7,10 @@
<li><a class="reference-link" href="#root/_help_YKWqdJhzi2VY">SQL Console</a>, which
can be used to exfiltrate important data such as the document secret or
cause irreparable damage to the database.</li>
+ <li><a class="reference-link" href="#root/_help_swSFivWk6KkA">Network Access</a>&nbsp;for
+ the&nbsp;<a class="reference-link" href="#root/_help_poXkQfguuA0U">Desktop Installation</a>.</li>
</ul>
-<p>To activate either one of them, there are three variants:</p>
+<p>To activate any of them, there are three variants:</p>
<ul>
<li>For the desktop app, go to&nbsp;<a class="reference-link" href="#root/_help_4TIF1oA4VQRO">Options</a>&nbsp;→ <em>Security</em> and
toggle the desired option.
diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json
index dc9ccb7e03..ddf64d6b0b 100644
--- a/docs/User Guide/!!!meta.json
+++ b/docs/User Guide/!!!meta.json
@@ -379,17 +379,24 @@
{
"type": "relation",
"name": "internalLink",
- "value": "x3i7MxGccDuM",
+ "value": "fiHicjpHjIRJ",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
- "value": "swSFivWk6KkA",
+ "value": "x3i7MxGccDuM",
"isInheritable": false,
"position": 30
},
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "swSFivWk6KkA",
+ "isInheritable": false,
+ "position": 40
+ },
{
"type": "label",
"name": "shareAlias",
@@ -491,38 +498,52 @@
{
"type": "relation",
"name": "internalLink",
- "value": "MtPxeAWVAzMg",
+ "value": "poXkQfguuA0U",
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
- "value": "cbkrhQjrkKrh",
+ "value": "pgxEVkzLl1OP",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
- "value": "WOcw2SLH6tbX",
+ "value": "nRqcgfTb97uV",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
- "value": "nRqcgfTb97uV",
+ "value": "MtPxeAWVAzMg",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
- "value": "Gzjqa934BdH4",
+ "value": "GBBMSlVSOIGP",
"isInheritable": false,
"position": 50
},
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "R9pX4DGra2Vt",
+ "isInheritable": false,
+ "position": 60
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "cbkrhQjrkKrh",
+ "isInheritable": false,
+ "position": 80
+ },
{
"type": "label",
"name": "shareAlias",
@@ -536,6 +557,13 @@
"value": "bx bx-network-chart",
"isInheritable": false,
"position": 90
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "WOcw2SLH6tbX",
+ "isInheritable": false,
+ "position": 100
}
],
"format": "markdown",
@@ -11572,32 +11600,32 @@
"position": 20
},
{
- "type": "label",
- "name": "iconClass",
- "value": "bx bx-checkbox-checked",
+ "type": "relation",
+ "name": "internalLink",
+ "value": "i16PM6A7GXdU",
"isInheritable": false,
"position": 30
},
{
- "type": "label",
- "name": "shareAlias",
- "value": "todo-lists",
+ "type": "relation",
+ "name": "internalLink",
+ "value": "CtBQqbwXDx1w",
"isInheritable": false,
"position": 40
},
{
- "type": "relation",
- "name": "internalLink",
- "value": "i16PM6A7GXdU",
+ "type": "label",
+ "name": "iconClass",
+ "value": "bx bx-checkbox-checked",
"isInheritable": false,
- "position": 50
+ "position": 30
},
{
- "type": "relation",
- "name": "internalLink",
- "value": "CtBQqbwXDx1w",
+ "type": "label",
+ "name": "shareAlias",
+ "value": "todo-lists",
"isInheritable": false,
- "position": 60
+ "position": 40
}
],
"format": "markdown",
@@ -21309,24 +21337,38 @@
{
"type": "relation",
"name": "internalLink",
- "value": "4TIF1oA4VQRO",
+ "value": "swSFivWk6KkA",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
- "value": "tAassRL4RSQL",
+ "value": "poXkQfguuA0U",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
- "value": "Gzjqa934BdH4",
+ "value": "4TIF1oA4VQRO",
"isInheritable": false,
"position": 50
},
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "tAassRL4RSQL",
+ "isInheritable": false,
+ "position": 60
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "Gzjqa934BdH4",
+ "isInheritable": false,
+ "position": 70
+ },
{
"type": "label",
"name": "iconClass",
diff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.md
index e40f706624..9806b7301c 100644
--- a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.md
+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.md
@@ -1,20 +1,14 @@
# Network Access
-The Trilium desktop app opens a TCP port (usually `37840`) for the following reasons:
+Prior to v0.104.0, the [desktop application](../Desktop%20Installation.md) would also open a network port so that it can offer access to <a class="reference-link" href="../../Advanced%20Usage/ETAPI%20(REST%20API).md">ETAPI (REST API)</a> or even use it as a web server (see <a class="reference-link" href="Using%20the%20desktop%20application%20as%20a%20server.md">Using the desktop application as a server</a>).
-* Integration with the <a class="reference-link" href="../Web%20Clipper.md">Web Clipper</a>.
-* Desktop-to-desktop <a class="reference-link" href="../Synchronization.md">Synchronization</a>.
-* Making Trilium accessible over the web, similar to a <a class="reference-link" href="../Server%20Installation.md">Server Installation</a>. See <a class="reference-link" href="Using%20the%20desktop%20application%20as%20a%20server.md">Using the desktop application as a server</a>.
+In order to reduce the attack surface, Trilium now enables these services only for the local device (e.g. `localhost`) instead of serving them over the LAN.
-## Enabling access on the LAN
+To better understand what is affected, refer to the following table:
-Before v0.104.0, this port was open for the entire local network. After v0.104.0 the port is open only on `localhost` (127.0.0.1). This prevents other devices on the same network — and websites you open in another browser on the same machine — from reaching the Trilium API. If you don't use the desktop as a sync source, remote server, you don't need to change anything.
-
-To open the port on all networks, modify [config.ini](../../Advanced%20Usage/Configuration%20\(config.ini%20or%20environment%20variables\).md) as follows:
-
-```
-[Network]
-host=0.0.0.0
-```
-
-> [!NOTE]
-> If you use the <a class="reference-link" href="../Web%20Clipper.md">Web Clipper</a> on the same device as the one running the desktop application, there is no need to enable access on the LAN.
\ No newline at end of file
+| Feature | Network access OFF | Network access ON |
+| --- | --- | --- |
+| <a class="reference-link" href="../Web%20Clipper.md">Web Clipper</a> | 🔒️ `localhost` only (still accessible to the browser extension on the same device) | 🌐 `localhost` + LAN |
+| <a class="reference-link" href="../../Advanced%20Usage/ETAPI%20(REST%20API).md">ETAPI (REST API)</a> | 🔒️ `localhost` only | 🌐 `localhost` + LAN |
+| [LLM MCP](../../AI.md) (only if enabled in settings) | 🔒️ `localhost` only (never LAN as a security measure) | 🔒️ `localhost` only (never LAN as a security measure) |
+| [Web app](Using%20the%20desktop%20application%20as%20a%20server.md) | ❌️ completely disabled (403), only the desktop app is usable. | 🌐 `localhost` + LAN |
+| <a class="reference-link" href="../../Advanced%20Usage/Sharing.md">Sharing</a> notes | ❌️ completely disabled (403), if you are using <a class="reference-link" href="../Synchronization.md">Synchronization</a> this will still work as part of the [server](../Server%20Installation.md). | 🌐 `localhost` + LAN |
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.md
index 781285f9cc..3c6179c662 100644
--- a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.md
+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.md
@@ -1,7 +1,9 @@
# Using the desktop application as a server
Sometimes, setting up a [dedicated server installation](../Server%20Installation.md) is not feasible. The desktop application ships with a fully functional server instance by default.
-You can access this web interface locally by navigating to [http://localhost:37840/login](http://localhost:37840/login).
+For security reasons, this feature is **not enabled** by default. To enable it, enable _Network access_ in <a class="reference-link" href="../../Scripting/Security.md">Security</a>.
+
+After enabling network access and restarting the application, you can access this web interface locally by navigating to [http://localhost:37840/login](http://localhost:37840/login).
> [!NOTE]
> The server embedded in the desktop application will only run as long as the desktop application itself is running. So closing the application will also close the server. To overcome this, you can try hiding the application in the system tray.
diff --git a/docs/User Guide/User Guide/Scripting/Security.md b/docs/User Guide/User Guide/Scripting/Security.md
index 24062d57ef..1b7f520099 100644
--- a/docs/User Guide/User Guide/Scripting/Security.md
+++ b/docs/User Guide/User Guide/Scripting/Security.md
@@ -3,8 +3,9 @@ Starting with v0.104.0, some features in Trilium are intentionally disabled in o
* <a class="reference-link" href="Backend%20scripts.md">Backend scripts</a>, which can run processes on the server, access the file system or bypass security measures.
* <a class="reference-link" href="../Advanced%20Usage/Database/Manually%20altering%20the%20database/SQL%20Console.md">SQL Console</a>, which can be used to exfiltrate important data such as the document secret or cause irreparable damage to the database.
+* <a class="reference-link" href="../Installation%20%26%20Setup/Desktop%20Installation/Network%20Access.md">Network Access</a> for the <a class="reference-link" href="../Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a>.
-To activate either one of them, there are three variants:
+To activate any of them, there are three variants:
* For the desktop app, go to <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Security_ and toggle the desired option.
* This will prompt a system dialog confirming the change. Note that scripts could potentially call this confirmation dialog as well, make sure to accept it only if enabling any of these features is required.