From 315ca993587198e6b72cf2673a2030af800a5446 Mon Sep 17 00:00:00 2001 From: meichthys Date: Mon, 5 Aug 2024 12:04:40 -0400 Subject: [PATCH 1/5] Update docker image references --- Wiki/anonymized-database.md | 4 +-- Wiki/apache-proxy-setup.md | 46 +++++++++++++------------- Wiki/docker-server-installation.md | 16 ++++----- Wiki/home.md | 4 +-- Wiki/import-docs.md | 4 +-- Wiki/manual-server-installation.md | 4 +-- Wiki/patterns-of-personal-knowledge.md | 4 +-- 7 files changed, 40 insertions(+), 42 deletions(-) diff --git a/Wiki/anonymized-database.md b/Wiki/anonymized-database.md index 54f79d5..d3777da 100644 --- a/Wiki/anonymized-database.md +++ b/Wiki/anonymized-database.md @@ -1,4 +1,4 @@ -# Anonymized database +# Anonymized database ### Anonymized database In some cases, it's necessary to see the database structure to be able to debug the problem. Of course, we can't ask you to send us [Document](document.md) file with your notes. @@ -7,7 +7,7 @@ For this, Trilium supports anonymization of the database - you can trigger this ![](images/anonymization.png) -This will create a copy of your document and remove all sensitive data (currently note titles, contents, revisions, history and some of the options, and non-system attributes) while leaving all structure and metadata (e.g. date of last change). After this is done, the database is [VACUUMed](https://sqlite.org/lang_vacuum.html) to make sure there's no stale sensitive data in the document file. The resulting file is stored in `anonymized` directory (placed in the [data directory](data-directory.md)). You can safely attach it with your bug report or send it to [zadam.apps@gmail.com](#root/N3Zt66yETj9g) %%{WARNING}%% +This will create a copy of your document and remove all sensitive data (currently note titles, contents, revisions, history and some of the options, and non-system attributes) while leaving all structure and metadata (e.g. date of last change). After this is done, the database is [VACUUMed](https://sqlite.org/lang_vacuum.html) to make sure there's no stale sensitive data in the document file. The resulting file is stored in `anonymized` directory (placed in the [data directory](data-directory.md)). You can safely attach it to a bug report. #### Command line anonymization diff --git a/Wiki/apache-proxy-setup.md b/Wiki/apache-proxy-setup.md index cffff2d..dd241c9 100644 --- a/Wiki/apache-proxy-setup.md +++ b/Wiki/apache-proxy-setup.md @@ -1,40 +1,40 @@ -# Apache proxy setup +# Apache proxy setup I've assumed you have created a DNS A record for `trilium.yourdomain.com` that you want to use for your Trilium server. 1. Download docker image and create container - + ```text-plain - docker pull zadam/trilium:[VERSION] %%{WARNING}%% - docker create --name trilium -t -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data zadam/trilium:[VERSION] + docker pull triliumnext/notes:[VERSION] + docker create --name trilium -t -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/notes:[VERSION] ``` - + 2. Configure Apache proxy and websocket proxy - + 1. Enable apache proxy modules - + ```text-plain a2enmod ssl a2enmod proxy a2enmod proxy_http a2enmod proxy_wstunnel ``` - + 2. Create a new let's encrypt certificate - + ```text-plain sudo certbot certonly -d trilium.mydomain.com ``` - + Choose standalone (2) and note the location of the created certificates (typically /etc/letsencrypt/live/...) - + 3. Create a new virtual host file for apache (you may want to use `apachectl -S` to determine the server root location, mine is /etc/apache2) - + ```text-plain sudo nano /etc/apache2/sites-available/trilium.yourdomain.com.conf ``` - + Paste (and customize) the following text into the configuration file - + ```text-plain ServerName http://trilium.yourdomain.com @@ -55,32 +55,32 @@ I've assumed you have created a DNS A record for `trilium.yourdomain.com` that y Include /etc/letsencrypt/options-ssl-apache.conf ``` - + 4. Enable the virtual host with `sudo a2ensite trilium.yourdomain.com.conf` - + 5. Reload apache2 with `sudo systemctl reload apache2` - + 3. Create and enable a systemd service to start the docker container on boot - + 1. Create a new empty file called `/lib/systemd/system/trilium.service` with the contents - + ```text-plain [Unit] Description=Trilium Server Requires=docker.service After=docker.service - + [Service] Restart=always ExecStart=/usr/bin/docker start -a trilium ExecStop=/usr/bin/docker stop -t 2 trilium - + [Install] WantedBy=local.target ``` - + 2. Install, enable and start service - + ```text-plain sudo systemctl daemon-reload sudo systemctl enable trilium.service diff --git a/Wiki/docker-server-installation.md b/Wiki/docker-server-installation.md index a5729b1..de0707c 100644 --- a/Wiki/docker-server-installation.md +++ b/Wiki/docker-server-installation.md @@ -1,7 +1,7 @@ # Docker-server-installation Trilium can be run as docker image. This is recommended way to deploy Trilium on servers. -Official docker images are published on docker hub for **AMD64**, **ARMv6**, **ARMv7** and **ARMv8/64**: [https://hub.docker.com/r/zadam/trilium/](https://hub.docker.com/r/zadam/trilium/)%%{WARNING}%% +Official docker images are published on docker hub for **AMD64**, **ARMv6**, **ARMv7** and **ARMv8/64**: [https://hub.docker.com/r/triliumnext/notes/](https://hub.docker.com/r/triliumnext/notes/) Prerequisites ------------- @@ -17,7 +17,7 @@ Pull image ---------- ```text-plain -docker pull zadam/trilium:[VERSION] %%{WARNING}%% +docker pull triliumnext/notes:[VERSION] ``` Replace \[VERSION\] for actual latest version or use "series" tag - e.g. `0.52-latest`. @@ -39,7 +39,7 @@ These commands mount the volume to the host system so that trilium's data (most This will run the container so that it only available on the localhost. Use this to test the installation from a web browser on the same machine you run this command on, or if you are using a proxy with nginx/apache. ```text-plain -sudo docker run -t -i -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data zadam/trilium:[VERSION] %%{WARNING}%% +sudo docker run -t -i -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/notes:[VERSION] ``` 1. Test to see that the docker image is running with `docker ps` @@ -58,20 +58,20 @@ docker network create -d macvlan -o parent=eth0 --subnet 192.168.2.0/24 --gatewa Secondly, you have to adjust the docker run command so it takes this network into account but keep using localhost to limit the accessibility of the ports to the outside world. ```text-plain -docker run --net=mynet -d -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data zadam/trilium:0.52-latest +docker run --net=mynet -d -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/notes:-latest ``` Alternatively, if you wish to have the saved data and the application using a different UID & GID than 1000:1000, you can use the USER\_UID & USER\_GID environment variables: ```text-plain -docker run --net=mynet -d -p 127.0.0.1:8080:8080 -e "USER_UID=1001" -e "USER_GID=1001" -v ~/trilium-data:/home/node/trilium-data zadam/trilium:0.52-latest %%{WARNING}%% +docker run --net=mynet -d -p 127.0.0.1:8080:8080 -e "USER_UID=1001" -e "USER_GID=1001" -v ~/trilium-data:/home/node/trilium-data triliumnext/notes:-latest ``` Finally, use docker inspect to find your local IP address to connect to. You can access this from all your devices connected to the local network as such: \[local:ip\]:8080. ```text-plain docker ps -docker inspect [container_name] +docker inspect [container_name] ``` ### Available anywhere @@ -79,14 +79,14 @@ docker inspect [container_name] This will run the container as a background process and will be available from any IP address ```text-plain -docker run -d -p 0.0.0.0:8080:8080 -v ~/trilium-data:/home/node/trilium-data zadam/trilium:[VERSION] %%{WARNING}%% +docker run -d -p 0.0.0.0:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/notes:[VERSION] ``` To stop this background docker process use `docker ps` to get the "CONTAINER ID" and then use `docker stop ` ### Different data directory location -If you want to run your instance in a non-default way, please use the volume switch as follows: `-v ~/YourOwnDirectory:/home/node/trilium-data zadam/trilium:[VERSION]`. It is important to be aware of how Docker works for volumes, with the first path being your own and the second the one to virtually bind to. [https://docs.docker.com/storage/volumes/](https://docs.docker.com/storage/volumes/) +If you want to run your instance in a non-default way, please use the volume switch as follows: `-v ~/YourOwnDirectory:/home/node/trilium-data triliumnext/notes:`. It is important to be aware of how Docker works for volumes, with the first path being your own and the second the one to virtually bind to. [https://docs.docker.com/storage/volumes/](https://docs.docker.com/storage/volumes/) ### Note about --user directive diff --git a/Wiki/home.md b/Wiki/home.md index f332e8e..92f5238 100644 --- a/Wiki/home.md +++ b/Wiki/home.md @@ -1,8 +1,8 @@ -# Home +# Home Overview -------- -Basic overview of the Trilium project is available at project homepage - [https://github.com/zadam/trilium#trilium-notes](https://github.com/zadam/trilium#trilium-notes) +Basic overview of the Trilium project is available at project homepage - [https://github.com/triliumnext/notes#trilium-notes](https://github.com/triliumnext/notes#trilium-notes) Inspiration for the name "Trilium": diff --git a/Wiki/import-docs.md b/Wiki/import-docs.md index 1185a7c..507b047 100644 --- a/Wiki/import-docs.md +++ b/Wiki/import-docs.md @@ -5,7 +5,7 @@ To import these docs into your own Trilium instance: 1. Download archive from main branch of this repo: https://github.com/TriliumNext/Docs/archive/refs/heads/main.zip 2. In Trilim create a new note to act as branch for the docs -3. Right-click on the note, select "Import into note" and select downloaded `Docs-main.zip` file. +3. Right-click on the note, select "Import into note" and select downloaded `Docs-main.zip` file. - Optionally uncheck "Shrink images" ## Optional cleanup @@ -13,5 +13,3 @@ https://github.com/TriliumNext/Docs/archive/refs/heads/main.zip - Move `images` node down to the bottom (instead of dragging, it's easier to move out to parent node than back into Wiki. It will go to end of list automatically). For new releases delete the old docs note tree and start fresh, or you'll get duplicates. - -[0]: https://github.com/zadam/trilium/wiki diff --git a/Wiki/manual-server-installation.md b/Wiki/manual-server-installation.md index 59541f2..c6416f2 100644 --- a/Wiki/manual-server-installation.md +++ b/Wiki/manual-server-installation.md @@ -1,4 +1,4 @@ -# Manual-server-installation +# Manual-server-installation This page describes manually installing Trilium on your server. **Note that this is a not well supported way to install Trilium, problems may appear, information laid out here is quite out of date. It is recommended to use either Docker or packaged build installation.** Requirements @@ -30,7 +30,7 @@ Installation You can either download source code zip/tar from [https://github.com/TriliumNext/Notes/releases/latest\]\]](https://github.com/TriliumNext/Notes/releases/latest%5D%5D) %%{WARNING}%%or clone git repository **from stable branch** with ```text-plain -git clone -b stable https://github.com/zadam/trilium.git %%{WARNING}%% +git clone -b stable https://github.com/triliumnext/notes.git %%{WARNING}%% ``` Installation diff --git a/Wiki/patterns-of-personal-knowledge.md b/Wiki/patterns-of-personal-knowledge.md index 9f71d81..d971275 100644 --- a/Wiki/patterns-of-personal-knowledge.md +++ b/Wiki/patterns-of-personal-knowledge.md @@ -1,8 +1,8 @@ -# Patterns-of-personal-knowledge +# Patterns-of-personal-knowledge Patterns-of-personal-knowledge-base ----------------------------------- -This page contains description of some of the patterns I use to organize information in my knowledge base. This is meant to give some inspiration of how one might create and structure their knowledge base in general and also specifically in [Trilium Notes](https://github.com/zadam/trilium). It also gives some background and justification for some of the design decisions. +This page contains description of some of the patterns I use to organize information in my knowledge base. This is meant to give some inspiration of how one might create and structure their knowledge base in general and also specifically in [Trilium Notes](https://github.com/triliumnext/notes). It also gives some background and justification for some of the design decisions. Meta patterns ------------- From c33a2ad071e5a6f1875ddb4a4ccfee9d96fc2fe2 Mon Sep 17 00:00:00 2001 From: meichthys Date: Mon, 5 Aug 2024 13:06:15 -0400 Subject: [PATCH 2/5] Reference new documentation --- Wiki/day-notes.md | 4 ++-- Wiki/default-note-title.md | 4 ++-- Wiki/error-logs.md | 4 ++-- Wiki/frontend-basics.md | 8 ++++---- Wiki/script-api.md | 4 ++-- Wiki/widget-basics.md | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Wiki/day-notes.md b/Wiki/day-notes.md index 4b5f233..528cf56 100644 --- a/Wiki/day-notes.md +++ b/Wiki/day-notes.md @@ -1,4 +1,4 @@ -# Day-notes +# Day-notes A common pattern in note-taking is that a lot of notes will be centered around a certain date - e.g. you have some tasks which needs to be done on a certain date, you have meeting minutes from a certain date, you have your thoughts etc. and it all revolves around a date on which they occurred. For this reason, it makes sense to create a certain "day workspace" which will centralize all those notes relevant for a certain date. For this, Trilium provides a concept of "day note". Trilium semi-automatically generates a single note for each day. Under this note you can save all those relevant notes. @@ -55,7 +55,7 @@ The default is `{monthNumberPadded} - {month}` Implementation -------------- -Trilium has some special support for day notes in the form of [backend Script API](https://zadam.github.io/trilium/backend_api/BackendScriptApi.html) - see e.g. getDayNote() function. +Trilium has some special support for day notes in the form of [backend Script API](https://triliumnext.github.io/Notes/backend_api/BackendScriptApi.html) - see e.g. getDayNote() function. Day (and year, month) notes are created with a label - e.g. `#dateNote="2018-08-16"` this can then be used by other scripts to add new notes to day note etc. diff --git a/Wiki/default-note-title.md b/Wiki/default-note-title.md index 2dbe0da..e13fc59 100644 --- a/Wiki/default-note-title.md +++ b/Wiki/default-note-title.md @@ -1,4 +1,4 @@ -# Default-note-title +# Default-note-title When a new note is created, its name is by default "new note". In some cases, it can be desirable to have a different or even a dynamic default note title. For this use case, Trilium (since v0.52) supports `#titleTemplate` [label](attributes.md). You can create such a label for a given note, assign it a value, and this value will be used as a default title when creating child notes. As with other labels, you can make it inheritable to apply recursively, and you can even place it on the root note to have it applied globally everywhere. @@ -26,6 +26,6 @@ As an example, imagine you collect server outage incidents and write some notes. You can automatize the date assignment by assigning a label `#titleTemplate="${now.format('YYYY-MM-DD')}: "` to the parent note "Incidents". Whenever a new child note is created, the title template is evaluated with the injected [now](https://day.js.org/docs/en/display/format) object. -Second variable injected is [parentNote](https://zadam.github.io/trilium/backend_api/Note.html), an example could be `#titleTemplate="${parentNote.getLabelValue('authorName')}'s literary works"`. +Second variable injected is [parentNote](https://triliumnext.github.io/Notes/backend_api/BNote.html), an example could be `#titleTemplate="${parentNote.getLabelValue('authorName')}'s literary works"`. See also \[\[[template](template.md)\]\] which provides similar capabilities, including default note's content. diff --git a/Wiki/error-logs.md b/Wiki/error-logs.md index 8a553e2..a939601 100644 --- a/Wiki/error-logs.md +++ b/Wiki/error-logs.md @@ -1,4 +1,4 @@ -# Error-logs +# Error-logs It's important to provide all available error logs together with bug reports. This page will show you how to do it. Backend logs @@ -29,7 +29,7 @@ Copy-paste (or screenshot) the logs. It's better to provide not just errors, but Providing sensitive data ------------------------ -If you don't feel comfortable attaching the logs or anything sensitive to the public GitHub issues, feel free to mail them to [zadam.apps@gmail.com](#root/N3Zt66yETj9g) +If you don't feel comfortable attaching the logs or anything sensitive to the public GitHub issues, feel free to contact the devs in our Matrix [support channel](https://github.com/TriliumNext/Notes#-discuss-with-us). Use this email to also provide anything which could assist in analysing the bug - e.g. files/images/ZIPs being imported or [anonymized database](anonymized-database.md). diff --git a/Wiki/frontend-basics.md b/Wiki/frontend-basics.md index dcd83ca..7976868 100644 --- a/Wiki/frontend-basics.md +++ b/Wiki/frontend-basics.md @@ -1,4 +1,4 @@ -# Frontend-Basics +# Frontend-Basics Frontend API ------------ @@ -39,14 +39,14 @@ Widgets Conversely to scripts, widgets do have some specific requirements in order to work. A widget must: -* Extend [BasicWidget](https://zadam.github.io/trilium/frontend_api/BasicWidget.html) or one of it's subclasses. +* Extend [BasicWidget](https://triliumnext.github.io/Notes/frontend_api/BasicWidget.html) or one of it's subclasses. * Create a new instance and assign it to `module.exports`. * Define a `parentWidget` member to determine where it should be displayed. * Define a `position` (integer) that determines the location via sort order. * Have a `#widget` attribute on the containing note. * Create, render, and return your element in the render function. - * For [BasicWidget](https://zadam.github.io/trilium/frontend_api/BasicWidget.html) and [NoteContextAwareWidget](https://zadam.github.io/trilium/frontend_api/NoteContextAwareWidget.html) you should create `this.$widget` and render it in `doRender()`. - * For [RightPanelWidget](https://zadam.github.io/trilium/frontend_api/RightPanelWidget.html) the `this.$widget` and `doRender()` are already handled and you should instead return the value in `doRenderBody()`. + * For [BasicWidget](https://triliumnext.github.io/Notes/frontend_api/BasicWidget.html) and [NoteContextAwareWidget](https://triliumnext.github.io/Notes/frontend_api/NoteContextAwareWidget.html) you should create `this.$widget` and render it in `doRender()`. + * For [RightPanelWidget](https://triliumnext.github.io/Notes/frontend_api/RightPanelWidget.html) the `this.$widget` and `doRender()` are already handled and you should instead return the value in `doRenderBody()`. ### parentWidget diff --git a/Wiki/script-api.md b/Wiki/script-api.md index 0233f5b..b943212 100644 --- a/Wiki/script-api.md +++ b/Wiki/script-api.md @@ -1,8 +1,8 @@ # Script API For [Scripts](scripts.md) to do anything useful, Trilium publishes "Script API". Actually there are two such APIs: -* [Frontend API](https://zadam.github.io/trilium/frontend_api/FrontendScriptApi.html) %%{WARNING}%% -* [Backend API](https://zadam.github.io/trilium/backend_api/BackendScriptApi.html) %%{WARNING}%% +* [Frontend API](https://triliumnext.github.io/Notes/frontend_api/FrontendScriptApi.html) %%{WARNING}%% +* [Backend API](https://triliumnext.github.io/Notes/backend_api/BackendScriptApi.html) %%{WARNING}%% Backwards compatibility ----------------------- diff --git a/Wiki/widget-basics.md b/Wiki/widget-basics.md index a65f1e9..f53d895 100644 --- a/Wiki/widget-basics.md +++ b/Wiki/widget-basics.md @@ -1,4 +1,4 @@ -# Widget-Basics +# Widget-Basics ### The Very Basics Based on the information from [Frontend Basics](frontend-basics.md), the most basic widget we can make looks something like this. @@ -7,7 +7,7 @@ Based on the information from [Frontend Basics](frontend-basics.md), the most ba class MyWidget extends api.BasicWidget { get position() {return 1;} get parentWidget() {return "left-pane"} - + doRender() { this.$widget = $("
"); return this.$widget; @@ -33,7 +33,7 @@ const template = `
`; class MyWidget extends api.BasicWidget { get position() {return 1;} get parentWidget() {return "left-pane"} - + doRender() { this.$widget = $(template); return this.$widget; @@ -49,7 +49,7 @@ Make that change, and reload Trilium and you should see a really ugly looking bu const template = `
`; ``` -After reloading, that already looks a little bit better. But it's still in the wrong spot. We can fix that with a little bit of css. Thankfully [BasicWidget](https://zadam.github.io/trilium/frontend_api/BasicWidget.html) allows us to do this very easily with `this.cssBlock`. +After reloading, that already looks a little bit better. But it's still in the wrong spot. We can fix that with a little bit of css. Thankfully [BasicWidget](https://triliumnext.github.io/Notes/frontend_api/BasicWidget.html) allows us to do this very easily with `this.cssBlock`. ```text-plain const template = `
`; @@ -57,7 +57,7 @@ const template = `