summaryrefslogtreecommitdiffstats
path: root/lib/xdsconfig
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-02-06 17:07:30 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-02-06 17:11:30 +0100
commit0a53346ecd92e1281587c724631fdf76dc756fc7 (patch)
treedd9996613a7f4237fd996be9a54949369cd064f4 /lib/xdsconfig
parent60a59bcfdb3c2404a468cc314b7afde85ee35e1b (diff)
Auto update SDK DB on startup.
Auto update db is enable by default (setting sdkDbUpdate = "startup") but it can be disable by setting sdkDbUpdate to "disable" in server config file. Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsconfig')
-rw-r--r--lib/xdsconfig/config.go2
-rw-r--r--lib/xdsconfig/fileconfig.go4
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/xdsconfig/config.go b/lib/xdsconfig/config.go
index 11960c9..335c116 100644
--- a/lib/xdsconfig/config.go
+++ b/lib/xdsconfig/config.go
@@ -56,6 +56,7 @@ const (
DefaultShareDir = "${HOME}/.xds/server/projects"
DefaultSTHomeDir = "${HOME}/.xds/server/syncthing-config"
DefaultSdkScriptsDir = "${EXEPATH}/sdks"
+ DefaultSdkDbUpdate = "startup"
)
// Init loads the configuration on start-up
@@ -98,6 +99,7 @@ func Init(cliCtx *cli.Context, log *logrus.Logger) (*Config, error) {
WebAppDir: "webapp/dist",
ShareRootDir: dfltShareDir,
SdkScriptsDir: DefaultSdkScriptsDir,
+ SdkDbUpdate: DefaultSdkDbUpdate,
HTTPPort: DefaultPort,
SThgConf: &SyncThingConf{Home: dfltSTHomeDir},
LogsDir: "",
diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go
index 69467b4..ef207ec 100644
--- a/lib/xdsconfig/fileconfig.go
+++ b/lib/xdsconfig/fileconfig.go
@@ -54,6 +54,7 @@ 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"`
@@ -139,6 +140,9 @@ func readGlobalConfig(c *Config, confFile string) error {
if fCfg.SdkScriptsDir == "" {
fCfg.SdkScriptsDir = c.FileConf.SdkScriptsDir
}
+ if fCfg.SdkDbUpdate == "" {
+ fCfg.SdkDbUpdate = c.FileConf.SdkDbUpdate
+ }
if fCfg.HTTPPort == "" {
fCfg.HTTPPort = c.FileConf.HTTPPort
}