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:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -2,8 +2,9 @@
|
|||||||
venv/
|
venv/
|
||||||
.venv/
|
.venv/
|
||||||
|
|
||||||
# Flask instance folder
|
# Flask instance folder - keep the folder but ignore sensitive files
|
||||||
instance/
|
instance/flask_secret_key
|
||||||
|
instance/*.log
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
__pycache__/
|
__pycache__/
|
||||||
@@ -12,8 +13,7 @@ __pycache__/
|
|||||||
*.pyd
|
*.pyd
|
||||||
.Python
|
.Python
|
||||||
|
|
||||||
# Database files
|
# Database WAL files (keep main .db file)
|
||||||
*.db
|
|
||||||
*.db-shm
|
*.db-shm
|
||||||
*.db-wal
|
*.db-wal
|
||||||
|
|
||||||
|
|||||||
2
instance/README.md
Normal file
2
instance/README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# This file will be generated automatically on each server
|
||||||
|
# Run: python -c "import secrets; print(secrets.token_hex(32))" > instance/flask_secret_key
|
||||||
BIN
instance/quotes.db
Normal file
BIN
instance/quotes.db
Normal file
Binary file not shown.
21
setup.sh
21
setup.sh
@@ -5,17 +5,19 @@
|
|||||||
|
|
||||||
echo "Setting up ircquotes on production server..."
|
echo "Setting up ircquotes on production server..."
|
||||||
|
|
||||||
# Create instance directory
|
# Instance directory should already exist from git
|
||||||
echo "Creating instance directory..."
|
# But create it if it doesn't
|
||||||
mkdir -p instance
|
mkdir -p instance
|
||||||
|
|
||||||
# Generate secret key
|
# Generate secret key
|
||||||
echo "Generating Flask secret key..."
|
echo "Generating Flask secret key..."
|
||||||
python3 -c "import secrets; print(secrets.token_hex(32))" > instance/flask_secret_key
|
python3 -c "import secrets; print(secrets.token_hex(32))" > instance/flask_secret_key
|
||||||
|
|
||||||
# Create empty database file
|
# Create empty database file if it doesn't exist
|
||||||
echo "Creating database file..."
|
if [ ! -f "instance/quotes.db" ]; then
|
||||||
touch instance/quotes.db
|
echo "Creating database file..."
|
||||||
|
touch instance/quotes.db
|
||||||
|
fi
|
||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
echo "Setting file 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.username 'yourusername'"
|
||||||
echo " python config_manager.py admin.password_hash 'generated_hash'"
|
echo " python config_manager.py admin.password_hash 'generated_hash'"
|
||||||
echo ""
|
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 " source .venv/bin/activate"
|
||||||
echo " gunicorn --config gunicorn.conf.py app:app"
|
echo " gunicorn --config gunicorn.conf.py app:app"
|
||||||
echo ""
|
echo ""
|
||||||
echo "3. Or run in development mode:"
|
echo "4. Or run in development mode:"
|
||||||
echo " python app.py"
|
echo " python app.py"
|
||||||
Reference in New Issue
Block a user