tobogganSe connecter

packages

The Louise packages, each released on its own

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

NomDernier commitDate
src/packages: resilience, throttle and secrets from the apps; fetch.request (ADR 0081)il y a 1 sem.
CHANGELOG.mdA repository of its own: README, CI, release checks, fixturesil y a 4 j
louise.tomlVersion every package 0.21.0, on louise 0.22.0il y a 4 j
README.mdpackages: resilience, throttle and secrets from the apps; fetch.request (ADR 0081)il y a 1 sem.
README.MD

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.

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.