Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (101 sloc) 4.47 KB

GOST server configuration using yaml

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)
     host: localhost (host of the MQTT broker)
     port: 1883 (port of the MQTT broker)
     prefix: GOST (GOST MQTT prefix)
     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)
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)

GOST server configuration using environment variables

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_HOST
GOST_MQTT_PORT GOST_MQTT_PREFIX GOST_MQTT_CLIENTID 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
You can’t perform that action at this time.