Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
services:silverbullet [2024/03/12 15:26] – 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 / | ||
+ | </ | ||
- | 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> | ||
+ | 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 / |
- | ./ | + | ===== Reverse proxy ===== |
- | ===== Startup ===== | + | 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, |
- | Create | + | Here is the NGINX configuration file: |
- | <file - silverbullet.sh> | + | <file - silverbullet.conf> |
- | #!/bin/bash | + | |
- | cd /data/daemons/silverbullet && | + | access_log |
+ | error_log | ||
+ | |||
+ | # login protected access from outside | ||
+ | server { | ||
+ | server_name notes.mydomain.com; | ||
+ | listen 8443 ssl; | ||
+ | http2 on; | ||
+ | include "com.mydomain/authelia_location.conf"; | ||
+ | |||
+ | 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 " | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
</ | </ | ||
- | make it executable. | ||
- | Now, create the startup script **/ | + | Note: do not just copy and paste this file, you need to understand it and adapt where needed. |
- | <file - 44-silverbullet.sh> | + | |
- | #!/bin/bash | + | |
- | / | + | ===== 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 | ||
+ | |||
+ | description=" | ||
+ | pidfile="/ | ||
+ | command_background=true | ||
+ | command=" | ||
+ | command_args="/ | ||
+ | command_user=" | ||
+ | |||
+ | depend() { | ||
+ | need net | ||
+ | } | ||
</ | </ | ||
- | and make it executable | + | Make it executable |
+ | <code bash> | ||
+ | chmod +x / | ||
+ | rc-update add silverbullet default | ||
+ | </ | ||
+ | |||
+ | ===== Update ===== | ||
+ | |||
+ | Download new binary (see link above) and simply replace old one and restart service. | ||