Configuration Reference

Gofer reads its configuration from /etc/gofer/gofer_web.toml, or the file passed to gofer service start --config <path>. Any key can also be set through an environment variable that starts with GOFER_WEB_, using a double underscore between the block and the key. For example api.log_level becomes GOFER_WEB_API__LOG_LEVEL. Environment variables win over the file.

Every key has a default, so you only need to set the ones you want to change. The defaults are set up for running Gofer locally; see the bare minimum production file for what to change before running it for real.

The defaults come from default_api_config.toml and the keys themselves are defined in conf/api.rs. If this page and those files ever disagree, the files are right.

Keys that end in _seconds take a whole number of seconds, and keys that end in _runs take a number of runs.

API

nametypedefaultdescription
allow_task_attachbooltrueLets users open a shell inside a running task's container with gofer task attach. Anyone with write access to a pipeline's task executions can run any command in its containers, so you may want to turn this off.
event_log_retention_secondsint15768000How long, in seconds, Gofer holds onto events before discarding them (6 months by default). This is an important factor in disk space; rough math on a 5,000 pipeline Gofer instance with 6 months of retention puts it at about 9GB.
event_prune_interval_secondsint604800How often, in seconds, Gofer checks for and removes events older than event_log_retention_seconds.
global_run_concurrency_limitint2000How many runs can be in progress across all of Gofer at once.
log_levelstringinfoThe log level for the service and its extensions.
pipeline_run_concurrency_limitint200How many runs a single pipeline can have in progress at once. Pipelines can set a lower limit with Parallelism, but not a higher one. 0 is unlimited.
task_execution_log_retention_runsint50How many of each pipeline's runs keep their task logs. Once a pipeline has more runs than this, the logs of its oldest run are deleted.
task_execution_logs_dirstring/tmpThe directory task execution logs are stored in. Each one is a text file on the server.
task_execution_max_timeout_secondsint86400The longest, in seconds, a task's container can run before Gofer stops it and fails the task (24 hours by default). Applies to tasks that don't set their own timeout and caps the ones that do. 0 is unlimited.
task_execution_stop_timeout_secondsint300How long, in seconds, Gofer waits for a task's container to stop gracefully before killing it. 0 kills containers immediately.
[api]
pipeline_run_concurrency_limit = 200
global_run_concurrency_limit = 2000
event_log_retention_seconds = 15768000    # 6 months
event_prune_interval_seconds = 604800     # 1 week
log_level = "info"
task_execution_log_retention_runs = 50
task_execution_logs_dir = "/tmp"
task_execution_stop_timeout_seconds = 300 # 5 mins
task_execution_max_timeout_seconds = 86400 # 24 hours
allow_task_attach = true

Server

nametypedefaultdescription
bind_addressstring0.0.0.0:8080The address and port the API and web UI listen on.
extension_addressstring172.17.0.1:8080The address extension and task containers use to reach Gofer. Containers usually sit on a different network than your users, like the docker bridge network, so they need their own address. The default is the docker bridge's host address. Tasks get it as GOFER_API_BASE_URL and extensions as GOFER_EXTENSION_SYSTEM_GOFER_HOST, with http:// or https:// added to match use_tls if you leave the scheme off. With use_tls on, containers check Gofer's certificate against this address, so use a name your certificate covers, like https://gofer.internal:8080, rather than the bridge IP.
storage_pathstring/tmp/gofer.dbWhere Gofer keeps its sqlite database.
use_tlsboolfalseServe the API over TLS. Requires tls_cert_path and tls_key_path; see development.use_included_certs for testing without them.
tls_cert_pathstringPath to the TLS certificate.
tls_key_pathstringPath to the TLS certificate's key.
[server]
bind_address = "0.0.0.0:8080"
extension_address = "172.17.0.1:8080"
storage_path = "/tmp/gofer.db"
use_tls = false

Development

Feature flags that make running Gofer locally easier. The defaults are all on, which is what lets gofer service start work with no configuration. Turn them all off in production.

nametypedefaultdescription
bypass_authbooltrueSkip authentication for all routes. Anyone who can reach Gofer can do anything.
pretty_loggingbooltrueHuman readable logs instead of JSON.
use_included_certsbooltrueWhen TLS is turned on but no certificate paths are set, use the localhost certificates built into Gofer. Paths you set always win. They cover localhost, 127.0.0.1 and 172.17.0.1 and are public, so they are for testing TLS locally and don't protect anything.
[development]
pretty_logging = true
bypass_auth = true
use_included_certs = true

External Events

The external events service is a separate HTTP server that takes webhooks and passes them on to extensions. It runs on its own port so you can expose it to services like Github without exposing the rest of Gofer. See External Events for how it works.

