- Add orientation parameter support to create_group and edit_group functions - Fix manage_group.html template URL endpoint from 'update_group_content_order' to 'update_group_content_order_route' - Add orientation field and filtering to edit_group.html template with JavaScript functionality - Update group_player_management.py to handle orientation validation in create and edit operations - Fix docker-compose.yml to include build directive and correct volume paths - Update entrypoint.sh to handle fresh deployments without migrations - Ensure orientation consistency across group and player management These changes resolve: - Internal Server Error on manage_group page - Missing orientation parameter in group creation/editing - Template URL endpoint mismatches - Docker deployment issues with fresh installations
29 lines
1002 B
Bash
Executable File
29 lines
1002 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Create necessary directories
|
|
mkdir -p static/uploads static/resurse
|
|
mkdir -p instance
|
|
|
|
# Check if database exists
|
|
if [ ! -f instance/dashboard.db ]; then
|
|
echo "No database found, creating fresh database..."
|
|
|
|
# Create admin user if environment variables are set
|
|
if [ -n "$ADMIN_USER" ] && [ -n "$ADMIN_PASSWORD" ]; then
|
|
echo "Creating admin user: $ADMIN_USER"
|
|
flask create-admin --username "$ADMIN_USER" --password "$ADMIN_PASSWORD"
|
|
else
|
|
echo "Warning: ADMIN_USER or ADMIN_PASSWORD not set, skipping admin creation"
|
|
fi
|
|
else
|
|
echo "Existing database found, skipping initialization..."
|
|
echo "Creating admin user if needed..."
|
|
if [ -n "$ADMIN_USER" ] && [ -n "$ADMIN_PASSWORD" ]; then
|
|
flask create-admin --username "$ADMIN_USER" --password "$ADMIN_PASSWORD" 2>/dev/null || echo "Default user '$ADMIN_USER' already exists."
|
|
fi
|
|
fi
|
|
|
|
echo "Starting DigiServer..."
|
|
# Start the application
|
|
exec flask run --host=0.0.0.0 |