diff options
Diffstat (limited to 'contrib/webmentions-ssg.example.cfg')
| -rw-r--r-- | contrib/webmentions-ssg.example.cfg | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/contrib/webmentions-ssg.example.cfg b/contrib/webmentions-ssg.example.cfg index d92726e..d214312 100644 --- a/contrib/webmentions-ssg.example.cfg +++ b/contrib/webmentions-ssg.example.cfg @@ -15,27 +15,13 @@ BOOTSTRAP_SERVE_LOCAL = True # BOOTSTRAP_BOOTSWATCH_THEME = "Materia" # --------------------------------------------------------------------------- -# Flask / Security +# Flask / Security # --------------------------------------------------------------------------- -# Generate a persistent random key, e.g.: +# Generate a persistent random key, e.g.: # python -c 'import secrets; print(secrets.token_urlsafe(32))' # Never commit your real key or SMTP password to version control. SECRET_KEY = "REPLACE_WITH_A_LONG_RANDOM_SECRET" -# Only transmit session cookies over HTTPS connections. -# Recommended for production deployments using HTTPS. -# Set to False only when developing locally over plain HTTP. -SESSION_COOKIE_SECURE = True - -# Prevent JavaScript from accessing session cookies via document.cookie. -# Helps protect session cookies from theft through XSS attacks. -SESSION_COOKIE_HTTPONLY = True - -# Restrict session cookies to same-site requests to help mitigate CSRF. -# "Lax" allows normal navigation from external sites while restricting -# cookies on most cross-site requests. -SESSION_COOKIE_SAMESITE = "Lax" - # --------------------------------------------------------------------------- # Database and logging # --------------------------------------------------------------------------- @@ -64,6 +50,23 @@ MAX_REDIRECTS = 20 # also used for outgoing requests MAX_SOURCE_BYTES = 1_000_000 # --------------------------------------------------------------------------- +# Rate limiting +# --------------------------------------------------------------------------- +# In-memory storage is for development/testing ONLY. Production requires shared +# storage, such as Redis, or the application will refuse to start. +RATELIMIT_STORAGE_URI = "memory://" +RATELIMIT_HEADERS_ENABLED = True + +# Limits per client and across all clients for incoming Webmention submissions. +ENDPOINT_RATE_LIMIT = "10/minute;100/hour" +ENDPOINT_GLOBAL_RATE_LIMIT = "1000/hour" +# Minimum seconds between verifications of the same source/target pair. +ENDPOINT_REVERIFY_COOLDOWN_SECONDS = 600 + +# Limit login POST attempts per client. +LOGIN_RATE_LIMIT = "5/minute;30/hour" + +# --------------------------------------------------------------------------- # Sending Webmentions from a statically generated site # --------------------------------------------------------------------------- # Folder containing generated pages named index.html. Set to None to disable @@ -92,6 +95,8 @@ HUEY_URL = "redis://127.0.0.1:6379/0" # --------------------------------------------------------------------------- # Set NOTIFICATION_EMAIL = None to disable notification emails. NOTIFICATION_EMAIL = "admin@example.com" +# Daily notification digest at 08:00 UTC (Huey defaults to UTC). +NOTIFICATION_SCHEDULE = "0 8 * * *" # Example SMTP-over-STARTTLS setup; adapt to your mail provider. MAIL_SERVER = "smtp.example.com" |
