Skip to main content

Module cloud_env

Module cloud_env 

Source
Expand description

Cloud variables from [cloud] env_files, beside the real environment.

A project’s .env often holds the keys to its bucket. Reading one is opt-in: a .env picked up from whatever directory datui starts in, unasked, would be picking up secrets. Only cloud variable names are taken, the real environment wins over the files, and nothing is exported, so no program datui starts ever sees them.

Constants§

KNOWN
Variables datui itself reads. MC_HOST_<alias> is matched by prefix, and the names [[cloud.connections]] point at with *_env are added to these.

Functions§

load
Read the files cloud.env_files names, relative to dir, and keep their cloud variables for var. Returns a note for each file that could not be read.
parse
The KEY=value lines of a dotenv file whose key allowed accepts. Handles export , # comments, and single or double quotes around a value.
var
A variable: the real environment’s, else one from the env files.
vars
Every variable: the real environment, and the env files’ where it has none.