debian-mirror-gitlab/config/initializers/0_license.rb

11 lines
366 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
Gitlab.ee do
2021-01-03 14:25:43 +05:30
prefix = ENV['GITLAB_LICENSE_MODE'] == 'test' ? 'test_' : ''
public_key_file = File.read(Rails.root.join(".#{prefix}license_encryption_key.pub"))
2020-04-08 14:13:33 +05:30
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-09-30 21:07:59 +05:30
end