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

commandline: path to config #33

Closed
Inveracity opened this issue Jan 24, 2021 · 2 comments · Fixed by #34
Closed

commandline: path to config #33

Inveracity opened this issue Jan 24, 2021 · 2 comments · Fixed by #34
Labels
priority: low status: WIP Work in progress type: enhancement Changes or improvements to existing features

Comments

@Inveracity
Copy link
Contributor

Inveracity commented Jan 24, 2021

Add commandline functionality to specify a path to a config

blackbox --config=path/to/config.yml

and of course have a sensible default

@lemonsaurus
Copy link
Owner

This is blocked by #31, the way it's currently specified, but I need a solution to this very soon, since it's blocking deployment for python-discord. For kubernetes, I can't put files into the root folder easily with volume mounts, I need to put them in subdirectories.

Here are two approaches I'm considering:

Just rglob the whole folder looking for the config file.

We could just make the config parser use pathlibs excellent .rglob to recursively search through every folder (except maybe .venv) looking for something like blackbox.yaml. Then, if it finds it, use that. That way, the user can put the file anywhere they want inside the blackbox folder and it'll work fine.

Allow an environment variable to specify the path

We could implement this as an environment variable at first, and then later we can add the commandline flag as well.

@lemonsaurus
Copy link
Owner

the rglob idea is more fun, but I don't know if it's useful. the rglob method does not allow you to configure a path outside the /blackbox folder, which may be useful.

Let's just implement an env var that it will respect for now, and then we can extend that method to a flag for the CLI tool later.

@Inveracity Inveracity mentioned this issue Jan 24, 2021
@Inveracity Inveracity added priority: low status: WIP Work in progress type: enhancement Changes or improvements to existing features labels Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low status: WIP Work in progress type: enhancement Changes or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants