Include instance folder in git and improve setup

- Updated .gitignore to include instance folder but exclude sensitive files
- Added instance/README.md with setup instructions
- Updated setup script with better configuration examples
- Instance folder will now be tracked in git to preserve quotes.db
This commit is contained in:
2025-09-20 20:09:15 +01:00
parent 3dbb181cb0
commit 4b31d3b9e0
4 changed files with 20 additions and 11 deletions

View File

@@ -5,17 +5,19 @@
echo "Setting up ircquotes on production server..."
# Create instance directory
echo "Creating instance directory..."
# Instance directory should already exist from git
# But create it if it doesn't
mkdir -p instance
# Generate secret key
echo "Generating Flask secret key..."
python3 -c "import secrets; print(secrets.token_hex(32))" > instance/flask_secret_key
# Create empty database file
echo "Creating database file..."
touch instance/quotes.db
# Create empty database file if it doesn't exist
if [ ! -f "instance/quotes.db" ]; then
echo "Creating database file..."
touch instance/quotes.db
fi
# Set permissions
echo "Setting file permissions..."
@@ -42,9 +44,14 @@ echo " python generate_password.py"
echo " python config_manager.py admin.username 'yourusername'"
echo " python config_manager.py admin.password_hash 'generated_hash'"
echo ""
echo "2. Start the application:"
echo "2. Configure other settings:"
echo " python config_manager.py app.port 6969"
echo " python config_manager.py quotes.min_length 1"
echo " python config_manager.py quotes.max_length 10000"
echo ""
echo "3. Start the application:"
echo " source .venv/bin/activate"
echo " gunicorn --config gunicorn.conf.py app:app"
echo ""
echo "3. Or run in development mode:"
echo "4. Or run in development mode:"
echo " python app.py"