|
|
# Jetconf configuration
|
|
|
The configuraton file of Jetconf is formatted in YAML with a simple, 2-level only syntax. The purpose of this document is to describe all configuration options of Jetconf. If any of the possible options is not explicitly present in the configuraton file, a default value will be used instead. The configuration file can be passed to Jetconf with `-c /path/to/config.yaml` command line argument.
|
|
|
|
|
|
## Common sections
|
|
|
### Section "GLOBAL":
|
|
|
```
|
|
|
GLOBAL:
|
|
|
TIMEZONE: GMT
|
|
|
LOGFILE: -
|
|
|
PIDFILE: /tmp/jetconf.pid
|
|
|
PERSISTENT_CHANGES: True
|
|
|
LOG_LEVEL: info
|
|
|
LOG_DBG_MODULES: [*]
|
|
|
YANG_LIB_DIR: yang-data/
|
|
|
DATA_JSON_FILE: data.json
|
|
|
VALIDATE_TRANSACTIONS: True
|
|
|
```
|
|
|
|
|
|
```
|
|
|
TIMEZONE
|
|
|
```
|
|
|
*Default:* `GMT`
|
|
|
A timezone of the Jetconf server. This is necessary because all timestamps returned in HTTP response headers need to be returned in GMT.
|
|
|
|
|
|
```
|
|
|
LOGFILE
|
|
|
```
|
|
|
*Default:* `-`
|
|
|
A location of Jetconf's log file. This can be either a path on the filesystem or a "-". If configured as a "-", Jetconf server will run in foreground and all logging information will be written to stdout (suitable for testing).
|
|
|
|
|
|
```
|
|
|
PIDFILE:
|
|
|
```
|
|
|
*Default:* `/tmp/jetconf.pid`
|
|
|
A location of Jetconf's process ID file.
|
|
|
|
|
|
```
|
|
|
PERSISTENT_CHANGES
|
|
|
```
|
|
|
*Default:* `true`
|
|
|
This option specifies if the changes commited to datastore will also be synchronized to the filesystem (JSON file defined by the DATA_JSON_FILE option). It should be set to true in most cases, but can be turned off for i.e. testing purposes. If turned off, the Jetconf datastore will contain exactly the same initial data at every startup.
|
|
|
|
|
|
```
|
|
|
LOG_LEVEL
|
|
|
```
|
|
|
*Default:* `info`
|
|
|
Defines the Jetconf's log verbosity. Possible values are: `debug`, `info`, `warning` and `error`.
|
|
|
|
|
|
```
|
|
|
LOG_DBG_MODULES
|
|
|
```
|
|
|
*Default:* `[*]`
|
|
|
When LOG_LEVEL is set to "debug", this options defines list of Python modules which will write out debugging information. This is useful to prevent flooding the log with debugging messages from irrelevant modules. I.e. when debugging "usr_conf_data_handlers" module, you may not be interested with debug information from the "nacm". Can be set to wildcard `*`.
|
|
|
|
|
|
```
|
|
|
YANG_LIB_DIR
|
|
|
```
|
|
|
*Default:* `yang-data/`
|
|
|
Specifies the location of YANG library. This is the directory containing .yang files, it must also contain the "yang-library-data.json" file with configuration and description of all present YANG modules (see example).
|
|
|
|
|
|
```
|
|
|
DATA_JSON_FILE
|
|
|
```
|
|
|
*Default:* `data.json`
|
|
|
A path to JSON file containing the datastore data. This file will be loaded at Jetconf startup. If PERSISTENT_CHANGES is set to true, all changes made to the datastore will be also stored to this file.
|
|
|
|
|
|
```
|
|
|
VALIDATE_TRANSACTIONS
|
|
|
```
|
|
|
*Default:* `true`
|
|
|
This option defines if the datastore data should be validated according to YANG data model after a transaction is commited. It should be set to true except for testing and debugging purposes.
|
|
|
|
|
|
### Section "HTTP":
|
|
|
```
|
|
|
HTTP:
|
|
|
DOC_ROOT: doc-root
|
|
|
DOC_DEFAULT_NAME: index.html
|
|
|
API_ROOT: /restconf
|
|
|
API_ROOT_STAGING: /restconf_staging
|
|
|
SERVER_NAME: jetconf-h2
|
|
|
UPLOAD_SIZE_LIMIT: 1
|
|
|
LISTEN_LOCALHOST_ONLY: False
|
|
|
PORT: 8443
|
|
|
SERVER_SSL_CERT: server.crt
|
|
|
SERVER_SSL_PRIVKEY: server.key
|
|
|
CA_CERT: ca.pem
|
|
|
DBG_DISABLE_CERTS: False
|
|
|
```
|
|
|
|
|
|
```
|
|
|
DOC_ROOT
|
|
|
```
|
|
|
*Default:* `doc-root`
|
|
|
A root directory where regular files will be placed. All HTTP GET requests outside API_ROOT are considered as requests for regular files on filesystem.
|
|
|
|
|
|
```
|
|
|
DOC_DEFAULT_NAME
|
|
|
```
|
|
|
*Default:* `index.html`
|
|
|
A default filename in DOC_ROOT and its subdirectories.
|
|
|
|
|
|
```
|
|
|
API_ROOT
|
|
|
```
|
|
|
*Default:* `/restconf`
|
|
|
Defines the base URI of RESTCONF data. All requests for resources inside API_ROOT will be considered as RESTCONF requests. It is usually not needed to change this value. Example: `/restconf` -> `https://localhost/restconf/ns:some_resouce`
|
|
|
|
|
|
```
|
|
|
API_ROOT_STAGING
|
|
|
```
|
|
|
*Default:* `/restconf_staging`
|
|
|
Same as above, except this is for staging data (data edited by user, but not commited yet).
|
|
|
|
|
|
```
|
|
|
SERVER_NAME
|
|
|
```
|
|
|
*Default:* `jetconf-h2`
|
|
|
A value returned in "Server: " header of HTTP response.
|
|
|
|
|
|
```
|
|
|
UPLOAD_SIZE_LIMIT
|
|
|
```
|
|
|
*Default:* `1`
|
|
|
A maximum size of incoming data in PUT or POST body (in megabytes), which the server can handle.
|
|
|
|
|
|
```
|
|
|
LISTEN_LOCALHOST_ONLY
|
|
|
```
|
|
|
*Default:* `false`
|
|
|
If set to true, the Jetconf HTTP server will only accept incoming connections from localhost.
|
|
|
|
|
|
```
|
|
|
PORT
|
|
|
```
|
|
|
*Default:* `8443`
|
|
|
The TCP port of Jetconf server.
|
|
|
|
|
|
```
|
|
|
SERVER_SSL_CERT
|
|
|
```
|
|
|
*Default:* `server.crt`
|
|
|
The location of server SSL certificate in PEM format.
|
|
|
|
|
|
```
|
|
|
SERVER_SSL_PRIVKEY
|
|
|
```
|
|
|
*Default:* `server.key`
|
|
|
The location of server SSL private key in PEM format.
|
|
|
|
|
|
```
|
|
|
CA_CERT
|
|
|
```
|
|
|
*Default:* `ca.pem`
|
|
|
The location of certification authority certificate, which is used for issuing client certificates.
|
|
|
|
|
|
```
|
|
|
DBG_DISABLE_CERTS
|
|
|
```
|
|
|
*Default:* `false`
|
|
|
If enabled, the user authentication system based on client certificates will be turned off and every incoming connection will default to "test-user" username. This should never be turned on in real environment, it is only intended for testing and benchmarking purposes (no HTTP/2 benchmarking tools support client certificates at this moment).
|
|
|
|
|
|
### Section "NACM":
|
|
|
```
|
|
|
NACM:
|
|
|
ALLOWED_USERS: [lojza@mail.tld]
|
|
|
```
|
|
|
|
|
|
```
|
|
|
ALLOWED_USERS
|
|
|
```
|
|
|
*Default:* `[lojza@mail.tld]` (example, should always be configured)
|
|
|
A list of superusers allowed to edit NACM data.
|
|
|
|
|
|
|
|
|
## Application-specific sections
|
|
|
### Section "KNOT":
|
|
|
```
|
|
|
KNOT:
|
|
|
SOCKET: /tmp/knot.sock
|
|
|
```
|
|
|
|
|
|
```
|
|
|
SOCKET
|
|
|
```
|
|
|
*Default:* `/tmp/knot.sock`
|
|
|
A path to KnotDNS control socket. |