Simplified doc-site generation
[AGL/documentation.git] / docs / ATTIC / 3_Developer_Guides / 4_X(cross)_Development_System:_User's_Guide / 4_X(cross)_Development_System:_ Internals / 3.4.4.2_xds-server / 3.4.4.2.2_Config.md
1 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/xds-docs-guides-devguides-book.yml -->
2
3 # Configuration
4
5 `xds-server` configuration is driven by a JSON config file (`server-config.json`).
6
7 Here is the logic to determine which `server-config.json` file will be used:
8
9 1. from command line option: `--config myConfig.json`
10 1. `$HOME/.xds/server/server-config.json` file
11 1. `/etc/xds/server/server-config.json` file
12 1. `<xds-server executable dir>/server-config.json` file
13
14 Supported fields in configuration file are:
15
16 - **httpPort** : HTTP port of client webapp/REST API
17 - **webAppDir** : location of client web application (default: webapp/dist)
18 - **shareRootDir** : root directory where projects will be copied
19 - **logsDir**  : directory to store logs (eg. syncthing output)
20 - **sdkScriptsDir** : directory where scripts, used to managed SDKs, are installed
21 - **sdkDbUpdate** : define how SDK database(s) is(are) updated, supported values are:
22   `disable`, `startup` (default: `startup`)
23 - **syncthing.binDir** : syncthing binaries directory (default: executable directory)
24 - **syncthing.home"** : syncthing home directory (usually .../syncthing-config)
25 - **syncthing.gui-address** : syncthing gui url (default <http://localhost:8385>)
26 - **syncthing.gui-apikey** : syncthing api-key to use (default auto-generated)
27
28 All fields are optional and example below corresponds to the default values.
29
30 ```json
31 {
32     "httpPort": 8000,
33     "webAppDir": "webapp/dist",
34     "shareRootDir": "${HOME}/.xds/server/projects",
35     "logsDir": "/tmp/logs",
36     "sdkScriptsDir": "${EXEPATH}/scripts/sdks",
37     "sdkDbUpdate": "startup",
38     "syncthing": {
39         "binDir": "./bin",
40         "home": "${HOME}/.xds/server/syncthing-config",
41         "gui-address": "http://localhost:8385",
42         "gui-apikey": "123456789",
43     }
44 }
45 ```
46
47 >**Notes:**
48 >
49 >Environment variables are supported by using `${MY_VAR}` syntax.
50 >
51
52 When `xds-server` is started as a systemd service, default environment variables
53 are set into `/etc/default/xds-server` file.
54
55 `xds-server` configuration is also driven by a JSON config file (`server-config.json`),
56 and default JSON config is `/etc/xds/server/server-config.json`.
57
58 <!-- section-note -->
59 **Note:**
60 You can use your own JSON config by settings `APP_CONFIG` variable of
61 `/etc/default/xds-server` file to your file, for example `/home/MYUSER/.xds/server/server-config.json`
62 <!-- end-section-note -->
63
64 ## Disable syncthing
65
66 `CloudSync` synchronization type based on `syncthing` tool can be disabled by
67 simply removing (or renaming) `"syncthing"` key in configuration file.
68 Here is a JSON configuration file example where syncthing key as been renamed:
69
70 ```json
71 {
72     "httpPort": 8000,
73     "webAppDir": "webapp/dist",
74     "shareRootDir": "${HOME}/.xds/server/projects",
75     "logsDir": "/tmp/logs",
76     "sdkScriptsDir": "${EXEPATH}/scripts/sdks",
77     "syncthing_DISABLE": {
78         "binDir": "./bin",
79         "home": "${HOME}/.xds/server/syncthing-config",
80     }
81 }
82 ```
83
84 On benefit to do that is to increase XDS-Server startup time.
85
86 <!-- section-note -->
87 **Note:**
88
89 - `CloudSync` (AKA syncthing) synchronization type can also be disabled when `"syncthing"` key is not defined in JSON configuration file.
90
91 <!-- end-section-note -->