Add repos from the page, answer actions in place, Expo-style redesign
Add repository: - New remote verb `add-repo KEY OWNER/NAME`. Off unless config.toml has [repo_add] (base_url + owners). Only listed owners; the dev box builds the URL itself, checks it with `git ls-remote` (bot access), then appends to [repos] under the lock. No URL crosses the SSH link. - `repos` also reports where adding is allowed, so the page shows the form only when it's on and rejects other hosts before calling SSH. - set_toml_string inserts after the section's last key, not after trailing blank lines / the next section's comments. Responsiveness: - web/static/app.js (progressive enhancement; every form still works without JS): forms go via fetch and get a JSON answer instead of POST-redirect-GET; buttons/cards show the change immediately; the list refreshes itself (15 s, 3 s while something is starting). - `repos` is cached for 5 min (refreshed on add-repo), so a page view is one SSH call instead of two. - `list` reads all unit states with one `systemctl show` instead of one per session: 676 -> 374 ms on the dev box with 21 sessions. - Static assets are content-hashed and cached immutably. Design: slate greys, hairline borders, black primary action, tinted status badges, monospace repo/branch, two columns on desktop, stacked on phones, light and dark. Docs: README security model, AGENTS.md (JS convention, add-repo invariant), config.example.toml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MCUMXh8zZConC75Mptbeou
This commit is contained in:
parent
39997de1e8
commit
1b3172bd50
10 changed files with 1084 additions and 92 deletions
11
AGENTS.md
11
AGENTS.md
|
|
@ -14,7 +14,12 @@ model" before changing anything that touches the SSH boundary.
|
|||
## Stack and conventions
|
||||
- Python ≥ 3.11, **standard library only** on both sides. No pip install, so
|
||||
there's no supply chain to audit. Keep it that way unless there's a strong reason.
|
||||
- The web page has **no JavaScript**. Plain forms, POST, then a redirect.
|
||||
- The web page works **without JavaScript**: plain forms, POST, then a
|
||||
redirect. `web/static/app.js` is progressive enhancement on top (fetch +
|
||||
JSON answers, self-refreshing list). Keep it that way: one same-origin
|
||||
script, no inline script or handlers (the CSP forbids them), no third-party
|
||||
code, never insert server data as HTML except the same-origin page itself.
|
||||
Static files are served with a content-hash `?v=` and cached immutably.
|
||||
- `sessions-ctl` prints exactly one JSON object (except `keygen`: KEY=VALUE
|
||||
lines on stdout, human note on stderr); exit 0/1/2.
|
||||
- The web app has no login: Authelia (Caddy forward_auth) in front of it is
|
||||
|
|
@ -34,7 +39,9 @@ model" before changing anything that touches the SSH boundary.
|
|||
dev box's UFW `limit` refuses a 6th connection in 30 s, so don't drop
|
||||
`ControlMaster`, and keep `init: true` so the master gets reaped.
|
||||
2. Local-only verbs (`delete`, `refresh-access`, `keygen`, `_launch`) stay out
|
||||
of `REMOTE_VERBS`.
|
||||
of `REMOTE_VERBS`. `add-repo` is remote but stays off unless `[repo_add]`
|
||||
is configured, takes `OWNER/NAME` (never a URL), accepts only listed
|
||||
owners, and checks the repo with `git ls-remote` before writing config.
|
||||
6. The private key is never written to disk on the dev box outside a temp dir
|
||||
in `XDG_RUNTIME_DIR` (RAM), which `keygen` removes.
|
||||
3. `refresh-access` never writes an empty `from=`, and never touches lines
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue