1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-06 06:26:46 +00:00

feature(worker): added worker http server config

这个提交包含在:
bigeagle
2016-04-28 10:50:51 +08:00
父节点 731fba842f
当前提交 8b56fda1e9
共有 2 个文件被更改,包括 17 次插入0 次删除

查看文件

@@ -49,6 +49,7 @@ func (p *ProviderEnum) UnmarshalText(text []byte) error {
type Config struct {
Global globalConfig `toml:"global"`
Manager managerConfig `toml:"manager"`
Server serverConfig `toml:"server"`
Mirrors []mirrorConfig `toml:"mirrors"`
}
@@ -66,6 +67,14 @@ type managerConfig struct {
Token string `toml:"token"`
}
type serverConfig struct {
Hostname string `toml:"hostname"`
Addr string `toml:"listen_addr"`
Port int `toml:"listen_port"`
SSLCert string `toml:"ssl_cert"`
SSLKey string `toml:"ssl_key"`
}
type mirrorConfig struct {
Name string `toml:"name"`
Provider ProviderEnum `toml:"provider"`

查看文件

@@ -21,6 +21,13 @@ interval = 240
api_base = "https://127.0.0.1:5000"
token = "some_token"
[server]
hostname = "worker1.example.com"
listen_addr = "127.0.0.1"
listen_port = 6000
ssl_cert = "/etc/tunasync.d/worker1.cert"
ssl_key = "/etc/tunasync.d/worker1.key"
[[mirrors]]
name = "AOSP"
provider = "command"
@@ -68,6 +75,7 @@ exclude_file = "/etc/tunasync.d/fedora-exclude.txt"
So(cfg.Global.MirrorDir, ShouldEqual, "/data/mirrors")
So(cfg.Manager.APIBase, ShouldEqual, "https://127.0.0.1:5000")
So(cfg.Server.Hostname, ShouldEqual, "worker1.example.com")
m := cfg.Mirrors[0]
So(m.Name, ShouldEqual, "AOSP")