Configuration
The API server can be configured in the way that makes the most sense for your
deployment environment. Choose from either CLI arguments, environment variables
or a persistent config.yaml file located under the –config-dir option.
(Default’s to /config/config.yaml
inside the container.)
The values of these variables take precedence in the following order of highest to lowest:
- CLI arguments
- Environment variables
- Config file
For example, a CLI argument will override any values set by an environment variable or in the config file.
The following is an example config.yaml file showing the default values for the container:
addr: ":80"
auto_tls: false
auto_tls_staging: false
cache_lifetime: 1h0m0s
captures_dir: /data/captures
config_dir: /config
config_file: ""
cors_all: false
debug: false
environment: production
fetch_invalid_https: false
hostname: ""
https: ":443"
https_host: ""
license_dir: /license
no_tls: false
prefix: ""
profiles_dir: /data/profiles
s3_bucket: ""
s3_endpoint: ""
s3_use_path_style: false
sharkd: /usr/cloudshark/bin/sharkd
sharkd_debug: false
sharkd_docker: ""
sharkd_idle_timeout: 30s
storybook: false
version: false
To use these as a CLI argument, add --
to the argument name and add the =
sign. For example, use the CLI argument --debug
to turn on debugging. To
turn off a boolean option, you can set the value to false like
--cors-all=false
.
To set these as an environment variable, prefix the variable with PV_
and
replace all hyphens (-) with underscores (_). For example, the flag --no-tls
on the CLI
shows in the environment as PV_NO_TLS
set to true
.
Variable/Option Reference
Option | Description |
---|---|
addr |
HTTP Address/Port to bind to (default “:80”) |
auto-tls |
Enable automatic HTTPS via Let’s Encrypt and HOSTNAME environment variable |
auto-tls-staging |
With --auto-tls , get certificate via the Let’s Encrypt staging CA for testing purposes |
cache-lifetime |
Cache lifetime for files fetched from a URL or an S3 bucket (default 1h0m0s) |
captures-dir |
Directory to serve pcaps out of (default “./”) |
config-dir |
Directory where configuration files are stored (default “./”) |
cors-all |
Disable CORS protection for non-same-origin requests |
debug |
Enable debug mode |
environment |
Environment to run in, must be ‘production’ or ‘development’ (default “production”) |
fetch-invalid-https |
Allow fetching HTTPS URL’s with invalid certificates |
hostname |
Hostname to use for HTTPS |
https |
HTTP Address/Port to bind to (default “:443”) |
https-host |
Specify alternate host (or host:port) to use when redirecting HTTP to HTTPS |
license-dir |
Directory where license files are stored (default “/license”) |
no-tls |
Disable HTTPS entirely |
prefix |
URL prefix to serve the embedded UI |
profiles-dir |
Path to available profiles (default “./”) |
s3-bucket |
S3 bucket to use |
s3-endpoint |
S3 endpoint to use, i.e. https://s3.example.com:9000 |
s3-use-path-style |
Use path-style rather than virtual hosted S3 bucket addressing, i.e. “https://HOST/BUCKET/KEY” instead of “https://BUCKET.HOST/KEY” |
sharkd |
Full path of sharkd executable, cannot use with --sharkd-docker (default “/usr/cloudshark/bin/sharkd”) |
sharkd-debug |
Enable debug mode for sharkd |
sharkd-docker |
Docker image for sharkd, cannot use with --sharkd |
sharkd-idle-timeout |
Close sharkd processes if idle for this long (default 30s) |
storybook |
Enable the Storybook demo pages at the URL /storybook |
version |
Print version and exit |