# secrets Secrets from files, the way container secrets are mounted (ADR 0081): a variable `NAME` may instead be given as `NAME_FILE`, the path of a file holding it. Pure Louise, no dependencies. Promoted from toki2's and the newsletter's `secret_files`. ```louise import secrets let env = fn name { os.env name } use files <- result.try (secrets.read ["DATABASE_URL", "APP_ROOT_KEY"] env file.read_text) let setting = fn name { secrets.lookup files env name } // setting "DATABASE_URL" is the file's content when DATABASE_URL_FILE is // set, the variable otherwise. ``` - Only the names given are read from files; `NAME` and `NAME_FILE` both set is an error, as is a file that cannot be read. - One trailing newline (`\n` or `\r\n`) is dropped, as editors add one. - Read once in `main`, for the server and every command.