summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-11 11:05:55 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-11 15:46:53 +0100
commit57bdfc8349b3c8a727d6f439e1fd12661bc00a15 (patch)
tree9682a32b7feb2f6ac7429f01bcca6ac77327a8d3 /lib
parent7adfd21a66846ebb907bdcfd411e00670d70fa06 (diff)
Standardized XDS config file name and location.
- config file name is : agent-config.json - xds-agent settings under user's home is: $HOME/.xds/agent - xds-agent settings under etc is: /etc/xds/agent Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib')
-rw-r--r--lib/agent/agent.go2
-rw-r--r--lib/syncthing/st.go2
-rw-r--r--lib/xdsconfig/configfile.go4
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/agent/agent.go b/lib/agent/agent.go
index 58a2ba0..a562e77 100644
--- a/lib/agent/agent.go
+++ b/lib/agent/agent.go
@@ -132,7 +132,7 @@ func (ctx *Context) Run() (int, error) {
ctx._logPrint("Logging file for HTTP requests: %s\n", logFileHTTPReq)
}
- // Create syncthing instance when section "syncthing" is present in config.json
+ // Create syncthing instance when section "syncthing" is present in agent-config.json
if ctx.Config.FileConf.SThgConf != nil {
ctx.SThg = st.NewSyncThing(ctx.Config, ctx.Log)
}
diff --git a/lib/syncthing/st.go b/lib/syncthing/st.go
index ac1e99d..c4b72c5 100644
--- a/lib/syncthing/st.go
+++ b/lib/syncthing/st.go
@@ -278,7 +278,7 @@ func (s *SyncThing) Start() (*exec.Cmd, error) {
*/
s.STCmd, err = s.startProc("syncthing", args, env, &s.exitSTChan)
- // Use autogenerated apikey if not set by config.json
+ // Use autogenerated apikey if not set by agent-config.json
if err == nil && s.APIKey == "" {
if fd, err := os.Open(filepath.Join(s.Home, "config.xml")); err == nil {
defer fd.Close()
diff --git a/lib/xdsconfig/configfile.go b/lib/xdsconfig/configfile.go
index 71870d0..c252073 100644
--- a/lib/xdsconfig/configfile.go
+++ b/lib/xdsconfig/configfile.go
@@ -55,7 +55,7 @@ type FileConfig struct {
// Order to determine which config file is used:
// 1/ from command line option: "--config myConfig.json"
// 2/ $HOME/.xds/agent/agent-config.json file
-// 3/ /etc/xds-agent/config.json file
+// 3/ /etc/xds/agent/agent-config.json file
func readGlobalConfig(c *Config, confFile string) error {
@@ -67,7 +67,7 @@ func readGlobalConfig(c *Config, confFile string) error {
searchIn = append(searchIn, path.Join(homeDir, ".xds", "agent", "agent-config.json"))
}
- searchIn = append(searchIn, "/etc/xds-agent/agent-config.json")
+ searchIn = append(searchIn, "/etc/xds/agent/agent-config.json")
var cFile *string
for _, p := range searchIn {