diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-05-09 13:45:25 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-05-09 13:45:25 +0000 |
commit | 444959bfa0b79e827a2a1a7a314acac19390f976 (patch) | |
tree | 86e727c66f658c0d9ebb543e70a9533f4be5e0d1 /config | |
parent | 81528a3a88f4a9d1c3e07f567797c485746356a1 (diff) | |
download | gitlab-ce-444959bfa0b79e827a2a1a7a314acac19390f976.tar.gz |
Generate Let's Encrypt private key
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/01_secret_token.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/config/initializers/01_secret_token.rb b/config/initializers/01_secret_token.rb index 02bded43083..4328ca509ba 100644 --- a/config/initializers/01_secret_token.rb +++ b/config/initializers/01_secret_token.rb @@ -28,7 +28,8 @@ def create_tokens secret_key_base: file_secret_key || generate_new_secure_token, otp_key_base: env_secret_key || file_secret_key || generate_new_secure_token, db_key_base: generate_new_secure_token, - openid_connect_signing_key: generate_new_rsa_private_key + openid_connect_signing_key: generate_new_rsa_private_key, + lets_encrypt_private_key: generate_lets_encrypt_private_key } missing_secrets = set_missing_keys(defaults) @@ -49,6 +50,10 @@ def generate_new_rsa_private_key OpenSSL::PKey::RSA.new(2048).to_pem end +def generate_lets_encrypt_private_key + OpenSSL::PKey::RSA.new(4096).to_pem +end + def warn_missing_secret(secret) warn "Missing Rails.application.secrets.#{secret} for #{Rails.env} environment. The secret will be generated and stored in config/secrets.yml." end |