feat(config): add pool_domain and upgrade dependencies
- Add configurable pool_domain with pool.ntp.org default - Update Go from 1.23.5 to 1.24.0 - Update golang.org/x/* dependencies - Add enumer and accessory as tool dependencies - Update goreleaser to v2.12.3
This commit is contained in:
@@ -39,6 +39,8 @@ type Config struct {
|
||||
webHostnames []string
|
||||
webTLS bool
|
||||
|
||||
poolDomain string `accessor:"getter"`
|
||||
|
||||
valid bool `accessor:"getter"`
|
||||
}
|
||||
|
||||
@@ -52,6 +54,7 @@ type Config struct {
|
||||
// - web_hostname: Comma-separated web hostnames (first becomes primary)
|
||||
// - manage_tls: Management interface TLS setting
|
||||
// - web_tls: Web interface TLS setting
|
||||
// - pool_domain: NTP pool domain (default: pool.ntp.org)
|
||||
func New() *Config {
|
||||
c := Config{}
|
||||
c.deploymentMode = os.Getenv("deployment_mode")
|
||||
@@ -69,6 +72,11 @@ func New() *Config {
|
||||
c.manageTLS = parseBool(os.Getenv("manage_tls"))
|
||||
c.webTLS = parseBool(os.Getenv("web_tls"))
|
||||
|
||||
c.poolDomain = os.Getenv("pool_domain")
|
||||
if c.poolDomain == "" {
|
||||
c.poolDomain = "pool.ntp.org"
|
||||
}
|
||||
|
||||
return &c
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,13 @@ func (c *Config) WebHostname() string {
|
||||
return c.webHostname
|
||||
}
|
||||
|
||||
func (c *Config) PoolDomain() string {
|
||||
if c == nil {
|
||||
return ""
|
||||
}
|
||||
return c.poolDomain
|
||||
}
|
||||
|
||||
func (c *Config) Valid() bool {
|
||||
if c == nil {
|
||||
return false
|
||||
|
Reference in New Issue
Block a user