feat(stats): add dashboard analytics

This commit is contained in:
Aethersailor
2026-05-26 09:24:48 +08:00
parent 91969356ea
commit 91f0287751
22 changed files with 1391 additions and 40 deletions

View File

@@ -164,6 +164,18 @@ profile=lan
;Environment override: SUBCONVERTER_ALLOW_PUBLIC_UPLOAD=true|false
allow_public_upload=false
[statistics]
;Opt-in runtime statistics and /dashboard. Missing or false keeps it disabled.
enabled=false
;Put this directory on a Docker volume if statistics should survive restarts.
data_dir=stats
;Minimum seconds between persistence writes.
flush_interval=5
;header uses country-only headers such as CF-IPCountry and never stores IPs.
;none records all countries as unknown.
geo_provider=header
country_headers=CF-IPCountry,X-Geo-Country,X-Vercel-IP-Country,CloudFront-Viewer-Country
[emojis]
add_emoji=false
remove_old_emoji=true

View File

@@ -183,6 +183,21 @@ profile = "lan"
# Environment override: SUBCONVERTER_ALLOW_PUBLIC_UPLOAD=true|false
allow_public_upload = false
[statistics]
# Opt-in runtime statistics and /dashboard. Missing or false keeps it disabled
# and avoids registering the dashboard or statistics-enabled request handler.
enabled = false
# Put this directory on a Docker volume if statistics should survive restarts.
data_dir = "stats"
# Minimum seconds between persistence writes.
flush_interval = 5
[statistics.geo]
# header uses country-only headers such as CF-IPCountry and never stores IPs.
# none records all countries as unknown.
provider = "header"
country_headers = ["CF-IPCountry", "X-Geo-Country", "X-Vercel-IP-Country", "CloudFront-Viewer-Country"]
[emojis]
add_emoji = false
remove_old_emoji = true

View File

@@ -83,6 +83,19 @@ security:
# Environment override: SUBCONVERTER_ALLOW_PUBLIC_UPLOAD=true|false
allow_public_upload: false
statistics:
# Opt-in runtime statistics and /dashboard. Missing or false keeps it disabled.
enabled: false
# Put this directory on a Docker volume if statistics should survive restarts.
data_dir: stats
# Minimum seconds between persistence writes.
flush_interval: 5
geo:
# header uses country-only headers such as CF-IPCountry and never stores IPs.
# none records all countries as unknown.
provider: header
country_headers: ["CF-IPCountry", "X-Geo-Country", "X-Vercel-IP-Country", "CloudFront-Viewer-Country"]
emojis:
add_emoji: false
remove_old_emoji: true