mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-21 19:24:37 +02:00
Merge yaml files instead?
This commit is contained in:
parent
5f95500b6f
commit
f59f0ee57d
2 changed files with 82 additions and 122 deletions
|
@ -33,23 +33,23 @@ func installCrowdsec(config Config) error {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := copyWebsecureEntryPoint("config/crowdsec/traefik_config.yml", "config/traefik/traefik_config.yml"); err != nil {
|
||||
if err := MergeYAML("config/traefik/traefik_config.yml", "config/crowdsec/traefik_config.yml"); err != nil {
|
||||
fmt.Printf("Error copying entry points: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
// delete the 2nd file
|
||||
if err := os.Remove("config/crowdsec/traefik_config.yml"); err != nil {
|
||||
fmt.Printf("Error removing file: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := copyEntryPoints("config/traefik/traefik_config.yml", "config/crowdsec/traefik_config.yml"); err != nil {
|
||||
if err := MergeYAML("config/traefik/dynamic_config.yml", "config/crowdsec/dynamic_config.yml"); err != nil {
|
||||
fmt.Printf("Error copying entry points: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := moveFile("config/crowdsec/traefik_config.yml", "config/traefik/traefik_config.yml"); err != nil {
|
||||
fmt.Printf("Error moving file: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := moveFile("config/crowdsec/dynamic_config.yml", "config/traefik/dynamic_config.yml"); err != nil {
|
||||
fmt.Printf("Error moving file: %v\n", err)
|
||||
// delete the 2nd file
|
||||
if err := os.Remove("config/crowdsec/dynamic_config.yml"); err != nil {
|
||||
fmt.Printf("Error removing file: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue