Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch 1 #94

Merged
merged 19 commits into from
Jul 24, 2024
Binary file added Wiki/images/template-create-instance-note.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Wiki/images/text-notes-formatting-block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Wiki/images/text-notes-formatting-inline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions Wiki/read-only-note.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Read only note
[Text](text-notes.md) or [code](code-notes.md) can be set to be read-only. In such case only read view is presented to the user with the option of editing the note if needed.
# Read-Only Notes

Setting read only view with label
---------------------------------
Both [text](text-notes.md) and [code](code-notes.md) notes in Trilium can be set to read-only. When a note is in read-only mode, it is presented to the user in a non-editable view, with the option to switch to editing mode if needed.

You can set the note as read only by adding [label](attributes.md) `readOnly`.
## Setting Read-Only Mode with a Label

Auto read only
--------------
To set a note as read-only, add the `readOnly` [label](attributes.md) to the note.

If the note is too large then Trilium will automatically set the note as readOnly as an optimization - displaying such long notes can take a long time in editing mode and this might unnecessarily slow down operation even if editing is not necessary.
## Automatic Read-Only Mode

If you want to keep specific note automatically editable, you can add [label](attributes.md) `autoReadOnlyDisabled`.
For optimization purposes, Trilium will automatically set very large notes to read-only. Displaying such lengthy notes in editing mode can slow down performance, especially when editing is unnecessary.

If you want to ensure that a specific note remains editable regardless of its size, you can add the `autoReadOnlyDisabled` [label](attributes.md) to the note.
12 changes: 6 additions & 6 deletions Wiki/saved-search.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Saved-search
Trilium provides a way to save common search as a note in the note tree. Search results will then appear as sub-notes of this "saved search" note. You can see how this works in action:
# Saved Searches

![save-search](images/Saved-search%20image.gif)
Trilium allows you to save common searches as notes within the note tree. The search results will appear as sub-notes under these "saved search" notes. Here is an example of how it works:

Location
--------
![save-search](images/saved-search-image.gif)

Saved search is by default stored in the day note. You can also mark some note with `#searchHome` label, all saved searches will be then saved there. There's also `#workspaceSearchHome` variant for \[\[workspaces|workspace\]\].
## Location

By default, saved searches are stored in the day note. However, you can designate a different note to store saved searches by marking it with the `#searchHome` label. Additionally, for [workspaces](workspace.md), you can use the `#workspaceSearchHome` label to specify a storage location for saved searches within that workspace.
226 changes: 86 additions & 140 deletions Wiki/search.md

Large diffs are not rendered by default.

35 changes: 17 additions & 18 deletions Wiki/sorting.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# Sorting
One time sorting
----------------
# Sorting Notes

You can sort notes one time by right-clicking parent note in the note tree, Advanced -> Sort notes by ...
You can sort notes by right-clicking the parent note in the note tree and selecting Advanced -> Sort notes by ...
Alumniminium marked this conversation as resolved.
Show resolved Hide resolved
This will sort existing notes, but will not automatically sort future notes added to this parent note

Automatic / permanent sorting
-----------------------------
## Automatic/Permanent Sorting

Child notes can be kept sorted by attaching [labels](attributes.md) to the parent note:
Child notes can be automatically sorted by attaching specific [labels](attributes.md) to the parent note:

* `#sorted` - enables sorting, can optionally include name of the note's property/label (see details below)
* `#sortDirection` - by default ascending, set it to `desc` value to reverse the sort order
* `#sortFoldersFirst` - notes with children will be sorted on top
- `#sorted`: Enables sorting. Can optionally include the name of the note's property/label for sorting criteria (details below).
- `#sortDirection`: By default, sorting is ascending. Set this to `desc` to sort in descending order.
- `#sortFoldersFirst`: Notes with children will be sorted to the top.

Sorting works by comparing note property or a specific label on the child notes.
Sorting is done by comparing note properties or specific labels on child notes. There are four sorting levels, with the first having the highest priority. Lower priority levels are applied only if higher priority comparisons result in equality.

