init
This commit is contained in:
24
configs/config.example.toml
Normal file
24
configs/config.example.toml
Normal file
@@ -0,0 +1,24 @@
|
||||
# 全局配置,适用于所有 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"
|
||||
Domain = "docker.hub.local"
|
||||
Upstream = "https://registry-1.docker.io"
|
||||
Proxy = ""
|
||||
Type = "docker" # 必填:docker|npm|go
|
||||
Username = "" # 可选:若填写需与 Password 同时出现
|
||||
Password = ""
|
||||
CacheTTL = 43200 # 可选: 覆盖全局缓存 TTL(秒)
|
||||
EnableHeadCheck = true
|
||||
21
configs/docker.sample.toml
Normal file
21
configs/docker.sample.toml
Normal file
@@ -0,0 +1,21 @@
|
||||
# Docker Hub 代理示例配置
|
||||
# 使用前请在 /etc/hosts 中为 docker.hub.local 配置 127.0.0.1,
|
||||
# 并根据需要调整 StoragePath/ListenPort 等字段。
|
||||
|
||||
ListenPort = 5000
|
||||
LogLevel = "info"
|
||||
LogFilePath = "./logs/docker-proxy.log"
|
||||
StoragePath = "./storage/docker"
|
||||
CacheTTL = 86400
|
||||
UpstreamTimeout = "30s"
|
||||
|
||||
[[Hub]]
|
||||
Name = "docker"
|
||||
Domain = "docker.hub.local"
|
||||
Upstream = "https://registry-1.docker.io"
|
||||
Proxy = ""
|
||||
Type = "docker" # docker|npm|go
|
||||
Username = ""
|
||||
Password = ""
|
||||
CacheTTL = 43200
|
||||
EnableHeadCheck = true
|
||||
21
configs/npm.sample.toml
Normal file
21
configs/npm.sample.toml
Normal file
@@ -0,0 +1,21 @@
|
||||
# NPM Registry 代理示例配置
|
||||
# 使用前请在 /etc/hosts 中为 npm.hub.local 配置 127.0.0.1,
|
||||
# 并根据需要调整 StoragePath/ListenPort 等字段。
|
||||
|
||||
ListenPort = 5000
|
||||
LogLevel = "info"
|
||||
LogFilePath = "./logs/npm-proxy.log"
|
||||
StoragePath = "./storage/npm"
|
||||
CacheTTL = 86400
|
||||
UpstreamTimeout = "30s"
|
||||
|
||||
[[Hub]]
|
||||
Name = "npm"
|
||||
Domain = "npm.hub.local"
|
||||
Upstream = "https://registry.npmjs.org"
|
||||
Proxy = ""
|
||||
Type = "npm" # docker|npm|go
|
||||
Username = ""
|
||||
Password = ""
|
||||
CacheTTL = 43200
|
||||
EnableHeadCheck = false
|
||||
Reference in New Issue
Block a user