diff options
author | Krasimir Angelov <kangelov@gitlab.com> | 2019-09-10 01:26:17 +0300 |
---|---|---|
committer | Krasimir Angelov <kangelov@gitlab.com> | 2019-09-19 03:09:36 +0300 |
commit | 7469a7726f367c5b426be18970463c6c25ed5643 (patch) | |
tree | 6854568878c9d6551c10debe308e8184b6e0f71e /lib | |
parent | a7706bcb567ee31c6454c4197354b3210839b564 (diff) |
Add support for namespaces to Pages internal API61927-pages-namespaces-virtual-domain
Introduce new `project_pages_metadata` table, insert new record on
project creation. Update its `depoyed` flag when pages are
deployed/removed.
Return only these projects from namespace that have pages marked as
deployed. On-demand and mass data migration will handled in subsequent
commits.
Related to https://gitlab.com/gitlab-org/gitlab-ee/issues/28781.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/internal/pages.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/api/internal/pages.rb b/lib/api/internal/pages.rb index eaa434cff51..003af7f6dd4 100644 --- a/lib/api/internal/pages.rb +++ b/lib/api/internal/pages.rb @@ -17,11 +17,18 @@ module API namespace 'internal' do namespace 'pages' do + desc 'Get GitLab Pages domain configuration by hostname' do + detail 'This feature was introduced in GitLab 12.3.' + end + params do + requires :host, type: String, desc: 'The host to query for' + end get "/" do - host = PagesDomain.find_by_domain(params[:host]) + host = Namespace.find_by_pages_host(params[:host]) || PagesDomain.find_by_domain(params[:host]) not_found! unless host virtual_domain = host.pages_virtual_domain + no_content! unless virtual_domain present virtual_domain, with: Entities::Internal::Pages::VirtualDomain end |