feat: Auto-generate admin password from project folder name

Changes:
- Removed --admin-password argument (no longer needed)
- Password auto-generated: folder_name.lower().replace(' ', '')
- Each website has unique password
- No need to ask user for password

Examples:
- moreminimore → password: moreminimore
- My Website → password: mywebsite
- deal-plustech → password: deal-plustech

Benefits:
- Simple (same as folder name)
- Secure (different per project)
- No password management needed
- Not stored in git (in .env)
This commit is contained in:
Kunthawat Greethong
2026-03-12 09:53:17 +07:00
parent 61321669d1
commit 6e183c584b
3 changed files with 123 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ UMAMI_DOMAIN=analytics.example.com
# Admin Dashboard
# Change this before deploying to production!
ADMIN_PASSWORD=changeme
ADMIN_PASSWORD=(auto-generated from folder name)
# Database (Optional - for production with Turso)
# ASTRO_DB_REMOTE_URL=libsql://your-db.turso.io

View File

@@ -250,8 +250,6 @@ def main():
help='Umami Website ID')
parser.add_argument('--umami-domain', default='analytics.example.com',
help='Umami domain')
parser.add_argument('--admin-password', default='changeme',
help='Admin password for consent logs')
parser.add_argument('--output', '-o', default='.',
help='Output directory')
parser.add_argument('--no-interactive', action='store_true',
@@ -259,6 +257,9 @@ def main():
args = parser.parse_args()
# Auto-generate admin password from project folder name
args.admin_password = Path(args.output).name.replace(' ', '').lower()
# Load unified credentials
from dotenv import load_dotenv
load_dotenv(os.path.join(os.path.dirname(__file__), '../../../.env'))