8 config.yml
Hunter Long edited this page 2020-05-01 05:48:23 -07:00

The config.yml file contains all of the Statping database settings and API keys/secrets. When Statping loads, it will attempt to open this file to parse it's core values. You can view the Go type file on types/types.go.

config.yml Parameters

  • connection: sqlite (sqlite, mysql, postgres)
  • host: 0.0.0.0 (database host)
  • user: root (database username)
  • password: password123 (database password)
  • database: root (Statping database name)
  • port: 5432 (database port)
  • api_key: 1d31a96a8b3... (Public API Key)
  • api_secret: 18cd0a7373cb... (Private API Key)
  • location: /Users/username/statping_dir (Statping absolute directory)

The location setting will contain core files/folders for Statping like, logs, assets, and should contain the config.yml file.

Using Environment Variables instead of config.yml

You technically don't need this config.yml file to run Statping. You can also run the Statping server by including environment variables when you start the server. You can view all the available variables by viewing the Config with .env Wiki page.

Statping will auto run with environment variables if DB_CONN is set!

Example config.yml

connection: mysql
host: localhost
user: root
password: password123
database: root
port: 3306
api_secret: apisecretcanbeset
location: /app/statping