Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load config from environment #117

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Load config from environment #117

wants to merge 7 commits into from

Conversation

bitbyt3r
Copy link
Member

This code allows loading all config values from environment variables.
For example, the following sideboard.ini

[cherrypy]
server.socket_port = 80
server.socket_host = 0.0.0.0
server.socket_timeout = 1
tools.sessions.host = redis
tools.sessions.prefix = uber
tools.sessions.storage_type = redis

[loggers]
cherrypy.access = DEBUG

would become the following environment variables.

sideboard_cherrypy_server.socket_port=80
sideboard_cherrypy_server.socket_host=0.0.0.0
sideboard_cherrypy_server.socket_timeout=1
sideboard_cherrypy_tools.sessions.host=redis
sideboard_cherrypy_tools.sessions.prefix=uber
sideboard_cherrypy_tools.sessions.storage_type=redis
sideboard_loggers_cherrypy.access=DEBUG

Additionally, you can specify ini files to load via SIDEBOARD_CONFIG_FILES and <plugin name>_CONFIG_FILES with ; separated lists of files. These files can have either absolute paths or paths relative to their plugin root_dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants