Prune unverified accounts
This commit is contained in:
@@ -39,8 +39,16 @@ docker-compose up
|
||||
|
||||
# Debug mode with hot-reload
|
||||
docker-compose -f docker-compose.debug.yml up
|
||||
|
||||
# Manual cleanup of unverified accounts
|
||||
docker exec timetrack-timetrack-1 python cleanup_unverified_accounts.py
|
||||
|
||||
# Dry run to see what would be deleted
|
||||
docker exec timetrack-timetrack-1 python cleanup_unverified_accounts.py --dry-run
|
||||
```
|
||||
|
||||
**Note:** Unverified accounts are automatically cleaned up every hour via cron job in the Docker container.
|
||||
|
||||
## Database Operations
|
||||
|
||||
### Flask-Migrate Commands
|
||||
@@ -187,6 +195,7 @@ When modifying billing/invoice features:
|
||||
- Two-factor authentication (2FA) using TOTP
|
||||
- Session-based authentication with "Remember Me" option
|
||||
- Email verification for new accounts (configurable)
|
||||
- Automatic cleanup of unverified accounts after 24 hours
|
||||
|
||||
### Mobile UI Features
|
||||
- Progressive Web App (PWA) manifest for installability
|
||||
|
||||
@@ -14,6 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
python3-dev \
|
||||
postgresql-client \
|
||||
cron \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -35,6 +36,12 @@ RUN pip install gunicorn==21.2.0
|
||||
# Copy the rest of the application
|
||||
COPY . .
|
||||
|
||||
# Setup cron job for cleanup
|
||||
COPY docker-cron /etc/cron.d/cleanup-cron
|
||||
RUN chmod 0644 /etc/cron.d/cleanup-cron && \
|
||||
crontab /etc/cron.d/cleanup-cron && \
|
||||
touch /var/log/cron.log
|
||||
|
||||
# Create the SQLite database directory with proper permissions
|
||||
RUN mkdir -p /app/instance && chmod 777 /app/instance
|
||||
|
||||
|
||||
@@ -73,6 +73,16 @@ if [ -f "migrations_old/run_postgres_migrations.py" ]; then
|
||||
echo "Found old migration system. Consider removing after confirming Flask-Migrate is working."
|
||||
fi
|
||||
|
||||
# Start cron service for scheduled tasks
|
||||
echo ""
|
||||
echo "=== Starting Cron Service ==="
|
||||
service cron start
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Cron service started for scheduled cleanup tasks"
|
||||
else
|
||||
echo "⚠️ Failed to start cron service, cleanup tasks won't run automatically"
|
||||
fi
|
||||
|
||||
# Start the Flask application with gunicorn
|
||||
echo ""
|
||||
echo "=== Starting Application ==="
|
||||
|
||||
Reference in New Issue
Block a user