Skip to content

Commit

Permalink
Adding secret support
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbyt3r committed Feb 7, 2023
1 parent a691ee5 commit bec7fb6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions make_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

root = os.environ.get("UBERSYSTEM_ROOT", "/app")
config = os.environ.get("UBERSYSTEM_CONFIG", "[]")
secrets = yaml.load(os.environ.get("UBERSYSTEM_SECRETS", "{}"), Loader=yaml.Loader)


plugins = os.listdir(os.path.join(root, "plugins"))
plugin_configs = {x: [] for x in plugins}
Expand Down Expand Up @@ -50,6 +52,8 @@
config = configs[0]
for override in configs[1:]:
config.merge(override)
if plugin in secrets:
config.merge(ConfigObj(secrets[plugin]))
config.filename = os.path.join(root, "plugins/", plugin, "development.ini")
config.write()
with open(os.path.join(root, "plugins/", plugin, "development.ini"), "r") as CONFIG:
Expand All @@ -59,6 +63,8 @@
config = sideboard_configs[0]
for override in configs[1:]:
config.merge(override)
if "sideboard" in secrets:
config.merge(ConfigObj(secrets["sideboard"]))
config.filename = os.path.join(root, "development.ini")
config.write()
with open(os.path.join(root, "development.ini"), "r") as CONFIG:
Expand Down

0 comments on commit bec7fb6

Please sign in to comment.