d31f783c13
- 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>
38 lines
932 B
Bash
Executable File
38 lines
932 B
Bash
Executable File
#!/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 "" |