mirror of
https://github.com/Mailu/Mailu.git
synced 2025-03-31 21:55:23 +02:00
Make it possible to opt out of statistics
This commit is contained in:
parent
45902ae012
commit
6eaffd514d
@ -41,7 +41,8 @@ default_config = {
|
|||||||
'PASSWORD_SCHEME': 'SHA512-CRYPT',
|
'PASSWORD_SCHEME': 'SHA512-CRYPT',
|
||||||
'WEBMAIL': 'none',
|
'WEBMAIL': 'none',
|
||||||
'AUTH_RATELIMIT': '10/minute;1000/hour',
|
'AUTH_RATELIMIT': '10/minute;1000/hour',
|
||||||
'RATELIMIT_STORAGE_URL': 'redis://redis'
|
'RATELIMIT_STORAGE_URL': 'redis://redis',
|
||||||
|
'DISABLE_STATISTICS': 'False'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load configuration from the environment if available
|
# Load configuration from the environment if available
|
||||||
@ -62,6 +63,7 @@ else:
|
|||||||
instance_id = str(uuid.uuid4())
|
instance_id = str(uuid.uuid4())
|
||||||
with open(app.config["INSTANCE_ID_PATH"], "w") as handle:
|
with open(app.config["INSTANCE_ID_PATH"], "w") as handle:
|
||||||
handle.write(instance_id)
|
handle.write(instance_id)
|
||||||
|
if app.config["DISABLE_STATISTICS"].lower() != "true":
|
||||||
try:
|
try:
|
||||||
socket.gethostbyname(app.config["STATS_ENDPOINT"].format(instance_id))
|
socket.gethostbyname(app.config["STATS_ENDPOINT"].format(instance_id))
|
||||||
except:
|
except:
|
||||||
|
@ -36,6 +36,9 @@ TLS_FLAVOR=cert
|
|||||||
# Authentication rate limit (per source IP address)
|
# Authentication rate limit (per source IP address)
|
||||||
AUTH_RATELIMIT=10/minute;1000/hour
|
AUTH_RATELIMIT=10/minute;1000/hour
|
||||||
|
|
||||||
|
# Opt-out of statistics, replace with "True" to opt out
|
||||||
|
DISABLE_STATISTICS=False
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
# Optional features
|
# Optional features
|
||||||
###################################
|
###################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user