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

20 lines
633 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
Gitlab.ee do
begin
public_key_file = File.read(Rails.root.join(".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
# Needed to run migration
2019-10-12 21:52:04 +05:30
if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?('licenses')
2019-09-30 21:07:59 +05:30
message = LicenseHelper.license_message(signed_in: true, is_admin: true, in_html: false)
if ::License.block_changes? && message.present?
warn "WARNING: #{message}"
end
end
end