docs(user): document read-only database (closes #4341)

This commit is contained in:
Elian Doran 2025-11-05 10:20:35 +02:00
parent d271fe7fdd
commit 977284fe57
No known key found for this signature in database
4 changed files with 151 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,42 @@
<aside class="admonition warning">
<p>This functionality is still in preview, expect possible issues or even
the feature disappearing completely.
<br>Feel free to <a href="#root/pOsGYCXsbNQG/BgmBlOIl72jZ/_help_wy8So3yZZlH9">report</a> any
issues you might have.</p>
</aside>
<p>The read-only database is an alternative to&nbsp;<a class="reference-link"
href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_R9pX4DGra2Vt">Sharing</a>&nbsp;notes.
Although the share functionality works pretty well to publish pages to
the Internet in a wiki, blog-like format it does not offer the full functionality
behind Trilium (such as the advanced&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/wArbEsdSae6g/_help_eIg8jdvaoNNd">Search</a>&nbsp;or
the interactivity behind&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/_help_GTwFsgaA0lCt">Collections</a>&nbsp;or
the various&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/_help_KSZ04uQ2D1St">Note Types</a>).</p>
<p>When the database is in read-only mode, the Trilium application can be
used as normal, but editing is disabled and changes are made in-memory
only.</p>
<h2>What it does</h2>
<ul>
<li data-list-item-id="e97d71c2d01fa683d840e3f8de9e5bea9">All notes are read-only, without the possibility of editing them.</li>
<li
data-list-item-id="e6e82b25093f659cca922614ea8701ca4">Features that would normally alter the database such as the list of recent
notes are disabled.</li>
</ul>
<h2>Limitations</h2>
<ul>
<li data-list-item-id="ec1a648467ed42eee3d6b96f829b6daad">Some features might “slip through” and still end up creating a note, for
example.
<ul>
<li data-list-item-id="ed98de88bf24f574cfda28cf278be7f86">However, the database is still read-only, so all modifications will be
reset if the server is restarted.</li>
<li data-list-item-id="e3f0450830304fa98038a8a5fd9026b06">Whenever this occurs, <code>ERROR: read-only DB ignored</code> will be shown
in the logs.</li>
</ul>
</li>
</ul>
<h2>Setting a database as read-only</h2>
<p>First, make sure the database is initialized (e.g. the first set up is
complete). Then modify the <a href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_Gzjqa934BdH4">config.ini</a> by
looking for the <code>[General]</code> section and adding a new <code>readOnly</code> field:</p><pre><code class="language-text-x-trilium-auto">[General]
readOnly=true</code></pre>
<p>If your server is already running, restart it to apply the changes.</p>
<p>Similarly, to disable read-only remove the line or set it to <code>false</code>.</p>

View File

@ -14150,6 +14150,82 @@
"format": "markdown",
"dataFileName": "Nightly release.md",
"attachments": []
},
{
"isClone": false,
"noteId": "ZmT9ln8XJX2o",
"notePath": [
"pOsGYCXsbNQG",
"tC7s2alapj8V",
"ZmT9ln8XJX2o"
],
"title": "Read-only database",
"notePosition": 270,
"prefix": null,
"isExpanded": false,
"type": "text",
"mime": "text/html",
"attributes": [
{
"type": "label",
"name": "iconClass",
"value": "bx bx-book-reader",
"isInheritable": false,
"position": 30
},
{
"type": "label",
"name": "shareAlias",
"value": "read-only-db",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "wy8So3yZZlH9",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "R9pX4DGra2Vt",
"isInheritable": false,
"position": 60
},
{
"type": "relation",
"name": "internalLink",
"value": "Gzjqa934BdH4",
"isInheritable": false,
"position": 70
},
{
"type": "relation",
"name": "internalLink",
"value": "eIg8jdvaoNNd",
"isInheritable": false,
"position": 80
},
{
"type": "relation",
"name": "internalLink",
"value": "GTwFsgaA0lCt",
"isInheritable": false,
"position": 90
},
{
"type": "relation",
"name": "internalLink",
"value": "KSZ04uQ2D1St",
"isInheritable": false,
"position": 100
}
],
"format": "markdown",
"dataFileName": "Read-only database.md",
"attachments": []
}
]
},

View File

@ -0,0 +1,32 @@
# Read-only database
> [!WARNING]
> This functionality is still in preview, expect possible issues or even the feature disappearing completely.
> Feel free to [report](../Troubleshooting/Reporting%20issues.md) any issues you might have.
The read-only database is an alternative to <a class="reference-link" href="Sharing.md">Sharing</a> notes. Although the share functionality works pretty well to publish pages to the Internet in a wiki, blog-like format it does not offer the full functionality behind Trilium (such as the advanced <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> or the interactivity behind <a class="reference-link" href="../Collections.md">Collections</a> or the various <a class="reference-link" href="../Note%20Types.md">Note Types</a>).
When the database is in read-only mode, the Trilium application can be used as normal, but editing is disabled and changes are made in-memory only.
## What it does
* All notes are read-only, without the possibility of editing them.
* Features that would normally alter the database such as the list of recent notes are disabled.
## Limitations
* Some features might “slip through” and still end up creating a note, for example.
* However, the database is still read-only, so all modifications will be reset if the server is restarted.
* Whenever this occurs, `ERROR: read-only DB ignored` will be shown in the logs.
## Setting a database as read-only
First, make sure the database is initialized (e.g. the first set up is complete). Then modify the [config.ini](Configuration%20\(config.ini%20or%20e.md) by looking for the `[General]` section and adding a new `readOnly` field:
```
[General]
readOnly=true
```
If your server is already running, restart it to apply the changes.
Similarly, to disable read-only remove the line or set it to `false`.