Repository navigation
8.9.0: stop publishing the passphrase, and ship in a container - #24
Merged
Merged
Conversation
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
GET /api/agent-prompt is public by design: it is how a fresh agent learns the protocol. It also answered with "full_access_phrase": "yesiknow" to anyone who knew the URL, which made the second step of a two-step switch worth nothing. The phrase is a loopback credential, the same kind of thing as the token, so it now travels the same way: the panel reads it from 127.0.0.1:8767/bootstrap after the Origin check and keeps it in memory. /api/quick stops carrying it too — a public answer is not the place for the second step — and the terminal banner still prints it for the operator. services/system.py held the literal twice next to the real definition in services/full_access.py. Both now import FULL_ACCESS_PHRASE, and a test fails if the string appears anywhere else under src/. Breaking: GET /api/quick no longer returns phrase. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
`pip install .` produced a server with an empty panel. The static files and the brand assets sat next to the package (`parents[2] / "static"`), so an installed copy resolved them to a directory that does not exist and served 404 for every stylesheet and module. Nobody noticed because the project is normally run from its checkout, where the sibling directory is right there. Found by exercising a real install rather than a checkout, which is what the container does. static/ and assets/ now live under nerveforge/ and are declared in package-data; tests follow them. This also makes the wheel self-describing: an installed NerveForge serves its own panel without needing the repository around it. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
docker/Dockerfile builds a python:3.12-slim image with no runtime dependencies, cloudflared included and a non-root uid. docker/docker-compose.yml adds the two volumes that matter and binds the loopback bootstrap listener to 127.0.0.1 only. The tunnel is off by default: a container that opens a public address on start is a surprise with a shell behind it. ansible/roles/nerveforge covers the long-lived host: dedicated user, data directory, hardened systemd unit (NoNewPrivileges, ProtectSystem=strict, empty capability set, @System-service), optional cloudflared. It never arms full access — that is a runtime decision — and never stores the token, which the bridge mints itself. CI gains an image job: it builds the container and asserts that the panel, a module and a brand asset all answer 200 with a non-empty body. That is the check that would have caught the static/ regression; it should not need to be found by hand twice. docs/DEPLOY.md (EN+RU) explains both paths and the decisions behind them. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The README tree still showed static/ at the repository root — the layout this release fixed — and did not mention docker/ or ansible/. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Three separate reasons the new image job failed, all of them in the Dockerfile: - .dockerignore sat in docker/, where Docker does not look for it. The whole repository — .git, tests, docs — travelled to the builder. Moved to the root. - A fresh environment has no `bdist_wheel`, so `pip install .` died in the metadata phase. setuptools and wheel are now installed explicitly and the install runs with --no-build-isolation. - cloudflared was fetched with a single unretried curl. A cold runner that fails that one request lost the whole build for an optional binary. It now retries, and can be skipped entirely with CLOUDFLARED_VERSION=skip. The install step also asserts that static/index.html shipped inside the package, so a repeat of the 8.9.0 packaging bug fails the build instead of producing an image with an empty panel. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The bridge listens on 127.0.0.1 by default, which inside a container is the container's own namespace. A published port then reaches a socket nobody is listening on, and the health check times out — which is exactly what the image job reported. NERVEFORGE_BIND=0.0.0.0 in the image. The admin listener on 8767 is untouched and still loopback-only, and the routes that treat a local caller specially (_local_ui) require a loopback peer *and* a loopback Host, so widening the main socket grants nothing extra. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three commits, one release. Version 8.9.0 — the
/api/quickpayload changes.1. The passphrase was published
GET /api/agent-promptis public by design: it is how a fresh agent learns the protocol. It also answered"full_access_phrase": "yesiknow"to anyone who knew the URL, which made the second step of a two-step switch worth nothing.The phrase is a loopback credential, the same kind of thing as the token, so it now travels the same way:
GET /api/agent-prompt(public)full_access_phrase: "yesiknow"GET /api/quick(bearer)phrase: "yesiknow"GET 127.0.0.1:8767/bootstrap(loopback, Origin-checked){token}{token, phrase}The panel reads it from
/bootstrapon every boot and does not cache it, so arming full access in the browser still works.services/system.pyheld the literal twice next to the real definition inservices/full_access.py. Both now importFULL_ACCESS_PHRASE, and a test fails if the string appears anywhere else undersrc/.Breaking:
GET /api/quickno longer returnsphrase.2. The panel was not in the package
Found by exercising a real
pip installinstead of a checkout — which is what the container does.static/andassets/sat next to the package, so an installed copy resolved them to a directory that does not exist and served 404 for every stylesheet and module. In the container that would have been an empty page.Both directories moved inside
nerveforge/and are declared inpackage-data. Verified: an installed copy serves/,/static/app.jsand/api/healthwith 200.3. Container and Ansible
docker/Dockerfile—python:3.12-slim, no runtime dependencies,cloudflaredincluded, non-root uid 10001, tunnel off by default.docker/docker-compose.yml— two named volumes, loopback bootstrap bound to127.0.0.1only.ansible/roles/nerveforge— dedicated user, hardened systemd unit (NoNewPrivileges,ProtectSystem=strict, empty capability set,@system-service), optionalcloudflared. Never arms full access and never stores the token.docs/DEPLOY.md+ RU, with the decisions written down.CI gains an
imagejob that builds the container and asserts the panel, a module and a brand asset all answer 200 with a non-empty body — the check that would have caught thestatic/regression.Verification
check_docs20 pairs;gen_api_doc --check,bump_version --checkok/api/agent-promptcontains noyesiknow,/api/quickhas nophrase,/bootstrapreturns both, foreignOrigingets 403ansible-playbook --syntax-checkand a local--checkrunCloses nothing — this is the work you asked for after the live-server check.