feat: add show-admin-password and reset-admin-password make targets

make show-admin-password — prints the admin password from the initial
  setup file if the API hasn't consumed it yet; otherwise prompts to reset
make reset-admin-password — generates a strong random password, updates
  auth_users.json directly, writes it back to the setup file, and prints
  it prominently so it's easy to copy

Also enhances reset_admin_password.py with --show, --generate flags and
a clear banner output, and adds both targets to make help.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 03:17:38 -04:00
parent 7d2979b8af
commit ec9ceec7a7
2 changed files with 97 additions and 11 deletions
+11
View File
@@ -11,6 +11,7 @@
test-integration test-integration-readonly \
test-e2e-deps test-e2e-api test-e2e-ui test-e2e-wg test-e2e \
reset-test-admin-pass \
show-admin-password reset-admin-password \
show-routes add-peer list-peers
# Detect docker compose command (v2 plugin preferred, fallback to v1 standalone)
@@ -54,6 +55,8 @@ help:
@echo " backup - Backup config + data to backups/"
@echo " restore - List available backups"
@echo " clean - Remove containers and volumes (keeps config/data dirs)"
@echo " show-admin-password - Print the admin password (reads setup file or prompts to reset)"
@echo " reset-admin-password - Generate a new random admin password and print it"
@echo ""
@echo "Tests:"
@echo " test - Run all tests"
@@ -271,6 +274,14 @@ ifndef PIC_TEST_ADMIN_PASS
endif
python3 scripts/reset_admin_password.py "$(PIC_TEST_ADMIN_PASS)"
# ── Admin password management ──────────────────────────────────────────────────
show-admin-password:
@python3 scripts/reset_admin_password.py --show
reset-admin-password:
@python3 scripts/reset_admin_password.py --generate
test-phase1:
cd api && python3 -m pytest tests/test_network_manager.py tests/test_phase1_endpoints.py -v