diff --git a/docs/Developer Guide/!!!meta.json b/docs/Developer Guide/!!!meta.json
index 397bdcab4..a6c26628d 100644
--- a/docs/Developer Guide/!!!meta.json
+++ b/docs/Developer Guide/!!!meta.json
@@ -15,6 +15,20 @@
"type": "text",
"mime": "text/html",
"attributes": [
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "T2W7WCZrYZBU",
+ "isInheritable": false,
+ "position": 10
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "cxfTSHIUQtt2",
+ "isInheritable": false,
+ "position": 20
+ },
{
"type": "label",
"name": "label:shareAlias",
@@ -35,20 +49,6 @@
"value": "developer-guide",
"isInheritable": false,
"position": 30
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "T2W7WCZrYZBU",
- "isInheritable": false,
- "position": 40
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "cxfTSHIUQtt2",
- "isInheritable": false,
- "position": 50
}
],
"format": "markdown",
@@ -245,6 +245,13 @@
"value": "database",
"isInheritable": false,
"position": 20
+ },
+ {
+ "type": "label",
+ "name": "iconClass",
+ "value": "bx bx-data",
+ "isInheritable": false,
+ "position": 30
}
],
"format": "markdown",
@@ -590,13 +597,6 @@
"type": "text",
"mime": "text/html",
"attributes": [
- {
- "type": "relation",
- "name": "internalLink",
- "value": "VIcWnKGs0sMh",
- "isInheritable": false,
- "position": 10
- },
{
"type": "relation",
"name": "internalLink",
@@ -624,6 +624,13 @@
"value": "notes",
"isInheritable": false,
"position": 40
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "VIcWnKGs0sMh",
+ "isInheritable": false,
+ "position": 50
}
],
"format": "markdown",
@@ -765,6 +772,71 @@
"format": "markdown",
"dataFileName": "revisions.md",
"attachments": []
+ },
+ {
+ "isClone": false,
+ "noteId": "6DG1au6rgOTl",
+ "notePath": [
+ "jdjRLhLV3TtI",
+ "MhwWMgxwDTZL",
+ "pRZhrVIGCbMu",
+ "vNMojjUN76jc",
+ "6DG1au6rgOTl"
+ ],
+ "title": "sessions",
+ "notePosition": 66,
+ "prefix": null,
+ "isExpanded": false,
+ "type": "text",
+ "mime": "text/html",
+ "attributes": [
+ {
+ "type": "label",
+ "name": "iconClass",
+ "value": "bx bx-table",
+ "isInheritable": false,
+ "position": 20
+ },
+ {
+ "type": "label",
+ "name": "shareAlias",
+ "value": "sessions",
+ "isInheritable": false,
+ "position": 30
+ }
+ ],
+ "format": "markdown",
+ "dataFileName": "sessions.md",
+ "attachments": []
+ },
+ {
+ "isClone": false,
+ "noteId": "zWY2LKmas9os",
+ "notePath": [
+ "jdjRLhLV3TtI",
+ "MhwWMgxwDTZL",
+ "pRZhrVIGCbMu",
+ "vNMojjUN76jc",
+ "zWY2LKmas9os"
+ ],
+ "title": "user_data",
+ "notePosition": 76,
+ "prefix": null,
+ "isExpanded": false,
+ "type": "text",
+ "mime": "text/html",
+ "attributes": [
+ {
+ "type": "label",
+ "name": "iconClass",
+ "value": "bx bx-table",
+ "isInheritable": false,
+ "position": 20
+ }
+ ],
+ "format": "markdown",
+ "dataFileName": "user_data.md",
+ "attachments": []
}
]
}
@@ -817,7 +889,7 @@
"name": "internalLink",
"value": "Jg7clqogFOyD",
"isInheritable": false,
- "position": 20
+ "position": 10
},
{
"type": "label",
diff --git a/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/notes.md b/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/notes.md
index 19cb4a322..108ea8b26 100644
--- a/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/notes.md
+++ b/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/notes.md
@@ -6,10 +6,10 @@
| `isProtected` | Integer | Non-null | 0 | `1` if the entity is [protected](../../../Concepts/Protected%20entities.md), `0` otherwise. |
| `type` | Text | Non-null | `"text"` | The type of note (i.e. `text`, `file`, `code`, `relationMap`, `mermaid`, `canvas`). |
| `mime` | Text | Non-null | `"text/html"` | The MIME type of the note (e.g. `text/html`).. Note that it can be an empty string in some circumstances, but not null. |
+| `blobId` | Text | Nullable | `null` | The corresponding ID fromĀ blobs. Although it can theoretically be `NULL`, haven't found any such note yet. |
| `isDeleted` | Integer | Nullable | 0 | `1` if the entity is [deleted](../../../Concepts/Deleted%20notes.md), `0` otherwise. |
| `deleteId` | Text | Non-null | `null` | |
| `dateCreated` | Text | Non-null | | Localized creation date (e.g. `2023-11-08 18:43:44.204+0200`) |
| `dateModified` | Text | Non-null | | Localized modification date (e.g. `2023-11-08 18:43:44.204+0200`) |
| `utcDateCreated` | Text | Non-null | | Creation date in UTC format (e.g. `2023-11-08 16:43:44.204Z`) |
-| `utcDateModified` | Text | Non-null | | Modification date in UTC format (e.g. `2023-11-08 16:43:44.204Z`) |
-| `blobId` | Text | Nullable | `null` | The corresponding ID fromĀ blobs. Although it can theoretically be `NULL`, haven't found any such note yet. |
\ No newline at end of file
+| `utcDateModified` | Text | Non-null | | Modification date in UTC format (e.g. `2023-11-08 16:43:44.204Z`) |
\ No newline at end of file
diff --git a/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/revisions.md b/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/revisions.md
index fef9ed1ed..faae5421c 100644
--- a/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/revisions.md
+++ b/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/revisions.md
@@ -1,7 +1,7 @@
# revisions
| Column Name | Data Type | Nullity | Default value | Description |
| --- | --- | --- | --- | --- |
-| `revisionId` | TextText | Non-null | | Unique ID of the revision (e.g. `0GjgUqnEudI8`). |
+| `revisionId` | Text | Non-null | | Unique ID of the revision (e.g. `0GjgUqnEudI8`). |
| `noteId` | Text | Non-null | | ID of the [note](notes.md) this revision belongs to. |
| `type` | Text | Non-null | `""` | The type of note (i.e. `text`, `file`, `code`, `relationMap`, `mermaid`, `canvas`). |
| `mime` | Text | Non-null | `""` | The MIME type of the note (e.g. `text/html`). |
diff --git a/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/sessions.md b/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/sessions.md
new file mode 100644
index 000000000..456236152
--- /dev/null
+++ b/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/sessions.md
@@ -0,0 +1,8 @@
+# sessions
+Contains user sessions for authentication purposes. The table is almost a direct mapping of the information that `express-session` requires.
+
+| Column Name | Data Type | Nullity | Default value | Description |
+| --- | --- | --- | --- | --- |
+| `id` | Text | Non-null | | Unique, non-sequential ID of the session, directly as indicated by `express-session` |
+| `data` | Text | Non-null | | The session information, in stringified JSON format. |
+| `expires` | Integer | Non-null | | The expiration date of the session, extracted from the session information. Used to rapidly clean up expired sessions. |
\ No newline at end of file
diff --git a/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/user_data.md b/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/user_data.md
new file mode 100644
index 000000000..3b27ee30f
--- /dev/null
+++ b/docs/Developer Guide/Developer Guide/Architecture/Database/Database structure/user_data.md
@@ -0,0 +1,17 @@
+# user_data
+Contains the user information for two-factor authentication. This table is **not** used for multi-user.
+
+Relevant files:
+
+* `apps/server/src/services/encryption/open_id_encryption.ts`
+
+| Column Name | Data Type | Nullity | Default value | Description |
+| --- | --- | --- | --- | --- |
+| `tmpID` | Integer | | | A sequential ID of the user. Since only one user is supported by Trilium, this value is always zero. |
+| `username` | Text | | | The user name as returned from the OAuth operation. |
+| `email` | Text | | | The email as returned from the OAuth operation. |
+| `userIDEncryptedDataKey` | Text | | | An encrypted hash of the user subject identifier from the OAuth operation. |
+| `userIDVerificationHash` | Text | | | A salted hash of the subject identifier from the OAuth operation. |
+| `salt` | Text | | | The verification salt. |
+| `derivedKey` | Text | | | A random secure token. |
+| `isSetup` | Text | | `"false"` | Indicates that the user has been saved (`"true"`). |
\ No newline at end of file
diff --git a/docs/Developer Guide/Developer Guide/Architecture/Security.md b/docs/Developer Guide/Developer Guide/Architecture/Security.md
index 61fdc7377..f1ef4da77 100644
--- a/docs/Developer Guide/Developer Guide/Architecture/Security.md
+++ b/docs/Developer Guide/Developer Guide/Architecture/Security.md
@@ -383,7 +383,7 @@ for (const blob of orphanedBlobs) {
**Process:**
-```sh
+```
# Check for vulnerabilities
npm audit
@@ -424,7 +424,7 @@ npm audit fix --force
**pnpm Patches:**
-```sh
+```
# Create patch
pnpm patch @ckeditor/ckeditor5
diff --git a/docs/Developer Guide/Developer Guide/Concepts/Synchronisation.md b/docs/Developer Guide/Developer Guide/Concepts/Synchronisation.md
index f97bd3c4e..45a520cb6 100644
--- a/docs/Developer Guide/Developer Guide/Concepts/Synchronisation.md
+++ b/docs/Developer Guide/Developer Guide/Concepts/Synchronisation.md
@@ -9,7 +9,7 @@ Trilium implements a **bidirectional synchronization system** that allows users
## Sync Architecture
-```mermaid
+```
graph TB
Desktop1[Desktop 1
Client]
Desktop2[Desktop 2
Client]
diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md
index 4da87601a..9d3bb1f07 100644
--- a/docs/Developer Guide/Developer Guide/Documentation.md
+++ b/docs/Developer Guide/Developer Guide/Documentation.md
@@ -1,5 +1,5 @@
# Documentation
-There are multiple types of documentation for Trilium:
+There are multiple types of documentation for Trilium:
* The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing F1.
* The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers.
diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json
index 86ddd9589..c0be59116 100644
--- a/docs/User Guide/!!!meta.json
+++ b/docs/User Guide/!!!meta.json
@@ -25,56 +25,35 @@
{
"type": "relation",
"name": "internalLink",
- "value": "BFs8mudNFgCS",
+ "value": "gh7bpGYxajRS",
"isInheritable": false,
"position": 20
},
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "BFs8mudNFgCS",
+ "isInheritable": false,
+ "position": 30
+ },
{
"type": "relation",
"name": "internalLink",
"value": "GTwFsgaA0lCt",
"isInheritable": false,
- "position": 30
- },
- {
- "type": "label",
- "name": "shareAlias",
- "value": "user-guide",
- "isInheritable": false,
- "position": 10
- },
- {
- "type": "label",
- "name": "label:shareAlias",
- "value": "promoted,alias=Slug,single,text",
- "isInheritable": true,
- "position": 20
- },
- {
- "type": "label",
- "name": "iconClass",
- "value": "bx bx-help-circle",
- "isInheritable": false,
- "position": 30
+ "position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "poXkQfguuA0U",
"isInheritable": false,
- "position": 40
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "WOcw2SLH6tbX",
- "isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
- "value": "gh7bpGYxajRS",
+ "value": "WOcw2SLH6tbX",
"isInheritable": false,
"position": 60
},
@@ -98,6 +77,27 @@
"value": "9qPsTWBorUhQ",
"isInheritable": false,
"position": 90
+ },
+ {
+ "type": "label",
+ "name": "shareAlias",
+ "value": "user-guide",
+ "isInheritable": false,
+ "position": 10
+ },
+ {
+ "type": "label",
+ "name": "label:shareAlias",
+ "value": "promoted,alias=Slug,single,text",
+ "isInheritable": true,
+ "position": 20
+ },
+ {
+ "type": "label",
+ "name": "iconClass",
+ "value": "bx bx-help-circle",
+ "isInheritable": false,
+ "position": 30
}
],
"format": "markdown",