diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-23 11:36:11 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-23 11:36:11 +0200 |
| commit | 1abb7649b930d35d1f5a76fd72856659b1ee8275 (patch) | |
| tree | 50d1d3dd905056b75749e22a58e7247e4a4bb0e2 /deploy/web-entrypoint.sh | |
| parent | 71a702f375750829c634b552217c9925d549828b (diff) | |
| download | bokf-0.1.69.tar.gz bokf-0.1.69.zip | |
web: bokftui in the browser (ttyd + bokfweb login gate); per-user login limitv0.1.69
New image bokf-web (Dockerfile target "web", compose service "web" on
127.0.0.1:8790): Caddy routing with forward_auth, the bokfweb login gate
(C, authenticates with bokfd's session.open, per-address limit, cookie +
terminal handle, one login handed to the TUI via /redeem) and ttyd running
bokftui in web mode in an isolated throwaway HOME. TLS stays with the
host's reverse proxy. BOKF_WEB=1 blocks every local file and viewer path in
the TUI. bokfd's login limiter is now per user name instead of one global
counter (5 wrong guesses from anyone locked out everybody), and a full
counter table no longer disables it. The cross build and deploy.sh build
and ship both images.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'deploy/web-entrypoint.sh')
| -rwxr-xr-x | deploy/web-entrypoint.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/deploy/web-entrypoint.sh b/deploy/web-entrypoint.sh new file mode 100755 index 0000000..38e07f9 --- /dev/null +++ b/deploy/web-entrypoint.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Web frontend container: bokfweb (login gate), ttyd (browser terminal) +# and Caddy (routing on :8790, behind the host's TLS proxy). The gate and +# ttyd listen on 127.0.0.1 only. Each helper is restarted if it dies; Caddy +# is the main process, so the container stops (and compose restarts it) +# when Caddy does. +set -eu + +export BOKFD_SOCKET="${BOKFD_SOCKET:-/run/bokfd/bokfd.sock}" +export XDG_DATA_HOME=/tmp/caddy-data XDG_CONFIG_HOME=/tmp/caddy-config + +keep() { + while :; do + "$@" || true + echo "web: $1 exited, restarting" >&2 + sleep 1 + done +} + +keep bokfweb & +keep ttyd -i 127.0.0.1 -p 7681 -b /web/tty -a -W -O \ + -m "${BOKF_WEB_MAX_SESSIONS:-20}" \ + -t titleFixed=bokf -t fontSize=15 -t disableLeaveAlert=true \ + bokftui-web & + +exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile |
