Move the notes editor and job tracker to stppriv
Test and deploy / test (push) Successful in 31s
Test and deploy / deploy (push) Successful in 27s

The SilverBullet editor and the job tracker now run on their own LXC
(adamf/stppriv) at priv.<DOMAIN>, behind Cloudflare Access. Here:

- silverbullet and jobs services removed; /sb/, /jobs/ and the old
  /cv/jobs, /cv/leads and userscript URLs 301 to priv.<DOMAIN>
- silverbullet-git runs with SYNC_MODE=pull: stppriv is the vault's only
  writer. The backend's vault mount is read-only.
- jobs env vars, dev overrides and docs removed; edge_test.sh checks
  the new redirects

Merge only after stppriv serves /sb/ and /jobs/ and the jobs data has
been moved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-26 13:53:48 +00:00
co-authored by Claude Opus 5.5
parent 65f2408ad4
commit 94a6abba97
12 changed files with 97 additions and 252 deletions
-1
View File
@@ -22,7 +22,6 @@ RUN set -e; \
BACKEND_HOST=backend BACKEND_PORT=8080 BACKEND_ENDPOINT=/api \
ICECAST_HOST=icecast2 ICECAST_PORT=8000 \
GITEA_HOST=gitea GITEA_PORT=3000 \
SILVERBULLET_HOST=silverbullet SILVERBULLET_PORT=3000 \
SILVERBULLET_PUBLIC_HOST=silverbullet-public SILVERBULLET_PUBLIC_PORT=3000 \
PYTHON_HOST=python PYTHON_PORT=8000 \
RECEIPT_WEB_UPSTREAM=127.0.0.1:9 RECEIPT_WEB_TOKEN=validate \
+18 -8
View File
@@ -105,25 +105,24 @@ must 404 - py-internal /py//internal/rowing/read --path-as-is -X POST
echo "# admin gate, signed out: must redirect to the login, with the original URI"
for p in \
/sb/ /sb/index.html /jobs/ /jobs/api/graphql /tracker/ /tracker/dashboard \
/dozzle/ /garage/ /radio/admin/stats.xsl /uploads/private/x.png \
"/jobs/leads?x=1"; do
/tracker/ /tracker/dashboard \
/dozzle/ /garage/ /radio/admin/stats.xsl /uploads/private/x.png; do
must 302 "$LOGIN$p" gate "$p"
done
must 302 "${LOGIN}/uploads/x/../private/x.png" gate /uploads/x/../private/x.png --path-as-is
show gate "$BASE/SB/"
show gate "$BASE/TRACKER/"
must 302 "${LOGIN}/receipt/" permission /receipt/
if [ -n "${EDGE_COOKIE:-}" ]; then
echo "# admin gate, signed in: must be let through"
for p in /sb/ /jobs/ /tracker/ /dozzle/ /garage/ /radio/admin/stats.xsl \
for p in /tracker/ /dozzle/ /garage/ /radio/admin/stats.xsl \
/receipt/; do
not_login gate "$p" -H "Cookie: $EDGE_COOKIE"
done
fi
echo "# carve-outs and public routes (status depends on the upstream)"
for p in /jobs/api/capture /jobs/job-capture.user.js /tracker/api/v1/events \
for p in /tracker/api/v1/events \
/tracker/tracker.user.js /tracker/readyz /usaco/ /notes/ /radio/status.xsl \
/py/ /py/docs /api/ /api/me /; do
show public "$BASE$p"
@@ -138,9 +137,20 @@ must 301 "$GIT/adamf/stpweb/src/branch/main/README.md" gitea /gitea/adamf/stpweb
must 301 "$GIT/adamf/stpweb.git/info/refs?service=git-upload-pack" gitea "/gitea/adamf/stpweb.git/info/refs?service=git-upload-pack"
must 301 "$GIT/adamf/stpweb/commit/0000000" gitea /gitea/adamf/stpweb/commit/0000000
echo "# the editor and job tracker are on stppriv: must 301 there, path kept"
PRIV="https://priv.${GIT_HOST#www.}"
for p in /sb/ /sb/index.html /SB/ /jobs/ /jobs/api/graphql "/jobs/leads?x=1" \
/jobs/api/capture /jobs/job-capture.user.js; do
must 301 "$PRIV$p" priv "$p"
done
must 301 "$PRIV/sb/" priv /sb
must 301 "$PRIV/jobs/" priv /jobs
must 301 "$PRIV/jobs/" priv /cv/jobs
must 301 "$PRIV/jobs/job-capture.user.js" priv /job-capture.user.js
echo "# bare prefixes and moved URLs"
for p in /api /radio /dozzle /garage /notes /sb /py /jobs /usaco \
/tracker /receipt /cv/jobs /cv/leads /job-capture.user.js "/gitea?x=1"; do
for p in /api /radio /dozzle /garage /notes /py /usaco \
/tracker /receipt /cv/leads "/gitea?x=1"; do
show redirect "$BASE$p"
done
+10 -31
View File
@@ -44,17 +44,17 @@ redir /dozzle /dozzle/ 301
redir /garage /garage/ 301
redir /gitea https://git.{$DOMAIN}/ 301
redir /notes /notes/ 301
redir /sb /sb/ 301
redir /sb https://priv.{$DOMAIN}/sb/ 301
redir /py /py/ 301
redir /jobs /jobs/ 301
redir /jobs https://priv.{$DOMAIN}/jobs/ 301
redir /usaco /usaco/ 301
redir /tracker /tracker/ 301
redir /receipt /receipt/ 301
# Old job tracker URLs; the userscript's old @updateURL finds its update here.
redir /cv/jobs /jobs/ 301
redir /cv/leads /jobs/leads 301
redir /job-capture.user.js /jobs/job-capture.user.js 301
redir /cv/jobs https://priv.{$DOMAIN}/jobs/ 301
redir /cv/leads https://priv.{$DOMAIN}/jobs/leads 301
redir /job-capture.user.js https://priv.{$DOMAIN}/jobs/job-capture.user.js 301
# ---- Backend API ---------------------------------------------------------------
@@ -144,13 +144,9 @@ handle /radio/admin/* {
}
}
# No prefix strip: with SB_URL_PREFIX the app builds its URLs from /sb, and a
# stripped prefix loads a blank page.
# The notes editor is on stppriv, behind Cloudflare Access.
handle /sb/* {
import admin_gate
reverse_proxy {$SILVERBULLET_HOST}:{$SILVERBULLET_PORT} {
import proxy
}
redir https://priv.{$DOMAIN}{uri} 301
}
# ---- Public services -----------------------------------------------------------
@@ -195,27 +191,10 @@ handle /py/* {
}
# ---- Job tracker (/jobs/) ----
# Not stripped: the app lives at /jobs/. The capture API (bearer token) and
# the userscript (fetched without cookies, holds no secrets) bypass the gate.
handle /jobs/api/capture* {
import limit api 30 1s
reverse_proxy jobs:8080 {
import proxy
}
}
handle /jobs/job-capture.user.js {
reverse_proxy jobs:8080 {
import proxy
}
}
# On stppriv. A 301 turns a POST into a GET, so capture clients must call
# priv. directly.
handle /jobs/* {
import admin_gate
import limit api 30 1s
reverse_proxy jobs:8080 {
import proxy
}
redir https://priv.{$DOMAIN}{uri} 301
}
# ---- USACO (/usaco/) ----