Skip to content

feat(devnet): resolve local file server and SOGS alongside the devnet - #117

Closed
mpretty-cyro wants to merge 4 commits into
mainfrom
fix/auto-detect-devnet
Closed

feat(devnet): resolve local file server and SOGS alongside the devnet#117
mpretty-cyro wants to merge 4 commits into
mainfrom
fix/auto-detect-devnet

Conversation

@mpretty-cyro

Copy link
Copy Markdown
Collaborator

FILE_SERVER_URL and COMMUNITY_LINK embed the devnet host, which varies per environment, so both had to be maintained by hand next to the DEVNET_* values.

resolve_devnet.ts now derives them from the already-resolved service-node IP, with the room token and name read from the SOGS /rooms API. Both services are probed independently and treated as optimisations: whichever is reachable is emitted, whichever is not is warned about and omitted, leaving the harness on the production file server and remote community. The devnet itself must still resolve.

The two server pubkeys are baked deterministic keys that neither service exposes over HTTP, so they are built-in constants with an env override. The resolved IP is used rather than the bootstrap hostname because the app reaches both services over onion requests through the snodes, and containers cannot resolve mDNS .local names.

@mpretty-cyro
mpretty-cyro requested a review from Bilb July 30, 2026 05:06
@mpretty-cyro mpretty-cyro self-assigned this Jul 30, 2026
FILE_SERVER_URL and COMMUNITY_LINK embed the devnet host, which varies per
environment, so both had to be maintained by hand next to the DEVNET_* values.

resolve_devnet.ts now derives them from the already-resolved service-node IP, with
the room token and name read from the SOGS /rooms API. Both services are probed
independently and treated as optimisations: whichever is reachable is emitted,
whichever is not is warned about and omitted, leaving the harness on the production
file server and remote community. The devnet itself must still resolve.

The two server pubkeys are baked deterministic keys that neither service exposes
over HTTP, so they are built-in constants with an env override. The resolved IP is
used rather than the bootstrap hostname because the app reaches both services over
onion requests through the snodes, and containers cannot resolve mDNS .local names.
The reachability probe is now the resolve step itself. The previous curl form (`-w '%{http_code}' ... || echo 000`) produced "000000" on a failed connection, which compared unequal to "000" and reported an unreachable devnet as reachable.

curl's exit status is now the signal. The fallback also suppressed an errexit abort under the runner's default `bash -e`, so the status is captured with `|| CURL_RC=$?` rather than a bare assignment.
DEVNET_URL was hardcoded to 'http://sesh-net.local:1280', which stopped
resolving. isDevnetReachable() therefore always reported the devnet unreachable
and every AQA run failed with "Cannot use AQA build without internal network
access" before running a test.

The address now comes from DEVNET_BOOTSTRAP_HOST — the same value both regression
workflows expose as the DEVNET_BOOTSTRAP input — resolved per call, since
run/constants/index.ts does not load .env and a constant there could not read it
reliably. The default and the address parsing are shared with
scripts/resolve_devnet.ts so the two cannot drift, and that shared module stays
dependency-free so the script continues not to see .env.
@mpretty-cyro
mpretty-cyro force-pushed the fix/auto-detect-devnet branch from 89d8ad4 to 0b47831 Compare July 30, 2026 06:49
@Bilb

Bilb commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

I think this should be soon closed in favor of #121

@Bilb

Bilb commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Closed in favor of #121

@Bilb Bilb closed this Aug 5, 2026
@mpretty-cyro
mpretty-cyro deleted the fix/auto-detect-devnet branch August 6, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants