Module: Gitlab::Pages
- Includes:
- JwtAuthenticatable
- Defined in:
- lib/gitlab/pages.rb,
lib/gitlab/pages/settings.rb,
lib/gitlab/pages/url_builder.rb,
lib/gitlab/pages/random_domain.rb,
lib/gitlab/pages/virtual_host_finder.rb,
lib/gitlab/pages/deployment_validations.rb
Defined Under Namespace
Classes: DeploymentValidations, RandomDomain, Settings, UniqueDomainGenerationFailure, UrlBuilder, VirtualHostFinder
Constant Summary
collapse
- VERSION =
File.read(Rails.root.join("GITLAB_PAGES_VERSION")).strip.freeze
'Gitlab-Pages-Api-Request'
- MAX_SIZE =
1.terabyte
- DEPLOYMENT_EXPIRATION =
24.hours
JwtAuthenticatable::SECRET_LENGTH
Class Method Summary
collapse
included
Class Method Details
.access_control_is_forced? ⇒ Boolean
.add_unique_domain_to(project) ⇒ Object
38
39
40
41
42
43
44
45
|
# File 'lib/gitlab/pages.rb', line 38
def add_unique_domain_to(project)
return unless enabled?
return if project.project_setting.pages_unique_domain_in_database.present?
project.project_setting.pages_unique_domain_enabled = true
project.project_setting.pages_unique_domain = generate_unique_domain(project)
end
|
.enabled? ⇒ Boolean
34
35
36
|
# File 'lib/gitlab/pages.rb', line 34
def enabled?
Gitlab.config.pages.enabled
end
|
.multiple_versions_enabled_for?(project) ⇒ Boolean
47
48
49
50
51
52
|
# File 'lib/gitlab/pages.rb', line 47
def multiple_versions_enabled_for?(project)
return false if project.blank?
::Feature.enabled?(:pages_multiple_versions_setting, project) &&
project.licensed_feature_available?(:pages_multiple_versions)
end
|
.secret_path ⇒ Object
25
26
27
|
# File 'lib/gitlab/pages.rb', line 25
def secret_path
Gitlab.config.pages.secret_file
end
|
.verify_api_request(request_headers) ⇒ Object
19
20
21
22
23
|
# File 'lib/gitlab/pages.rb', line 19
def verify_api_request()
decode_jwt([INTERNAL_API_REQUEST_HEADER], issuer: 'gitlab-pages')
rescue JWT::DecodeError
false
end
|