actix / actix/actix-extras

Settings: Builtin mapping from environment variables

Offen
#386 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
A-settings C-feature
Vorherrschende Sprache
Rust
Sterne
889
Forks
224
Ø Merge
9 Std. 37 Min.
Gemergte PRs (30 T.)
20

Beschreibung

## Expected Behavior

IMO actix-settings should have a default mechanism for overriding all settings from the environment. i.e. it should provide a consistent mapping of its settings to env-var names, so there is a function like 'apply_env(..)' which will read the env and override with any values found there.

Env vars are the more typical approach for overriding settings in a production service, e.g. in k8s. c.f. https://12factor.net/config and many others.

Some people prefer to use config files over envvars, but usually settings systems allow for both.

## Current Behavior

The application needs to define all of their own env var names.

## Possible Solution

IMO the names for the envvars could be prefixed with `ACTIX_` and `APPLICATION_` matching the toml, and then the rest of the name being the key in the toml with `-` -> `_` .

## Steps to Reproduce (for bugs)

## Context

## Your Environment

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.