Greetings, Jeff,
Thank you for the reply. I tried the following, all without success:
export SECRET_KEY_BASE=“X”
sudo su user -c 'source /opt/ood/ondemand/enable; …
export SECRET_KEY_BASE=“/var/lib/ondemand-nginx/config/puns/user.secret_key_base.txt”
sudo su user -c 'source /opt/ood/ondemand/enable; …
export SECRET_KEY_BASE=“/var/lib/ondemand-nginx/config/puns”
sudo su user -c 'source /opt/ood/ondemand/enable; …
Next, taking a cue from the error message
ArgumentError: Missing secret_key_base
for ‘production’ environment,\
set this string with bin/rails credentials:edit
(ArgumentError)
I tried
(source /opt/ood/ondemand/enable; bin/rails credentials:edit)
and received the following messages:
No $EDITOR to open file in. Assign one like this:
EDITOR=“mate --wait” bin/rails credentials:edit
For editors that fork and exit immediately, it’s important to pass a wait flag,
otherwise the credentials will be saved immediately with no chance to edit.
Next I tried
(source /opt/ood/ondemand/enable; EDITOR=“/bin/vi” bin/rails credentials:edit)
and found myself in vi with the following file:
aws:
access_key_id: 123
secret_access_key: 345
Used as the base secret for all MessageVerifiers in Rails, including the one protecting cookies.
secret_key_base: XXXX
I exited the editor without making or saving changes and saw messages:
Adding config/master.key to store the encryption key: YYYY
Save this in a password manager your team can access.
If you lose the key, no one, including you, can access anything encrypted with it.
create config/master.key
IMPORTANT: Don’t commit config/master.key. Add this to your ignore file:
/config/master.key
on_green
File encrypted and saved.
Then I tried the test command again:
sudo su user -c 'source /opt/ood/ondemand/enable; …
and received the following messages:
rake aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /var/www/ood/apps/sys/dashboard/config/master.key (Errno::EACCES)
Directory “config” now contains the following:
(cd config; ls -lt | more)
-rw-r–r–. 1 root root 464 Jul 16 16:11 credentials.yml.enc
-rw-------. 1 root root 32 Jul 16 16:11 master.key
(everything else at least 2 days older)
First, please reassure me that I have not broken or locked anything irretrievably.
Second, what should I do next?
Regards,
Eric