All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Configuration

Configuring Tarmac

Tarmac supports multiple configuration sources such as Environment Variables, JSON files, or using HashiCorp Consul. All of these configuration options can also exist together to provide both static and dynamic configurations.

When using Environment Variables, all configurations are prefixed with APP_. The list below will show both Environment and Consul/JSON format for configuration.

Environment Variable
Consul/JSON
Type
Description

APP_ENABLE_TLS

enable_tls

Consul Format

When using Consul the consul_keys_prefix should be the path to a key with a JSON string as the value. For example, a key of tarmac/config will have a value of {"from_consul":true}.

bool

Enable the HTTPS Listener (default: True)

APP_LISTEN_ADDR

listen_addr

string

Define the HTTP/HTTPS Listener address (default: 0.0.0.0:8443)

APP_CONFIG_WATCH_INTERVAL

config_watch_interval

int

Frequency in seconds which Consul configuration will be refreshed (default: 15)

APP_USE_CONSUL

use_consul

bool

Enable Consul based configuration (default: False)

APP_CONSUL_ADDR

consul_addr

string

Consul address (i.e. consul.example.com:8500)

APP_CONSUL_KEYS_PREFIX

consul_keys_prefix

string

Key path for app specific consul configuration

from_consul

bool

Indicator to reflect whether Consul config was loaded

APP_DEBUG

debug

bool

Enable debug logging

APP_TRACE

trace

bool

Enable trace logging

APP_DISABLE_LOGGING

disable_logging

bool

Disable all logging

APP_TEXT_LOG_FORMAT

text_log_format

bool

Use text format for logs instead of JSON (default: False)

APP_CERT_FILE

cert_file

string

Certificate File Path (i.e. /some/path/cert.crt)

APP_KEY_FILE

key_file

string

Key File Path (i.e. /some/path/cert.key)

APP_CA_FILE

ca_file

string

Certificate Authority Bundle File Path (i.e /some/path/ca.pem). When defined, enables mutual-TLS authentication

APP_IGNORE_CLIENT_CERT

ignore_client_cert

string

When defined will disable Client Cert validation for m-TLS authentication

APP_WASM_FUNCTION

wasm_function

string

Path and Filename of the WASM Function to execute (Default: /functions/tarmac.wasm)

APP_WASM_FUNCTION_CONFIG

wasm_function_config

string

Path to Service configuration for multi-function services (Default: /functions/tarmac.json)

APP_WASM_POOL_SIZE

wasm_pool_size

int

Number of WASM function instances to create (Default: 100). Only applicable when wasm_function is used.

APP_ENABLE_PPROF

enable_pprof

bool

Enable PProf Collection HTTP end-points

APP_ENABLE_KVSTORE

enable_kvstore

bool

Enable the KV Store

APP_KVSTORE_TYPE

kvstore_type

string

Select KV Store to use (Options: redis, cassandra, boltdb, in-memory, internal)

APP_ENABLE_SQL

enable_sql

bool

Enable the SQL Store

APP_SQL_TYPE

sql_type

string

Select SQL Store to use (Options: postgres, mysql)

APP_RUN_MODE

run_mode

string

Select the run mode for Tarmac (Options: daemon, job). Default: daemon. The job option will cause Tarmac to exit after init functions are executed.

APP_ENABLE_MAINTENANCE_MODE

enable_maintenance_mode

bool

Enable Maintenance Mode. When enabled, Tarmac will return a 503 for requests to /ready allowing the service to go into "maintenance mode".

APP_HTTP_CLIENT_MAX_RESPONSE_BODY_SIZE

http_client_max_response_body_size

int

Maximum size in bytes for HTTP response bodies from client requests (default: 10485760 - 10MB). Prevents DoS attacks and excessive memory usage.

Redis

Configuring Tarmac with Redis

This page contains Redis specific configuration to utilize Redis with Tarmac.

Tarmac supports multiple configuration sources such as Environment Variables, JSON files, or using HashiCorp Consul. All of these configuration options can also exist together to provide both static and dynamic configurations.

When using Environment Variables, all configurations are prefixed with APP_. The list below will show both Environment and Consul/JSON format for configuration.

