GOST server uses a default config.yaml configuration file, you can edit this file or specify your own file by running gost with the -config flag.
./gost -config myconfig.yaml
default config.yaml
server:
name: GOST Server (name of the webserver)
host: (host of webserver, set to 0.0.0.0 if hosting on external machine)
port: 8080 (port of webserver)
externalUri: http://localhost:8080/ (change to the uri where users can reach the service)
maxEntityResponse: 50 (max entities to return if no $top and $skip is given)
indentedJson: true (return indented JSON)
https: false (ron GOST on HTTPS true/false)
httpsCert: (location of https cert file)
httpsKey: (location of https key file)
database:
host: localhost (location of PostGIS server)
port: 5432 (port of PostGIS database)
user: postgres (PostGIS user)
password: postgres (PostGIS password)
database: gost (PostGIS database to use)
schema: v1 (schema to use)
ssl: false (SSL enabled, not implemented yet)
maxIdleConns: 30 (maximum idle connections)
maxOpenConns: 100 (maximum open connections)
mqtt:
enabled: true (true/false to enable/disable MQTT)
verbose: false (true/false to enable/disable debug logging for Paho MQTT client)
host: localhost (host of the MQTT broker)
port: 1883 (port of the MQTT broker)
prefix: GOST (GOST MQTT prefix)
clientID: gost (Client ID for MQTT connection)
ssl: false (true/false to enable/disable ssl)
caCertFile: cacert.crt (location of Certificate Authority (CA) file. Use when SSL is true.)
clientCertFile: client.crt (location of client certificate file. Use when SSL is true.)
privateKeyFile: client.key (location of the client key file. Use when SSL is true.)
username:(username to be used. Optional)
password: (password. Optional)
keepAliveSec: 300 (Keepalive option for Paho MQTT client)
pingTimeoutSec: 20 (PingTimeout option for Paho MQTT client)
subscriptionQos: 1 (QoS for MQTT subscription)
persistent: false (true/false to enable / disable persistent MQTT session)
order: true (Order option for Paho MQTT client)
logger:
fileName: gost (filename to log to, leave blank to log to stdout)
verbose: true (true for logging debug and up, false to log from warn and up)
The config.yaml parameters can be overruled with the following environment variables, check default config.yaml above for the variable descriptions.
Gost server configuration
GOST_SERVER_NAME
GOST_SERVER_HOST
GOST_SERVER_PORT
GOST_SERVER_EXTERNAL_URI
GOST_SERVER_MAX_ENTITIES
GOST_SERVER_INDENT_JSON
GOST_SERVER_HTTPS
GOST_SERVER_HTTPS_KEY
GOST_SERVER_HTTPS_CERT
Gost server database connection
GOST_DB_HOST
GOST_DB_SCHEMA
GOST_DB_DATABASE
GOST_DB_PORT
GOST_DB_USER
GOST_DB_PASSWORD
GOST_DB_MAX_IDLE_CONS
GOST_DB_MAX_OPEN_CONS
GOST_DB_SSL_ENABLED
Gost server mqtt connection
GOST_MQTT_ENABLED
GOST_MQTT_VERBOSE
GOST_MQTT_HOST
GOST_MQTT_PORT
GOST_MQTT_PREFIX
GOST_MQTT_CLIENTID
GOST_MQTT_SUBSCRIPTIONQOS
GOST_MQTT_PERSISTENT
GOST_MQTT_ORDER_MATTERS
GOST_MQTT_KEEPALIVE_SECS
GOST_MQTT_PINGTIMEOUT_SECS
GOST_MQTT_SSL
GOST_MQTT_CA_CERT_FILE
GOST_MQTT_CLIENT_CERT_FILE
GOST_MQTT_PRIVATE_KEY_FILE
GOST_MQTT_USERNAME
GOST_MQTT_PASSWORD
Gost logging
GOST_LOG_FILENAME
GOST_LOG_VERBOSE_FLAG
Example setting GOST environment variable on Windows
set GOST_DB_HOST=192.168.40.10
Example setting GOST environment variable on Mac/Linux
export GOST_DB_HOST=192.168.40.10
Example setting GOST environment variable in docker-compose.yml
gost:
image: geodan/gost
depends_on:
- mosquitto
- gost-db
environment:
GOST_DB_HOST: gost-db
GOST_MQTT_HOST: mosquitto
GOST_SERVER_EXTERNAL_URI: http://fancy_server:8181
Example setting GOST environment variable in docker run
$ docker run -d -p 8080:8080 -t -e GOST_DB_HOST=192.168.40.10 -e GOST_DB_DATABASE=gost