← back to Designer Wallcoverings
appointments: FINISH-on-kamatera one-paste (mount+reload, vhost+certbot) — agent did DNS/rsync/pg/env/migration, prod entrypoint edit reserved for Steve
9a74adab4821f351ea6168fc52adf0b79e8062cf · 2026-06-29 10:51:46 -0700 · Steve Abrams
Files touched
A shopify/quote-api/appointments/deploy/FINISH-on-kamatera.sh
Diff
commit 9a74adab4821f351ea6168fc52adf0b79e8062cf
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Jun 29 10:51:46 2026 -0700
appointments: FINISH-on-kamatera one-paste (mount+reload, vhost+certbot) — agent did DNS/rsync/pg/env/migration, prod entrypoint edit reserved for Steve
---
.../appointments/deploy/FINISH-on-kamatera.sh | 53 ++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/shopify/quote-api/appointments/deploy/FINISH-on-kamatera.sh b/shopify/quote-api/appointments/deploy/FINISH-on-kamatera.sh
new file mode 100644
index 00000000..517e545d
--- /dev/null
+++ b/shopify/quote-api/appointments/deploy/FINISH-on-kamatera.sh
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+# ═══════════════════════════════════════════════════════════════════════════════
+# DW Appointments — FINISH (the 2 prod actions reserved for Steve). KEEP IN DEV.
+#
+# Already done by the agent (verified): DNS A-record in Cloudflare; module rsynced
+# to the box; pg installed; .env set (DATABASE_URL/APPT_*/showroom/OAuth-redirect);
+# canonical dw_unified migration ran (appt_ tables + 5 seeded rows); the router was
+# proven to load + query dw_unified on the box (ROUTER_LOADS_OK; rows=5).
+#
+# These two blocks just (A) mount the router into the live app + reload, and
+# (B) stand up the api. vhost + SSL. They do NOT create the Shopify page or publish
+# the theme — the storefront stays in dev. Paste each block into your Mac terminal.
+# ═══════════════════════════════════════════════════════════════════════════════
+
+# ─── BLOCK A — mount the router + reload (safe: backup, syntax-check, smoke) ───
+ssh my-server 'bash -s' <<'EOF'
+set -e
+APP=/root/Projects/koroseal-quote-api
+cp "$APP/server.js" "$APP/server.js.bak-pre-appt-$(date +%Y%m%d-%H%M%S)"
+python3 - <<'PY'
+import sys
+p="/root/Projects/koroseal-quote-api/server.js"; s=open(p).read()
+if "appointments/router" in s: print("already mounted"); sys.exit(0)
+a="app.post('/api/sku-inquiry', handleSkuInquiry);"
+assert a in s, "anchor line not found — inspect server.js"
+open(p,"w").write(s.replace(a, a+"\n\n// Appointment scheduling — /api/appointments/* + /appointments/:id\napp.use(require('./appointments/router'));", 1))
+print("inserted mount line")
+PY
+node --check "$APP/server.js"
+pm2 reload koroseal-quote-api --update-env
+sleep 2
+echo "--- appointments health (expect availability_rows:5) ---"; curl -s http://127.0.0.1:3001/api/appointments/health; echo
+echo "--- koroseal health (must still be ok) ---"; curl -s http://127.0.0.1:3001/health; echo
+echo "If either is broken, ROLL BACK:"
+echo " cp \$(ls -t $APP/server.js.bak-pre-appt-* | head -1) $APP/server.js && pm2 reload koroseal-quote-api"
+EOF
+
+# ─── BLOCK B — api. vhost + Let's Encrypt SSL + edge smoke ─────────────────────
+scp ~/Projects/Designer-Wallcoverings/shopify/quote-api/appointments/deploy/api.designerwallcoverings.com.conf \
+ my-server:/etc/nginx/sites-available/api.designerwallcoverings.com
+ssh my-server 'ln -sf /etc/nginx/sites-available/api.designerwallcoverings.com /etc/nginx/sites-enabled/ \
+ && nginx -t && systemctl reload nginx \
+ && certbot --nginx -d api.designerwallcoverings.com --redirect -m info@designerwallcoverings.com --agree-tos -n'
+echo "--- edge smoke ---"
+curl -s https://api.designerwallcoverings.com/api/appointments/health; echo
+curl -s "https://api.designerwallcoverings.com/api/appointments/availability?owner_email=info@designerwallcoverings.com&date=$(date -v+Mon +%F 2>/dev/null || date -d 'next monday' +%F)"; echo
+curl -s -X POST https://api.designerwallcoverings.com/api/sku-inquiry -H 'Content-Type: application/json' -d '{}'; echo # expect JSON validation error, not 404
+
+# ─── THEN (you, separately) ───────────────────────────────────────────────────
+# • Google OAuth: create the client, route GOOGLE_OAUTH_CLIENT_ID/SECRET via /secrets,
+# pm2 reload, then visit (signed in as info@'s calendar owner):
+# https://api.designerwallcoverings.com/api/appointments/oauth/start?owner_email=info@designerwallcoverings.com
+# • Verify on the DEV theme preview only — DO NOT publish / DO NOT create the live page yet.
← bbe051b7 auto-save: 2026-06-29T10:48:32 (5 files) — pending-approval/
·
back to Designer Wallcoverings
·
product: per-variant min quantity (Sold Per Yard=5, Wallcove ab77a98e →