2019-07-08 21:06:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-07-08 15:46:34 -04:00
|
|
|
Gitlab.ee do
|
2020-09-25 05:09:40 -04:00
|
|
|
prefix = ENV['GITLAB_LICENSE_MODE'] == 'test' ? 'test_' : ''
|
|
|
|
public_key_file = File.read(Rails.root.join(".#{prefix}license_encryption_key.pub"))
|
2020-02-24 16:09:08 -05:00
|
|
|
public_key = OpenSSL::PKey::RSA.new(public_key_file)
|
|
|
|
Gitlab::License.encryption_key = public_key
|
|
|
|
rescue
|
|
|
|
warn "WARNING: No valid license encryption key provided."
|
2019-07-08 15:46:34 -04:00
|
|
|
end
|