summaryrefslogtreecommitdiff
path: root/config/initializers/0_license.rb
blob: ce3103be2e441329e2e08d2d1884591e28824149 (plain)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

Gitlab.ee do
  prefix = ENV['GITLAB_LICENSE_MODE'] == 'test' ? 'test_' : ''
  public_key_file = File.read(Rails.root.join(".#{prefix}license_encryption_key.pub"))
  public_key = OpenSSL::PKey::RSA.new(public_key_file)
  Gitlab::License.encryption_key = public_key
rescue
  warn "WARNING: No valid license encryption key provided."
end