Missing production secret_key_base in rails

223 views
Skip to first unread message

Reza Ardestani

unread,
May 19, 2014, 4:27:40 AM5/19/14
to rubyonra...@googlegroups.com
Hi,

I have asked this question on github.
Senny answered me to set 
export SECRET_KEY_BASE =d1f4810e662acf46a33960e3aa5bd0************************
in your peoduction server. but I do not know how to set that. I am deploying in openshift. I also have access to SSH via putty. I have tried this command in SSH but it gives an error "Invalid identifer". Where should I run this command?

Benjamin Iandavid Rodriguez

unread,
May 19, 2014, 2:22:34 PM5/19/14
to rubyonra...@googlegroups.com
If using bash edit your ~/.bashrc or ~/.bash_profile and add that line, if using zsh edit your ~/.zshrc reload your terminal, restart your app and you're done


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3b9903b7-3796-4353-96e2-558e107e5342%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hassan Schroeder

unread,
May 19, 2014, 4:21:27 PM5/19/14
to rubyonrails-talk
On Mon, May 19, 2014 at 11:22 AM, Benjamin Iandavid Rodriguez
<ian...@gmail.com> wrote:
> If using bash edit your ~/.bashrc or ~/.bash_profile and add that line, if
> using zsh edit your ~/.zshrc reload your terminal, restart your app and
> you're done

Right, because having that information in a file called 'secrets.yml'
would be AWFUL but having it in a file called '.bashrc' is just aces.

Not to mention that when your server is started at boot time by root
it will immediately fail because *your* bash environment is *not* that
of the root user...

Sigh.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Benjamin Iandavid Rodriguez

unread,
May 19, 2014, 6:22:33 PM5/19/14
to rubyonra...@googlegroups.com
Hey Hassan,

While I agree that having the secret key base defined in the secrets.yml file is better, remember that this feature was introduced in Rails 4.1

How would you know if this is the case?

I made that recommendation as he stated that the answer from github was to set the secret keybase using export. So please dont be rude and have a little more respect for those who aren't as experienced as you are.

My best,
Ian


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

Hassan Schroeder

unread,
May 19, 2014, 6:54:35 PM5/19/14
to rubyonrails-talk
On Mon, May 19, 2014 at 3:22 PM, Benjamin Iandavid Rodriguez
<ian...@gmail.com> wrote:

> I made that recommendation as he stated that the answer from github was to
> set the secret keybase using export. So please dont be rude and have a
> little more respect for those who aren't as experienced as you are.

My apologies, I meant neither rudeness nor disrespect.

The whole idea of loading initialization values through environment
variables in the name of "security" seems pointless to me if you're
going to put them all in a shell init file anyway :-)

We already put our DB server passwords in a file that's not typically
included in the app's repository but symlinked on deploy, and I've
never seen anyone express any issues with that.

In any case, the .bashrc approach *will* be a problem if the app's
started at boot time as a different user...

FWIW,

Reza Ardestani

unread,
May 20, 2014, 1:58:52 AM5/20/14
to rubyonra...@googlegroups.com
Thanks for sll answers.
I have asked this question specifically for openshif service. 
The answer is posted in this question.
Reply all
Reply to author
Forward
0 new messages