Put zapier.georgelambert.org service names on Caddy.
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
HTTPS reverse-proxy for portal, api, leaf, zap, staff, iam, login, cs, sales, acct, mw, and fleet. Staff HTML login redirects use X-Forwarded-Proto so next= is https on the public host.
This commit is contained in:
parent
bd94d6c208
commit
acf902e361
10 changed files with 118 additions and 11 deletions
|
|
@ -23,7 +23,7 @@ Loopback on that box is `127.0.0.1`. Do **not** publish NATS `:4222`.
|
||||||
|
|
||||||
## Service → hostname (NS1 all-in-one)
|
## Service → hostname (NS1 all-in-one)
|
||||||
|
|
||||||
Suggested public names are under `zapier.georgelambert.org`. They are **not** in Caddy yet except the docs site. Until they are, use `NS1.GEORGELAMBERT.ORG:<port>` (or SSH tunnel for loopback).
|
HTTPS names under `*.zapier.georgelambert.org` are live in Caddy on NS1 (wildcard DNS already pointed here). Loopback services stay off the public internet.
|
||||||
|
|
||||||
| Service | Port | Bind now | Machine hostname | Suggested service hostname | Public? |
|
| Service | Port | Bind now | Machine hostname | Suggested service hostname | Public? |
|
||||||
|---------|------|----------|------------------|----------------------------|---------|
|
|---------|------|----------|------------------|----------------------------|---------|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ export async function denyOrRedirect(req, res, json, { permission, html }) {
|
||||||
if (out.ok) return out;
|
if (out.ok) return out;
|
||||||
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
||||||
if (html) {
|
if (html) {
|
||||||
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent('http://' + (req.headers.host || '127.0.0.1') + '/')}` });
|
const proto = String(req.headers['x-forwarded-proto'] || 'http').split(',')[0].trim();
|
||||||
|
const host = String(req.headers['x-forwarded-host'] || req.headers.host || '127.0.0.1').split(',')[0].trim();
|
||||||
|
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent(`${proto}://${host}/`)}` });
|
||||||
res.end();
|
res.end();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ set -euo pipefail
|
||||||
STACK="${VERAE_STACK:-$HOME/verae-stack}"
|
STACK="${VERAE_STACK:-$HOME/verae-stack}"
|
||||||
FLEET="$STACK/packages/verae-fleet"
|
FLEET="$STACK/packages/verae-fleet"
|
||||||
EDGE_PORT="${EDGE_PORT:-13000}"
|
EDGE_PORT="${EDGE_PORT:-13000}"
|
||||||
export STAFF_IAM_URL="${STAFF_IAM_URL:-http://127.0.0.1:3028}"
|
export STAFF_IAM_URL="${STAFF_IAM_URL:-https://iam.zapier.georgelambert.org}"
|
||||||
|
export STAFF_COOKIE_DOMAIN="${STAFF_COOKIE_DOMAIN:-.zapier.georgelambert.org}"
|
||||||
export NATS_URL="${NATS_URL:-nats://127.0.0.1:4222}"
|
export NATS_URL="${NATS_URL:-nats://127.0.0.1:4222}"
|
||||||
export FLEET_ENABLE_LAN134="${FLEET_ENABLE_LAN134:-}"
|
export FLEET_ENABLE_LAN134="${FLEET_ENABLE_LAN134:-}"
|
||||||
test -d "$FLEET" || { echo "missing $FLEET" >&2; exit 1; }
|
test -d "$FLEET" || { echo "missing $FLEET" >&2; exit 1; }
|
||||||
|
|
@ -45,17 +46,21 @@ for name in (
|
||||||
"accounting-export",
|
"accounting-export",
|
||||||
"access-staff",
|
"access-staff",
|
||||||
"access-web",
|
"access-web",
|
||||||
|
"staff-iam",
|
||||||
|
"staff-session",
|
||||||
|
"zappier-edge",
|
||||||
):
|
):
|
||||||
p = root / "services" / f"{name}.json"
|
p = root / "services" / f"{name}.json"
|
||||||
if not p.exists():
|
if not p.exists():
|
||||||
continue
|
continue
|
||||||
spec = json.loads(p.read_text())
|
spec = json.loads(p.read_text())
|
||||||
env = spec.setdefault("env", {})
|
env = spec.setdefault("env", {})
|
||||||
if "ZAPPIER_ADMIN_URL" in env or name != "access-web":
|
if "ZAPPIER_ADMIN_URL" in env:
|
||||||
env["ZAPPIER_ADMIN_URL"] = admin
|
env["ZAPPIER_ADMIN_URL"] = admin
|
||||||
if name == "access-web":
|
if name == "access-web":
|
||||||
env["ZAPPIER_EDGE_URL"] = admin
|
env["ZAPPIER_EDGE_URL"] = admin
|
||||||
env["STAFF_IAM_URL"] = "http://127.0.0.1:3028"
|
env["STAFF_IAM_URL"] = "https://iam.zapier.georgelambert.org"
|
||||||
|
env["STAFF_COOKIE_DOMAIN"] = ".zapier.georgelambert.org"
|
||||||
env["STAFF_AUTH"] = "1"
|
env["STAFF_AUTH"] = "1"
|
||||||
p.write_text(json.dumps(spec, indent=2) + "\n")
|
p.write_text(json.dumps(spec, indent=2) + "\n")
|
||||||
print("overlay applied edge", edge_port)
|
print("overlay applied edge", edge_port)
|
||||||
|
|
@ -66,7 +71,7 @@ if curl -sf http://127.0.0.1:3850/health >/dev/null; then
|
||||||
echo "fleet already up"
|
echo "fleet already up"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
nohup env STAFF_IAM_URL="$STAFF_IAM_URL" NATS_URL="$NATS_URL" node src/cli.js serve \
|
nohup env STAFF_IAM_URL="$STAFF_IAM_URL" STAFF_COOKIE_DOMAIN="$STAFF_COOKIE_DOMAIN" NATS_URL="$NATS_URL" node src/cli.js serve \
|
||||||
>/tmp/verae-fleet-serve.out 2>&1 &
|
>/tmp/verae-fleet-serve.out 2>&1 &
|
||||||
echo "fleet pid $!"
|
echo "fleet pid $!"
|
||||||
for i in $(seq 1 40); do
|
for i in $(seq 1 40); do
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ export async function denyOrRedirect(req, res, json, { permission, html }) {
|
||||||
if (out.ok) return out;
|
if (out.ok) return out;
|
||||||
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
||||||
if (html) {
|
if (html) {
|
||||||
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent('http://' + (req.headers.host || '127.0.0.1') + '/')}` });
|
const proto = String(req.headers['x-forwarded-proto'] || 'http').split(',')[0].trim();
|
||||||
|
const host = String(req.headers['x-forwarded-host'] || req.headers.host || '127.0.0.1').split(',')[0].trim();
|
||||||
|
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent(`${proto}://${host}/`)}` });
|
||||||
res.end();
|
res.end();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ NS1-style: a box that already runs NATS on **127.0.0.1:4222** (never a public bi
|
||||||
2. `nats-server -js` listening **127.0.0.1:4222** only (cluster later on a private NIC).
|
2. `nats-server -js` listening **127.0.0.1:4222** only (cluster later on a private NIC).
|
||||||
3. Clone `zappier-edge`, `verae-middleware`, `verae-fleet`.
|
3. Clone `zappier-edge`, `verae-middleware`, `verae-fleet`.
|
||||||
4. systemd units (below) or `verae-fleet serve` which keepFloor-spawns workers.
|
4. systemd units (below) or `verae-fleet serve` which keepFloor-spawns workers.
|
||||||
5. Caddy/nginx for public HTTPS to **access-web `:3021/portal/`** and **access-zapier `:3024`**. zappier-edge stays loopback (`:3000`, or `:13000` on NS1 if `:3000` is already taken).
|
5. Caddy file `caddy/zapier-services.georgelambert.org.caddy` on NS1: `portal`/`zap`/`api`/staff/fleet hostnames → local ports. zappier-edge stays loopback (`:3000`, or `:13000` on NS1 if `:3000` is already taken).
|
||||||
6. Operator console: `0.0.0.0:3850`. `verae-keep` (`:3860`) + `watch` (`:3861`) + `guard.sh` keep workers up unless you paused/stopped them in the console.
|
6. Operator console: `0.0.0.0:3850`. `verae-keep` (`:3860`) + `watch` (`:3861`) + `guard.sh` keep workers up unless you paused/stopped them in the console.
|
||||||
7. Clone/install: [verae-bootstrap](https://git.georgelambert.org/marchon/verae-bootstrap) type `ns1-all-in-one`.
|
7. Clone/install: [verae-bootstrap](https://git.georgelambert.org/marchon/verae-bootstrap) type `ns1-all-in-one`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
# Verae Time × Zapier HTTP doors on NS1.
|
||||||
|
# DNS: wildcard *.zapier.georgelambert.org → 70.88.205.138
|
||||||
|
# Do not proxy NATS :4222, keep, archive workers, or loopback edge :13000.
|
||||||
|
|
||||||
|
(zapier_headers) {
|
||||||
|
header {
|
||||||
|
X-Content-Type-Options nosniff
|
||||||
|
Referrer-Policy strict-origin-when-cross-origin
|
||||||
|
}
|
||||||
|
encode gzip zstd
|
||||||
|
}
|
||||||
|
|
||||||
|
http://portal.zapier.georgelambert.org,
|
||||||
|
http://api.zapier.georgelambert.org,
|
||||||
|
http://leaf.zapier.georgelambert.org,
|
||||||
|
http://zap.zapier.georgelambert.org,
|
||||||
|
http://staff.zapier.georgelambert.org,
|
||||||
|
http://iam.zapier.georgelambert.org,
|
||||||
|
http://login.zapier.georgelambert.org,
|
||||||
|
http://cs.zapier.georgelambert.org,
|
||||||
|
http://sales.zapier.georgelambert.org,
|
||||||
|
http://acct.zapier.georgelambert.org,
|
||||||
|
http://mw.zapier.georgelambert.org,
|
||||||
|
http://fleet.zapier.georgelambert.org {
|
||||||
|
redir https://{host}{uri} permanent
|
||||||
|
}
|
||||||
|
|
||||||
|
portal.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
redir / /portal/ 302
|
||||||
|
reverse_proxy 127.0.0.1:3021
|
||||||
|
}
|
||||||
|
|
||||||
|
api.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3022
|
||||||
|
}
|
||||||
|
|
||||||
|
leaf.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3023
|
||||||
|
}
|
||||||
|
|
||||||
|
zap.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3024
|
||||||
|
}
|
||||||
|
|
||||||
|
staff.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3025
|
||||||
|
}
|
||||||
|
|
||||||
|
iam.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3028
|
||||||
|
}
|
||||||
|
|
||||||
|
login.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3027
|
||||||
|
}
|
||||||
|
|
||||||
|
cs.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3011
|
||||||
|
}
|
||||||
|
|
||||||
|
sales.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3012
|
||||||
|
}
|
||||||
|
|
||||||
|
acct.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3013
|
||||||
|
}
|
||||||
|
|
||||||
|
mw.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3100
|
||||||
|
}
|
||||||
|
|
||||||
|
fleet.zapier.georgelambert.org {
|
||||||
|
import zapier_headers
|
||||||
|
reverse_proxy 127.0.0.1:3850
|
||||||
|
}
|
||||||
|
|
@ -32,6 +32,11 @@
|
||||||
- Disable lan-134 unless `FLEET_ENABLE_LAN134=1`.
|
- Disable lan-134 unless `FLEET_ENABLE_LAN134=1`.
|
||||||
- SSH spawn timeout 8s; failed hosts skipped.
|
- SSH spawn timeout 8s; failed hosts skipped.
|
||||||
|
|
||||||
|
## 2026-09-11 — Caddy host names live
|
||||||
|
|
||||||
|
- Installed `/etc/caddy/sites/zapier-services.georgelambert.org.caddy` on NS1. HTTPS: portal, api, leaf, zap, staff, iam, login, cs, sales, acct, mw, fleet.
|
||||||
|
- Not proxied: NATS, keep, workers, loopback edge.
|
||||||
|
|
||||||
## 2026-09-11 — host names
|
## 2026-09-11 — host names
|
||||||
|
|
||||||
- Mapped every running service to **NS1.GEORGELAMBERT.ORG** (`70.88.205.138`).
|
- Mapped every running service to **NS1.GEORGELAMBERT.ORG** (`70.88.205.138`).
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ export async function denyOrRedirect(req, res, json, { permission, html }) {
|
||||||
if (out.ok) return out;
|
if (out.ok) return out;
|
||||||
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
||||||
if (html) {
|
if (html) {
|
||||||
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent('http://' + (req.headers.host || '127.0.0.1') + '/')}` });
|
const proto = String(req.headers['x-forwarded-proto'] || 'http').split(',')[0].trim();
|
||||||
|
const host = String(req.headers['x-forwarded-host'] || req.headers.host || '127.0.0.1').split(',')[0].trim();
|
||||||
|
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent(`${proto}://${host}/`)}` });
|
||||||
res.end();
|
res.end();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ export async function denyOrRedirect(req, res, json, { permission, html }) {
|
||||||
if (out.ok) return out;
|
if (out.ok) return out;
|
||||||
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
||||||
if (html) {
|
if (html) {
|
||||||
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent('http://' + (req.headers.host || '127.0.0.1') + '/')}` });
|
const proto = String(req.headers['x-forwarded-proto'] || 'http').split(',')[0].trim();
|
||||||
|
const host = String(req.headers['x-forwarded-host'] || req.headers.host || '127.0.0.1').split(',')[0].trim();
|
||||||
|
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent(`${proto}://${host}/`)}` });
|
||||||
res.end();
|
res.end();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ export async function denyOrRedirect(req, res, json, { permission, html }) {
|
||||||
if (out.ok) return out;
|
if (out.ok) return out;
|
||||||
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
const login = iamBase() || (process.env.STAFF_SESSION_URL || 'http://127.0.0.1:3028').replace(/\/$/, '');
|
||||||
if (html) {
|
if (html) {
|
||||||
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent('http://' + (req.headers.host || '127.0.0.1') + '/')}` });
|
const proto = String(req.headers['x-forwarded-proto'] || 'http').split(',')[0].trim();
|
||||||
|
const host = String(req.headers['x-forwarded-host'] || req.headers.host || '127.0.0.1').split(',')[0].trim();
|
||||||
|
res.writeHead(302, { location: `${login}/login?next=${encodeURIComponent(`${proto}://${host}/`)}` });
|
||||||
res.end();
|
res.end();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue