Restore config layout with 0.1.7 default
This commit is contained in:
@@ -19,7 +19,6 @@ type Config struct {
|
||||
N8N N8NConfig `envconfig:"n8n"`
|
||||
OpenTelemetry OpenTelemetryConfig `envconfig:"opentelemetry"`
|
||||
Composer ComposerConfig `envconfig:"composer"`
|
||||
TaskAnnouncer TaskAnnouncerConfig `envconfig:"task_announcer"`
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
@@ -45,6 +44,7 @@ type DatabaseConfig struct {
|
||||
MaxIdleConns int `envconfig:"DB_MAX_IDLE_CONNS" default:"5"`
|
||||
}
|
||||
|
||||
|
||||
type GITEAConfig struct {
|
||||
BaseURL string `envconfig:"BASE_URL" required:"true"`
|
||||
Token string `envconfig:"TOKEN"`
|
||||
@@ -125,16 +125,6 @@ type ComposerConfig struct {
|
||||
SkillMatchThreshold float64 `envconfig:"SKILL_MATCH_THRESHOLD" default:"0.6"`
|
||||
}
|
||||
|
||||
type TaskAnnouncerConfig struct {
|
||||
Enabled bool `envconfig:"ENABLED" default:"false"`
|
||||
Interval time.Duration `envconfig:"INTERVAL" default:"2m"`
|
||||
ListenAddresses []string `envconfig:"LISTEN_ADDRESSES" default:"/ip4/0.0.0.0/tcp/0"`
|
||||
BootstrapPeers []string `envconfig:"BOOTSTRAP_PEERS"`
|
||||
MonitorLabels []string `envconfig:"MONITOR_LABELS" default:"bzzz-task"`
|
||||
ReannounceAfter time.Duration `envconfig:"REANNOUNCE_AFTER" default:"12h"`
|
||||
NodeID string `envconfig:"NODE_ID" default:"whoosh-task-announcer"`
|
||||
}
|
||||
|
||||
func readSecretFile(filePath string) (string, error) {
|
||||
if filePath == "" {
|
||||
return "", nil
|
||||
@@ -158,6 +148,7 @@ func (c *Config) loadSecrets() error {
|
||||
c.Database.Password = password
|
||||
}
|
||||
|
||||
|
||||
// Load GITEA token from file if specified
|
||||
if c.GITEA.TokenFile != "" {
|
||||
token, err := readSecretFile(c.GITEA.TokenFile)
|
||||
|
||||
Reference in New Issue
Block a user