feat(multi-site): wire selfUrl through setup.sh so joins register live

Extends the shipped CFG_MASTER_DIRECTORY_URL/JOIN_KEY join flow with the
selfUrl a spoke needs to register itself for live catalog replication
(theta-directory v2.4.0's POST /api/site/spokes) -- without this, every
spoke was permanently limited to the one-time join snapshot even after
the master gained the ability to push live updates.

setup.sh already computes CFG_SSO_HOST before this point in the script;
passes https://$CFG_SSO_HOST as bootstrap/site-join.js's third argument,
which forwards it as `selfUrl` in the POST /api/site/join body.
This commit is contained in:
2026-08-10 16:50:07 -04:00
parent 0367c33542
commit f42b69c084
3 changed files with 23 additions and 5 deletions
+5 -1
View File
@@ -1161,8 +1161,12 @@ fi
# joined reports "already a spoke" and setup continues.
if [[ -n "${CFG_MASTER_DIRECTORY_URL:-}" && -n "${CFG_MASTER_DIRECTORY_JOIN_KEY:-}" ]]; then
info "Joining master site ${CFG_MASTER_DIRECTORY_URL} (CFG_MASTER_DIRECTORY_*)..."
# selfUrl (https://$CFG_SSO_HOST, already derived above) registers this
# spoke for LIVE replication -- without it the join still succeeds, but
# the master has no way to reach this spoke to push resync pings, so it
# only ever gets the one-time snapshot from the moment it joined.
if ! "${COMPOSE[@]}" exec -T sso-manager node /bootstrap/site-join.js \
"$CFG_MASTER_DIRECTORY_URL" "$CFG_MASTER_DIRECTORY_JOIN_KEY"; then
"$CFG_MASTER_DIRECTORY_URL" "$CFG_MASTER_DIRECTORY_JOIN_KEY" "https://$CFG_SSO_HOST"; then
die "site join failed — check the master URL + site join key (mint one on the master's Site Join Keys card)."
fi
else