Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| services:silverbullet [2024/04/02 14:20] – willy | services:silverbullet [2025/04/17 06:53] (current) – willy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Silverbullet ====== | ====== Silverbullet ====== | ||
| + | [[https:// | ||
| + | ===== Installation ===== | ||
| + | |||
| + | As usual you need a dedicated user: | ||
| + | <code bash> | ||
| useradd -d / | useradd -d / | ||
| + | </ | ||
| - | umask 0002 in bashrc | + | Note that i am adding it to the **users** group because i want to share the notes (which are plain md files) via Syncthing later on. |
| - | Download: | + | Set umask to 0002 in bashrc, so that any md files created by Silverbullet will also be accessible to all users in **users** group: |
| - | https://github.com/ | + | <code bash> |
| + | echo "umask 0002" >> | ||
| + | </ | ||
| - | https:// | + | Now, just download the latest release from [[https:// |
| + | <code bash> | ||
| + | mkdir / | ||
| + | chown silverbullet: | ||
| + | su - silverbullet | ||
| + | wget 'https:// | ||
| + | unzip silverbullet-server-linux-x86_64.zip | ||
| + | </ | ||
| - | unzip silverbullet-server-linux-x86_64.zip | + | And you are all set! You will need to define a folder to store the notes, i will assume it's / |
| - | ./silverbullet /data/common/willy/Notes/ --hostname | + | ===== Reverse proxy ===== |
| + | |||
| + | Silverbullet requires a dedicated subdomain, it will not work on subpath. I will assume it's **notes.mydomain.com**. Also, since Silverbullet do not manage authentication, | ||
| + | |||
| + | Here is the NGINX configuration file: | ||
| + | <file - silverbullet.conf> | ||
| + | |||
| + | access_log | ||
| + | error_log | ||
| + | |||
| + | # login protected access from outside | ||
| + | server { | ||
| + | server_name notes.mydomain.com; | ||
| + | listen 8443 ssl; | ||
| + | http2 on; | ||
| + | include " | ||
| + | |||
| + | location / { | ||
| + | | ||
| + | | ||
| + | if ($http_origin = '' | ||
| + | set $http_origin " | ||
| + | } | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | |||
| + | # Manage direct request inside home network | ||
| + | # It's identical to the remote one, but it has no authentication | ||
| + | # HTTPS on port 443 for direct local connections | ||
| + | server { | ||
| + | server_name notes.mydomain.com; | ||
| + | listen 443 ssl; | ||
| + | http2 on; | ||
| + | |||
| + | location / { | ||
| + | if ($http_origin = '' | ||
| + | set $http_origin " | ||
| + | } | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Note: do not just copy and paste this file, you need to understand it and adapt where needed. | ||
| ===== Startup ===== | ===== Startup ===== | ||
| - | Following my [[gentoo: | + | Since i use OpenRC, to start silverbullet simply |
| - | <code bash> | + | <file - /etc/init.d/ |
| - | cd /etc/local.d | + | # |
| - | ln -s _servicer.sh 60-silverbullet--service.start | + | # Copyright 1999-2021 Gentoo Authors |
| - | ln -s _servicer.sh 60-silverbullet--service.stop | + | # Distributed under the terms of the GNU General Public License v2 |
| - | </ | + | |
| - | And the associated service support file **/data/ | + | description=" |
| - | <file - service_silverbuller_start> | + | pidfile=" |
| - | COMMAND="/ | + | command_background=true |
| - | ARGUMENTS=(/data/common/ | + | command="/ |
| + | command_args="/home/notes/ --hostname 127.0.0.1 --port 8001" | ||
| + | command_user=" | ||
| + | output_log="/ | ||
| + | output_err="/ | ||
| + | |||
| + | depend() { | ||
| + | need net | ||
| + | } | ||
| </ | </ | ||
| + | Make it executable and add the service to the default runlevel: | ||
| + | <code bash> | ||
| + | chmod +x / | ||
| + | rc-update add silverbullet default | ||
| + | </ | ||
| + | |||
| + | ===== Update ===== | ||
| + | Download new binary (see link above) and simply replace old one and restart service. | ||