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 /scripts/tui-golden.py | |
| parent | 71a702f375750829c634b552217c9925d549828b (diff) | |
| download | bokf-2ecf4bb37cfd604168625271249e3006ef7d00c8.tar.gz bokf-2ecf4bb37cfd604168625271249e3006ef7d00c8.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 'scripts/tui-golden.py')
| -rwxr-xr-x | scripts/tui-golden.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/scripts/tui-golden.py b/scripts/tui-golden.py index bce00eb..deca6ef 100755 --- a/scripts/tui-golden.py +++ b/scripts/tui-golden.py @@ -709,6 +709,31 @@ SCENARIOS = [ ], }, { + # Web mode (the browser-terminal wrapper sets BOKF_WEB=1): nothing + # may touch the frontend's files or start a viewer there. + "name": "web-mode", + "screen": "vouchers", + "env": {"BOKF_WEB": "1"}, + "steps": [ + { + "keys": ["home", "enter"], + "expect": ["Golden verifikat", "a = bifoga"], + }, + { + "keys": ["a"], + "expect": ["Inte tillgängligt i webbversionen"], + }, + { + "keys": ["enter", "f", "enter", "right", "enter"], + "expect": ["Inte tillgängligt i webbversionen"], + }, + { + "keys": ["enter"], + "expect": ["Underlag"], + }, + ], + }, + { # Keep last: changes the rig's login password, then restores it so # a rerun of the list still logs in. "name": "change-password", @@ -1362,7 +1387,9 @@ def main(argv): "--socket", str(sock), "--user", "admin", "--org", str(org_id), "--fy", str(fy["id"]), "--screen", sc["screen"]] - app = PtyApp(argv_tui, env, TERM_COLS, TERM_ROWS) + sc_env = dict(env) + sc_env.update(sc.get("env", {})) + app = PtyApp(argv_tui, sc_env, TERM_COLS, TERM_ROWS) name = sc["name"] missing = None before = current = "" |
