Skip to content

Configuration Options

All configuration options can be set via command line flags, environment variables or config file.

All options are optional.

Environment variables must be prefixed with SHAPER_ and use uppercase letters and underscores. For example, --nats-token 123 turns into SHAPER_NATS_TOKEN=123.

The config file format is plain text, with one flag per line. The flag name and value are separated by whitespace. For example, --nats-token 123 turns into nats-token 123.

To use a config file, pass the --config-file flag with the path to the config file.

You can combine all three methods to set configuration options. Command-line args have the highest priority. Environment variables have the next-highest priority. The config file has the lowest priority.

Web server address to listen on

FlagEnv VarDefault
--addrSHAPER_ADDRlocalhost:5454

Directory to store data in

FlagEnv VarDefaultDocker Default
-d, --dirSHAPER_DIR/home/jorin/.shaper/data

CSS string to inject into the frontend.

Also see Custom Styles

FlagEnv Var
--cssSHAPER_CSS

Path to a favicon file to override favicon. Must end with .svg or .ico.

FlagEnv Var
--faviconSHAPER_FAVICON

SQL string to execute on startup.

Supports environment variables in the format $VAR or ${VAR}.

FlagEnv Var
--init-sqlSHAPER_INIT_SQL

Read SQL from a file to execute on startup.

In most cases you probably want to use init-sql-file over init-sql since it makes managing longer SQL scripts easier.

Note that Shaper doesn’t error if the file doesn’t exist.

FlagEnv VarDefaultDocker Default
--init-sql-fileSHAPER_INIT_SQL_FILE[--dir]/init.sql/var/lib/shaper/init.sql

Disable public sharing of dashboards.

Also previously shared dashboards will not be accessible while this flag is set.

FlagEnv Var
--no-public-sharingSHAPER_NO_PUBLIC_SHARING=true

Base URL path the frontend is served from.

Override if you are using a reverse proxy and serve the frontend from a subpath.

FlagEnv VarDefault
--basepathSHAPER_BASEPATH/

NATS server hostname to listen on.

FlagEnv VarDefault
--nats-hostSHAPER_NATS_HOST0.0.0.0

NATS server port to listen on.

Set to 0 to disable listening on any port.

FlagEnv VarDefault
-p, --nats-portSHAPER_NATS_PORT0

Admin authentication token for the NATS server.

Set to manage NATS via the NATS CLI or other tools.

To get access to ingest data, use an API key instead.

By default no authentication is used. That means once you set a NATS port you should also set a token to secure the NATS server.

FlagEnv Var
-t, --nats-tokenSHAPER_NATS_TOKEN

Use an external NATS server.

Specify one or more addresses as a comma-separated list.

FlagEnv VarDefault
--nats-serversSHAPER_NATS_SERVERSUsing internal NATS server

Maximum storage in bytes for JetStream.

Set to 0 for unlimited storage.

FlagEnv VarDefault
--nats-max-storeSHAPER_NATS_MAX_STORE0

JetStream encryption key. Set to encrypt JetStream data on disk.

Watch out: You cannot change or remove the key once set. Then NATS will fail to load existing data.

FlagEnv Var
--nats-js-keySHAPER_NATS_JS_KEY

Override JetStream storage directory.

Defaults to [--dir]/nats. This means that if you set --dir /data then the NATS storage directory will be /data/nats.

FlagEnv Var
--nats-dirSHAPER_NATS_DIR

Override DuckDB DSN.

Use this to change the location of the DuckDB database file. Or get creative and us a DSN DuckDB supports that is not even on the local file system.

FlagEnv VarDefault
--duckdbSHAPER_DUCKDB[--dir]/shaper.duckdb

Override DuckDB extension directory.

By default it uses the system’s default DuckDB extension directory, which is ~/.duckdb/extensions/ on most systems. In Docker it defaults to /data/duckdb_extensions so it’s easy to mount extensions and not have to download them every time the container restarts.

FlagEnv VarDefaultDocker Default
--duckdb-ext-dirSHAPER_DUCKDB_EXT_DIR~/.duckdb/extensions//data/duckdb_extensions

Database schema name for internal tables

FlagEnv VarDefault
--schemaSHAPER_SCHEMA_shaper

JWT expiration duration. Used for authentication tokens.

Pass a duration string like 15m for 15 minutes, 1h:15m for 1 hour 15 minutes, etc.

FlagEnv VarDefault
--jwtexpSHAPER_JWTEXP15m0s

Session expiration duration. Used for user sessions.

FlagEnv VarDefault
--sessionexpSHAPER_SESSIONEXP720h0m0s

Invite expiration duration. Used for user invites.

FlagEnv VarDefault
--inviteexpSHAPER_INVITEEXP168h0m0s

Prefix for NATS stream and KV bucket names. Will be prepened to ingest-stream, state-stream, and config-kv-bucket.

FlagEnv VarDefault
--stream-prefixSHAPER_STREAM_PREFIX""

Override NATS stream name for ingest messages.

FlagEnv VarDefault
--ingest-streamSHAPER_INGEST_STREAMshaper-ingest

Override NATS stream name for Shaper-internal state messages.

FlagEnv VarDefault
--state-streamSHAPER_STATE_STREAMshaper-state

Override NATS config KV bucket name.

FlagEnv VarDefault
--config-kv-bucketSHAPER_CONFIG_KV_BUCKETshaper-config

Maximum age of messages in the ingest stream.

Set to 0s for indefinite retention.

FlagEnv VarDefault
--ingest-max-ageSHAPER_INGEST_MAX_AGE0s

Maximum age of messages in the state stream.

Set to 0s for indefinite retention.

FlagEnv VarDefault
--state-max-ageSHAPER_STATE_MAX_AGE0s

File to store and lookup name for the ingest consumer.

Binding consumer names to the local file system means they reset when the file system is reset. This works well together with Docker containers.

FlagEnv VarDefault
--ingest-consumer-name-fileSHAPER_INGEST_CONSUMER_NAME_FILE[--dir]/ingest-consumer-name.txt

File to store and lookup name for the state consumer.

Binding consumer names to the local file system means they reset when the file system is reset. This works well together with Docker containers.

FlagEnv VarDefault
--state-consumer-name-fileSHAPER_STATE_CONSUMER_NAME_FILE[--dir]/state-consumer-name.txt

Prefix for NATS subjects.

Is prepended to ingest-subject-prefix and state-subject-prefix.

Must be a valid NATS subject name. Should probably end with a dot.

FlagEnv VarDefault
--subject-prefixSHAPER_SUBJECT_PREFIX""

Prefix for ingest NATS subjects.

FlagEnv VarDefault
--ingest-subject-prefixSHAPER_INGEST_SUBJECT_PREFIXshaper.ingest.

Prefix for state NATS subjects.

FlagEnv VarDefault
--state-subject-prefixSHAPER_STATE_SUBJECT_PREFIXshaper.state.