#!/bin/bash # First-run setup - create admin user if database doesn't exist if [ ! -f "${PUFFER_DATA_DIR}/data.db" ]; then echo "First run detected - creating admin user" # Create database structure by running panel in setup mode pufferpanel run --setup-only # Manually create admin user in SQLite database sqlite3 "${PUFFER_DATA_DIR}/data.db" \ "INSERT INTO users (id, username, email, password, language, theme, admin) VALUES \ (1, '${ADMIN_USERNAME}', '${ADMIN_USERNAME}@example.com', \ '\$2a\$10\$$(openssl rand -base64 32 | tr -d '\n')', 'en', 'default', 1);" fi # Start PufferPanel echo "Starting PufferPanel on port ${PANEL_PORT}" pufferpanel run