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

Environment Variables guide #224

Open
cllns opened this issue Oct 10, 2016 · 7 comments
Open

Environment Variables guide #224

cllns opened this issue Oct 10, 2016 · 7 comments

Comments

@cllns
Copy link
Member

cllns commented Oct 10, 2016

Right now we use dotenv in development and test environments, but not production. This issue has effected several people in the chat.

We should consider adding a guide for Environment variables. Specifically, explain how they're set in development and test, as well as offer some suggestions for how to set them in production (heroku config:set,.env.production combined with an entry in .gitignore, or even .bashrc).

We can talk about SERVE_STATIC_ASSETS and APPNAME_SESSIONS_SECRET there too.

@vlad-at-work
Copy link
Contributor

Which section do you see that fitting best under in the Guide? Dotenv is easy enough but the SERVE_STATIC_ASSETS + heroku may be tricky for some.

@jodosha
Copy link
Member

jodosha commented Oct 24, 2016

@cllns Please do 👍 Be sure to make clear the security concerns of having a .env file in source control.

@schnittchen
Copy link

schnittchen commented Dec 5, 2016

@jodosha why not add ^.env.production to the initially generated .gitignore?

@schnittchen
Copy link

I noticed HANAMI_ENV is nowhere mentioned in the guides.

@florish
Copy link

florish commented Dec 12, 2016

I also had trouble finding documentation on HANAMI_ENV, took me some trial and error, especially when running database migrations for test environment.

I'd love to help documenting this, but similar to the comment by @vladdypwnz, I'm new to Hanami and not sure where a section on environment variables belongs in the Guides. If anyone could give some pointers, that would be great.

@jodosha
Copy link
Member

jodosha commented Dec 21, 2016

@schnittchen

why not add ^.env.production to the initially generated .gitignore?

Because .env.production isn't generated by Hanami, and because for production env it MUST NOT be used. You should set env variables via your VPS/Cloud provider.

@jodosha
Copy link
Member

jodosha commented Dec 21, 2016

@cllns I think this guide should be under Guides -> Projects section.

It should include the details mentioned in the comment above ☝️ and how to use Dotenv.

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

No branches or pull requests

6 participants