There are 4 sorting levels, where the first one has the highest priority and the lower one will be applied only if the 2 compared notes are equal based on higher priority comparison.
1. **Top Label Sorting**: Child notes with the `#top` label will appear at the top of the folder.
2. **Bottom Label Sorting**: (Introduced in Trilium 0.62) Child notes with the `#bottom` label will appear at the bottom of the folder.
3. **Property/Label-Based Sorting**: Sorting is based on the parent note's `#sorted` label:
- **Default Sorting**: If `#sorted` has no value, notes are sorted alphabetically.
- **Property Sorting**: If `#sorted` is set to `title`, `dateModified`, or `dateCreated`, notes are sorted based on the specified property.
- **Label Sorting**: If `#sorted` has any other value, this value is treated as the name of a child note's label, and sorting is based on the values of this label. For example, setting `#sorted=myOrder` on the parent note and using `#myOrder=001`, `#myOrder=002`, etc., on child notes.
4. **Alphabetical Sorting**: Used as a last resort when other criteria result in equality.

1. implicit sorting by `#top` label - child notes with this label will appear on the top of the folder.
2. implicit sorting by `#bottom` label (since Trilium 0.62) - child notes with this label will appear on the bottom of the folder.
3. sorting by child's property or a specific label defined on the parent note's `#sorted` label a) parent note has `#sorted` with no value - by default sorting will be done alphabetically b) parent note has `#sorted=title` or `#sorted=dateModified` or `#sorted=dateCreated` - sorting will be done based on the defined note's property c) parent note has `#sorted` label with any other value - this value is the name of the child note's label, whose value will be used for sorting. So e.g. you set `#sorted=myOrder` on the parent note and then child notes will have labels `#myOrder=001`, \`#myOrder=002" etc.
4. sorting of "last resort" is alphabetical

All comparisons are made string-wise - e.g. "1" < "2" or "2020-10-10" < "2021-01-15" but also "2" > "10".
All comparisons are made string-wise (e.g., "1" < "2" or "2020-10-10" < "2021-01-15", but also "2" > "10").
88 changes: 37 additions & 51 deletions Wiki/synchronization.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,71 @@
# Synchronization
Trilium is offline-first note-taking application - when you use the desktop application, all the data is stored locally, but you also have an option to set up synchronization to the server instance. When you add another desktop client, you can get to star-shaped topology:
# Synchronization

![](images/star-topology.png)
Trilium is an offline-first note-taking application that stores all data locally on the desktop client. However, it also offers the option to set up synchronization with a server instance, allowing multiple desktop clients to sync with a central server. This creates a star-shaped topology:

This means that there's one central server (we'll call this instance _sync server_) and several _client_ (sometimes called _desktop_) instances which all point to this sync server and synchronize against it.
![topology visualization](images/star-topology.png)

Once sync is set up, synchronization is automatic and ongoing - you don't need to trigger it manually. It should "just work".
In this setup, a central server (referred to as the _sync server_) and multiple _client_ (or _desktop_) instances synchronize with the sync server. Once configured, synchronization is automatic and ongoing, requiring no manual intervention.

How to set up synchronization
-----------------------------
## Setting Up Synchronization

### Security
### Security Considerations

Please note that setting up server securely is not easy and far reaching mistakes can be made. It is especially important to use a valid TLS certificate (https) instead of unencrypted/unauthenticated HTTP.
Setting up the server securely is critical and can be complex. It is crucial to use a valid [TLS certificate](tls-configuration.md) (HTTPS) rather than an unencrypted HTTP connection to ensure security and avoid potential vulnerabilities.

### Setup synchronization from desktop instance to sync server
### Synchronizing a Desktop Instance with a Sync Server

This approach is used when you already have a desktop instance of Trilium and you want to [setup sync server on your web host](server-installation.md).
This method is used when you already have a desktop instance of Trilium and want to set up a sync server on your web host.

So let's assume your server instance is already deployed, but it's uninitialized (no data). Then open your desktop instance, click on Options -> Sync tab -> Sync configuration and set "Server instance address" to point to your sync server. Click Save.
1. **Server Deployment**: Ensure your server instance is deployed but uninitialized.
2. **Desktop Configuration**: Open your desktop instance, navigate to Options -> Sync tab -> Sync configuration, and set the "Server instance address" to your sync server's address. Click Save.

![](images/sync-config.png)
![screenshot of the sync settings options modal](images/sync-config.png)

Now click on "Test sync" button which will tell you if the handshake with sync server succeeded. If yes, sync with sync server started - client started pushing all the data towards the server instance. This might take some time to finish, but you can close the Options dialog and keep using Trilium.
3. **Testing Sync**: Click the "Test sync" button to verify the connection to the sync server. If successful, the client will start pushing all data to the server instance. This process may take some time, but you can continue using Trilium. Periodically check the server instance to confirm when the sync is complete. Once finished, you should see the login screen on the server.

You can also check the server instance periodically to see if the sync finished. Once it's finished, you should see the login screen.
### Synchronizing a Desktop Instance from a Sync Server

### Setup synchronization from sync server to desktop instance
This method is used when you already have a sync server and want to configure a new desktop instance to sync with it.

This is used when you already have sync server, and you want to set up a desktop instance to sync with (from) it.
1. **Desktop Setup**: Follow the [desktop installation page](desktop-installation.md).
2. **Initial Configuration**: When prompted, choose the option to set up sync with a sync server.

Here we assume that you downloaded [the most recent release](https://github.com/TriliumNext/Notes/releases/latest) for your platform, unzipped it and ran it.
![screenshot of the sync from server setup page](images/sync-init.png)

Since the desktop instance is completely empty, it will first ask if you want to create an initial document, or you want to set up sync with sync server - you need to choose the second option.
3. **Server Details**: Configure the Trilium server address and enter the correct username and password for authentication.
4. **Finish Setup**: Click the "Finish setup" button. If successful, you will see the following screen:

![](images/sync-init.png)
![screenshot of the sync page](images/sync-in-progress.png)

You'll need to configure Trilium server address and importantly also correct username / password (sync setup requires authentication).
Once synchronization is complete, you will be automatically redirected to the Trilium application.

Click on "Finish setup" button and if everything went fine, you'll see this screen:
## Proxy Configuration

![](images/sync-in-progress.png)
Two proxy setups are supported:

Once the sync is finished, you'll be automatically redirected to the Trilium application.
- **Explicit Proxy Configuration**: Set the proxy server in Options / Sync. Only unauthenticated proxy servers are supported.
- **System Proxy Settings**: If no proxy server is explicitly configured, Trilium will use the system proxy settings.

Proxy setup
-----------
## Troubleshooting

Two different setups are supported:
### Date/Time Synchronization

* you can explicitly set proxy server to be used in Options / Sync. Only unauthenticated proxy servers are currently supported.
* if no proxy server is explicitly configured, then Trilium will use system proxy settings
For successful synchronization, both client and server must have the same date and time, with a tolerance of up to five minutes.

Troubleshooting
---------------
### Certificate Issues

### Different date/time on client and server
When using TLS, Trilium will verify the server certificate. If verification fails (e.g., due to self-signed certificates or certain corporate proxies), you can run the Trilium client with the `NODE_TLS_REJECT_UNAUTHORIZED` environment variable set to `0`:

For a successful sync, both client and server need to have save date time, with a tolerance of maximum 5 minutes difference.

Certificate issues
------------------

When TLS is in use, Trilium client will attempt to verify the server certificate. In some cases (self-signed certs, some corporate proxy servers), the verification will be unsuccessful and sync will fail. In those cases, you can run the Trilium client with environment variable `NODE_TLS_REJECT_UNAUTHORIZED` set to `0`:

```text-plain
```sh
Alumniminium marked this conversation as resolved.
Show resolved Hide resolved
export NODE_TLS_REJECT_UNAUTHORIZED=0
```

