Agent host: SilverBullet serves the vault as its one space, behind Authelia
The operator chose single-space mode: the vault is mounted at /data, with memory/ read-only over it, and there are no accounts or setup wizard; Authelia in the operator's Caddy is the login. SB_NAME forces the mode, so an empty vault can't boot the wizard. SilverBullet's own data folder is gone. check now fails if the wizard could be open. The README says how to make memory/ writable for a while and back. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
This commit is contained in:
1 parent
1d33d50907
commit
bf98445fcb
7 files changed
+70
-52
No files matched your search
+15
-13
@@ -7,9 +7,9 @@ later (M6.1).
|
||||
|
||||
## What's here
|
||||
|
||||
- `silverbullet/compose.yaml`: SilverBullet, its version pinned. It mounts the
|
||||
vault, with the agents' `memory/` read-only, and its own data folder.
|
||||
Nothing else of the host.
|
||||
- `silverbullet/compose.yaml`: SilverBullet, its version pinned, serving the
|
||||
vault as its one space, with the agents' `memory/` read-only. Nothing else of
|
||||
the host. It has no accounts: the operator logs in through Authelia.
|
||||
- `setup.sh`: makes the vault's folders, installs the stack under
|
||||
`/opt/stacks/silverbullet` and the firewall, and starts it. Safe to run again.
|
||||
- `nisse-firewall`: only the operator's Caddy may reach SilverBullet's port
|
||||
@@ -17,8 +17,8 @@ later (M6.1).
|
||||
- `check.sh`: run on the host by `scripts/agent-host.sh check`; says "all
|
||||
checks passed" only once every check has run.
|
||||
- `caddy/nisse-memory.dongar.net.caddy`: the site for the operator's Caddy on
|
||||
`docker.garrett-hall.com`. HTTPS from Caddy's usual certificate, inside
|
||||
garrett-hall.com only.
|
||||
`docker.garrett-hall.com`. HTTPS from Caddy's usual certificate,
|
||||
behind Authelia.
|
||||
|
||||
## The vault
|
||||
|
||||
@@ -41,12 +41,14 @@ scripts/agent-host.sh install # copy this folder over and run setup.sh
|
||||
scripts/agent-host.sh check # running, mounts, firewall
|
||||
```
|
||||
|
||||
Then:
|
||||
Then **the operator adds the Caddy site** from
|
||||
`caddy/nisse-memory.dongar.net.caddy`, behind Authelia, and reloads Caddy.
|
||||
There's no setup wizard: SilverBullet starts serving the vault at once.
|
||||
|
||||
1. **The operator adds the Caddy site** from `caddy/nisse-memory.dongar.net.caddy`
|
||||
and reloads Caddy.
|
||||
2. **The operator runs SilverBullet's setup wizard at once,** at
|
||||
`https://nisse-memory.dongar.net`. Until it's done, whoever opens the page first
|
||||
makes the administrator account.
|
||||
- Account: the operator's, with a strong password.
|
||||
- Space: folder `/vault`, address `nisse-memory.dongar.net`, path `/`.
|
||||
**Making `memory/` writable for a while** (for example, to upload material that
|
||||
will be sorted into the agents' folders): on the host, add
|
||||
`/opt/stacks/silverbullet/compose.override.yaml` that replaces the volumes with
|
||||
the vault alone (`volumes: !override [/srv/nisse/vault:/data]`), give `memory/`
|
||||
to uid 1000, and `docker compose up -d`. `check` fails while it's in place.
|
||||
To end it, delete the override and run `install` again, which gives `memory/`
|
||||
back to root.
|
||||
@@ -1,5 +1,7 @@
|
||||
# The vault's SilverBullet, for the operator's Caddy on docker.garrett-hall.com
|
||||
# (/opt/stacks). HTTPS from Caddy's usual automatic certificate; LAN only.
|
||||
# Out of date: the live site is behind Authelia and open beyond the LAN. This
|
||||
# copy is updated once the operator shares it.
|
||||
nisse-memory.dongar.net {
|
||||
# Anyone outside the LAN gets nothing. Caddy still answers Let's Encrypt's
|
||||
# checks, which it handles before the site's own routes.
|
||||
|
||||
@@ -11,18 +11,18 @@ cd "$stack" || { echo "FAIL: no $stack"; exit 1; }
|
||||
[ "$(sudo docker compose ps --status running -q | wc -l)" -ge 1 ] \
|
||||
&& ok "SilverBullet is running" || bad "SilverBullet isn't running"
|
||||
if sudo docker compose logs --no-color silverbullet 2>/dev/null | grep -q 'boot mode: single-space'; then
|
||||
bad "it booted a single space with no accounts (an SB_* setting?)"
|
||||
ok "it serves the vault as one space (no setup wizard)"
|
||||
else
|
||||
ok "it keeps accounts (no single-space boot)"
|
||||
bad "it didn't boot one space: the setup wizard may be open"
|
||||
fi
|
||||
code=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3000/)
|
||||
case $code in 2??|3??) ok "it answers locally ($code)" ;; *) bad "it answers $code" ;; esac
|
||||
probe=.nisse-probe-$$
|
||||
sudo docker compose exec -T -u 1000 silverbullet \
|
||||
sh -c "touch /vault/infrastructure/$probe && rm /vault/infrastructure/$probe" \
|
||||
sh -c "touch /data/infrastructure/$probe && rm /data/infrastructure/$probe" \
|
||||
&& ok "the operator's folders are writable" || bad "the operator's folders aren't writable"
|
||||
if sudo docker compose exec -T silverbullet sh -c "touch /vault/memory/$probe" 2>/dev/null; then
|
||||
sudo docker compose exec -T silverbullet rm -f "/vault/memory/$probe"
|
||||
if sudo docker compose exec -T silverbullet sh -c "touch /data/memory/$probe" 2>/dev/null; then
|
||||
sudo docker compose exec -T silverbullet rm -f "/data/memory/$probe"
|
||||
bad "memory/ is writable from SilverBullet, even as root in it"
|
||||
else
|
||||
ok "memory/ is read-only to SilverBullet"
|
||||
|
||||
@@ -7,7 +7,8 @@ set -euo pipefail
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
|
||||
# The only address allowed to reach SilverBullet: the operator's Caddy
|
||||
# (docker.garrett-hall.com), which serves nisse-memory.dongar.net inside garrett-hall.com.
|
||||
# (docker.garrett-hall.com), which serves nisse-memory.dongar.net behind
|
||||
# Authelia.
|
||||
CADDY_ADDR=192.168.6.13
|
||||
SB_PORT=3000
|
||||
SB_UID=1000 # the image's PUID/PGID: the operator's side of the vault
|
||||
@@ -16,7 +17,6 @@ SB_UID=1000 # the image's PUID/PGID: the operator's side of the vault
|
||||
# memory/, where each agent gets a folder of its own when it moves in. memory/
|
||||
# is root's, and SilverBullet mounts it read-only besides.
|
||||
install -d -m 0755 /srv/nisse
|
||||
install -d -o "$SB_UID" -g "$SB_UID" -m 0750 /srv/nisse/silverbullet
|
||||
install -d -o "$SB_UID" -g "$SB_UID" -m 0755 /srv/nisse/vault
|
||||
install -d -o "$SB_UID" -g "$SB_UID" -m 0755 /srv/nisse/vault/infrastructure
|
||||
install -d -o root -g root -m 0755 /srv/nisse/vault/memory
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# SilverBullet on the agent host: the operator's view of the vault (L10, M5.4).
|
||||
# Installed to /opt/stacks/silverbullet by ../setup.sh. No secrets here: its
|
||||
# accounts are made in its setup wizard and kept in its data folder.
|
||||
# Installed to /opt/stacks/silverbullet by ../setup.sh. No secrets here: it
|
||||
# has no accounts of its own; the operator logs in through Authelia, in front of
|
||||
# it in their Caddy, and only Caddy can reach it (setup.sh's firewall).
|
||||
services:
|
||||
silverbullet:
|
||||
# Pinned: the docker role updates stacks' images nightly, and a pinned
|
||||
@@ -8,20 +9,20 @@ services:
|
||||
image: ghcr.io/silverbulletmd/silverbullet:2.11.1-slim
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
# Only these. Any SB_* setting (even SB_NAME) boots a single space with
|
||||
# no accounts, serving /data instead of the vault.
|
||||
PUID: "1000"
|
||||
PGID: "1000"
|
||||
# Set on purpose: any SB_* setting boots one space, the vault mounted at
|
||||
# /data, with no accounts or setup wizard. Without one, an empty vault
|
||||
# would boot the wizard instead.
|
||||
SB_NAME: Nisse vault
|
||||
ports:
|
||||
# IPv4 only; setup.sh's firewall lets only the operator's Caddy in.
|
||||
- "0.0.0.0:3000:3000"
|
||||
volumes:
|
||||
# Its own accounts and settings.
|
||||
- /srv/nisse/silverbullet:/data
|
||||
# The vault, the space's folder: the operator writes everything in it...
|
||||
- /srv/nisse/vault:/vault
|
||||
# The vault is the space: the operator writes everything in it...
|
||||
- /srv/nisse/vault:/data
|
||||
# ...except the agents' memory, which only the agents write (one writer
|
||||
# per folder, enforced by the kernel).
|
||||
- /srv/nisse/vault/memory:/vault/memory:ro
|
||||
- /srv/nisse/vault/memory:/data/memory:ro
|
||||
logging:
|
||||
driver: journald # logs go to the host's journal (L12)
|
||||
Reference in new issue
Block a user