scripts: check.sh passes the federation check when it cannot connect; init.sh prints a needless hint under deploy.sh #3

Closed
opened 2026-10-07 20:02:11 +09:00 by bot-genji1024 · 0 comments
Collaborator

Two small problems in the operational scripts, both found while setting up the demo (#1).

1. check.sh reports "federation must be closed" as ok when it cannot connect

The federation probe treats every result other than HTTP 200 as a pass, including curl errors. Before the demo's DNS existed, check.sh printed:

==> federation must be closed
  ok   federation endpoint not served (curl:6 Could not resolve host: matrix-demo.genji1024.com)

The other probes fail in that situation, so the overall exit status was still non-zero. But this line claims something it never checked, and it would mislead anyone reading only this line, or running the check against a proxy that drops the request.

Plan

Only an actual HTTP answer proves the endpoint is not served:

  • curl error (curl:*) → fail: "could not check federation (…)"
  • 200 → fail, as now
  • any other HTTP status → pass

2. init.sh tells you to restart Synapse when deploy.sh runs it

At the end, init.sh prints a next step: either "Synapse is running with the previous config. Apply this one with: docker compose up -d && docker compose restart synapse", or "Next: docker compose up -d, then open …". When deploy.sh calls it, deploy.sh already stops Synapse if the config changed and then starts the stack. So the hint is wrong advice in the deploy log, and it shows on every demo deploy.

Plan

  • Add a --no-hint option to init.sh that skips the final next-step message. The rendering itself is unchanged, and so is the default behaviour when you run init.sh by hand.
  • Have deploy.sh call ./scripts/init.sh --no-hint.

I prefer an explicit option to hiding the hint when output is not a terminal: someone running deploy.sh in a terminal should not see it either.

Verification

  • sh -n on both scripts (CI already runs this)
  • On the demo: check.sh against an unresolvable domain shows a FAIL for the federation probe; a normal run still shows all ok
  • The deploy log no longer contains the restart hint
Two small problems in the operational scripts, both found while setting up the demo (#1). ## 1. `check.sh` reports "federation must be closed" as `ok` when it cannot connect The federation probe treats every result other than HTTP 200 as a pass, including curl errors. Before the demo's DNS existed, `check.sh` printed: ``` ==> federation must be closed ok federation endpoint not served (curl:6 Could not resolve host: matrix-demo.genji1024.com) ``` The other probes fail in that situation, so the overall exit status was still non-zero. But this line claims something it never checked, and it would mislead anyone reading only this line, or running the check against a proxy that drops the request. ### Plan Only an actual HTTP answer proves the endpoint is not served: - curl error (`curl:*`) → **fail**: "could not check federation (…)" - `200` → **fail**, as now - any other HTTP status → **pass** ## 2. `init.sh` tells you to restart Synapse when `deploy.sh` runs it At the end, `init.sh` prints a next step: either "Synapse is running with the previous config. Apply this one with: docker compose up -d && docker compose restart synapse", or "Next: docker compose up -d, then open …". When `deploy.sh` calls it, `deploy.sh` already stops Synapse if the config changed and then starts the stack. So the hint is wrong advice in the deploy log, and it shows on every demo deploy. ### Plan - Add a `--no-hint` option to `init.sh` that skips the final next-step message. The rendering itself is unchanged, and so is the default behaviour when you run `init.sh` by hand. - Have `deploy.sh` call `./scripts/init.sh --no-hint`. I prefer an explicit option to hiding the hint when output is not a terminal: someone running `deploy.sh` in a terminal should not see it either. ## Verification - `sh -n` on both scripts (CI already runs this) - On the demo: `check.sh` against an unresolvable domain shows a FAIL for the federation probe; a normal run still shows all `ok` - The deploy log no longer contains the restart hint
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
genji1024/koto#3
No description provided.