Files
any-hub/configs/config.example.toml
Rogee 40c6f2fcce fix: align cache controls with config
Remove unused head-check config, make TTL overrides explicit, and tighten revalidation to avoid stale cache behavior.
2026-01-26 15:55:03 +08:00

51 lines
1.2 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 全局配置,适用于所有 Hub
ListenPort = 5000 # 所有 Hub 共享的监听端口
LogLevel = "info"
LogFilePath = "./logs/any-hub.log"
LogMaxSize = 100
LogMaxBackups = 10
LogCompress = true
StoragePath = "./storage" # 磁盘缓存根目录,按 Hub/路径 划分
CacheTTL = 86400 # 全局缓存 TTL用于判断命中/过期
MaxMemoryCacheSize = 268435456 # 256MB
MaxRetries = 3
InitialBackoff = "1s"
UpstreamTimeout = "30s"
[[Hub]]
Name = "docker-cache"
Domain = "docker.hub.local"
Upstream = "https://registry-1.docker.io"
Proxy = ""
Type = "docker"
Username = ""
Password = ""
CacheTTL = 43200
[[Hub]]
Name = "composer-cache"
Domain = "composer.hub.local"
Upstream = "https://repo.packagist.org"
Type = "composer"
CacheTTL = 21600
[[Hub]]
Name = "legacy-fallback"
Domain = "legacy.hub.local"
Upstream = "https://registry.npmjs.org"
Type = "npm"
# Debian/Ubuntu APT 示例
[[Hub]]
Name = "apt-cache"
Domain = "apt.hub.local"
Upstream = "https://mirrors.edge.kernel.org/ubuntu"
Type = "debian"
# Alpine APK 示例
[[Hub]]
Name = "apk-cache"
Domain = "apk.hub.local"
Upstream = "https://dl-cdn.alpinelinux.org/alpine"
Type = "apk"