6f5878989d
Entering the base DN directly (CFG_BASE_DN=dc=foo,dc=bar) is fragile — a missing comma between labels silently produces a malformed domain (e.g. "theta42dc=duckdns.org" instead of "theta42.duckdns.org") with no validation to catch it. Flip the direction: operators now set CFG_DOMAIN to a plain domain (any number of labels — a DuckDNS domain like foo.duckdns.org works the same as a normal one), and setup.sh derives the base DN from it via the new dn_from_domain(). CFG_BASE_DN is still supported as an explicit override (e.g. to namespace under an OU-style prefix) and is how migrated .env/proxy.env deployments keep working, since domain_from_dn() still reads the domain back out of an existing DN either way.
51 lines
3.0 KiB
Bash
51 lines
3.0 KiB
Bash
# ─────────────────────────────────────────────────────────────────────────────
|
|
# setup.env — first-run setup for the theta-env stack.
|
|
#
|
|
# This file is used ONLY on the FIRST run of ./setup.sh, to generate
|
|
# ./config/sso-secrets.js + ./config/proxy-secrets.js with your domain filled
|
|
# in everywhere consistently. Once ./config/*.js exist they are operator-owned
|
|
# (edit them directly; setup.env is ignored on later runs).
|
|
#
|
|
# cp setup.env.example setup.env
|
|
# $EDITOR setup.env # set CFG_DOMAIN below to your domain
|
|
# ./setup.sh # generates ./config/ and builds the stack
|
|
#
|
|
# Copying this file to setup.env (gitignored) keeps your domain out of git.
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
# Your domain. THIS IS THE ONE PLACE THE DOMAIN IS ENTERED. Everything else
|
|
# derives from it: the SSO/proxy hostnames default to sso.<domain> /
|
|
# proxy.<domain>, and the LDAP base DN is built from it (example.com becomes
|
|
# dc=example,dc=com; a 3-label domain like myhost.duckdns.org becomes
|
|
# dc=myhost,dc=duckdns,dc=org — any number of labels works). Required —
|
|
# setup.sh refuses to run without it.
|
|
CFG_DOMAIN=example.com
|
|
|
|
# Public hostnames. Optional — default to sso.<domain> / proxy.<domain> derived
|
|
# from CFG_DOMAIN above. Uncomment and set only if your hostnames differ
|
|
# (e.g. a different subdomain, or the domain isn't the bare apex):
|
|
#CFG_SSO_HOST=sso.example.com
|
|
#CFG_PROXY_HOST=proxy.example.com
|
|
|
|
# Advanced: override the derived LDAP base DN directly (e.g. to namespace
|
|
# under an OU-style prefix). Leave unset to use the DN built from CFG_DOMAIN:
|
|
#CFG_BASE_DN=dc=example,dc=com
|
|
|
|
# Optional — sensible defaults if left blank:
|
|
#CFG_ORG=SSO Manager # app display name + outbound email org
|
|
#CFG_ADMIN_UID=admin # initial SSO admin username
|
|
#CFG_ADMIN_EMAIL=admin@proxy.example.com # defaults to admin@<proxyHost>
|
|
#CFG_LDAP_CERT_CN= # LDAP TLS cert CN; empty -> defaults to the domain
|
|
|
|
# Optional SMTP (outbound email from the SSO app). Leave blank to disable:
|
|
#CFG_SMTP_HOST=smtp.example.com
|
|
#CFG_SMTP_PORT=587
|
|
#CFG_SMTP_USER=noreply@example.com
|
|
#CFG_SMTP_PASS=your-smtp-password
|
|
#CFG_SMTP_FROM=SSO Manager <noreply@example.com>
|
|
|
|
# ── DO NOT put secrets here ──────────────────────────────────────────────────
|
|
# The LDAP admin password, JWT secret, admin password, and LDAP service-account
|
|
# password are GENERATED (random) into ./config/sso-secrets.js on first run.
|
|
# Change them later by editing ./config/sso-secrets.js directly. Do NOT set
|
|
# CFG_LDAP_ADMIN_PASS / CFG_JWT_SECRET / CFG_ADMIN_PASS / CFG_SVC_PASS here. |