19 lines
1003 B
Bash
Executable File
19 lines
1003 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Operator cron: 0 */12 * * * cd /path/to/lab7 && scripts/renew-pki.sh
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
exec 9> secrets/operator/pki.lock
|
|
flock -n 9 || exit 0
|
|
for identity in lb api worker db minio redis client-api openbao otel-collector prometheus tempo loki grafana operator; do
|
|
if ! openssl x509 -checkend 172800 -noout -in "certs/$identity/$identity.crt" >/dev/null; then
|
|
scripts/bootstrap-pki.sh "$identity"
|
|
fi
|
|
done
|
|
# Refresh CRL even when no leaf is due; invalidate cached TLS state by restarting proxies.
|
|
scripts/bootstrap-pki.sh
|
|
scripts/dc.sh restart lb api-tls api2-tls otel-collector-tls prometheus-tls tempo-tls loki-tls grafana-tls cache minio openbao
|
|
scripts/dc.sh exec -T db psql -U postgres -d messenger -c 'SELECT pg_reload_conf()' >/dev/null
|
|
# OpenBao restarts sealed with file storage. Operator script unseals using protected material.
|
|
scripts/bootstrap-openbao.sh
|
|
scripts/dc.sh restart api api2 worker otel-collector prometheus grafana loki tempo
|