# Environment Variables

### Environment Variables

The environment variables can be set in the file `.env`, e.g.

```
CORE_API_AUTH_USERNAME=admin
CORE_API_AUTH_PASSWORD=datarhei
...
```

`.env` file and on the command line, the one set on the command line will overrule the one from the `.env` file.

The currently known environment variables (but not all will be respected) are:

| Name                                          | Default      | Description                                                                                                                                                                          |
| --------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CORE\_CONFIGFILE                              | (not set)    | Path to a config file. The following environment variables will override the respective values in the config file.                                                                   |
| CORE\_ADDRESS                                 | `:8080`      | HTTP listening address.                                                                                                                                                              |
| CORE\_LOG\_LEVEL                              | `info`       | silent, error, warn, info, debug.                                                                                                                                                    |
| CORE\_LOG\_TOPICS                             | (not set)    | List of topics to log (comma separated)                                                                                                                                              |
| CORE\_LOG\_MAXLINES                           | `1000`       | Number of latest log lines to keep in memory.                                                                                                                                        |
| CORE\_DB\_DIR                                 | `.`          | Directory for holding the operational data. This directory must exist.                                                                                                               |
| CORE\_HOST\_NAME                              | (not set)    | Set to the domain name of the host this instance is running on.                                                                                                                      |
| CORE\_HOST\_AUTO                              | `true`       | Enable detection of public IP addresses.                                                                                                                                             |
| CORE\_API\_READ\_ONLY                         | `false`      | Allow only ready only access to the API                                                                                                                                              |
| CORE\_API\_ACCESS\_HTTP\_ALLOW                | (not set)    | Comma separated list of IP ranges in CIDR notation (HTTP traffic), e.g. `127.0.0.1/32,::1/128`.                                                                                      |
| CORE\_API\_ACCESS\_HTTP\_BLOCK                | (not set)    | Comma separated list of IP ranges in CIDR notation (HTTP traffic), e.g. `127.0.0.1/32,::1/128`.                                                                                      |
| CORE\_API\_ACCESS\_HTTPS\_ALLOW               | (not set)    | Comma separated list of IP ranges in CIDR notation (HTTPS traffic), e.g. `127.0.0.1/32,::1/128`.                                                                                     |
| CORE\_API\_ACCESS\_HTTPS\_BLOCK               | (not set)    | Comma separated list of IP ranges in CIDR notation (HTTPS traffic), e.g. `127.0.0.1/32,::1/128`.                                                                                     |
| CORE\_API\_AUTH\_ENABLE                       | `true`       | Set to `false` to disable auth for all clients.                                                                                                                                      |
| CORE\_API\_AUTH\_DISABLE\_LOCALHOST           | `false`      | Set to `true` to disable auth for clients from localhost.                                                                                                                            |
| CORE\_API\_AUTH\_USERNAME                     | (required)   | Username for auth.                                                                                                                                                                   |
| CORE\_API\_AUTH\_PASSWORD                     | (required)   | Password for auth.                                                                                                                                                                   |
| CORE\_API\_AUTH\_JWT\_SECRET                  | (not set)    | A secret for en- and decrypting the JWT. If not set, a secret will be generated.                                                                                                     |
| CORE\_API\_AUTH\_AUTH0\_ENABLE                | `false`      | Enable Auth0.                                                                                                                                                                        |
| CORE\_API\_AUTH\_AUTH0\_TENANTS               | (not set)    | List of base64 encoded Auth0 tenant JSON objects (comma-separated). The tenant JSON object is defined as `{"domain":string,"audience":string,"users":array of strings}`              |
| CORE\_TLS\_ADDRESS                            | `:8181`      | Port to listen on for HTTPS requests.                                                                                                                                                |
| CORE\_TLS\_ENABLE                             | `false`      | Set to `true` to enable TLS support.                                                                                                                                                 |
| CORE\_TLS\_AUTO                               | `false`      | Set to `true` to enable automatic retrieval of a Let's Encrypt certificate. Requires `CORE_TLS_ENABLE` to be `true` and `CORE_HOST_NAME` to be set with `CORE_HOST_AUTO` to `false`. |
| CORE\_TLS\_CERTFILE                           | (not set)    | TLS certificate file in PEM format.                                                                                                                                                  |
| CORE\_TLS\_KEYFILE                            | (not set)    | TLS key file in PEM format.                                                                                                                                                          |
| CORE\_STORAGE\_DISK\_DIR                      | `.`          | A directory that will be exposed by HTTP on /. This directory must exist.                                                                                                            |
| CORE\_STORAGE\_DISK\_MAXSIZEMBYTES            | `0`          | Max. allowed megabytes for `CORE_STORAGE_DISK_DIR`.                                                                                                                                  |
| CORE\_STORAGE\_DISK\_CACHE\_ENABLE            | `true`       | Enable cache for files from `CORE_STORAGE_DISK_DIR`.                                                                                                                                 |
| CORE\_STORAGE\_DISK\_CACHE\_MAXSIZEMBYTES     | `0`          | Max. allowed cache size, 0 for unlimited.                                                                                                                                            |
| CORE\_STORAGE\_DISK\_CACHE\_TTLSECONDS        | `300`        | Seconds to keep files in cache.                                                                                                                                                      |
| CORE\_STORAGE\_DISK\_CACHE\_MAXFILESIZEMBYTES | `1`          | Max. file size to put in cache.                                                                                                                                                      |
| CORE\_STORAGE\_DISK\_CACHE\_TYPES             | (not set)    | List of file extensions to cache (space-separated, e.g. ".html .js"), empty for all.                                                                                                 |
| CORE\_STORAGE\_MEMORY\_AUTH\_ENABLE           | `true`       | Enable basic auth for PUT,POST, and DELETE on /memfs.                                                                                                                                |
| CORE\_STORAGE\_MEMORY\_AUTH\_USERNAME         | (not set)    | Username for Basic-Auth of `/memfs`. Required if auth is enabled.                                                                                                                    |
| CORE\_STORAGE\_MEMORY\_AUTH\_PASSWORD         | (not set)    | Password for Basic-Auth of `/memfs`. Required if auth is enabled.                                                                                                                    |
| CORE\_STORAGE\_MEMORY\_MAXSIZEMBYTES          | `0`          | Max. allowed megabytes for `/memfs`. Any value <= 0 means unlimited.                                                                                                                 |
| CORE\_STORAGE\_MEMORY\_PURGE                  | `false`      | Set to `true` to remove the oldest entries if the `/memfs`is full.                                                                                                                   |
| CORE\_STORAGE\_COCORE\_ORIGINS                | `*`          | List of allowed CORS origins (comma separated). Will be used for `/` and `/memfs`.                                                                                                   |
| CORE\_STORAGE\_MIMETYPES\_FILE                | `mime.types` | Path to file with MIME type definitions.                                                                                                                                             |
| CORE\_RTMP\_ENABLE                            | `false`      | Enable RTMP server.                                                                                                                                                                  |
| CORE\_RTMP\_ENABLE\_TLS                       | `false`      | Enable RTMP over TLS (RTMPS). Requires `CORE_TLS_ENABLE` to be `true`.                                                                                                               |
| CORE\_RTMP\_ADDRESS                           | `:1935`      | RTMP server listen address.                                                                                                                                                          |
| CORE\_RTMP\_APP                               | `/`          | RTMP app for publishing.                                                                                                                                                             |
| CORE\_RTMP\_TOKEN                             | (not set)    | RTMP token for publishing and playing. The token is the value of the URL query parameter `token`.                                                                                    |
| CORE\_FFMPEG\_BINARY                          | `ffmpeg`     | Path to FFmpeg binary.                                                                                                                                                               |
| CORE\_FFMPEG\_MAXPROCESSES                    | `0`          | Max. allowed simultaneously running FFmpeg instances. Any value <= 0 means unlimited.                                                                                                |
| CORE\_FFMPEG\_ACCESS\_INPUT\_ALLOW            | (not set)    | List of pattern for allowed input URI (space-separated), leave emtpy to allow any.                                                                                                   |
| CORE\_FFMPEG\_ACCESS\_INPUT\_BLOCK            | (not set)    | List of pattern for blocked input URI (space-separated), leave emtpy to block none.                                                                                                  |
| CORE\_FFMPEG\_ACCESS\_OUTPUT\_ALLOW           | (not set)    | List of pattern for allowed output URI (space-separated), leave emtpy to allow any.                                                                                                  |
| CORE\_FFMPEG\_ACCESS\_OUTPUT\_BLOCK           | (not set)    | List of pattern for blocked output URI (space-separated), leave emtpy to block none.                                                                                                 |
| CORE\_FFMPEG\_LOG\_MAXLINES                   | `50`         | Number of latest log lines to keep for each process.                                                                                                                                 |
| CORE\_FFMPEG\_LOG\_MAXHISTORY                 | `3`          | Number of latest logs to keep for each process.                                                                                                                                      |
| CORE\_PLAYOUT\_ENABLE                         | `false`      | Enable playout API where available                                                                                                                                                   |
| CORE\_PLAYOUT\_MINPORT                        | `0`          | Min. port a playout server per input can run on.                                                                                                                                     |
| CORE\_PLAYOUT\_MAXPORT                        | `0`          | Max. port a playout server per input can run on.                                                                                                                                     |
| CORE\_DEBUG\_PROFILING                        | `false`      | Set to `true` to enable profiling endpoint on `/profiling`.                                                                                                                          |
| CORE\_DEBUG\_FORCEGC                          | `0`          | Number of seconds between forcing GC to return memory to the OS. Use in conjuction with `GODEBUG=madvdontneed=1`. Any value <= 0 means not to force GC.                              |
| CORE\_METRICS\_ENABLE                         | `false`      | Enable collecting historic metrics data.                                                                                                                                             |
| CORE\_METRICS\_ENABLE\_PROMETHEUS             | `false`      | Enable prometheus endpoint /metrics.                                                                                                                                                 |
| CORE\_METRICS\_RANGE\_SECONDS                 | `300`        | Seconds to keep history metric data.                                                                                                                                                 |
| CORE\_METRICS\_INTERVAL\_SECONDS              | `2`          | Interval for collecting metrics.                                                                                                                                                     |
| CORE\_SESSIONS\_ENABLE                        | `false`      | Enable HLS statistics for `/memfs`.                                                                                                                                                  |
| CORE\_SESSIONS\_IP\_IGNORELIST                | (not set)    | Comma separated list of IP ranges in CIDR notation, e.g. `127.0.0.1/32,::1/128`.                                                                                                     |
| CORE\_SESSIONS\_SESSION\_TIMEOUT\_SEC         | `30`         | Timeout of a session in seconds.                                                                                                                                                     |
| CORE\_SESSIONS\_PERSIST                       | `false`      | Whether to persist the session history. Will be stored in `CORE_DB_DIR`.                                                                                                             |
| CORE\_SESSIONS\_MAXBITRATE\_MBIT              | `0`          | Max. allowed outgoing bitrate in mbit/s, 0 for unlimited.                                                                                                                            |
| CORE\_SESSIONS\_MAXSESSIONS                   | `0`          | Max. allowed number of simultaneous sessions, 0 for unlimited.                                                                                                                       |
| CORE\_ROUTER\_BLOCKED\_PREFIXES               | `/api`       | List of path prefixes that can't be routed.                                                                                                                                          |
| CORE\_ROUTER\_ROUTES                          | (not set)    | List of route mappings of the form \[from]:\[to], e.g. `/foo:/bar`. Leave empty for no routings.                                                                                     |

## For latest

You can also provide them on the command line, whatever you prefer. If the same environment variable is set in the&#x20;

## Learn more

{% content-ref url="../knowledge-base/troubleshooting/why-do-i-see-env-and-cannot-select-anything" %}
[why-do-i-see-env-and-cannot-select-anything](https://docs.datarhei.com/restreamer/knowledge-base/troubleshooting/why-do-i-see-env-and-cannot-select-anything)
{% endcontent-ref %}

{% content-ref url="../knowledge-base/user-guides/how-do-i-install-docker" %}
[how-do-i-install-docker](https://docs.datarhei.com/restreamer/knowledge-base/user-guides/how-do-i-install-docker)
{% endcontent-ref %}

{% content-ref url="../installing" %}
[installing](https://docs.datarhei.com/restreamer/installing)
{% endcontent-ref %}

{% content-ref url="../knowledge-base" %}
[knowledge-base](https://docs.datarhei.com/restreamer/knowledge-base)
{% endcontent-ref %}
