quilla icon indicating copy to clipboard operation
quilla copied to clipboard

Add support for loading configuration from environment variables

Open cryptaliagy opened this issue 3 years ago • 0 comments

At this time, Quilla exclusively gets its configuration from the CLI options. However, it might be of use to have the options be read from environment variables.

My recommendation for this would be to add a plugin that uses the quilla_configure hook, and check some environment variables and the CLI parsed args to see what should be pulled from the environment and what shouldn't. Alternatively, using the quilla_addopts hook would potentially allow the setting of defaults for the various configuration options, which would bypass the need for changing the context object later on

One potential limitation to this approach would be the plugin execution order. If a plugin (i.e. the BlobStorage plugin) needs the configuration options at a specific time, then the environment loader would necessarily need to run prior to the BlobStorage plugin. However, that can also be mitigated by only handling environment configuration of parser options that are created in the make_parser function, and adding logic in the BlobStorage plugin to handle its own needs

cryptaliagy avatar Jul 21 '21 22:07 cryptaliagy