fix(deploy): provision tenant API domains
Some checks failed
Architecture Governance / architecture (push) Failing after 6m16s

Reconcile TLS, exact CORS, and backend proxying before release activation so every storefront uses its derived API host.
This commit is contained in:
2026-08-20 15:04:03 +04:00
parent 66a0ccfdb8
commit e5949c3967
8 changed files with 315 additions and 6 deletions

View File

@@ -133,8 +133,17 @@ nginx -t
systemctl enable --now nginx
systemctl reload nginx
echo "==> dynamic domain reconciler"
SRC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "==> tenant API-domain configurator"
if [[ -f "$SRC_DIR/configure-api-domain.sh" ]]; then
install -m 755 -o root -g root "$SRC_DIR/configure-api-domain.sh" \
/usr/local/sbin/marketplaces-configure-api-domain
else
echo "configure-api-domain.sh not found next to server-setup.sh" >&2
exit 1
fi
echo "==> dynamic domain reconciler"
install -d -m 755 "$BASE/bin" /etc/marketplaces "/var/lib/marketplaces"
if [[ -f "$SRC_DIR/sync-domains.sh" ]]; then
install -m 755 "$SRC_DIR/sync-domains.sh" "$BASE/bin/sync-domains.sh"
@@ -172,9 +181,10 @@ else
echo " sync-domains.sh not found next to this script - skipping"
fi
echo "==> sudoers: let the deploy user reload nginx, nothing else"
echo "==> sudoers: deployment reload plus validated tenant API provisioning"
cat > /etc/sudoers.d/marketplaces-deploy <<SUDO
$DEPLOY_USER ALL=(root) NOPASSWD: /bin/systemctl reload nginx
Cmnd_Alias MARKETPLACES_DEPLOY = /bin/systemctl reload nginx, /usr/local/sbin/marketplaces-configure-api-domain *
$DEPLOY_USER ALL=(root) NOPASSWD: MARKETPLACES_DEPLOY
SUDO
chmod 440 /etc/sudoers.d/marketplaces-deploy
visudo -c -f /etc/sudoers.d/marketplaces-deploy