aboutsummaryrefslogtreecommitdiffstats
path: root/docs/part-2/1_xds-server/2_config.md
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-10-09 10:45:08 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-12-04 10:24:36 +0000
commit781fce71d4b78c0edfc489e4093d082f271a234f (patch)
treeeb01b9ea369f0b41c16aa8394d3a3c9393449c08 /docs/part-2/1_xds-server/2_config.md
parentfd283ead7bfe789b6f7c5d5428bb5ed15158d3f8 (diff)
Improves documentation
* Describes better available source tree sharing method (between xds-agent and xds-server), and which to prefer depending on the deployment setup. * Gives indication about how to pass RSYNC_TARGET and RSYNC_PREFIX env vars to the helloworld-native-application build process. * Swap chapter order (build before config) Bug: SPEC-1993 Change-Id: Ie4c22f277a59b0405744d71b0fadff67c5d5d025 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'docs/part-2/1_xds-server/2_config.md')
-rw-r--r--docs/part-2/1_xds-server/2_config.md89
1 files changed, 89 insertions, 0 deletions
diff --git a/docs/part-2/1_xds-server/2_config.md b/docs/part-2/1_xds-server/2_config.md
new file mode 100644
index 0000000..ad86043
--- /dev/null
+++ b/docs/part-2/1_xds-server/2_config.md
@@ -0,0 +1,89 @@
+# Configuration
+
+`xds-server` configuration is driven by a JSON config file (`server-config.json`).
+
+Here is the logic to determine which `server-config.json` file will be used:
+
+1. from command line option: `--config myConfig.json`
+1. `$HOME/.xds/server/server-config.json` file
+1. `/etc/xds/server/server-config.json` file
+1. `<xds-server executable dir>/server-config.json` file
+
+Supported fields in configuration file are:
+
+- **httpPort** : HTTP port of client webapp/REST API
+- **webAppDir** : location of client web application (default: webapp/dist)
+- **shareRootDir** : root directory where projects will be copied
+- **logsDir** : directory to store logs (eg. syncthing output)
+- **sdkScriptsDir** : directory where scripts, used to managed SDKs, are installed
+- **sdkDbUpdate** : define how SDK database(s) is(are) updated, supported values are:
+ `disable`, `startup` (default: `startup`)
+- **syncthing.binDir** : syncthing binaries directory (default: executable directory)
+- **syncthing.home"** : syncthing home directory (usually .../syncthing-config)
+- **syncthing.gui-address** : syncthing gui url (default <http://localhost:8385>)
+- **syncthing.gui-apikey** : syncthing api-key to use (default auto-generated)
+
+All fields are optional and example below corresponds to the default values.
+
+```json
+{
+ "httpPort": 8000,
+ "webAppDir": "webapp/dist",
+ "shareRootDir": "${HOME}/.xds/server/projects",
+ "logsDir": "/tmp/logs",
+ "sdkScriptsDir": "${EXEPATH}/scripts/sdks",
+ "sdkDbUpdate": "startup",
+ "syncthing": {
+ "binDir": "./bin",
+ "home": "${HOME}/.xds/server/syncthing-config",
+ "gui-address": "http://localhost:8385",
+ "gui-apikey": "123456789",
+ }
+}
+```
+
+>**Notes:**
+>
+>Environment variables are supported by using `${MY_VAR}` syntax.
+>
+
+When `xds-server` is started as a systemd service, default environment variables
+are set into `/etc/default/xds-server` file.
+
+`xds-server` configuration is also driven by a JSON config file (`server-config.json`),
+and default JSON config is `/etc/xds/server/server-config.json`.
+
+<!-- section-note -->
+**Note:**
+You can use your own JSON config by settings `APP_CONFIG` variable of
+`/etc/default/xds-server` file to your file, for example `/home/MYUSER/.xds/server/server-config.json`
+<!-- end-section-note -->
+
+## Disable syncthing
+
+`CloudSync` synchronization type based on `syncthing` tool can be disabled by
+simply removing (or renaming) `"syncthing"` key in configuration file.
+Here is a JSON configuration file example where syncthing key as been renamed:
+
+```json
+{
+ "httpPort": 8000,
+ "webAppDir": "webapp/dist",
+ "shareRootDir": "${HOME}/.xds/server/projects",
+ "logsDir": "/tmp/logs",
+ "sdkScriptsDir": "${EXEPATH}/scripts/sdks",
+ "syncthing_DISABLE": {
+ "binDir": "./bin",
+ "home": "${HOME}/.xds/server/syncthing-config",
+ }
+}
+```
+
+On benefit to do that is to increase XDS-Server startup time.
+
+<!-- section-note -->
+**Note:**
+
+- `CloudSync` (AKA syncthing) synchronization type can also be disabled when `"syncthing"` key is not defined in JSON configuration file.
+
+<!-- end-section-note -->