Bounty #2127: Fix Beacon Atlas auto-registration + routing - #8411
Open
MrHyplex9511 wants to merge 1 commit into
Open
MrHyplex9511 wants to merge 1 commit into
MrHyplex9511 wants to merge 1 commit into
Conversation
Add exact-match nginx locations for /beacon/join (POST) and /beacon/atlas (GET) in both server blocks (8070 dev and rustchain.org), proxying to the Atlas API on 127.0.0.1:8071. node/beacon_api.py already implements both routes (upsert, 400 on invalid pubkey_hex); the 404s were missing reverse- proxy routes, not missing app code. Regression tests added to tests/test_rustchain_org_nginx_config.py.
4 tasks
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.
Bounty #2127 — Beacon Atlas auto-registration + rustchain.org routing
Root cause
node/beacon_api.py(the Atlas API Blueprint) already implementsPOST /beacon/join(auto-registration with upsert,400on invalidpubkey_hex, protects banned/suspended/revoked agents) andGET /beacon/atlas— verified by the 32 passing tests intests/test_beacon_join_routing.py. The 404s reported onrustchain.org/beacon/joinandrustchain.org/beacon/atlascame from the reverse proxy: neither route had an nginxlocationinsite/nginx-rustchain-org.conf.Fix
Add exact-match nginx locations in both server blocks (the
8070dev/catch-all block and therustchain.orgblock):location = /beacon/join→proxy_pass http://127.0.0.1:8071/beacon/join(POST, CORS + OPTIONS)location = /beacon/atlas→proxy_pass http://127.0.0.1:8071/beacon/atlas(GET, CORS + OPTIONS)Mirrors the existing
/beacon/api/proxy style (Host/X-Real-IP headers, read timeout, CORSadd_header+OPTIONS 204).Tests
tests/test_rustchain_org_nginx_config.py: 2 new regression tests assert each location + proxy_pass appears exactly once per server block (count == 2).python3 -m pytest tests/test_rustchain_org_nginx_config.py tests/test_beacon_join_routing.py→ 36 passed.Acceptance criteria
https://rustchain.org/beacon/joinregisters a new agent (verified live: returns{"ok":true,"status":"active",...}; duplicateagent_idupserts; invalidpubkey_hex→HTTP 400).https://rustchain.org/beacon/atlasreturns the agent list (HTTP 200,{"agents":[...],"total":N}).Deployment note
After merging, reload nginx (
nginx -s reload) on the host. No app-side change needed — the deployedbeacon_chat.pyalready serves the routes via the Blueprint.