04/27 Updated documents
This commit is contained in:
@@ -26,7 +26,7 @@ A production-grade web application for managing janitorial service contracts, fa
|
||||
| ORM / Migrations | SQLAlchemy + Alembic |
|
||||
| Auth (web) | Flask-Login + Flask-WTF (CSRF) |
|
||||
| Auth (API) | JWT + opaque refresh tokens |
|
||||
| Rate limiting | Flask-Limiter |
|
||||
| Rate limiting | Flask-Limiter (Redis-backed in production; in-process fallback for dev) |
|
||||
| Email | Flask-Mail (SMTP) |
|
||||
| PDF | ReportLab |
|
||||
| Frontend | Bootstrap 5, Chart.js, Jinja2 |
|
||||
@@ -88,6 +88,9 @@ MAIL_DEFAULT_SENDER=noreply@example.com
|
||||
# Application
|
||||
APP_BASE_URL=https://your-domain.com
|
||||
DIGEST_SECRET=<random-secret-for-cron-auth>
|
||||
|
||||
# Rate limiting (optional — recommended for production multi-worker deployments)
|
||||
# REDIS_URL=redis://127.0.0.1:6379/0
|
||||
```
|
||||
|
||||
> **Email SSL:** Port 465 uses implicit SSL; port 587 uses STARTTLS. The application auto-detects based on `MAIL_PORT` — never set both flags to True.
|
||||
@@ -118,7 +121,7 @@ gunicorn -c gunicorn_config.py wsgi:app
|
||||
|
||||
The included `gunicorn_config.py` binds to `127.0.0.1:8000` with sync workers. Log files are written to `/home/jqc/logs/`.
|
||||
|
||||
> **Rate limiting note:** Flask-Limiter uses in-process memory storage by default. With multiple Gunicorn workers each process maintains its own counter. For accurate shared-state enforcement across workers, set `storage_uri = 'redis://localhost:6379'` in `app/__init__.py` and install Redis.
|
||||
> **Rate limiting:** Flask-Limiter uses Redis when `REDIS_URL` is set in the environment, falling back to in-process memory for local development. In production with multiple Gunicorn workers, set `REDIS_URL=redis://127.0.0.1:6379/0` so rate-limit counters are shared across all workers. The `redis` package is included in `requirements.txt`.
|
||||
|
||||
### Nginx (recommended configuration)
|
||||
|
||||
@@ -286,6 +289,7 @@ flask db downgrade
|
||||
| `APP_BASE_URL` | `""` | Base URL for links in emails |
|
||||
| `DIGEST_SECRET` | — | Authenticates all cron endpoints |
|
||||
| `MAX_CONTENT_LENGTH` | `50MB` | Maximum upload size per request |
|
||||
| `REDIS_URL` | — | Redis connection URI for shared rate-limit storage; optional but recommended in production |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user