Skip to content

Minimalistic configuration library with encryption and a tasty name 🦆

License

Notifications You must be signed in to change notification settings

dolead/confit2canard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI Codacy Badge

Confit2Canard 🦆

Minimalistic library to load settings from JSON and YAML files that also provides configuration encryption with AES-GCM.

The history of the confit de canard.

How to use

Configuration files written to a relative path:

# app.yml
title: How to cook?
# production/tokens.yml
api:
  token: AZERTY1234
# production/secrets.yml
$Vault;UZXhoxTumLPE6zkT;kRg9bGtmKFn/BeFODX5+;zFgpPMrgxAaVQW6Wv5Q6Ow==

The script:

# main.py
from confit2canard import Config

passkey = "ThisIsSupposedToBeAKey0000000000"
configuration_files = ["app.yml",
                       "production/tokens.yml",
                       "production/secrets.yml"]
configuration = Config(configuration_files, passkey=passkey)

print(configurgation.title)
print(configurgation.find("api.token"))

The configuration files can be JSON or YAML.

Command line tool

The VAULT_PASSKEY environment variable must be set to write encrypted configuration with a AES-GCM key:

VAULT_PASSKEY="ThisIsSupposedToBeAKey0000000000" python \
  -m confit2canard production/secrets.yml

About

Minimalistic configuration library with encryption and a tasty name 🦆

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published