aboutsummaryrefslogtreecommitdiffstats
path: root/docs/part-2/2_xds-agent/1_config.md
blob: 9e912cb3b7c5f8675a483c864a28d970b9703915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Configuration

xds-agent configuration is driven by a JSON config file.

The tarball mentioned in previous section includes this file with default settings.

Here is the logic to determine which conf file will be used:

1. from command line option: `--config myConfig.json`
1. `$HOME/.xds/agent/agent-config.json` file
1. `/etc/xds/agent/agent-config.json` file

Supported fields in configuration file are (all fields are optional and example
below corresponds to the default values):

- **httpPort** : http port of agent REST interface
- **webAppDir** : location of client webapp / dashboard (default: webapp/dist)
- **logsDir**  : directory to store logs (eg. syncthing output)
- **xdsServers** : an array of xds-server object
  - **xdsServers.url**: url of xds-server to connect to
- **syncthing**: a object defining syncthing settings
  - **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:8386>)
  - **syncthing.gui-apikey** : syncthing api-key to use (default auto-generated)

```json
{
    "httpPort": "8800",
    "webAppDir": "./www",
    "logsDir": "${HOME}/.xds/agent/logs",
    "xdsServers": [
        {
          "url": "http://localhost:8000"
        }
    ],
    "syncthing": {
        "home": "${HOME}/.xds/agent/syncthing-config",
        "gui-address": "http://localhost:8386",
        "gui-apikey": "1234abcezam"
    }
}
```

>**Note:**
>
>environment variables are supported by using `${MY_VAR}` syntax.