[object Object]

← back to Japan Enrich

japan: deploy artifacts for Kamatera go-live (nginx vhost japan+china, DEPLOY runbook, auth'd viewer, no Shopify publish)

4ebbbd5cfb0a83a71a8cc74391fdc51169f61066 · 2026-07-06 13:59:37 -0700 · Steve

Files touched

Diff

commit 4ebbbd5cfb0a83a71a8cc74391fdc51169f61066
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jul 6 13:59:37 2026 -0700

    japan: deploy artifacts for Kamatera go-live (nginx vhost japan+china, DEPLOY runbook, auth'd viewer, no Shopify publish)
---
 deploy/DEPLOY.md                                   | 49 ++++++++++++++++++++++
 deploy/japan-china.designerwallcoverings.com.nginx | 16 +++++++
 2 files changed, 65 insertions(+)

diff --git a/deploy/DEPLOY.md b/deploy/DEPLOY.md
new file mode 100644
index 0000000..6c06627
--- /dev/null
+++ b/deploy/DEPLOY.md
@@ -0,0 +1,49 @@
+# Deploy: japan/china staging viewer → Kamatera (live, authenticated)
+
+**Scope:** deploy the internal, Basic-Auth'd viewer to Kamatera and serve it at
+`japan.designerwallcoverings.com` + `china.designerwallcoverings.com`.
+DNS already points both at 45.61.58.125. **This does NOT publish any product to
+Shopify** — the storefront (`designerwallcoverings.com`) is untouched. Product
+promotion + Shopify publish stay separately gated (settlement gate applies to Sangetsu).
+
+Prereqs on Kamatera: node + pm2 + nginx + certbot already present (standard DW box).
+Port 9931 must be free (`ss -ltnp | grep 9931`).
+
+## 1. Push the code + staged data (run on Mac2)
+```sh
+rsync -avz --delete \
+  --exclude node_modules --exclude .git --exclude 'out/*.log' --exclude staging/import-queue.jsonl \
+  ~/Projects/japan-enrich/ root@45.61.58.125:/root/public-projects/japan-viewer/
+```
+
+## 2. Install deps + start under pm2 (run on Kamatera)
+```sh
+cd /root/public-projects/japan-viewer && npm i --omit=dev pg
+cd viewer-local
+REQUIRE_AUTH=1 BASIC_AUTH="admin:DW2024!" pm2 start server.js --name japan-viewer -- 9931
+pm2 save
+curl -s -u admin:DW2024! http://127.0.0.1:9931/api/scope   # expect the japan scope json
+```
+
+## 3. nginx vhost + SSL (run on Kamatera — sudo)
+```sh
+cp /root/public-projects/japan-viewer/deploy/japan-china.designerwallcoverings.com.nginx \
+   /etc/nginx/sites-available/japan-china.designerwallcoverings.com
+ln -sf /etc/nginx/sites-available/japan-china.designerwallcoverings.com \
+   /etc/nginx/sites-enabled/
+nginx -t && systemctl reload nginx
+certbot --nginx -d japan.designerwallcoverings.com -d china.designerwallcoverings.com --non-interactive --agree-tos -m steve@designerwallcoverings.com
+```
+
+## 4. Verify (from anywhere)
+```sh
+curl -s -o /dev/null -w '%{http_code}\n' https://japan.designerwallcoverings.com   # 401 (auth gate = healthy)
+curl -s -u admin:DW2024! https://japan.designerwallcoverings.com/api/scope         # japan scope
+curl -s -u admin:DW2024! https://china.designerwallcoverings.com/api/scope         # china scope
+```
+
+## Rollback
+```sh
+pm2 delete japan-viewer && pm2 save
+rm /etc/nginx/sites-enabled/japan-china.designerwallcoverings.com && systemctl reload nginx
+```
diff --git a/deploy/japan-china.designerwallcoverings.com.nginx b/deploy/japan-china.designerwallcoverings.com.nginx
new file mode 100644
index 0000000..b0583f7
--- /dev/null
+++ b/deploy/japan-china.designerwallcoverings.com.nginx
@@ -0,0 +1,16 @@
+# japan. + china.designerwallcoverings.com → the staging viewer (pm2 japan-viewer :9931).
+# One node process serves both; the app differentiates by Host header (hostScope) and
+# enforces Basic Auth when REQUIRE_AUTH=1. Place in /etc/nginx/sites-available/, symlink
+# into sites-enabled/, `nginx -t`, reload, then certbot --nginx for SSL.
+server {
+  server_name japan.designerwallcoverings.com china.designerwallcoverings.com;
+  client_max_body_size 12m;              # matches the import-queue body cap
+  location / {
+    proxy_pass http://127.0.0.1:9931;
+    proxy_set_header Host $host;          # REQUIRED — hostScope reads Host to pick japan vs china
+    proxy_set_header X-Real-IP $remote_addr;
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    proxy_set_header X-Forwarded-Proto $scheme;
+  }
+  listen 80;
+}

← efb6472 japan: bulk-stage full Sangetsu line into sangetsu_catalog (  ·  back to Japan Enrich  ·  japan: code-only UPDATE runbook for live japan.designerwallc 1521e3c →