nametypedefaultdescription
enablebooltrueStart the external events service.
bind_addressstring0.0.0.0:8081The address and port the external events service listens on.
use_tlsboolfalseServe external events over TLS. Requires tls_cert_path and tls_key_path; see development.use_included_certs for testing without them.
tls_cert_pathstringPath to the TLS certificate.
tls_key_pathstringPath to the TLS certificate's key.
[external_events]
enable = true
bind_address = "0.0.0.0:8081"
use_tls = false

Object Store

The object store holds values that tasks share with each other or keep between runs. More about the object store.

nametypedefaultdescription
enginestringfilesystemThe engine Gofer uses to store objects. The only accepted value is filesystem.
pipeline_object_limitint50How many objects each pipeline can store. Pipeline objects are kept until the limit is reached, then the oldest one is deleted to make room. Overwriting an object counts it as the newest. 0 is unlimited.
run_object_expiry_runsint2How many runs keep their run objects. An object stored on run #5 with an expiry of 2 is deleted when run #7 starts, regardless of how the runs went. Tokens from InjectAPIToken are deleted at the same time.

Filesystem

nametypedefaultdescription
pathstring/tmp/gofer_objectsThe directory that object files are stored in.
[object_store]
engine = "filesystem"
pipeline_object_limit = 50
run_object_expiry_runs = 2

[object_store.filesystem]
path = "/tmp/gofer_objects"

Secret Store

The secret store holds secrets that pipelines and extensions pull in at runtime. More about the secret store.

nametypedefaultdescription
enginestringsqliteThe engine Gofer uses to store secrets. The only accepted value is sqlite.

Sqlite

nametypedefaultdescription
pathstring/tmp/gofer_secrets.dbThe path of the sqlite file. Gofer creates it if it doesn't exist.
encryption_keystringchangemechangemechangemechangemeThe key secrets are encrypted with. It must be exactly 32 bytes (32 ASCII characters; openssl rand -hex 16 makes one). Don't change it once it's set; every existing secret becomes unreadable.
[secret_store]
engine = "sqlite"

[secret_store.sqlite]
path = "/tmp/gofer_secrets.db"
encryption_key = "changemechangemechangemechangeme"

Scheduler

The scheduler is the container orchestrator Gofer runs tasks and extensions on. More about schedulers.

nametypedefaultdescription
enginestringdockerThe scheduler Gofer uses. The only accepted value is docker.

Docker

nametypedefaultdescription
prunebooltruePeriodically remove stopped containers. Without this the host's disk eventually fills with old containers.
prune_interval_secondsint604800How often, in seconds, the prune job runs.
timeout_secondsint300How long, in seconds, a request to docker can take. Should be at least as long as api.task_execution_stop_timeout_seconds.
[scheduler]
engine = "docker"

[scheduler.docker]
prune = true
prune_interval_seconds = 604800
timeout_seconds = 300

Extensions

Controls Gofer's extension system. More about extensions.

nametypedefaultdescription
installlistemptyThe extensions Gofer should run, one [[extensions.install]] entry each. The cron and interval extensions are always included unless an entry with their id sets enabled = false. See installing and configuring extensions for every field.
stop_timeout_secondsint300How long, in seconds, Gofer waits for an extension container to stop before killing it.
use_tlsboolfalseHave extensions serve over TLS. Gofer hands each extension the certificate below. This only covers Gofer talking to extensions; how extensions reach Gofer follows server.use_tls.
tls_cert_pathstringPath to the TLS certificate Gofer gives extensions.
tls_key_pathstringPath to the TLS certificate's key.
verify_certsboolfalseCheck the extension's certificate when Gofer talks to it. Only matters when use_tls is on.
health_check_interval_secondsint60How often Gofer checks that each running extension still answers. See health checks.
health_check_failures_before_actionint3Failed checks in a row before Gofer restarts the extension or marks it failed. The first failed check already marks it degraded.
health_check_auto_restartbooltrueRestart an extension that keeps failing health checks. When off, it's marked failed instead.
health_check_max_restartsint1Restarts to try before giving up and marking the extension failed. The count resets once the extension passes a check.

gofer extension reload applies changes to the install entries without restarting Gofer. Everything else in this block needs a restart.

[extensions]
stop_timeout_seconds = 300    # 5 mins
use_tls = false
verify_certs = false
health_check_interval_seconds = 60
health_check_failures_before_action = 3
health_check_auto_restart = true
health_check_max_restarts = 1

[[extensions.install]]
id = "github"
manifest = "https://raw.githubusercontent.com/clintjedwards/gofer/v<gofer version>/containers/extensions/github/manifest.toml"
[extensions.install.settings]
app_id = "112348"
app_installation = "99560091"
app_key = "global_secret{{github-app-key}}"
app_webhook_secret = "global_secret{{github-app-webhook-secret}}"

[[extensions.install]]
id = "cron"
enabled = false