Commit Graph

169 Commits

Author SHA1 Message Date
wmantly b5f24d40fc Persist Redis + config in bind-mounted ./config/ (no .env); add backup/restore (#8)
Part A — lossless upgrades:
- Persist both bundled Redis stores via AOF+RDB on named volumes (sso-data,
  proxy-data) so OAuth clients, Host records, perms, DNS creds, and auto-ssl
  Let's Encrypt certs survive rebuilds.
- setup.sh: backup_before_rebuild() snapshots ./config/ + LDAP (slapcat) +
  both Redis (BGSAVE + compose cp) to ./backups/<ts>/ before each rebuild,
  keeps last BACKUP_KEEP (default 5). First run is a no-op.
- Restore runbook (README + docs): full / Redis-only / LDAP-only, with the
  AOF-vs-RDB note (delete the AOF before restoring an RDB).

Part B — eliminate .env / proxy.env:
- All config + secrets live in bind-mounted ./config/ (gitignored), read by each
  app's @simpleworkjs/conf from a symlinked secrets.js. Compose passes only
  NODE_ENV + NODE_PORT (no app_* env, which would override secrets.js).
- ./config/sso-secrets.js: app secrets + orchestrator-only stack/bootstrap/
  serviceAccountPass keys (app ignores the ones it doesn't use).
- ./config/proxy-secrets.js: oidc (clientId/clientSecret filled in by the
  bootstrap), ldap (bind creds), auth (admin groups/users).
- setup.sh ensure_config(): generates ./config/ with random secrets on first
  run (then exits for editing); one-time migration from .env/proxy.env
  preserving existing secrets (LDAP admin pass, JWT, OAuth client, service
  pass) so a running deployment keeps its directory + tokens + OAuth client.
- bootstrap/bootstrap.js: reads /config/*.js (not process.env), registers the
  proxy as an OIDC client, and writes the SSO-generated client id+secret back
  into ./config/proxy-secrets.js (sso mounts ./config RW, proxy RO).
- config.example/ holds committed annotated templates for manual reference.
- .gitignore: add config/, backups/, *.rdb, *.ldif.

Bump both gitlinks to the merged submodule tips:
- sso-manager-node -> 6920a9f (PR #34)
- proxy -> 8e78604 (PR #118)

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-12 13:16:17 -04:00
wmantly 2d2941e394 Merge pull request #7 from theta42/bump-sso-sudo-lpk-schema
bump sso-manager-node: sudo + openssh-lpk schemas in image
2026-07-11 22:35:13 -04:00
wmantly c72e501fc8 bump sso-manager-node: load sudo + openssh-lpk schemas in image
sso-manager-node d5e951f — ships sudo.schema + openssh-lpk.schema (included
in the all-in-one slapd.conf) so user creation works (addPosixAccount tags
every user with sudoRole + ldapPublicKey). Also fixes the .dockerignore build
error from the previous theta42 schema bump. See theta42/sso-manager-node#33.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 22:34:57 -04:00
wmantly c24563fb3e Merge pull request #6 from theta42/bump-sso-theta42-schema
Bump sso-manager-node for the theta42 schema fix
2026-07-11 21:42:02 -04:00
wmantly 25692780e2 Bump sso-manager-node for the theta42 schema fix
sso-manager-node: d1620dd -> 84e5358
  Load the theta42 (dateOfBirth) schema in the all-in-one image
  (theta42/sso-manager-node#32)

Fixes PUT /api/user/<uid> failing with "objectClass: value #0 invalid per
syntax (0x15)" when a dateOfBirth is set, and user creation for the
theta42Person objectClass. Requires a rebuild of the sso-manager image.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 21:41:53 -04:00
wmantly 1591ecd2bc Merge pull request #5 from theta42/bump-submodule-logs-docs
Bump submodules for the Logs (Docker) docs
2026-07-11 21:34:45 -04:00
wmantly e1ed517fe1 Bump submodules for the Logs (Docker) docs
Point sso-manager-node and proxy at the commits that add the Logs (Docker)
section to their README/DEPLOYMENT docs:
  proxy:              cca5e48 -> 3f178b0
  sso-manager-node:   fe9b7c1 -> d1620dd

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 21:34:33 -04:00
wmantly e9cc042019 Merge pull request #4 from theta42/docs-logs
README: add a Logs section for the Docker stack
2026-07-11 21:06:35 -04:00
wmantly dacd65602c README: add a Logs section for the Docker stack
Both services (sso-manager, proxy) run under Compose; document how to get
logs via docker compose logs, the proxy's nginx access/error logs (which go
to /var/log/nginx on the proxy-logs volume, not docker logs), and a direct
ldapsearch health check for the SSO.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 21:02:03 -04:00
wmantly 8947b422bc Merge pull request #3 from theta42/setup-auto-update-submodules
setup.sh: update submodules to latest before building
2026-07-11 20:53:01 -04:00
wmantly 8377b6eda5 Merge pull request #2 from theta42/bump-proxy-submodule
Bump proxy submodule to cca5e48 (per-host SSO, host modal, basic auth)
2026-07-11 20:52:54 -04:00
wmantly 87c7d7bc82 setup.sh: update submodules to latest before building
Add a first step to setup.sh that runs `git submodule update --init --remote
--recursive`, so each ./setup.sh builds from the newest sso-manager-node + proxy
upstream rather than whatever was pinned at clone time. --init also populates
the submodules if the repo was cloned without --recursive.

Behavior:
- If the fetch is unreachable (offline), warn and continue building the
  currently checked-out code instead of hard-failing.
- SKIP_SUBMODULE_UPDATE=1 locks to the pinned commits (offline rebuild /
  deliberate pin).
- Verifies the build contexts (Dockerfile.openldap, Dockerfile) exist and
  dies with a clear message if a submodule was never initialized.
- Requires git (added to the Requires line); git absent is fatal unless
  SKIP_SUBMODULE_UPDATE=1.

Renumbered the subsequent step headers (env -> 2, sso-manager -> 3, ...).
README repo-layout note updated to say setup.sh auto-updates submodules.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 20:48:51 -04:00
wmantly fb7a7559b7 Bump proxy submodule to cca5e48 (per-host SSO, host modal, basic auth)
Updates the pinned proxy submodule from 94ad614 to cca5e48, bringing in:
- per-host SSO (#57): OpenResty gate + Node auth endpoints + Redis sessions
- host modal redesign (tabbed), wildcard-child default, allow-list autocomplete
- per-host HTTP basic auth (#57)
- user-creation + password-policy fixes (#48)
- scheduler DNS-domain-list refresh (#69)
- removal of unused invite / SSH-key user features

sso-manager-node unchanged (already at its master tip, fe9b7c1).

Config compatibility: the proxy's oidc / auth / ldap conf shape is unchanged,
so the proxy.env setup.sh generates (app_oidc__*, app_ldap__*, app_auth__*) is
still consumed as-is. New optional sections (hostSso, service.hostScheduler,
dynamicDns) ship with defaults and need no proxy.env entries.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 20:45:06 -04:00
wmantly 89aa6d1f50 Merge pull request #1 from theta42/expose-admin-uis-lan
Expose SSO (3001) + proxy mgmt (3000) UIs on the LAN by default
2026-07-11 20:41:09 -04:00
wmantly ca0ddb1997 Expose SSO (3001) + proxy mgmt (3000) UIs on the LAN by default
The SSO web UI and the proxy management UI were bound to 127.0.0.1, so they
were only reachable from the host running the stack — inconvenient during
first-run setup from another machine. Make the bind address configurable
(SSO_BIND / MGMT_BIND, default 0.0.0.0) so both are LAN-reachable by default,
with a one-line flip back to 127.0.0.1 once the proxy fronts them under TLS.

Also: friendlier README with an upfront prerequisites section (domain, >=2 DNS
records to the public IP, port-forward 80/443) and a note that .env values with
spaces should be quoted.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 20:38:11 -04:00
wmantly 5ec951a683 Fixed issues with password 2026-07-11 18:46:20 -04:00
wmantly f7edc5b672 Fixed env template 2026-07-11 18:42:05 -04:00
wmantly 391eca17da Fixed env template 2026-07-11 18:31:46 -04:00
wmantly 9fb240ff45 theta-env: unified SSO Manager + Proxy stack with one-command setup
Composes theta42/sso-manager-node and theta42/proxy (as git submodules) on a
single Docker network and automates first-run wiring.

- docker-compose.yml: sso-manager (build ./sso-manager-node/Dockerfile.openldap)
  + proxy (build ./proxy/Dockerfile) on theta-net; SSO UI + mgmt port bound to
  localhost, LDAPS published, proxy 80/443/4443 published.
- setup.sh: idempotent one-command bring-up — validates .env, starts SSO, runs
  the bootstrap, writes ./proxy.env, starts the proxy, prints admin login.
- bootstrap/bootstrap.js: runs inside the sso-manager container (self-contained,
  Node built-ins + fetch only) — creates the LDAP service account, first admin
  (+ app_sso_admin/app_sso_oauth_admin membership), registers the proxy as an
  OIDC client via the SSO HTTP API, emits CLIENT_ID/CLIENT_SECRET.
- .env.example: all tunables (LDAP_BASE_DN, LDAP_ADMIN_PASS, JWT_SECRET,
  SSO_HOST, PROXY_HOST, BOOTSTRAP_ADMIN_*, LDAP_SERVICE_PASS, SMTP_*, ports).
- README.md + docs/ (Jekyll site for GitHub Pages): quickstart, architecture,
  standalone usage.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 17:04:36 -04:00