configure otp_secret_key secret

This commit is contained in:
Christophe Robillard 2020-11-05 11:17:09 +01:00
parent efd8ec85e8
commit a88172eb01
2 changed files with 3 additions and 1 deletions

View file

@ -26,7 +26,7 @@
# #
class Administration < ApplicationRecord class Administration < ApplicationRecord
devise :rememberable, :trackable, :validatable, :lockable, :async, :recoverable, devise :rememberable, :trackable, :validatable, :lockable, :async, :recoverable,
:two_factor_authenticatable, :otp_secret_encryption_key => ENV['OTP_SECRET_KEY'] :two_factor_authenticatable, :otp_secret_encryption_key => Rails.application.secrets.otp_secret_key
def enable_otp! def enable_otp!
self.otp_secret = Administration.generate_otp_secret self.otp_secret = Administration.generate_otp_secret

View file

@ -12,6 +12,7 @@
defaults: &defaults defaults: &defaults
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
signing_key: <%= ENV["SIGNING_KEY"] %> signing_key: <%= ENV["SIGNING_KEY"] %>
otp_secret_key: <%= ENV["OTP_SECRET_KEY"] %>
basic_auth: basic_auth:
username: <%= ENV['BASIC_AUTH_USERNAME'] %> username: <%= ENV['BASIC_AUTH_USERNAME'] %>
password: <%= ENV['BASIC_AUTH_PASSWORD'] %> password: <%= ENV['BASIC_AUTH_PASSWORD'] %>
@ -73,6 +74,7 @@ test:
<<: *defaults <<: *defaults
secret_key_base: aa52abc3f3a629d04a61e9899a24c12f52b24c679cbf45f8ec0cdcc64ab9526d673adca84212882dff3911ac98e0c32ec4729ca7b3429ba18ef4dfd1bd18bc7a secret_key_base: aa52abc3f3a629d04a61e9899a24c12f52b24c679cbf45f8ec0cdcc64ab9526d673adca84212882dff3911ac98e0c32ec4729ca7b3429ba18ef4dfd1bd18bc7a
signing_key: aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017 signing_key: aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017
otp_secret_key: 78ddda3679dc0ba2c99f50bcff04f49d862358dbeb7ead50368fdd6de14392be884ee10a204a0375b4b382e1a842fafe40d7858b7ab4796ec3a67c518d31112b
api_entreprise: api_entreprise:
key: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik9oIHllYWgiLCJpYXQiOjE1MTYyMzkwMjJ9.f06sBo3q2Yxnw_TYPFUEs0CozBmcV-XniH_DeKNWzKE" key: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik9oIHllYWgiLCJpYXQiOjE1MTYyMzkwMjJ9.f06sBo3q2Yxnw_TYPFUEs0CozBmcV-XniH_DeKNWzKE"
pipedrive: pipedrive: