add the emergency relocate/reset-mfa scripts the tests exercise

This commit is contained in:
Jarek Krochmalski committed 2026-08-27 07:41:02 +02:00
1 parent d34a7733f7
commit e7ee9b41c7
7 files changed
+621

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
#
# Emergency script to disable a user's MFA (TOTP)
# Automatically detects database type (SQLite or PostgreSQL)
#
# Usage:
# docker exec -it dockhand /app/scripts/reset-mfa.sh <username>
#
# Example:
# docker exec -it dockhand /app/scripts/reset-mfa.sh admin
#
SCRIPT_DIR="$(dirname "$0")"
# Detect database type
if [ -n "$DATABASE_URL" ] && (echo "$DATABASE_URL" | grep -qE '^postgres(ql)?://'); then
exec "$SCRIPT_DIR/postgres/reset-mfa.sh" "$@"
else
exec "$SCRIPT_DIR/sqlite/reset-mfa.sh" "$@"
fi