Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
services:silverbullet [2024/03/06 15:10] – created willy | services:silverbullet [2024/09/05 12:56] (current) – [Startup] willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Silverbullet ====== | ====== Silverbullet ====== | ||
+ | [[https:// | ||
+ | ===== Installation ===== | ||
+ | |||
+ | As usual you need a dedicated user: | ||
+ | <code bash> | ||
useradd -d / | useradd -d / | ||
+ | </ | ||
+ | |||
+ | 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. | ||
+ | |||
+ | Set umask to 0002 in bashrc, so that any md files created by Silverbullet will also be accessible to all users in **users** group: | ||
+ | <code bash> | ||
+ | echo "umask 0002" >> / | ||
+ | </ | ||
+ | |||
+ | Now, just download the latest release from [[https:// | ||
+ | <code bash> | ||
+ | su - silverbullet | ||
+ | wget ' | ||
+ | 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 / | ||
+ | |||
+ | ===== 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 ===== | ||
+ | |||
+ | Since i use OpenRC, to start silverbullet simply create the following script under / | ||
+ | <file - / | ||
+ | # | ||
+ | # Copyright 1999-2021 Gentoo Authors | ||
+ | # Distributed under the terms of the GNU General Public License v2 | ||
- | umask 0002 in bashrc | + | description=" |
+ | pidfile="/ | ||
+ | command_background=true | ||
+ | command="/ | ||
+ | command_args="/ | ||
+ | command_user=" | ||
- | Download: | + | depend() { |
- | https:// | + | need net |
+ | } | ||
+ | </file> | ||
- | https://github.com/ | + | Make it executable and add the service to the default runlevel: |
+ | <code bash> | ||
+ | chmod +x /etc/init.d/ | ||
+ | rc-update add silverbullet default | ||
+ | </code> | ||
- | unzip silverbullet-server-linux-x86_64.zip | + | ===== Update ===== |
- | ./ | + | Download new binary (see link above) and simply replace old one and restart service. |