### Enable and Start Trilium Systemd Service Source: https://docs.triliumnotes.org/user-guide/setup/server/reverse-proxy/apache Commands to reload systemd, enable the newly created Trilium service to start on boot, and then start the service immediately. ```bash sudo systemctl daemon-reload sudo systemctl enable trilium.service sudo systemctl start trilium.service ``` -------------------------------- ### ETAPI Export Note Example (Bash) Source: https://docs.triliumnotes.org/user-guide/advanced-usage/etapi Shows how to export a specific note from Trilium as a .zip file using the ETAPI. This example utilizes a GET request to the /notes/{noteId}/export endpoint and saves the output to a file named after the note ID. ```bash curl -H "Authorization: $TOKEN" \ -X GET "$SERVER/etapi/notes/$NOTE_ID/export" \ --output "out/$NOTE_ID.zip" ``` -------------------------------- ### Start Trilium Server Service Source: https://docs.triliumnotes.org/user-guide/setup/server/installation/packaged-server This script command starts the Trilium Notes server service using systemctl. It includes error handling to report if the service fails to start and exits the script if an error occurs. ```shell echo "Starting $SERVICE_NAME service..." sudo systemctl start "$SERVICE_NAME" || { echo "Error: Failed to start $SERVICE_NAME"; exit 1; } ``` -------------------------------- ### Install Trilium Notes Server on Linux Source: https://docs.triliumnotes.org/user-guide/setup/server/installation/packaged-server Steps to download, extract, and run the Trilium Notes server on a Linux machine. This includes initial setup and running the server directly. It also covers how to keep the process running after closing the SSH connection using 'nohup'. ```bash wget (or curl) to download latest TriliumNotes-Server-[VERSION]-linux-x64.tar.xz tar -xf -d TriliumNotes-Server-[VERSION]-linux-x64.tar.xz cd trilium-linux-x64-server ./trilium.sh # To keep running after SSH disconnect: nohup ./trilium.sh & ``` -------------------------------- ### Start Trilium Server in Production Mode Source: https://docs.triliumnotes.org/developer-guide/building/dev-build This command starts the Trilium Notes server in production mode, including its own copy of assets. This is suitable for deployment or testing production builds. ```bash pnpm server:start-prod ``` -------------------------------- ### GET /api/script/startup Source: https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference Retrieves startup script bundles for the application. These scripts are typically executed when the Trilium Notes server starts. ```APIDOC ## GET /api/script/startup ### Description Retrieves startup script bundles for the application. These scripts are typically executed when the Trilium Notes server starts. ### Method GET ### Endpoint /api/script/startup ### Parameters #### Query Parameters - **mobile** (boolean) - Optional - Filters for mobile-specific startup scripts. ### Response #### Success Response (200) - **(array of objects)** - An array containing startup script bundles. - **noteId** (string) - The ID of the note containing the script. - **script** (string) - The script content. - **html** (string) - HTML content associated with the script. - **css** (string) - CSS content associated with the script. #### Response Example ```json [ { "noteId": "string", "script": "string", "html": "string", "css": "string" } ] ``` ``` -------------------------------- ### Start Trilium Desktop in Development Mode Source: https://docs.triliumnotes.org/developer-guide/building/dev-build This command initiates the Trilium Notes desktop application in development mode. It is designed to work seamlessly on NixOS, automatically handling Electron binary compatibility. ```bash pnpm desktop:start ``` -------------------------------- ### Start Trilium Server in Development Mode Source: https://docs.triliumnotes.org/developer-guide/building/dev-build This command starts the Trilium Notes server in development mode. The default port is 8080. Ensure you have completed the environment setup before running this command. ```bash pnpm server:start ``` -------------------------------- ### ETAPI Authentication Header Example (HTTP) Source: https://docs.triliumnotes.org/user-guide/advanced-usage/etapi Illustrates the format for making a GET request to the Trilium ETAPI, specifically fetching application information. It highlights the use of the 'Authorization' header with an 'ETAPITOKEN'. ```http GET https://myserver.com/etapi/app-info Authorization: ETAPITOKEN ``` -------------------------------- ### Start Trilium Desktop in Production Mode Source: https://docs.triliumnotes.org/developer-guide/building/dev-build This command launches the Trilium Notes desktop application in production mode. This is recommended for testing the final packaged version of the application. ```bash pnpm desktop:start-prod ``` -------------------------------- ### GET /api/setup/status Source: https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference Checks the current setup status of the Trilium Notes application, indicating whether it has been initialized and if the schema exists. ```APIDOC ## GET /api/setup/status ### Description Checks the current setup status of the Trilium Notes application, indicating whether it has been initialized and if the schema exists. ### Method GET ### Endpoint /api/setup/status ### Response #### Success Response (200) - **isInitialized** (boolean) - True if the application has been initialized. - **schemaExists** (boolean) - True if the database schema exists. - **syncVersion** (integer) - The current synchronization version. #### Response Example ```json { "isInitialized": true, "schemaExists": true, "syncVersion": 0 } ``` ``` -------------------------------- ### Create Trilium Systemd Service File Source: https://docs.triliumnotes.org/user-guide/setup/server/reverse-proxy/apache Defines a systemd service unit to manage the Trilium Docker container, ensuring it starts on boot and restarts automatically if it fails. ```systemd [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 ``` -------------------------------- ### Shell Export Environment Variables for Trilium Source: https://docs.triliumnotes.org/user-guide/advanced-usage/configuration Example of setting environment variables using shell export commands for Trilium Notes. This covers boolean settings like authentication and HTTPS, certificate paths, logging retention, and demonstrates starting the application. ```bash # Using either format export TRILIUM_GENERAL_NOAUTHENTICATION=false export TRILIUM_NETWORK_HTTPS=true export TRILIUM_NETWORK_CERTPATH=/path/to/cert.pem export TRILIUM_NETWORK_KEYPATH=/path/to/key.pem export TRILIUM_LOGGING_RETENTIONDAYS=30 # Start Trilium npm start ``` -------------------------------- ### Example docker-compose.yaml for Trilium with Traefik Source: https://docs.triliumnotes.org/user-guide/setup/server/reverse-proxy/traefik A complete example of a docker-compose.yaml file for setting up Trilium Notes with Traefik as a reverse proxy. It includes service definitions, environment variables for trusted proxies, volume mounts, and Traefik labels. ```yaml services: trilium: image: triliumnext/trilium container_name: trilium networks: - traefik-proxy environment: - TRILIUM_NETWORK_TRUSTEDREVERSEPROXY=my-traefik-host-ip # e.g., 172.18.0.0/16 volumes: - /path/to/data:/home/node/trilium-data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro labels: - traefik.enable=true - traefik.http.routers.trilium.entrypoints=https - traefik.http.routers.trilium.rule=Host(`trilium.mydomain.tld`) - traefik.http.routers.trilium.tls=true - traefik.http.routers.trilium.service=trilium - traefik.http.services.trilium.loadbalancer.server.port=8080 # scheme must be HTTP instead of the usual HTTPS because of how trilium works - traefik.http.services.trilium.loadbalancer.server.scheme=http - traefik.docker.network=traefik-proxy # Tell Trilium the original request was HTTPS - traefik.http.routers.trilium.middlewares=trilium-headers@docker - traefik.http.middlewares.trilium-headers.headers.customrequestheaders.X-Forwarded-Proto=https networks: traefik-proxy: external: true ``` -------------------------------- ### Configure Trilium Notes to Auto-run on Boot with systemd Source: https://docs.triliumnotes.org/user-guide/setup/server/installation/packaged-server This section provides instructions and a systemd service file configuration to ensure Trilium Notes server starts automatically on system boot. It involves extracting the server, creating a systemd service unit file, and enabling the service. ```bash tar -xvf TriliumNotes-Server-[VERSION]-linux-x64.tar.xz sudo mv trilium-linux-x64-server /opt/trilium sudo nano /etc/systemd/system/trilium.service ``` ```systemd [Unit] Description=Trilium Daemon After=syslog.target network.target [Service] User=xxx Group=xxx Type=simple ExecStart=/opt/trilium/trilium.sh WorkingDirectory=/opt/trilium/ TimeoutStopSec=20 # KillMode=process leads to error, according to https://www.freedesktop.org/software/systemd/man/systemd.kill.html Restart=always [Install] WantedBy=multi-user.target ``` ```bash sudo systemctl enable --now -q trilium ``` -------------------------------- ### Install Latest Trilium Notes Nightly on Windows (PowerShell) Source: https://docs.triliumnotes.org/user-guide/advanced-usage/nightly-release This PowerShell script automates the download and execution of the latest Trilium Notes nightly installer for Windows. It detects the system architecture (x64 or ARM64), downloads the appropriate .exe installer to a temporary location, executes it, and then cleans up the installer file. Error handling is included for download and execution failures. ```powershell if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { $arch = "arm64"; } else { $arch = "x64"; } $exeUrl = "https://github.com/TriliumNext/Trilium/releases/download/nightly/TriliumNotes-main-windows-$($arch).exe"; Write-Host "Downloading $($exeUrl)" # Generate a unique path in the temp dir $guid = [guid]::NewGuid().ToString() $destination = Join-Path -Path $env:TEMP -ChildPath "$guid.exe" try { $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $exeUrl -OutFile $destination $process = Start-Process -FilePath $destination } catch { Write-Error "An error occurred: $_" } finally { # Clean up if (Test-Path $destination) { Remove-Item -Path $destination -Force } } ``` -------------------------------- ### Run Trilium Notes Desktop App Directly with Nix Source: https://docs.triliumnotes.org/user-guide/setup/desktop/nix-flake This command allows you to run the Trilium Notes desktop application directly using Nix without a full installation. It fetches the specified version from GitHub. Ensure you have Nix installed. ```bash nix run github:TriliumNext/Trilium/v0.95.0 ``` -------------------------------- ### Install Nginx and Remove Apache2 on Ubuntu Source: https://docs.triliumnotes.org/user-guide/setup/server/reverse-proxy/nginx Installs the Nginx web server and removes the Apache2 package using apt-get on Ubuntu. This is a prerequisite for configuring Nginx as a reverse proxy. ```bash sudo apt-get install nginx sudo apt-get remove apache2 ``` -------------------------------- ### NixOS Environment Setup for Building Source: https://docs.triliumnotes.org/developer-guide/building/build-deliveries Sets up a development environment on NixOS using `nix-shell` with necessary tools like `jq`. This is a prerequisite for certain build steps on NixOS. ```shell nix-shell -p jq ``` -------------------------------- ### ETAPI Authentication Header Example (Bash) Source: https://docs.triliumnotes.org/user-guide/advanced-usage/etapi Demonstrates how to authenticate with the Trilium ETAPI using the 'Authorization' header. This method requires an ETAPITOKEN obtained from Trilium's options or via the /auth/login REST call. The token is passed directly in the header. ```bash #!/usr/bin/env bash # Configuration TOKEN=z1vA4fkGxjOR_ZXLrZeqHEFOv65yV3882iFCRtNIK9k9iWrHliITNSLQ= SERVER=http://localhost:8080 # Download a note by ID NOTE_ID="i6ra4ZshJhgN" curl "$SERVER/etapi/notes/$NOTE_ID/content" -H "Authorization: $TOKEN" ``` -------------------------------- ### Start Trilium in Safe Mode Source: https://docs.triliumnotes.org/user-guide/troubleshooting This command starts Trilium with custom scripts disabled, preventing startup crashes caused by faulty scripts or widgets. It uses the TRILIUM_SAFE_MODE environment variable. ```bash TRILIUM_SAFE_MODE=true ./trilium ``` -------------------------------- ### ETAPI Basic Authentication Example (HTTP) Source: https://docs.triliumnotes.org/user-guide/advanced-usage/etapi Shows how to use Basic Authentication with the Trilium ETAPI, available since v0.56. This method involves encoding the username 'etapi' and the ETAPI token in the format 'username:password' and then Base64 encoding the result. ```http GET https://myserver.com/etapi/app-info Authorization: Basic BATOKEN ``` -------------------------------- ### Get sync seed for setup Source: https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference Retrieves the sync seed information necessary for setting up synchronization. ```APIDOC ## GET /api/setup/sync-seed ### Description Retrieves the sync seed information for setup. ### Method GET ### Endpoint /api/setup/sync-seed ### Parameters None ### Request Example None ### Response #### Success Response (200) - **syncVersion** (integer) - The sync version of the server. - **schemaVersion** (integer) - The schema version of the database. - **documentSecret** (string) - The secret key for document synchronization. - **maxSyncId** (integer) - The maximum sync ID. #### Response Example ```json { "syncVersion": 0, "schemaVersion": 0, "documentSecret": "string", "maxSyncId": 0 } ``` ``` -------------------------------- ### Get Sync Seed for Setup Source: https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference Retrieves the sync seed information required for setting up synchronization. ```APIDOC ## GET /api/setup/sync-seed ### Description Retrieves the sync seed information required for setting up synchronization. ### Method GET ### Endpoint /api/setup/sync-seed ### Responses #### Success Response (200) - **syncVersion** (integer) - The sync protocol version. - **schemaVersion** (integer) - The schema version. - **documentSecret** (string) - The document secret for synchronization. - **maxSyncId** (integer) - The maximum sync ID. #### Response Example ```json { "syncVersion": 0, "schemaVersion": 0, "documentSecret": "string", "maxSyncId": 0 } ``` ``` -------------------------------- ### POST /api/setup/new-document Source: https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference Initializes a new Trilium Notes document. This is typically the first step in setting up a new instance. ```APIDOC ## POST /api/setup/new-document ### Description Initializes a new Trilium Notes document. This is typically the first step in setting up a new instance. ### Method POST ### Endpoint /api/setup/new-document ### Parameters #### Request Body - **password** (string) - Required - The password for the initial user. - **theme** (string) - Optional - The theme to apply to the new document. ### Request Example ```json { "password": "pa$$word", "theme": "string" } ``` ### Response #### Success Response (201) - **Document initialized** - Indicates successful initialization. #### Response Example ```json { "message": "Document initialized" } ``` ``` -------------------------------- ### NixOS Environment Setup for Chromium Source: https://docs.triliumnotes.org/developer-guide/concepts/web-clipper Sets up a Nix shell environment on NixOS that includes the Chromium browser. This is useful for ensuring the browser is available in the system path when running development commands for the web clipper on NixOS. ```bash nix-shell -p chromium ``` -------------------------------- ### Define Translation Message Keys Source: https://docs.triliumnotes.org/developer-guide/concepts/i18n Example of the hierarchical JSON structure used for defining translation keys within the translation.json files. ```json { "about": { "title": "About Trilium Notes" } } ``` -------------------------------- ### Node.js Scrypt Error due to Outdated glibc Source: https://docs.triliumnotes.org/user-guide/setup/server/installation/packaged-server This is an example of an error message indicating an outdated glibc version, specifically reporting a missing GLIBCXX_3.4.21 symbol required by the scrypt Node.js module. The solution involves upgrading glibc or using an alternative installation method. ```javascript Error: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /var/www/virtual/.../node_modules/@mlink/scrypt/build/Release/scrypt.node) at Object.Module._extensions..node (module.js:681:18) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) ``` -------------------------------- ### Setup Sync from Server Source: https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference Sets up synchronization from a remote server. ```APIDOC ## POST /api/setup/sync-from-server ### Description Sets up synchronization from a remote server. ### Method POST ### Endpoint /api/setup/sync-from-server ### Parameters #### Request Body - **syncServerHost** (string) - Required - The URI of the sync server. - **syncProxy** (string) - Optional - The URI of a proxy server for synchronization. - **password** (string) - Required - The password for the sync server. ### Request Example ```json { "syncServerHost": "http://example.com", "syncProxy": "string", "password": "pa$$word" } ``` ### Responses #### Success Response (200) - **Sync setup successful** - Indicates that the sync setup was successful. ``` -------------------------------- ### Configure Trilium Environment Variables Source: https://docs.triliumnotes.org/user-guide/setup/server Environment variables used to define the data directory location and modify file upload constraints for the Trilium server instance. ```bash export TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data export TRILIUM_NO_UPLOAD_LIMIT=true export MAX_ALLOWED_FILE_SIZE_MB=450 ``` -------------------------------- ### GET /api/notes/{noteId}/subtree/export Source: https://docs.triliumnotes.org/user-guide/advanced-usage/etapi/api-reference Exports a ZIP file containing the note subtree starting from the specified note ID. Use 'root' for noteId to export the entire document. ```APIDOC ## GET /api/notes/{noteId}/subtree/export ### Description Exports a ZIP file containing the note subtree starting from the specified note ID. Use 'root' for noteId to export the entire document. ### Method GET ### Endpoint /api/notes/{noteId}/subtree/export ### Parameters #### Path Parameters - **noteId** (string) - Required - The unique identifier of the note from which to start the subtree export. Use 'root' to export the entire document. ### Responses #### Success Response (200) Returns a ZIP file containing the exported note subtree. ``` -------------------------------- ### Configure Nginx Reverse Proxy for Trilium Source: https://docs.triliumnotes.org/user-guide/setup/server Nginx configuration snippets to proxy incoming requests to the Trilium server and disable body size limits for file uploads. ```nginx location /trilium/ { proxy_pass http://127.0.0.1:8080/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } # Set to 0 for unlimited. Default is 1M. client_max_body_size 0; ``` -------------------------------- ### Configure Manual Trilium Server Instances Source: https://docs.triliumnotes.org/user-guide/setup/server/installation/multiple-instances.html This snippet demonstrates how to launch multiple Trilium server instances by defining unique environment variables for the network port and data directory. Each instance must point to a distinct directory to prevent data corruption. ```bash TRILIUM_NETWORK_PORT=8080 TRILIUM_DATA_DIR=/path/to/your/data-dir-A /opt/trilium/trilium.sh ``` ```bash TRILIUM_NETWORK_PORT=8081 TRILIUM_DATA_DIR=/path/to/your/data-dir-B /opt/trilium/trilium.sh ``` -------------------------------- ### Download and Create Trilium Docker Container Source: https://docs.triliumnotes.org/user-guide/setup/server/reverse-proxy/apache Pulls the latest Trilium Docker image and creates a container, mapping the host's port 8080 to the container's port 8080 and mounting a volume for persistent data storage. ```bash docker pull triliumnext/trilium:[VERSION] docker create --name trilium -t -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/trilium:[VERSION] ``` -------------------------------- ### Create Backup (API) Source: https://docs.triliumnotes.org/user-guide/advanced-usage/etapi/api-reference Creates a database backup with a specified name. The backup name must be a string ID consisting of alphanumeric characters and underscores, with a maximum length of 32. If 'now' is provided as the backupName, the file will be named 'backup-now.db'. ```http POST /etapi/backups/{backupName} HTTP/1.1 Host: localhost:37740 Accept: application/json ``` -------------------------------- ### Set Custom Port for Trilium Server Source: https://docs.triliumnotes.org/developer-guide/building/dev-build To run the Trilium server on a custom port, you can modify the TRILIUM_PORT environment variable within the package.json file. This example shows how to set it to a different value. ```bash # Example: Set TRILIUM_PORT to 9000 export TRILIUM_PORT=9000 pnpm server:start ``` -------------------------------- ### POST /api/setup/sync-from-server Source: https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference Sets up synchronization from a remote Trilium Notes server. This allows for data synchronization between instances. ```APIDOC ## POST /api/setup/sync-from-server ### Description Sets up synchronization from a remote Trilium Notes server. This allows for data synchronization between instances. ### Method POST ### Endpoint /api/setup/sync-from-server ### Parameters #### Request Body - **syncServerHost** (string) - Required - The URI of the synchronization server. - **syncProxy** (string) - Optional - The URI of a proxy server for synchronization. - **password** (string) - Required - The password for accessing the synchronization server. ### Request Example ```json { "syncServerHost": "", "syncProxy": "string", "password": "" } ``` ### Response #### Success Response (200) - **Sync setup successful** - Indicates that synchronization setup was successful. #### Response Example ```json { "message": "Sync setup successful" } ``` ``` -------------------------------- ### Enable Safe Mode for Trilium Server Source: https://docs.triliumnotes.org/developer-guide/building/dev-build This command starts the Trilium Notes server with safe mode enabled. Safe mode is off by default and can be temporarily activated by prepending the TRILIUM_SAFE_MODE environment variable. ```bash pnpm cross-env TRILIUM_SAFE_MODE=1 pnpm server:start ``` -------------------------------- ### Start Web Clipper Development Mode (Firefox) Source: https://docs.triliumnotes.org/developer-guide/concepts/web-clipper Initiates the development mode for the web clipper targeting Firefox with Manifest v2. This command uses pnpm to filter and run the 'dev:firefox' script for the 'web-clipper' package, facilitating development with live reload. ```bash pnpm --filter web-clipper dev:firefox ``` -------------------------------- ### Start Web Clipper Development Mode (Chrome) Source: https://docs.triliumnotes.org/developer-guide/concepts/web-clipper Initiates the development mode for the web clipper targeting Chrome with Manifest v3. This command utilizes pnpm to filter and run the 'dev' script for the 'web-clipper' package, enabling live reload and TypeScript support. ```bash pnpm --filter web-clipper dev ``` -------------------------------- ### API Endpoint Example - Get Note Source: https://docs.triliumnotes.org/developer-guide/architecture/backend Demonstrates a typical Express.js route handler for retrieving a note by its ID and returning its plain JavaScript object representation with content. This endpoint is part of the REST API for notes. ```typescript router.get('/api/notes/:noteId', (req, res) => { const noteId = req.params.noteId const note = becca.getNote(noteId) res.json(note.getPojoWithContent()) }) ``` -------------------------------- ### Enable and Configure Trilium Server on NixOS Source: https://docs.triliumnotes.org/user-guide/setup/server/installation/nixos This snippet shows how to enable the Trilium Notes server service in NixOS and provides commented-out examples for customizing the data directory, host, and port. Ensure you have a NixOS installation to use this configuration. ```nix services.trilium-server.enable = true; # default data directory: /var/lib/trilium #services.trilium-server.dataDir = "/var/lib/trilium-sync-server"; # default bind address: 127.0.0.1, port 8080 #services.trilium-server.host = "0.0.0.0"; #services.trilium-server.port = 12783; ``` -------------------------------- ### Run Trilium with Various Network Configurations Source: https://docs.triliumnotes.org/user-guide/setup/server/installation/docker Commands to run the Trilium container with different access levels, including local-only, custom macvlan network, and global access. ```bash # Local access only sudo docker run -t -i -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/trilium:[VERSION] # Create macvlan network for local network access docker network create -d macvlan -o parent=eth0 --subnet 192.168.2.0/24 --gateway 192.168.2.254 --ip-range 192.168.2.252/27 mynet # Run with custom UID/GID on network 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/trilium:-latest # Global access docker run -d -p 0.0.0.0:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/trilium:[VERSION] ``` -------------------------------- ### Set Widget Position (JavaScript) Source: https://docs.triliumnotes.org/user-guide/scripts/frontend-basics/custom-widget/right-pane-widget This example shows how to alter the display order of a widget within the sidebar by overriding the `position` getter. A higher `position` value will place the widget lower in the list. The default position starts at 10 and increments by 10. ```javascript class MyWidget extends api.RightPanelWidget { + get position() { return 20 }; } ``` -------------------------------- ### ETAPI Bearer Authentication Example (HTTP) Source: https://docs.triliumnotes.org/user-guide/advanced-usage/etapi Demonstrates an alternative way to authenticate with the Trilium ETAPI using the 'Bearer' token format in the 'Authorization' header. This is compatible with various tools and is available since Trilium version 0.93.0. ```http GET https://myserver.com/etapi/app-info Authorization: Bearer ETAPITOKEN ``` -------------------------------- ### Enable Apache Proxy Modules Source: https://docs.triliumnotes.org/user-guide/setup/server/reverse-proxy/apache Enables necessary Apache modules for proxying HTTP and WebSocket traffic, essential for reverse proxy configurations. ```bash a2enmod ssl a2enmod proxy a2enmod proxy_http a2enmod proxy_wstunnel ``` -------------------------------- ### Disable TLS Certificate Verification in Trilium Source: https://docs.triliumnotes.org/user-guide/setup/synchronization This command disables TLS certificate verification for Trilium, which can be useful for self-signed certificates or corporate proxies. However, it significantly reduces security and exposes the setup to MITM attacks. It is strongly recommended to use a valid signed server certificate. ```bash export NODE_TLS_REJECT_UNAUTHORIZED=0 ``` -------------------------------- ### Build Web Clipper (Firefox) Source: https://docs.triliumnotes.org/developer-guide/concepts/web-clipper Generates the production-ready output files for the web clipper targeting Firefox. The output will be located in the `.output/firefox` directory. ```bash pnpm build:firefox ``` -------------------------------- ### Generate CKEditor 5 Plugin Project Skeleton Source: https://docs.triliumnotes.org/developer-guide/dependencies/ckeditor/plugin-migration Uses the CKEditor 5 package generator to create a new plugin project structure. It specifies the package name, uses npm, sets the language to TypeScript, and uses the current installation method. ```bash npx ckeditor5-package-generator @triliumnext/ckeditor5-foo --use-npm --lang ts --installation-methods current ``` -------------------------------- ### Cleanup Installation Directory Source: https://docs.triliumnotes.org/user-guide/setup/server/installation/packaged-server This script command removes the temporary extraction directory after the Trilium server has been successfully installed or updated. It ensures that no leftover temporary files remain. ```shell rm -rf "$EXTRACT_DIR" echo "Cleanup complete. Trilium updated to $LATEST_VERSION." ```