Restore config layout with 0.1.7 default
This commit is contained in:
@@ -19,7 +19,6 @@ type Config struct {
|
|||||||
N8N N8NConfig `envconfig:"n8n"`
|
N8N N8NConfig `envconfig:"n8n"`
|
||||||
OpenTelemetry OpenTelemetryConfig `envconfig:"opentelemetry"`
|
OpenTelemetry OpenTelemetryConfig `envconfig:"opentelemetry"`
|
||||||
Composer ComposerConfig `envconfig:"composer"`
|
Composer ComposerConfig `envconfig:"composer"`
|
||||||
TaskAnnouncer TaskAnnouncerConfig `envconfig:"task_announcer"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServerConfig struct {
|
type ServerConfig struct {
|
||||||
@@ -45,6 +44,7 @@ type DatabaseConfig struct {
|
|||||||
MaxIdleConns int `envconfig:"DB_MAX_IDLE_CONNS" default:"5"`
|
MaxIdleConns int `envconfig:"DB_MAX_IDLE_CONNS" default:"5"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type GITEAConfig struct {
|
type GITEAConfig struct {
|
||||||
BaseURL string `envconfig:"BASE_URL" required:"true"`
|
BaseURL string `envconfig:"BASE_URL" required:"true"`
|
||||||
Token string `envconfig:"TOKEN"`
|
Token string `envconfig:"TOKEN"`
|
||||||
@@ -125,16 +125,6 @@ type ComposerConfig struct {
|
|||||||
SkillMatchThreshold float64 `envconfig:"SKILL_MATCH_THRESHOLD" default:"0.6"`
|
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) {
|
func readSecretFile(filePath string) (string, error) {
|
||||||
if filePath == "" {
|
if filePath == "" {
|
||||||
return "", nil
|
return "", nil
|
||||||
@@ -158,6 +148,7 @@ func (c *Config) loadSecrets() error {
|
|||||||
c.Database.Password = password
|
c.Database.Password = password
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Load GITEA token from file if specified
|
// Load GITEA token from file if specified
|
||||||
if c.GITEA.TokenFile != "" {
|
if c.GITEA.TokenFile != "" {
|
||||||
token, err := readSecretFile(c.GITEA.TokenFile)
|
token, err := readSecretFile(c.GITEA.TokenFile)
|
||||||
|
|||||||
Reference in New Issue
Block a user