-
Notifications
You must be signed in to change notification settings - Fork 197
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
improvement about config.py #786
Comments
Moving some secrets to config_access.py seems like a good idea, although AFAIK what broke local setup last time was that the variable name of one of the secrets changed. Also, looking through config.py as it is, it seems to have only a few things that are not secret.. |
It's an idea. Another one would be to check in Another one is (a variation of @magsout proposal):
|
A runtime check in run.py is a cool idea. It could relatively easily remove all strings (single- or doublequoted) from the config.py and config.py.example sources, then do a string comparison. It might have to take care of linebreaks. So run.py would output an error if the files didn't match, something like
|
I have zero opinions on how we do this, except I have broken production because I haven't added some new config variables from config.py.example to my config.py (so of course the app explodes). So whatever we do, it'll be a good thing. Lots of good options here, as long as we keep the environment variables we use for Travis (but those would likely stay in secret.py or whatever we end up with). |
IMO, We just need to separate the environment variables (secret key, url callback) form the Constants or other necessary variables in runtime. I do not know too Python framework, so it's hard for me to suggest something to normalize. But I tend to repeat the same mistakes in that file and same errors. |
We need to get more specific here. The first thing in config.py.example that's potentially secret is
How secret is this secret? Move to secrets.py? GitHub client secret etc - this is secret and definitely moves to secrets.py: OAUTH_TOKEN="" should move to secrets.py but if it wasn't set there, config.py can try to read it from environment variables. So, secrets.py.example might be https://gist.github.com/hallvors/fdcfe5aeaea86b0fcf1f |
Super secret. Needs to get moved, IMO. The rest sounds good. 👍 |
OK, I'm going to take the following approach: Have a top-level config/ folder where we stick config-y things:
In the future we can add I think this should be a not-too-painful upgrade, because we'll keep |
As a result, we no longer need config.py(.example)
Oops, need to split up b479fa1. |
As a result, we no longer need config.py(.example)
👍 |
As a result, we no longer need config.py(.example)
I don't know if it's me, but each time
config.py
is updated (and of course I don't see it) I spend many times to understand the errors in my terminal.Plus, with the @karlcow 's idea about export some information like the list of
Categories
(which is the great idea,) can may complicate maintenance of this file because it does not track by git. I wonder if it would not be better to have two files, maybe something like:config_app.py
andconfig_access.py
config_access.py
has only information about github acces (call_back_url
,client_secret
etc) is not tracked by gitconfig.py
but withtout variable (callback_url
,secret key
etc..) but importconfig_access.py
to have access forcallback_url, client_secret
etc) is tracked by git. We can add information without break the config and the website.It's just a thought. What do you think ?
The text was updated successfully, but these errors were encountered: