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

Updates to CONFIG_DIR, and STATIC_ROOT #61

Merged
merged 1 commit into from
Feb 7, 2018
Merged

Conversation

kfdm
Copy link
Collaborator

@kfdm kfdm commented Feb 6, 2018

  • Rename CONFIG_DIR to PROMGEN_CONFIG_DIR to be more descriptive
  • Add PROMGEN_CONFIG as the path to promgen.yml
  • Add STATIC_ROOT (was unintentionally hardcoded)
  • Move SECRET_KEY within settings.py to allow override in promgen.yml

STATIC_ROOT was missed and I've updated PROMGEN_CONFIG_DIR based on a comment in #54

@seoester let me know if this seems reasonable to you regarding your documentation changes.

@codecov-io
Copy link

codecov-io commented Feb 6, 2018

Codecov Report

Merging #61 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #61   +/-   ##
=======================================
  Coverage   47.81%   47.81%           
=======================================
  Files          72       72           
  Lines        2405     2405           
=======================================
  Hits         1150     1150           
  Misses       1255     1255
Impacted Files Coverage Δ
promgen/settings.py 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efb811c...1ef8f4d. Read the comment docs.

* Rename CONFIG_DIR to PROMGEN_CONFIG_DIR to be more descriptive
* Add PROMGEN_CONFIG as the path to promgen.yml
* Add STATIC_ROOT (was unintentionally hardcoded)
* Move SECRET_KEY within settings.py to allow override in promgen.yml
@hmmxp
Copy link

hmmxp commented Feb 6, 2018

Dear Paul,

Much appreciated as this update will resolve the static file issues not displaying correctly and i no need to manually move the static file and configure alias in nginx

@seoester
Copy link
Contributor

seoester commented Feb 6, 2018

Looks good to me, I'll amend my PR to match the new PROMGEN_CONFIG_DIR setting.

My only concern is, that there are now three ways to specify SECRET_KEY: The env var, the SECRET_KEY file and django.SECRET_KEY key in the promgen config file.

@kfdm
Copy link
Collaborator Author

kfdm commented Feb 6, 2018

The env var and the SECRET_KEY file are basically the same. Everything in PROMGEN_CONFIG_DIR that is in ALLCAPS is loaded into the environ dictionary. I agree having multiple ways to configure things is a little strange, so perhaps this should be re-visited to clean it up a bit more.

At a high level, I suppose I imagined an org might build their own Docker image with their own promgen.yml file baked in, and then just use ENV vars to set connection information DATABASE and CELERY_BROKER_URL via ENV vars

@seoester
Copy link
Contributor

seoester commented Feb 6, 2018

Alright, I see.
What are your thoughts on precedence? As I understand the code django keys override env vars, which is counter-intuitive at least for a docker deployment.

@seoester seoester mentioned this pull request Feb 6, 2018
@kfdm
Copy link
Collaborator Author

kfdm commented Feb 7, 2018

You're right >_<
I think env should override the config variables so I'll need to take another pass at it.

@kfdm
Copy link
Collaborator Author

kfdm commented Feb 7, 2018

I want to go ahead and merge this to fix the variable naming and missing setting for STATIC_ROOT knowing that I still have the precedence incorrect. I will file a new PR to fix the precedence

@kfdm kfdm merged commit c5fee94 into line:master Feb 7, 2018
@kfdm kfdm deleted the static-root-env branch February 7, 2018 06:44
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

4 participants