diff --git a/README.md b/README.md
index 1ae82efbd5..30f4dc1246 100644
--- a/README.md
+++ b/README.md
@@ -107,10 +107,11 @@ npm install
npm run server:start
```
+For more details, see the [development docs](https://github.com/TriliumNext/Notes/blob/develop/docs/Developer%20Guide/Developer%20Guide/Building%20and%20deployment/Running%20a%20development%20build.md).
+
### Documentation
-We are currently transitioning to a new documentation mechanism.
-Meanwhile you can still view the [archived Docs repository](https://github.com/TriliumNext/Docs).
+See the [documentation guide](https://github.com/TriliumNext/Notes/blob/develop/docs/Developer%20Guide/Developer%20Guide/Documentation.md) for details.
## 👏 Shoutouts
diff --git a/data-docs/config.ini b/data-docs/config.ini
index baa0267303..53fd677379 100644
--- a/data-docs/config.ini
+++ b/data-docs/config.ini
@@ -30,13 +30,6 @@ trustedReverseProxy=false
[Session]
-# Use this setting to set a custom value for the "Path" Attribute value of the session cookie.
-# This can be useful, when you have several instances running on the same domain, under different paths (e.g. by using a reverse proxy).
-# It prevents your instances from overwriting each others' cookies, allowing you to stay logged in multiple instances simultanteously.
-# E.g. if you have instances running under https://your-domain.com/triliumNext/instanceA and https://your-domain.com/triliumNext/instanceB
-# you would want to set the cookiePath value to "/triliumNext/instanceA" for your first and "/triliumNext/instanceB" for your second instance
-cookiePath=/
-
# Use this setting to set a custom value for the "Max-Age" Attribute of the session cookie.
# This controls how long your session will be valid, before it expires and you need to log in again, when you use the "Remember Me" option.
# Value needs to be entered in Seconds.
diff --git a/docs/Developer Guide/!!!meta.json b/docs/Developer Guide/!!!meta.json
index d415417719..af6ae2063d 100644
--- a/docs/Developer Guide/!!!meta.json
+++ b/docs/Developer Guide/!!!meta.json
@@ -2018,10 +2018,10 @@
},
{
"isClone": false,
- "noteId": "LjqM0VUL1CrU",
+ "noteId": "Sow7ThJozkzJ",
"notePath": [
"jdjRLhLV3TtI",
- "LjqM0VUL1CrU"
+ "Sow7ThJozkzJ"
],
"title": "Documentation",
"notePosition": 90,
@@ -2032,18 +2032,27 @@
"attributes": [],
"format": "markdown",
"dataFileName": "Documentation.md",
- "attachments": [],
+ "attachments": [
+ {
+ "attachmentId": "2bUrJyt2yfsd",
+ "title": "image.png",
+ "role": "image",
+ "mime": "image/png",
+ "position": 10,
+ "dataFileName": "Documentation_image.png"
+ }
+ ],
"dirFileName": "Documentation",
"children": [
{
"isClone": false,
- "noteId": "HptkyArOlRI5",
+ "noteId": "LjqM0VUL1CrU",
"notePath": [
"jdjRLhLV3TtI",
- "LjqM0VUL1CrU",
- "HptkyArOlRI5"
+ "Sow7ThJozkzJ",
+ "LjqM0VUL1CrU"
],
- "title": "User-facing documentation",
+ "title": "Documentation references in the application",
"notePosition": 10,
"prefix": null,
"isExpanded": false,
@@ -2051,7 +2060,7 @@
"mime": "text/html",
"attributes": [],
"format": "markdown",
- "dataFileName": "User-facing documentation.md",
+ "dataFileName": "Documentation references in th.md",
"attachments": []
}
]
@@ -2064,7 +2073,7 @@
"dtKC3FmoWOrv"
],
"title": "Testing",
- "notePosition": 100,
+ "notePosition": 110,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2183,7 +2192,7 @@
"dHfw0XZE515z"
],
"title": "Sub-projects",
- "notePosition": 110,
+ "notePosition": 120,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2486,7 +2495,7 @@
"ibAPHul7Efvr"
],
"title": "Notes for old development",
- "notePosition": 120,
+ "notePosition": 130,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2551,7 +2560,7 @@
"QRLbiDXNxoWN"
],
"title": "Troubleshooting",
- "notePosition": 130,
+ "notePosition": 140,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2590,7 +2599,7 @@
"x6lgrdztQwVB"
],
"title": "Installation",
- "notePosition": 140,
+ "notePosition": 150,
"prefix": null,
"isExpanded": false,
"type": "text",
diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md
index 7051d63bbb..5af483058f 100644
--- a/docs/Developer Guide/Developer Guide/Documentation.md
+++ b/docs/Developer Guide/Developer Guide/Documentation.md
@@ -1,23 +1,73 @@
# Documentation
-## Hard-coded links
+
-Hard-coded links are present throughout the application, either in dialogs or in the source code as comments.
+There are multiple types of documentation for Trilium:
-You can identify these links by searching for:
+* 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.
+* _Release Notes_, this contains the change log for each released or soon-to-be-released version. The release notes are used automatically by the CI when releasing a version.
+* The _Script API_, which is an automatically generated documentation for the front-end and back-end APIs for scripts.
-```
-https://triliumnext.github.io/Docs/Wiki/
-```
+## Editing documentation
-## Help buttons
+There are two ways to modify documentation:
-There is a pattern of “?” buttons throughout the application which make use of the `data-help-page` attribute. Whenever these buttons are pressed, the user is redirected to the corresponding wiki page by prepending the wiki root URL to the `data-help-page` attribute.
+* Using a special mode of Trilium.
+* By manually editing the files.
-Since the current wiki has a different structure than the original, for example to link to [https://github.com/TriliumNext/Docs/blob/main/Wiki/tree-concepts.md](https://github.com/TriliumNext/Docs/blob/main/Wiki/tree-concepts.md) the `data-help-page` attribute must be set to `tree-concepts.md`.
+### Using `docs:edit`
-For links to headings, simply add the heading after the `.md`: `tree-concepts.md#prefix`
+To edit the documentation using Trilium, set up a working development environment and run the following commands:
-You can identify those by looking for:
+* On most operating systems, `npm run electron:switch` followed by `npm run docs:edit`
+* On NixOS, `npm run docs:edit-nix`.
-* `.attr("data-help-page"`
-* `data-help-page="`
\ No newline at end of file
+> [!NOTE]
+> `npm run docs:edit` acts very similar to `npm run electron:start` in the sense that you cannot both be editing documentation and starting a server. Using both `npm run electron:start` and `docs:edit` is possible, since they are using the same Electron instance.
+
+How it works:
+
+* At startup, the documentation from `docs/` is imported from Markdown into a in-memory session (the initialization of the database is already handled by the application).
+* Each modification will trigger after 10s an export from the in-memory Trilium session back to Markdown, including the meta file.
+
+### Manual editing
+
+Apart from the User Guide, it's generally feasible to make small modifications directly using a Markdown editor or VS Code, for example.
+
+When making manual modifications, avoid:
+
+* Uploading pictures, since images are handled as Trilium attachments which are stored in the meta file.
+* Changing the file or directory structure in any way, since that is also handled by the meta file. A missing file will most certainly cause a crash at start-up when attempting to edit the docs using Trilium.
+
+### Reviewing & committing the changes
+
+Since the documentation is tracked with Git, after making the manual or automatic modifications (wait at least 10s after making the modification) the changes will reflect in Git.
+
+Make sure to analyze each modified file and report possible issues.
+
+Important aspects to consider:
+
+* The Trilium import/export mechanism is not perfect, so if you make some modifications to the documentation using `docs:edit`, at the next import/export/import cycle some whitespace might get thrown in. It's generally safe to commit the changes as-is.
+* Since we are importing Markdown, editing HTML and then exporting the HTML back to Markdown there might be some edge cases where the formatting is not properly preserved. Try to identify such cases and report them in order to get them fixed (this will benefit also the users).
+
+## Location of the documentation
+
+All documentation is stored in the [Notes](https://github.com/TriliumNext/Notes) repository:
+
+* `docs/Developer Guide` contains Markdown documentation that can be modified either externally (using a Markdown editor, or internally using Trilium).
+* `docs/Release Notes` is also stored in Markdown format and can be freely edited.
+* `docs/Script API` contains auto-generated files and thus must not be modified.
+* `docs/User Guide` contains also Markdown-only documentation but must generally not be edited externally.
+ * The reason is that the `docs:edit` feature will not only import/export this documentation, but also generate the corresponding HTML documentation and meta structure in `src/public/app/doc_notes/en/User Guide`.
+ * It's theoretically possible to edit the Markdown files externally and then run `docs:edit` and trigger a change in order to build the documentation, but that would not be a very productive workflow.
+
+## Updating the Script API
+
+As mentioned previously, the Script API is not manually editable since it is auto-generated using TypeDoc.
+
+To update the API documentation, simply run `npm run docs:build`. Compare the changes (if any) and commit them.
+
+Note that in order to simulate the environment a script would have, some fake source files (in the sense that they are only used for documentation) are being used as entrypoints for the documentation:
+
+* For back-end scripts, the script is located in `src/services/backend_script_entrypoint.ts`.
+* For front-end scripts, the script is located in `src/public/app/services/frontend_script_entrypoint.ts`.
\ No newline at end of file
diff --git a/docs/Developer Guide/Developer Guide/Documentation/Documentation references in th.md b/docs/Developer Guide/Developer Guide/Documentation/Documentation references in th.md
new file mode 100644
index 0000000000..61a585f120
--- /dev/null
+++ b/docs/Developer Guide/Developer Guide/Documentation/Documentation references in th.md
@@ -0,0 +1,23 @@
+# Documentation references in the application
+## Hard-coded links
+
+Hard-coded links are present throughout the application, either in dialogs or in the source code as comments.
+
+You can identify these links by searching for:
+
+```
+https://triliumnext.github.io/Docs/Wiki/
+```
+
+## Help buttons
+
+There is a pattern of “?” buttons throughout the application which make use of the `data-help-page` attribute. Whenever these buttons are pressed, the user is redirected to the corresponding wiki page by prepending the wiki root URL to the `data-help-page` attribute.
+
+Since the current wiki has a different structure than the original, for example to link to [https://github.com/TriliumNext/Docs/blob/main/Wiki/tree-concepts.md](https://github.com/TriliumNext/Docs/blob/main/Wiki/tree-concepts.md) the `data-help-page` attribute must be set to `tree-concepts.md`.
+
+For links to headings, simply add the heading after the `.md`: `tree-concepts.md#prefix`
+
+You can identify those by looking for:
+
+* `.attr("data-help-page"`
+* `data-help-page="`
\ No newline at end of file
diff --git a/docs/Developer Guide/Developer Guide/Documentation/User-facing documentation.md b/docs/Developer Guide/Developer Guide/Documentation/User-facing documentation.md
deleted file mode 100644
index e8bdd64e39..0000000000
--- a/docs/Developer Guide/Developer Guide/Documentation/User-facing documentation.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# User-facing documentation
-The user-facing documentation is available on a dedicated repository inside the organization: [https://github.com/TriliumNext/Docs](https://github.com/TriliumNext/Docs)
-
-It is currently organized as a flat tree of MarkDown notes.
-
-The documentation started as an import of the existing upstream documentation in [https://github.com/zadam/trilium/wiki](https://github.com/zadam/trilium/wiki).
-
-The public documentation is available at [https://triliumnext.github.io/Docs/Wiki](https://triliumnext.github.io/Docs/Wiki).
-
-The repository is here: [https://github.com/TriliumNext/Docs](https://github.com/TriliumNext/Docs)
-
-The documentation is stored as Markdown files and is meant to be imported into Trilium Notes and then exported back in, as per the README. However, it's also possible to modify the Markdown files manually and push the changes.
-
-The documentation is deployed automatically to GitHub Pages on every push on the `main` branch.
\ No newline at end of file
diff --git a/docs/Developer Guide/Developer Guide/Documentation_image.png b/docs/Developer Guide/Developer Guide/Documentation_image.png
new file mode 100644
index 0000000000..542bb7858c
Binary files /dev/null and b/docs/Developer Guide/Developer Guide/Documentation_image.png differ
diff --git a/docs/Release Notes/Release Notes/v0.92.8-beta.md b/docs/Release Notes/Release Notes/v0.92.8-beta.md
index 791a1af620..aae6a4addc 100644
--- a/docs/Release Notes/Release Notes/v0.92.8-beta.md
+++ b/docs/Release Notes/Release Notes/v0.92.8-beta.md
@@ -27,6 +27,7 @@
* Delete notes now requests confirmation.
* Modals now have a safe margin on their bottom and are scrollable.
* [Center Search results under quick search bar](https://github.com/TriliumNext/Notes/issues/1679)
+* Native ARM builds for Windows are now back.
## 🌍 Internationalization
@@ -39,4 +40,6 @@
## 🛠️ Technical updates
-* upgrade to express 5.1.0 by @pano9000
\ No newline at end of file
+* upgrade to express 5.1.0 by @pano9000
+* update dependency mind-elixir to v4.5.1
+* remove non-working cookiePath option
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md
index 53c34c9cc9..df8c1ab104 100644
--- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md
+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md
@@ -27,7 +27,7 @@ Configure Nginx proxy and HTTPS. The operating system here is Ubuntu 18.04.
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log; #check the path of access.log, if it doesn't fit your file, change it
-
+
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -40,10 +40,31 @@ Configure Nginx proxy and HTTPS. The operating system here is Ubuntu 18.04.
proxy_redirect http://127.0.0.1:8080 https://trilium.example.net; # change them based on your IP, port and domain
}
}
+
# This part is for HTTPS forced
server {
- listen 80;
- server_name trilium.example.net; # change to your domain
- return 301 https://$server_name$request_uri;
+ listen 80;
+ server_name trilium.example.net; # change to your domain
+ return 301 https://$server_name$request_uri;
}
+ ```
+4. Alternatively if you want to serve the instance under a different path (useful e.g. if you want to serve multiple instances), update the location block like so:
+
+ * update the location with your desired path (make sure to not leave a trailing slash "/", if your `proxy_pass` does not end on a slash as well)
+ * add the `proxy_cookie_path` directive with the same path: this allows you to stay logged in at multiple instances at the same time.
+
+ ```
+ location /trilium/instance-one {
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_pass http://127.0.0.1:8080; # change it to a different port if non-default is used
+ proxy_cookie_path / /trilium/instance-one
+ proxy_read_timeout 90;
+ proxy_redirect http://127.0.0.1:8080 https://trilium.example.net; # change them based on your IP, port and domain
+ }
+
```
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 7d9f26c260..d7ca97f27d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -172,7 +172,7 @@
"lorem-ipsum": "2.0.8",
"mark.js": "8.11.1",
"mermaid": "11.6.0",
- "mind-elixir": "4.5.0",
+ "mind-elixir": "4.5.1",
"mini-css-extract-plugin": "2.9.2",
"nodemon": "3.1.9",
"panzoom": "9.4.3",
@@ -15243,9 +15243,9 @@
}
},
"node_modules/mind-elixir": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/mind-elixir/-/mind-elixir-4.5.0.tgz",
- "integrity": "sha512-EyodIX7CK1d3Rq0urT91suZwVGHz7XegfcRiEVVFQfc952gW0xTU9Z5gaEQ4Iukwte5Sex6lOKgyxH8iGp/Puw==",
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/mind-elixir/-/mind-elixir-4.5.1.tgz",
+ "integrity": "sha512-R4KUaoqpe7u6/wi74nU/5Pk0KATbCXAuryQUy+7lTbBcKorVuY2d08CHGS+RoozXULAqDXIg+duxAUKRQ0XvYg==",
"dev": true,
"license": "MIT"
},
diff --git a/package.json b/package.json
index cb0205d72f..ec9f4616c1 100644
--- a/package.json
+++ b/package.json
@@ -42,10 +42,8 @@
"demo:edit-nix": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data-docs TRILIUM_PORT=37741 TRILIUM_ENV=dev TRILIUM_INTEGRATION_TEST=memory-no-store nix-shell -p electron_33 --run \"electron ./electron-edit-demo.ts .\"",
"electron-forge:start": "npm run build:prepare-dist && cd ./build && electron-forge start",
"electron-forge:make": "npm run build:prepare-dist && cross-env DEBUG=electron-windows-installer:* electron-forge make ./build",
- "electron-forge:package": "npm run build:prepare-dist && cd ./build && electron-forge package",
- "docs:build-backend": "rimraf ./docs/backend_api && typedoc",
- "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js",
- "docs:build": "npm run docs:build-backend && npm run docs:build-frontend",
+ "electron-forge:package": "npm run build:prepare-dist && cd ./build && electron-forge package",
+ "docs:build": "typedoc",
"build:webpack": "tsx node_modules/webpack/bin/webpack.js -c webpack.config.ts --progress",
"build:webpack-stats": "tsx node_modules/webpack/bin/webpack.js -c webpack.config.ts --profile --json=webpack-stats.json",
"build:ts": "tsc -p tsconfig.build.json",
@@ -231,7 +229,7 @@
"lorem-ipsum": "2.0.8",
"mark.js": "8.11.1",
"mermaid": "11.6.0",
- "mind-elixir": "4.5.0",
+ "mind-elixir": "4.5.1",
"mini-css-extract-plugin": "2.9.2",
"nodemon": "3.1.9",
"panzoom": "9.4.3",
diff --git a/packages/turndown-plugin-gfm/package-lock.json b/packages/turndown-plugin-gfm/package-lock.json
index acf67a1c56..1da8f10537 100644
--- a/packages/turndown-plugin-gfm/package-lock.json
+++ b/packages/turndown-plugin-gfm/package-lock.json
@@ -163,9 +163,9 @@
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.39.0.tgz",
- "integrity": "sha512-lGVys55Qb00Wvh8DMAocp5kIcaNzEFTmGhfFd88LfaogYTRKrdxgtlO5H6S49v2Nd8R2C6wLOal0qv6/kCkOwA==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.0.tgz",
+ "integrity": "sha512-+Fbls/diZ0RDerhE8kyC6hjADCXA1K4yVNlH0EYfd2XjyH0UGgzaQ8MlT0pCXAThfxv3QUAczHaL+qSv1E4/Cg==",
"cpu": [
"arm"
],
@@ -177,9 +177,9 @@
]
},
"node_modules/@rollup/rollup-android-arm64": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.39.0.tgz",
- "integrity": "sha512-It9+M1zE31KWfqh/0cJLrrsCPiF72PoJjIChLX+rEcujVRCb4NLQ5QzFkzIZW8Kn8FTbvGQBY5TkKBau3S8cCQ==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.0.tgz",
+ "integrity": "sha512-PPA6aEEsTPRz+/4xxAmaoWDqh67N7wFbgFUJGMnanCFs0TV99M0M8QhhaSCks+n6EbQoFvLQgYOGXxlMGQe/6w==",
"cpu": [
"arm64"
],
@@ -191,9 +191,9 @@
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.39.0.tgz",
- "integrity": "sha512-lXQnhpFDOKDXiGxsU9/l8UEGGM65comrQuZ+lDcGUx+9YQ9dKpF3rSEGepyeR5AHZ0b5RgiligsBhWZfSSQh8Q==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.0.tgz",
+ "integrity": "sha512-GwYOcOakYHdfnjjKwqpTGgn5a6cUX7+Ra2HeNj/GdXvO2VJOOXCiYYlRFU4CubFM67EhbmzLOmACKEfvp3J1kQ==",
"cpu": [
"arm64"
],
@@ -205,9 +205,9 @@
]
},
"node_modules/@rollup/rollup-darwin-x64": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.39.0.tgz",
- "integrity": "sha512-mKXpNZLvtEbgu6WCkNij7CGycdw9cJi2k9v0noMb++Vab12GZjFgUXD69ilAbBh034Zwn95c2PNSz9xM7KYEAQ==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.0.tgz",
+ "integrity": "sha512-CoLEGJ+2eheqD9KBSxmma6ld01czS52Iw0e2qMZNpPDlf7Z9mj8xmMemxEucinev4LgHalDPczMyxzbq+Q+EtA==",
"cpu": [
"x64"
],
@@ -219,9 +219,9 @@
]
},
"node_modules/@rollup/rollup-freebsd-arm64": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.39.0.tgz",
- "integrity": "sha512-jivRRlh2Lod/KvDZx2zUR+I4iBfHcu2V/BA2vasUtdtTN2Uk3jfcZczLa81ESHZHPHy4ih3T/W5rPFZ/hX7RtQ==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.0.tgz",
+ "integrity": "sha512-r7yGiS4HN/kibvESzmrOB/PxKMhPTlz+FcGvoUIKYoTyGd5toHp48g1uZy1o1xQvybwwpqpe010JrcGG2s5nkg==",
"cpu": [
"arm64"
],
@@ -233,9 +233,9 @@
]
},
"node_modules/@rollup/rollup-freebsd-x64": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.39.0.tgz",
- "integrity": "sha512-8RXIWvYIRK9nO+bhVz8DwLBepcptw633gv/QT4015CpJ0Ht8punmoHU/DuEd3iw9Hr8UwUV+t+VNNuZIWYeY7Q==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.0.tgz",
+ "integrity": "sha512-mVDxzlf0oLzV3oZOr0SMJ0lSDd3xC4CmnWJ8Val8isp9jRGl5Dq//LLDSPFrasS7pSm6m5xAcKaw3sHXhBjoRw==",
"cpu": [
"x64"
],
@@ -247,9 +247,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.39.0.tgz",
- "integrity": "sha512-mz5POx5Zu58f2xAG5RaRRhp3IZDK7zXGk5sdEDj4o96HeaXhlUwmLFzNlc4hCQi5sGdR12VDgEUqVSHer0lI9g==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.0.tgz",
+ "integrity": "sha512-y/qUMOpJxBMy8xCXD++jeu8t7kzjlOCkoxxajL58G62PJGBZVl/Gwpm7JK9+YvlB701rcQTzjUZ1JgUoPTnoQA==",
"cpu": [
"arm"
],
@@ -261,9 +261,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.39.0.tgz",
- "integrity": "sha512-+YDwhM6gUAyakl0CD+bMFpdmwIoRDzZYaTWV3SDRBGkMU/VpIBYXXEvkEcTagw/7VVkL2vA29zU4UVy1mP0/Yw==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.0.tgz",
+ "integrity": "sha512-GoCsPibtVdJFPv/BOIvBKO/XmwZLwaNWdyD8TKlXuqp0veo2sHE+A/vpMQ5iSArRUz/uaoj4h5S6Pn0+PdhRjg==",
"cpu": [
"arm"
],
@@ -275,9 +275,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.39.0.tgz",
- "integrity": "sha512-EKf7iF7aK36eEChvlgxGnk7pdJfzfQbNvGV/+l98iiMwU23MwvmV0Ty3pJ0p5WQfm3JRHOytSIqD9LB7Bq7xdQ==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.0.tgz",
+ "integrity": "sha512-L5ZLphTjjAD9leJzSLI7rr8fNqJMlGDKlazW2tX4IUF9P7R5TMQPElpH82Q7eNIDQnQlAyiNVfRPfP2vM5Avvg==",
"cpu": [
"arm64"
],
@@ -289,9 +289,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.39.0.tgz",
- "integrity": "sha512-vYanR6MtqC7Z2SNr8gzVnzUul09Wi1kZqJaek3KcIlI/wq5Xtq4ZPIZ0Mr/st/sv/NnaPwy/D4yXg5x0B3aUUA==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.0.tgz",
+ "integrity": "sha512-ATZvCRGCDtv1Y4gpDIXsS+wfFeFuLwVxyUBSLawjgXK2tRE6fnsQEkE4csQQYWlBlsFztRzCnBvWVfcae/1qxQ==",
"cpu": [
"arm64"
],
@@ -303,9 +303,9 @@
]
},
"node_modules/@rollup/rollup-linux-loongarch64-gnu": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.39.0.tgz",
- "integrity": "sha512-NMRUT40+h0FBa5fb+cpxtZoGAggRem16ocVKIv5gDB5uLDgBIwrIsXlGqYbLwW8YyO3WVTk1FkFDjMETYlDqiw==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.0.tgz",
+ "integrity": "sha512-wG9e2XtIhd++QugU5MD9i7OnpaVb08ji3P1y/hNbxrQ3sYEelKJOq1UJ5dXczeo6Hj2rfDEL5GdtkMSVLa/AOg==",
"cpu": [
"loong64"
],
@@ -317,9 +317,9 @@
]
},
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.39.0.tgz",
- "integrity": "sha512-0pCNnmxgduJ3YRt+D+kJ6Ai/r+TaePu9ZLENl+ZDV/CdVczXl95CbIiwwswu4L+K7uOIGf6tMo2vm8uadRaICQ==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.0.tgz",
+ "integrity": "sha512-vgXfWmj0f3jAUvC7TZSU/m/cOE558ILWDzS7jBhiCAFpY2WEBn5jqgbqvmzlMjtp8KlLcBlXVD2mkTSEQE6Ixw==",
"cpu": [
"ppc64"
],
@@ -331,9 +331,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.39.0.tgz",
- "integrity": "sha512-t7j5Zhr7S4bBtksT73bO6c3Qa2AV/HqiGlj9+KB3gNF5upcVkx+HLgxTm8DK4OkzsOYqbdqbLKwvGMhylJCPhQ==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.0.tgz",
+ "integrity": "sha512-uJkYTugqtPZBS3Z136arevt/FsKTF/J9dEMTX/cwR7lsAW4bShzI2R0pJVw+hcBTWF4dxVckYh72Hk3/hWNKvA==",
"cpu": [
"riscv64"
],
@@ -345,9 +345,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-musl": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.39.0.tgz",
- "integrity": "sha512-m6cwI86IvQ7M93MQ2RF5SP8tUjD39Y7rjb1qjHgYh28uAPVU8+k/xYWvxRO3/tBN2pZkSMa5RjnPuUIbrwVxeA==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.0.tgz",
+ "integrity": "sha512-rKmSj6EXQRnhSkE22+WvrqOqRtk733x3p5sWpZilhmjnkHkpeCgWsFFo0dGnUGeA+OZjRl3+VYq+HyCOEuwcxQ==",
"cpu": [
"riscv64"
],
@@ -359,9 +359,9 @@
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.39.0.tgz",
- "integrity": "sha512-iRDJd2ebMunnk2rsSBYlsptCyuINvxUfGwOUldjv5M4tpa93K8tFMeYGpNk2+Nxl+OBJnBzy2/JCscGeO507kA==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.0.tgz",
+ "integrity": "sha512-SpnYlAfKPOoVsQqmTFJ0usx0z84bzGOS9anAC0AZ3rdSo3snecihbhFTlJZ8XMwzqAcodjFU4+/SM311dqE5Sw==",
"cpu": [
"s390x"
],
@@ -373,9 +373,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.39.0.tgz",
- "integrity": "sha512-t9jqYw27R6Lx0XKfEFe5vUeEJ5pF3SGIM6gTfONSMb7DuG6z6wfj2yjcoZxHg129veTqU7+wOhY6GX8wmf90dA==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.0.tgz",
+ "integrity": "sha512-RcDGMtqF9EFN8i2RYN2W+64CdHruJ5rPqrlYw+cgM3uOVPSsnAQps7cpjXe9be/yDp8UC7VLoCoKC8J3Kn2FkQ==",
"cpu": [
"x64"
],
@@ -387,9 +387,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.39.0.tgz",
- "integrity": "sha512-ThFdkrFDP55AIsIZDKSBWEt/JcWlCzydbZHinZ0F/r1h83qbGeenCt/G/wG2O0reuENDD2tawfAj2s8VK7Bugg==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.0.tgz",
+ "integrity": "sha512-HZvjpiUmSNx5zFgwtQAV1GaGazT2RWvqeDi0hV+AtC8unqqDSsaFjPxfsO6qPtKRRg25SisACWnJ37Yio8ttaw==",
"cpu": [
"x64"
],
@@ -401,9 +401,9 @@
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.39.0.tgz",
- "integrity": "sha512-jDrLm6yUtbOg2TYB3sBF3acUnAwsIksEYjLeHL+TJv9jg+TmTwdyjnDex27jqEMakNKf3RwwPahDIt7QXCSqRQ==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.0.tgz",
+ "integrity": "sha512-UtZQQI5k/b8d7d3i9AZmA/t+Q4tk3hOC0tMOMSq2GlMYOfxbesxG4mJSeDp0EHs30N9bsfwUvs3zF4v/RzOeTQ==",
"cpu": [
"arm64"
],
@@ -415,9 +415,9 @@
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.39.0.tgz",
- "integrity": "sha512-6w9uMuza+LbLCVoNKL5FSLE7yvYkq9laSd09bwS0tMjkwXrmib/4KmoJcrKhLWHvw19mwU+33ndC69T7weNNjQ==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.0.tgz",
+ "integrity": "sha512-+m03kvI2f5syIqHXCZLPVYplP8pQch9JHyXKZ3AGMKlg8dCyr2PKHjwRLiW53LTrN/Nc3EqHOKxUxzoSPdKddA==",
"cpu": [
"ia32"
],
@@ -429,9 +429,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.39.0.tgz",
- "integrity": "sha512-yAkUOkIKZlK5dl7u6dg897doBgLXmUHhIINM2c+sND3DZwnrdQkkSiDh7N75Ll4mM4dxSkYfXqU9fW3lLkMFug==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.0.tgz",
+ "integrity": "sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ==",
"cpu": [
"x64"
],
@@ -5065,9 +5065,9 @@
}
},
"node_modules/rollup": {
- "version": "4.39.0",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.39.0.tgz",
- "integrity": "sha512-thI8kNc02yNvnmJp8dr3fNWJ9tCONDhp6TV35X6HkKGGs9E6q7YWCHbe5vKiTa7TAiNcFEmXKj3X/pG2b3ci0g==",
+ "version": "4.40.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.0.tgz",
+ "integrity": "sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -5081,26 +5081,26 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
- "@rollup/rollup-android-arm-eabi": "4.39.0",
- "@rollup/rollup-android-arm64": "4.39.0",
- "@rollup/rollup-darwin-arm64": "4.39.0",
- "@rollup/rollup-darwin-x64": "4.39.0",
- "@rollup/rollup-freebsd-arm64": "4.39.0",
- "@rollup/rollup-freebsd-x64": "4.39.0",
- "@rollup/rollup-linux-arm-gnueabihf": "4.39.0",
- "@rollup/rollup-linux-arm-musleabihf": "4.39.0",
- "@rollup/rollup-linux-arm64-gnu": "4.39.0",
- "@rollup/rollup-linux-arm64-musl": "4.39.0",
- "@rollup/rollup-linux-loongarch64-gnu": "4.39.0",
- "@rollup/rollup-linux-powerpc64le-gnu": "4.39.0",
- "@rollup/rollup-linux-riscv64-gnu": "4.39.0",
- "@rollup/rollup-linux-riscv64-musl": "4.39.0",
- "@rollup/rollup-linux-s390x-gnu": "4.39.0",
- "@rollup/rollup-linux-x64-gnu": "4.39.0",
- "@rollup/rollup-linux-x64-musl": "4.39.0",
- "@rollup/rollup-win32-arm64-msvc": "4.39.0",
- "@rollup/rollup-win32-ia32-msvc": "4.39.0",
- "@rollup/rollup-win32-x64-msvc": "4.39.0",
+ "@rollup/rollup-android-arm-eabi": "4.40.0",
+ "@rollup/rollup-android-arm64": "4.40.0",
+ "@rollup/rollup-darwin-arm64": "4.40.0",
+ "@rollup/rollup-darwin-x64": "4.40.0",
+ "@rollup/rollup-freebsd-arm64": "4.40.0",
+ "@rollup/rollup-freebsd-x64": "4.40.0",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.40.0",
+ "@rollup/rollup-linux-arm-musleabihf": "4.40.0",
+ "@rollup/rollup-linux-arm64-gnu": "4.40.0",
+ "@rollup/rollup-linux-arm64-musl": "4.40.0",
+ "@rollup/rollup-linux-loongarch64-gnu": "4.40.0",
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.40.0",
+ "@rollup/rollup-linux-riscv64-gnu": "4.40.0",
+ "@rollup/rollup-linux-riscv64-musl": "4.40.0",
+ "@rollup/rollup-linux-s390x-gnu": "4.40.0",
+ "@rollup/rollup-linux-x64-gnu": "4.40.0",
+ "@rollup/rollup-linux-x64-musl": "4.40.0",
+ "@rollup/rollup-win32-arm64-msvc": "4.40.0",
+ "@rollup/rollup-win32-ia32-msvc": "4.40.0",
+ "@rollup/rollup-win32-x64-msvc": "4.40.0",
"fsevents": "~2.3.2"
}
},
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.html b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.html
index 3ff97eb6a0..46ac6f4fbd 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.html
@@ -21,7 +21,7 @@
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log; #check the path of access.log, if it doesn't fit your file, change it
-
+
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -34,11 +34,35 @@
proxy_redirect http://127.0.0.1:8080 https://trilium.example.net; # change them based on your IP, port and domain
}
}
+
# This part is for HTTPS forced
server {
- listen 80;
- server_name trilium.example.net; # change to your domain
- return 301 https://$server_name$request_uri;
+ listen 80;
+ server_name trilium.example.net; # change to your domain
+ return 301 https://$server_name$request_uri;
}
+
+
Alternatively if you want to serve the instance under a different path
+ (useful e.g. if you want to serve multiple instances), update the location
+ block like so:
+
+
update the location with your desired path (make sure to not leave a trailing
+ slash "/", if your proxy_pass does not end on a slash as well)
+
add the proxy_cookie_path directive with the same path: this
+ allows you to stay logged in at multiple instances at the same time.
+
location /trilium/instance-one {
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_pass http://127.0.0.1:8080; # change it to a different port if non-default is used
+ proxy_cookie_path / /trilium/instance-one
+ proxy_read_timeout 90;
+ proxy_redirect http://127.0.0.1:8080 https://trilium.example.net; # change them based on your IP, port and domain
+ }
+
+
\ No newline at end of file
diff --git a/src/routes/csrf_protection.ts b/src/routes/csrf_protection.ts
index 0ee03d4672..391be0aaa7 100644
--- a/src/routes/csrf_protection.ts
+++ b/src/routes/csrf_protection.ts
@@ -1,12 +1,11 @@
import { doubleCsrf } from "csrf-csrf";
import sessionSecret from "../services/session_secret.js";
import { isElectron } from "../services/utils.js";
-import config from "../services/config.js";
const doubleCsrfUtilities = doubleCsrf({
getSecret: () => sessionSecret,
cookieOptions: {
- path: config.Session.cookiePath,
+ path: "/",
secure: false,
sameSite: "strict",
httpOnly: !isElectron // set to false for Electron, see https://github.com/TriliumNext/Notes/pull/966
diff --git a/src/routes/session_parser.ts b/src/routes/session_parser.ts
index cc69cc6a22..c674a4890e 100644
--- a/src/routes/session_parser.ts
+++ b/src/routes/session_parser.ts
@@ -11,7 +11,7 @@ const sessionParser = session({
resave: false, // true forces the session to be saved back to the session store, even if the session was never modified during the request.
saveUninitialized: false, // true forces a session that is "uninitialized" to be saved to the store. A session is uninitialized when it is new but not modified.
cookie: {
- path: config.Session.cookiePath,
+ path: "/",
httpOnly: true,
maxAge: config.Session.cookieMaxAge * 1000 // needs value in milliseconds
},
diff --git a/src/services/config.ts b/src/services/config.ts
index 99704e0cf7..eda656a79a 100644
--- a/src/services/config.ts
+++ b/src/services/config.ts
@@ -31,7 +31,6 @@ export interface TriliumConfig {
trustedReverseProxy: boolean | string;
};
Session: {
- cookiePath: string;
cookieMaxAge: number;
};
Sync: {
@@ -84,9 +83,6 @@ const config: TriliumConfig = {
},
Session: {
- cookiePath:
- process.env.TRILIUM_SESSION_COOKIEPATH || iniConfig?.Session?.cookiePath || "/",
-
cookieMaxAge:
parseInt(String(process.env.TRILIUM_SESSION_COOKIEMAXAGE)) || parseInt(iniConfig?.Session?.cookieMaxAge) || 21 * 24 * 60 * 60 // 21 Days in Seconds
},
diff --git a/typedoc.json b/typedoc.json
index 8813058d09..30771621ca 100644
--- a/typedoc.json
+++ b/typedoc.json
@@ -6,7 +6,6 @@
"plugin": [
"typedoc-plugin-missing-exports"
],
- "includeVersion": true,
"outputs": [
{
"name": "html",