Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49dee5c477 | |||
| 1a832d068e | |||
| 60ae421cb2 |
@@ -8,6 +8,11 @@ orchestration code; see each submodule's own `CHANGELOG.md`
|
|||||||
[sso-manager-node](https://github.com/theta42/sso-manager-node/blob/master/CHANGELOG.md))
|
[sso-manager-node](https://github.com/theta42/sso-manager-node/blob/master/CHANGELOG.md))
|
||||||
for what changed inside the apps it composes.
|
for what changed inside the apps it composes.
|
||||||
|
|
||||||
|
## [v1.26.0] - 2026-08-01
|
||||||
|
|
||||||
|
- Made OpenBao production-ready by using a persistent file backend, enabling `IPC_LOCK`, and dynamically generating a robust config file.
|
||||||
|
- Automated OpenBao initialization, unsealing, and secrets seeding via `setup.sh`.
|
||||||
|
|
||||||
## [v1.25.0] - 2026-08-01
|
## [v1.25.0] - 2026-08-01
|
||||||
|
|
||||||
- Added OpenBao (Vault) container for secrets management and native UI proxying.
|
- Added OpenBao (Vault) container for secrets management and native UI proxying.
|
||||||
|
|||||||
+21
-1
@@ -44,6 +44,8 @@ services:
|
|||||||
NO_PROXY: ${CFG_NO_PROXY:-}
|
NO_PROXY: ${CFG_NO_PROXY:-}
|
||||||
container_name: sso-manager
|
container_name: sso-manager
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- openbao
|
||||||
networks: [theta-net]
|
networks: [theta-net]
|
||||||
ports:
|
ports:
|
||||||
# SSO web UI. Bind address is configurable via SSO_BIND (default 0.0.0.0 so
|
# SSO web UI. Bind address is configurable via SSO_BIND (default 0.0.0.0 so
|
||||||
@@ -64,6 +66,7 @@ services:
|
|||||||
- NODE_PORT=3001
|
- NODE_PORT=3001
|
||||||
- LDAP_SERVER_ID=${LDAP_SERVER_ID:-}
|
- LDAP_SERVER_ID=${LDAP_SERVER_ID:-}
|
||||||
- LDAP_REPLICATION_HOSTS=${LDAP_REPLICATION_HOSTS:-}
|
- LDAP_REPLICATION_HOSTS=${LDAP_REPLICATION_HOSTS:-}
|
||||||
|
- VAULT_TOKEN=${VAULT_TOKEN:-}
|
||||||
# Optional upstream HTTP(S) proxy for outbound calls (SMTP, etc.) at
|
# Optional upstream HTTP(S) proxy for outbound calls (SMTP, etc.) at
|
||||||
# runtime. See the build args above for the same setting during build.
|
# runtime. See the build args above for the same setting during build.
|
||||||
- HTTP_PROXY=${CFG_HTTP_PROXY:-}
|
- HTTP_PROXY=${CFG_HTTP_PROXY:-}
|
||||||
@@ -214,6 +217,22 @@ services:
|
|||||||
- ./config/ldap-test-host.vars:/config/ldap.vars:ro
|
- ./config/ldap-test-host.vars:/config/ldap.vars:ro
|
||||||
- ./config/ldap-ca.crt:/config/ldap-ca.crt:ro
|
- ./config/ldap-ca.crt:/config/ldap-ca.crt:ro
|
||||||
|
|
||||||
|
openbao:
|
||||||
|
image: quay.io/openbao/openbao:latest
|
||||||
|
container_name: openbao
|
||||||
|
restart: unless-stopped
|
||||||
|
cap_add:
|
||||||
|
- IPC_LOCK
|
||||||
|
command: server -config=/vault/config/openbao.hcl
|
||||||
|
environment:
|
||||||
|
- BAO_ADDR=http://127.0.0.1:8200
|
||||||
|
ports:
|
||||||
|
- "8080:8200"
|
||||||
|
volumes:
|
||||||
|
- ./config/openbao.hcl:/vault/config/openbao.hcl:ro
|
||||||
|
- openbao-data:/vault/data
|
||||||
|
networks:
|
||||||
|
- theta-net
|
||||||
networks:
|
networks:
|
||||||
theta-net:
|
theta-net:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
@@ -226,4 +245,5 @@ volumes:
|
|||||||
proxy-cache:
|
proxy-cache:
|
||||||
proxy-logs:
|
proxy-logs:
|
||||||
jump-data:
|
jump-data:
|
||||||
jump-redis-data:
|
jump-redis-data:
|
||||||
|
openbao-data:
|
||||||
@@ -392,6 +392,23 @@ PROXYEOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
ensure_config() {
|
ensure_config() {
|
||||||
|
if [[ ! -f "$CONFIG_DIR/openbao.hcl" ]]; then
|
||||||
|
info "Generating $CONFIG_DIR/openbao.hcl ..."
|
||||||
|
mkdir -p "$CONFIG_DIR"
|
||||||
|
cat > "$CONFIG_DIR/openbao.hcl" <<BAOEOF
|
||||||
|
storage "file" {
|
||||||
|
path = "/vault/data"
|
||||||
|
}
|
||||||
|
listener "tcp" {
|
||||||
|
address = "0.0.0.0:8200"
|
||||||
|
tls_disable = 1
|
||||||
|
}
|
||||||
|
disable_mlock = true
|
||||||
|
ui = true
|
||||||
|
BAOEOF
|
||||||
|
chmod 644 "$CONFIG_DIR/openbao.hcl"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -f "$CONFIG_DIR/sso-secrets.js" ]]; then
|
if [[ -f "$CONFIG_DIR/sso-secrets.js" ]]; then
|
||||||
info "Using existing $CONFIG_DIR/sso-secrets.js (operator-owned — left untouched)."
|
info "Using existing $CONFIG_DIR/sso-secrets.js (operator-owned — left untouched)."
|
||||||
return 0
|
return 0
|
||||||
@@ -501,6 +518,7 @@ ensure_config() {
|
|||||||
mkdir -p "$CONFIG_DIR" && chmod 700 "$CONFIG_DIR"
|
mkdir -p "$CONFIG_DIR" && chmod 700 "$CONFIG_DIR"
|
||||||
write_sso_secrets
|
write_sso_secrets
|
||||||
write_proxy_secrets
|
write_proxy_secrets
|
||||||
|
|
||||||
chmod 600 "$CONFIG_DIR/sso-secrets.js" "$CONFIG_DIR/proxy-secrets.js"
|
chmod 600 "$CONFIG_DIR/sso-secrets.js" "$CONFIG_DIR/proxy-secrets.js"
|
||||||
|
|
||||||
if [[ "$migrated" == "1" ]]; then
|
if [[ "$migrated" == "1" ]]; then
|
||||||
@@ -646,6 +664,45 @@ backup_before_rebuild() {
|
|||||||
}
|
}
|
||||||
backup_before_rebuild
|
backup_before_rebuild
|
||||||
|
|
||||||
|
# ── 3b. Setup OpenBao (Vault) ────────────────────────────────────────────────
|
||||||
|
info "Starting openbao..."
|
||||||
|
"${COMPOSE[@]}" run --rm --user root openbao chown -R 100:1000 /vault/data
|
||||||
|
"${COMPOSE[@]}" up -d openbao
|
||||||
|
info "Waiting for openbao to be reachable..."
|
||||||
|
for i in $(seq 1 30); do
|
||||||
|
if docker exec openbao bao status >/dev/null 2>&1 || [[ $? -eq 2 ]]; then
|
||||||
|
info "openbao is reachable."; break
|
||||||
|
fi
|
||||||
|
if (( i == 30 )); then die "openbao did not become reachable in 60s. Check: ${COMPOSE[*]} logs openbao"; fi
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
if ! docker exec openbao bao status -format=json 2>/dev/null | grep -q '"initialized": true' || true; then
|
||||||
|
status_json=$(docker exec openbao bao status -format=json 2>/dev/null || true)
|
||||||
|
if ! echo "$status_json" | grep -q '"initialized": true'; then
|
||||||
|
info "Initializing openbao for the first time..."
|
||||||
|
docker exec openbao bao operator init -key-shares=1 -key-threshold=1 -format=json > "$CONFIG_DIR/bao-init.json"
|
||||||
|
chmod 600 "$CONFIG_DIR/bao-init.json"
|
||||||
|
info "Openbao initialized. Keys saved to $CONFIG_DIR/bao-init.json"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
status_json=$(docker exec openbao bao status -format=json 2>/dev/null || true)
|
||||||
|
if echo "$status_json" | grep -q '"sealed": true'; then
|
||||||
|
info "Unsealing openbao..."
|
||||||
|
UNSEAL_KEY=$(grep -A1 '"unseal_keys_b64":' "$CONFIG_DIR/bao-init.json" | tail -n1 | cut -d'"' -f2)
|
||||||
|
docker exec openbao bao operator unseal "$UNSEAL_KEY" >/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
export VAULT_TOKEN
|
||||||
|
VAULT_TOKEN=$(grep '"root_token":' "$CONFIG_DIR/bao-init.json" | cut -d'"' -f4)
|
||||||
|
env_upsert VAULT_TOKEN "$VAULT_TOKEN"
|
||||||
|
|
||||||
|
if ! docker exec -e BAO_TOKEN="$VAULT_TOKEN" openbao bao secrets list -format=json 2>/dev/null | grep -q '"secret/":'; then
|
||||||
|
info "Enabling kv-v2 secrets engine at secret/..."
|
||||||
|
docker exec -e BAO_TOKEN="$VAULT_TOKEN" openbao bao secrets enable -path=secret kv-v2 >/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# ── 4. Start SSO Manager, wait for health ─────────────────────────────────────
|
# ── 4. Start SSO Manager, wait for health ─────────────────────────────────────
|
||||||
# SSO_GIT_COMMIT: sso-manager-node is a git submodule here, so its .git is a
|
# SSO_GIT_COMMIT: sso-manager-node is a git submodule here, so its .git is a
|
||||||
# pointer file (not a real repo) -- the image can't resolve its own commit
|
# pointer file (not a real repo) -- the image can't resolve its own commit
|
||||||
@@ -670,6 +727,13 @@ for i in $(seq 1 60); do
|
|||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if ! docker exec -e BAO_TOKEN="$VAULT_TOKEN" openbao bao kv get secret/sso-manager/conf >/dev/null 2>&1; then
|
||||||
|
info "Seeding sso-manager/conf into Openbao..."
|
||||||
|
docker exec sso-manager node -e "console.log(JSON.stringify(require('/config/sso-secrets.js')))" > "$CONFIG_DIR/seed-conf.json"
|
||||||
|
cat "$CONFIG_DIR/seed-conf.json" | docker exec -i -e BAO_TOKEN="$VAULT_TOKEN" openbao bao kv put secret/sso-manager/conf -
|
||||||
|
rm -f "$CONFIG_DIR/seed-conf.json"
|
||||||
|
fi
|
||||||
|
|
||||||
# Read the summary values (hosts, admin, base DN) back from ./config via the
|
# Read the summary values (hosts, admin, base DN) back from ./config via the
|
||||||
# running container's node — works whether ./config was generated or pre-existing.
|
# running container's node — works whether ./config was generated or pre-existing.
|
||||||
read_config_kv() {
|
read_config_kv() {
|
||||||
|
|||||||
Reference in New Issue
Block a user