Environment Variable
Consul/JSON
Type
Description

Consul Format

When using Consul the consul_keys_prefix should be the path to a key with a JSON string as the value. For example, a key of tarmac/config will have a value of {"from_consul":true}.

BoltDB

Configuring Tarmac with BoltDB

This page contains BoltDB specific configuration to utilize BoltDB with Tarmac.

Tarmac supports multiple configuration sources such as Environment Variables, JSON files, or using HashiCorp Consul. All of these configuration options can also exist together to provide both static and dynamic configurations.

When using Environment Variables, all configurations are prefixed with APP_. The list below will show both Environment and Consul/JSON format for configuration.

Environment Variable
Consul/JSON
Type
Description

APP_REDIS_SERVER

redis_server

string

Redis server address

APP_REDIS_DATABASE

redis_database

int

Redis Database (default: 0)

APP_REDIS_PASSWORD

redis_password

string

Redis password

APP_REDIS_SENTINEL_SERVERS

redis_sentinel_servers

[]string

Redis Sentinel Server Addresses

APP_REDIS_SENTINEL_MASTER

redis_sentinel_master

string

Redis Sentinel Master Instance Name

APP_REDIS_CONNECT_TIMEOUT

redis_connect_timeout

int

Redis Connection Timeout in seconds

APP_REDIS_HOSTNAME_VERIFY

redis_hostname_verify

bool

Skip hostname verification for TLS

APP_REDIS_KEEPALIVE

redis_keepalive

int

TCP Keepalive Interval in seconds (Default: 300)

APP_REDIS_MAX_ACTIVE

redis_max_active

int

Max Active Connections

APP_REDIS_READ_TIMEOUT

redis_read_timeout

int

Read timeout in seconds

APP_REDIS_WRITE_TIMEOUT

redis_write_timeout

int

Write timeout in seconds

boltdb_filename

string

The full path and filename of the BoltDB file. If the file does not exist, it will be created.

APP_BOLTDB_BUCKET

boltdb_bucket

string

The name of the BoltDB bucket to use. If the bucket does not exist, it will be created.

APP_BOLTDB_PERMISSIONS

boltdb_permissions

int

The permissions to use when creating the BoltDB file. This is an octal value.

APP_BOLTDB_TIMEOUT

boltdb_timeout

int

The timeout in seconds to wait for BoltDB to open.

Consul Format

When using Consul the consul_keys_prefix should be the path to a key with a JSON string as the value. For example, a key of tarmac/config will have a value of {"from_consul":true}.

APP_BOLTDB_FILENAME

Cassandra

Configuring Tarmac with Cassandra

This page contains Cassandra specific configuration to utilize Cassandra with Tarmac.

Tarmac supports multiple configuration sources such as Environment Variables, JSON files, or using HashiCorp Consul. All of these configuration options can also exist together to provide both static and dynamic configurations.

When using Environment Variables, all configurations are prefixed with APP_. The list below will show both Environment and Consul/JSON format for configuration.

Environment Variable
Consul/JSON
Type
Description

Consul Format

When using Consul the consul_keys_prefix should be the path to a key with a JSON string as the value. For example, a key of tarmac/config will have a value of {"from_consul":true}.

APP_CASSANDRA_HOSTS

cassandra_hosts

[]string

Cassandra node addresses

APP_CASSANDRA_PORT

cassandra_port

int

Cassandra node port

APP_CASSANDRA_KEYSPACE

cassandra_keyspace

string

Cassandra Keyspace name

APP_CASSANDRA_CONSISTENCY

cassandra_consistency

string

Desired Consistency (Default: Quorum)

APP_CASSANDRA_REPL_STRATEGY

cassandra_repl_strategy

string

Replication Strategy for Cluster (Default: SimpleStrategy)

APP_CASSANDRA_REPLICAS

cassandra_replicas

int

Default number of replicas for data (Default: 1)

APP_CASSANDRA_USER

cassandra_user

string

Username to authenticate with

APP_CASSANDRA_PASSWORD

cassandra_password

string

Password to authenticate with

APP_CASSANDRA_HOSTNAME_VERIFY

cassandra_hostname_verify

bool

Enable/Disable hostname verification for TLS