From a3e6edf9c783fdfbe24c294a49718b0b3b07a2ce Mon Sep 17 00:00:00 2001 From: John Maguire Date: Mon, 19 Dec 2022 12:45:15 -0500 Subject: [PATCH] Use config.yml consistently (not config.yaml) (#789) --- README.md | 4 ++-- cmd/nebula-service/service.go | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc79f6d..0b110a7 100644 --- a/README.md +++ b/README.md @@ -93,13 +93,13 @@ Download a copy of the nebula [example configuration](https://github.com/slackhq #### 6. Copy nebula credentials, configuration, and binaries to each host -For each host, copy the nebula binary to the host, along with `config.yaml` from step 5, and the files `ca.crt`, `{host}.crt`, and `{host}.key` from step 4. +For each host, copy the nebula binary to the host, along with `config.yml` from step 5, and the files `ca.crt`, `{host}.crt`, and `{host}.key` from step 4. **DO NOT COPY `ca.key` TO INDIVIDUAL NODES.** #### 7. Run nebula on each host ``` -./nebula -config /path/to/config.yaml +./nebula -config /path/to/config.yml ``` ## Building Nebula from source diff --git a/cmd/nebula-service/service.go b/cmd/nebula-service/service.go index 591e8e7..a54fb0f 100644 --- a/cmd/nebula-service/service.go +++ b/cmd/nebula-service/service.go @@ -49,6 +49,14 @@ func (p *program) Stop(s service.Service) error { return nil } +func fileExists(filename string) bool { + _, err := os.Stat(filename) + if os.IsNotExist(err) { + return false + } + return true +} + func doService(configPath *string, configTest *bool, build string, serviceFlag *string) { if *configPath == "" { ex, err := os.Executable() @@ -56,6 +64,9 @@ func doService(configPath *string, configTest *bool, build string, serviceFlag * panic(err) } *configPath = filepath.Dir(ex) + "/config.yaml" + if !fileExists(*configPath) { + *configPath = filepath.Dir(ex) + "/config.yml" + } } svcConfig := &service.Config{