Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4bba30ca
Commit
4bba30ca
authored
Jul 08, 2019
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap 0_license initializer in `ee` block
parent
f6d3c3c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
config/initializers/0_license.rb
config/initializers/0_license.rb
+16
-12
No files found.
config/initializers/0_license.rb
View file @
4bba30ca
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
require_dependency
'lib/gitlab'
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
if
ActiveRecord
::
Base
.
connected?
&&
ActiveRecord
::
Base
.
connection
.
data_source_exists?
(
'licenses'
)
message
=
LicenseHelper
.
license_message
(
signed_in:
true
,
is_admin:
true
,
in_html:
false
)
if
::
License
.
block_changes?
&&
message
.
present?
warn
"WARNING:
#{
message
}
"
# Needed to run migration
if
ActiveRecord
::
Base
.
connected?
&&
ActiveRecord
::
Base
.
connection
.
data_source_exists?
(
'licenses'
)
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment