Gateherald
Docs
Split-Host Deployment
Internal Frontend + External Backend
This is the recommended split when UI users are internal but webhook/API runtime must be externally reachable.
Target Topology
- Host frontend (
ui/) on an internal-only web server. - Host backend (
index.js) on an external or DMZ-facing host. - Allow internal users to reach frontend only.
- Allow frontend-to-backend HTTPS traffic only.
- Allow external webhook senders to backend webhook routes.
Backend Settings
Use API-only mode and strict CORS:
SERVE_UI=false
FRONTEND_ONLY_API=true
ALLOWED_ORIGINS=https://gateherald.internal
PORT=3000
Notes:
ALLOWED_ORIGINSmust list exact internal frontend origins.- Keep it explicit; do not use wildcard origins.
- Set
ADMIN_PROXY_SHARED_SECRETand make your internal frontend proxy sendX-Gateherald-Proxy-Secreton/api/*so only frontend-proxied API traffic is accepted.
Proxy Auth And Route Protection
Use the Nginx configs in deploy/nginx/ to protect admin UI/API routes while keeping webhook ingress public.
Protected routes:
/ui/*/api/templates*/api/configs*/api/ui/templates
Public routes:
/webhook/*
When FRONTEND_ONLY_API=true, external callers should only reach /webhook/*. Route /api/* traffic should be internal-proxy-only.
For detailed Basic Auth/OIDC cutover and hardening guidance, see docs/nginx.md.
Single Nginx Host
Use deploy/nginx/gateherald.conf when the UI and backend run on the same host, with nginx in front:
- Run backend in API-only mode (
SERVE_UI=false). - Deploy static UI files from
ui/to/var/www/gateherald-uion the same host. - Install
deploy/nginx/gateherald.confas your site config. - Copy the active auth snippet to
/etc/nginx/snippets/gateherald-admin-auth.conf. - Replace
replace_me_with_admin_proxy_shared_secretin admin API locations with the exactADMIN_PROXY_SHARED_SECRETvalue. - Reload Nginx.
Auth snippet activation and OIDC cutover steps are documented in docs/nginx.md.
Split-Host Nginx Deployment
Use deploy/nginx/gateherald-split-hosts.conf when UI and API/webhook are on different hosts:
- Internal host:
gateherald.internal- Serves static UI from
/var/www/gateherald-ui - Enforces user auth for
/ui/*and admin API routes - Proxies admin API calls to
api.gateherald.example.com
- Serves static UI from
- External host:
api.gateherald.example.com- Exposes
/webhook/*and/api - Restricts
/api/templates*,/api/configs*, and/api/ui/templatesto internal proxy CIDRs - Returns
404for/ui/*
- Exposes
Rollout checklist:
- Set backend to API-only mode (
SERVE_UI=falsein.env.productionon the backend host). - Deploy UI files to internal host (
/var/www/gateherald-ui). - Apply the internal server block from
deploy/nginx/gateherald-split-hosts.confon internal Nginx. - Apply the external server block from
deploy/nginx/gateherald-split-hosts.confon external Nginx. - Replace example private CIDRs in external config with real internal proxy egress ranges.
- Set
ui/env.jsAPI base URL tohttps://api.gateherald.example.com. - Replace
replace_me_with_admin_proxy_shared_secretin both internal and external admin API locations with the exactADMIN_PROXY_SHARED_SECRETvalue. - Validate and reload both Nginx instances.