[object Object]

← back to Japan Enrich

japan: wrapper scripts for the 3 Steve-gated steps — create-distributor-dns.sh (Cloudflare), load-lines-remote.sh (canonical vendor lines), nginx-distributor-setup.sh (route + certs). Short single commands for Steve to run.

d08e0312a8aa5a859fea9588902a566ba07bbb42 · 2026-07-06 17:16:54 -0700 · Steve

Files touched

Diff

commit d08e0312a8aa5a859fea9588902a566ba07bbb42
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jul 6 17:16:54 2026 -0700

    japan: wrapper scripts for the 3 Steve-gated steps — create-distributor-dns.sh (Cloudflare), load-lines-remote.sh (canonical vendor lines), nginx-distributor-setup.sh (route + certs). Short single commands for Steve to run.
---
 scripts/load-lines-remote.sh       | 11 +++++++++++
 scripts/nginx-distributor-setup.sh | 26 ++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/scripts/load-lines-remote.sh b/scripts/load-lines-remote.sh
new file mode 100644
index 0000000..b9e3b74
--- /dev/null
+++ b/scripts/load-lines-remote.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# Push the loader + manifest to Kamatera and create the 19 distributor internal LINES
+# in canonical dw_unified (each its own id + unique DW prefix + range, use_for_ai=true,
+# keep_offline via vendor_never_on_shopify). Idempotent. NO Shopify publish.
+# Run under Steve:  bash ~/Projects/japan-enrich/scripts/load-lines-remote.sh
+set -euo pipefail
+rsync -avz ~/Projects/japan-enrich/db/ ~/Projects/japan-enrich/staging/onboarding-manifest.json \
+  root@45.61.58.125:/root/Projects/japan-staging-viewer/db/
+ssh root@45.61.58.125 'cd /root/Projects/japan-staging-viewer && npm i pg -s && \
+  export DATABASE_URL=$(grep -m1 "^DATABASE_URL=" /root/Projects/Designer-Wallcoverings/.env | cut -d= -f2-) && \
+  node db/load-distributor-lines.js'
diff --git a/scripts/nginx-distributor-setup.sh b/scripts/nginx-distributor-setup.sh
new file mode 100644
index 0000000..dc1d1d7
--- /dev/null
+++ b/scripts/nginx-distributor-setup.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# Route the 19 distributor subdomains to the japan-viewer (:9934) on Kamatera + issue certs.
+# Run under Steve:  bash ~/Projects/japan-enrich/scripts/nginx-distributor-setup.sh
+# (SSHes to Kamatera; nginx edit + certbot need root there.)
+set -euo pipefail
+SUBS="j-josephson eijffinger omexco goodrich p3tec vahallan la-scala-milano zambaiti-parati \
+carlise-co zintra versa-design-surfaces sangetsu greenland texam texdecor zambaiti \
+koroseal-sg harlequin-sg cole-son-sg"
+DFLAGS=""; for s in $SUBS; do DFLAGS="$DFLAGS -d $s.designerwallcoverings.com"; done
+
+ssh root@45.61.58.125 bash -s <<EOF
+set -e
+# find the nginx conf that serves japan-viewer (matches 'japan.designerwallcoverings.com')
+CONF=\$(grep -rl 'japan.designerwallcoverings.com' /etc/nginx/sites-available/ /etc/nginx/sites-enabled/ 2>/dev/null | head -1)
+echo "nginx conf: \$CONF"
+[ -z "\$CONF" ] && { echo "!! japan-viewer nginx conf not found — add server_name manually"; exit 1; }
+cp "\$CONF" "\$CONF.bak-\$(date +%s)"
+# append the 19 names to the existing japan server_name line if not already present
+if ! grep -q 'koroseal-sg.designerwallcoverings.com' "\$CONF"; then
+  sed -i "s/server_name japan.designerwallcoverings.com/server_name japan.designerwallcoverings.com $(echo $SUBS | sed 's/[a-z0-9-]*/&.designerwallcoverings.com/g')/" "\$CONF"
+fi
+nginx -t && systemctl reload nginx && echo "nginx reloaded"
+# issue certs for japan + all 19 in one run
+certbot --nginx --non-interactive --agree-tos -m steve@designerwallcoverings.com --expand \
+  -d japan.designerwallcoverings.com $DFLAGS
+EOF

← a6bb3a2 japan: viewer strips -sg subdomain suffix (koroseal-sg→Koros  ·  back to Japan Enrich  ·  japan: fix loader wrapper — manifest to staging/ (not db/), 6961b03 →