0.27.6 — guard seed-secrets: skip if Infisical already populated
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

This commit is contained in:
2026-08-08 21:15:00 +02:00
parent 0b6c546aae
commit ef762794e7

View File

@@ -1,12 +1,8 @@
#!/bin/sh #!/bin/sh
# One-shot: populate Infisical with oikos secrets. # One-shot: populate Infisical with oikos secrets from container env.
# Extracts secret values from running containers (where docker-compose # Only runs if Infisical is empty (first bootstrap). Safe to re-run.
# injects them from the host .env) and pushes them into Infisical via
# the api container's oikos binary.
# #
# Usage: ./scripts/seed-secrets.sh # Usage: ./scripts/seed-secrets.sh
#
# Safe to re-run (set is idempotent).
set -e set -e
@@ -16,6 +12,16 @@ COMPOSE="docker compose -f $REPO_DIR/docker-compose.yml"
echo "=== seed-secrets: $(date) ===" echo "=== seed-secrets: $(date) ==="
# Skip if Infisical already has secrets (avoid overwriting real values
# with dev defaults from docker-compose).
existing=$($COMPOSE exec -T api /oikos secret list 2>/dev/null | grep -c . || echo 0)
if [ "$existing" -gt 3 ]; then
echo "SKIP: Infisical already has $existing secrets (bootstrap complete)"
exit 0
fi
echo "Infisical has $existing secrets — seeding..."
set_count=0 set_count=0
skip_count=0 skip_count=0
fail_count=0 fail_count=0