Files
probably-rendering-one-more…/scripts/auth-admin.sh
T
codex-bot ad398db781
waterfall-wiki CI and deployment / verify-and-deploy (push) Has been cancelled
studio CI and deployment / verify-and-deploy (push) Successful in 9m15s
Restore PROMPT branding, rename waterfall-wiki, and add system tag workflows
2026-10-27 00:35:59 +08:00

16 lines
828 B
Bash

#!/usr/bin/env bash
set -Eeuo pipefail
if [ "$(id -u)" -ne 0 ]; then exec sudo bash "$0" "$@"; fi
command=${1:-qr}
cd /opt/prompt/current
compose(){ env -u AUTH_CONFIG_FILE -u AUTH_COOKIE_SECURE docker compose -p prompt --env-file /etc/prompt.env --env-file release.env -f compose.yml "$@"; }
case "$command" in
qr|token) compose exec waterfall-wiki node auth-cli.cjs "$command" ;;
rotate)
if [ "${2:-}" != "--confirm" ]; then echo 'This invalidates all bound authenticators and JWT sessions. Use: auth rotate --confirm'; exit 1; fi
compose run --rm --no-deps auth-admin node auth-cli.cjs rotate --confirm
echo 'Rotation complete. Run auth qr to bind again.' ;;
verify) compose exec -T waterfall-wiki node auth-cli.cjs verify ;;
*) echo 'Usage: auth [qr | token | verify | rotate --confirm]'; exit 1 ;;
esac