feat: Add admin password management tools and debug logging

- Add setAdminPassword.js utility for setting password inside container
- Add set-admin-password.sh for easy Docker exec password setting
- Add reset-to-default-password.sh for quick testing (sets to admin123)
- Add debug logging to password verification for troubleshooting
- Improve error handling when password hash is missing

These tools make it much easier to manage the admin password without
dealing with bcrypt hash generation and .env file formatting issues.

Usage:
- Set custom password: ./scripts/set-admin-password.sh
- Reset to default: ./scripts/reset-to-default-password.sh

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-23 15:28:17 +02:00
parent 2ee293244c
commit d31f783c13
4 changed files with 196 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
set -e
echo "======================================"
echo "MinIO WebUI - Set Admin Password"
echo "======================================"
echo ""
# Check if docker-compose is running
if ! docker ps | grep -q minio-webui-backend; then
echo "❌ Error: Backend container is not running."
echo ""
echo "Please start the containers first:"
echo " docker compose -f docker-compose.dev.yml up -d"
exit 1
fi
# Determine which container name to use
if docker ps | grep -q minio-webui-backend-dev; then
CONTAINER="minio-webui-backend-dev"
else
CONTAINER="minio-webui-backend"
fi
echo "Using container: $CONTAINER"
echo ""
# Run the password setter inside the container
docker exec -it $CONTAINER node src/utils/setAdminPassword.js
echo ""
echo "Restarting backend container..."
docker restart $CONTAINER
echo ""
echo "✅ Backend restarted. You can now login with your new password."
echo ""