TLS certificate won't be verified and simply accepted as it is. **You need to be aware that this will degrade the security of sync process significantly and open your setup to MITM attacks. It's strongly recommended to use a valid signed server certificate.**

Newer Trilium versions contain this in a script called `trilium-no-cert-check.sh`.

Conflict resolution
-------------------
This will disable TLS certificate verification, significantly reducing security and exposing the setup to MITM attacks. It is strongly recommended to use a valid signed server certificate. Newer Trilium versions include a script called `trilium-no-cert-check.sh` for this purpose.

You can sometimes encounter a situation where you edit the same note in multiple instances before the note changes are synchronized.
### Conflict Resolution

Trilium handles this situation by just picking up the newer change and discarding the older change. The older change should still be visible in [note revisions](note-revisions.md), so it should be possible to recover any data lost in conflict resolution.
If you edit the same note on multiple instances before synchronization, Trilium resolves conflicts by retaining the newer change and discarding the older one. The older version remains accessible in [note revisions](note-revisions.md), allowing data recovery if needed.

Hash check
----------
### Hash Check

After each completed sync, Trilium computes a hash of all synced data on both client and sync server. If there's a difference, something went wrong and Trilium will run an automatic recovery mechanism.
After each synchronization, Trilium computes a hash of all synced data on both the client and the sync server. If there is a discrepancy, Trilium will automatically initiate a recovery mechanism to resolve the issue.
Loading