Product
Search Results

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:

  1. CLI arguments
  2. Environment variables
  3. 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
cors-all: true
debug: false
hostname: ''
https: :443
https-host: ''
no-tls: false
profiles-dir: /data/profiles
prefix: ''
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

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, to disable TLS, set the environment variable PV_NO_TLS to true.

Variable Reference

Variable 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 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
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
no-tls Disable HTTPS entirely
profiles-dir Path to available profiles (default “./”)
prefix URL prefix to serve the embedded UI
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 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