summaryrefslogtreecommitdiffstats
path: root/lib/xdsconfig/fileconfig.go
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-10-01 11:51:47 +0200
committerClément Bénier <clement.benier@iot.bzh>2018-10-16 14:57:58 +0200
commit5e979f0ba451e64fc44ffaa8b79d714d9ad75a57 (patch)
tree6fb6ba51e034ba361fd833b482fb061d4f918da7 /lib/xdsconfig/fileconfig.go
parent4982769bd48b5c67c5eff4d9c6f297fa2a7531a4 (diff)
update xds-server package in docker
scripts/package-update: bash scripts to update xds-server package in docker monitor updates: default time is 24h, a update is tried at startup api/v1: 2 new requests: - get(updates): return various information about xds-server packages - post(updates): update xds-server packages Change-Id: I1673f7860e57cfe1d4abe5a24609ee46a90b67d8 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'lib/xdsconfig/fileconfig.go')
-rw-r--r--lib/xdsconfig/fileconfig.go26
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go
index 374afa3..a3e0cee 100644
--- a/lib/xdsconfig/fileconfig.go
+++ b/lib/xdsconfig/fileconfig.go
@@ -50,13 +50,15 @@ type SyncThingConf struct {
// FileConfig is the JSON structure of xds-server config file (server-config.json)
type FileConfig struct {
- WebAppDir string `json:"webAppDir"`
- ShareRootDir string `json:"shareRootDir"`
- SdkScriptsDir string `json:"sdkScriptsDir"`
- SdkDbUpdate string `json:"sdkDbUpdate"`
- HTTPPort string `json:"httpPort"`
- SThgConf *SyncThingConf `json:"syncthing"`
- LogsDir string `json:"logsDir"`
+ WebAppDir string `json:"webAppDir"`
+ ShareRootDir string `json:"shareRootDir"`
+ SdkScriptsDir string `json:"sdkScriptsDir"`
+ XdsUtilsScriptsDir string `json:"xdsUtilsScriptsDir"`
+ SdkDbUpdate string `json:"sdkDbUpdate"`
+ HTTPPort string `json:"httpPort"`
+ SThgConf *SyncThingConf `json:"syncthing"`
+ LogsDir string `json:"logsDir"`
+ XdsSrvUpdateTime string `json:"xdsSrvUpdateTime"`
}
// readGlobalConfig reads configuration from a config file.
@@ -118,7 +120,9 @@ func readGlobalConfig(c *Config, confFile string) error {
&fCfg.WebAppDir,
&fCfg.ShareRootDir,
&fCfg.SdkScriptsDir,
- &fCfg.LogsDir}
+ &fCfg.XdsUtilsScriptsDir,
+ &fCfg.LogsDir,
+ &fCfg.XdsSrvUpdateTime}
if fCfg.SThgConf != nil {
vars = append(vars, &fCfg.SThgConf.Home, &fCfg.SThgConf.BinDir)
}
@@ -132,6 +136,9 @@ func readGlobalConfig(c *Config, confFile string) error {
if fCfg.SdkScriptsDir == "" {
fCfg.SdkScriptsDir = c.FileConf.SdkScriptsDir
}
+ if fCfg.XdsUtilsScriptsDir == "" {
+ fCfg.XdsUtilsScriptsDir = c.FileConf.XdsUtilsScriptsDir
+ }
if fCfg.SdkDbUpdate == "" {
fCfg.SdkDbUpdate = c.FileConf.SdkDbUpdate
}
@@ -141,6 +148,9 @@ func readGlobalConfig(c *Config, confFile string) error {
if fCfg.LogsDir == "" {
fCfg.LogsDir = c.FileConf.LogsDir
}
+ if fCfg.XdsSrvUpdateTime == "" {
+ fCfg.XdsSrvUpdateTime = c.FileConf.XdsSrvUpdateTime
+ }
for _, field := range vars {
var err error