Skip to content

Environment Variables

Vignesh Rao edited this page Feb 21, 2024 · 5 revisions

Environment variables can be loaded from a .env file. There are custom functions in place to parse and validate the values.

RuStream also supports custom filename/filepath to load the env vars.
All environment variables are case sensitive.

How to use a custom filepath to load environment variables?

RuStream is capable of using any plain text file to load env vars.
To use a custom file (other than .env) please set the filepath as env var env_file before triggering RuStream

export env_file="/home/secrets/custom_env_file"
./rustream  # If initiated using binary
cargo run  # If initiated using crate

Environment variables are parsed as JSON strings, so quote them appropriately.

For example

# quotes are not required
secure_session=false
workers=10

# quotes are not required, but preferred
video_source="/home/hannibal/hosted"

# quotes are mandatory
authorization='{"hannibal": "s0m3ranDomP@sswOrD"}'
file_formats='["mp4", "mov", "mkv"]'

Note that the file extensions in file_formats should not have a preceding . (dot) in them

Clone this wiki locally