add tiered auto-expiry based on auth level
This commit is contained in:
@@ -22,10 +22,17 @@ class Config:
|
||||
MAX_PASTE_SIZE_AUTH = int(os.environ.get("FLASKPASTE_MAX_AUTH", 50 * 1024 * 1024)) # 50MiB
|
||||
MAX_CONTENT_LENGTH = MAX_PASTE_SIZE_AUTH # Flask request limit
|
||||
|
||||
# Paste expiry (default 5 days)
|
||||
PASTE_EXPIRY_SECONDS = int(os.environ.get("FLASKPASTE_EXPIRY", 5 * 24 * 60 * 60))
|
||||
# Maximum custom expiry (default 30 days, 0 = use default expiry as max)
|
||||
MAX_EXPIRY_SECONDS = int(os.environ.get("FLASKPASTE_MAX_EXPIRY", 30 * 24 * 60 * 60))
|
||||
# Paste expiry (tiered by authentication level)
|
||||
# Anonymous users: shortest expiry (default 1 day)
|
||||
EXPIRY_ANON = int(os.environ.get("FLASKPASTE_EXPIRY_ANON", 1 * 24 * 60 * 60))
|
||||
# Untrusted certs (authenticated but not registered): medium expiry (default 7 days)
|
||||
EXPIRY_UNTRUSTED = int(os.environ.get("FLASKPASTE_EXPIRY_UNTRUSTED", 7 * 24 * 60 * 60))
|
||||
# Trusted certs (registered in PKI): longest expiry (default 30 days, 0 = no expiry)
|
||||
EXPIRY_TRUSTED = int(os.environ.get("FLASKPASTE_EXPIRY_TRUSTED", 30 * 24 * 60 * 60))
|
||||
# Maximum custom expiry (default 90 days, 0 = unlimited for trusted)
|
||||
MAX_EXPIRY_SECONDS = int(os.environ.get("FLASKPASTE_MAX_EXPIRY", 90 * 24 * 60 * 60))
|
||||
# Legacy alias for backwards compatibility
|
||||
PASTE_EXPIRY_SECONDS = EXPIRY_ANON
|
||||
|
||||
# Content deduplication / abuse prevention
|
||||
# Throttle repeated submissions of identical content
|
||||
|
||||
Reference in New Issue
Block a user