diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/models/pages | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/models/pages')
-rw-r--r-- | app/models/pages/lookup_path.rb | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/app/models/pages/lookup_path.rb b/app/models/pages/lookup_path.rb index 17131cd736d..e7d455085c0 100644 --- a/app/models/pages/lookup_path.rb +++ b/app/models/pages/lookup_path.rb @@ -26,7 +26,18 @@ module Pages end def source - zip_source || legacy_source + return unless deployment&.file + + global_id = ::Gitlab::GlobalId.build(deployment, id: deployment.id).to_s + + { + type: 'zip', + path: deployment.file.url_or_file_path(expire_at: 1.day.from_now), + global_id: global_id, + sha256: deployment.file_sha256, + file_size: deployment.size, + file_count: deployment.file_count + } end def prefix @@ -46,32 +57,5 @@ module Pages project.pages_metadatum.pages_deployment end end - - def zip_source - return unless deployment&.file - - global_id = ::Gitlab::GlobalId.build(deployment, id: deployment.id).to_s - - { - type: 'zip', - path: deployment.file.url_or_file_path(expire_at: 1.day.from_now), - global_id: global_id, - sha256: deployment.file_sha256, - file_size: deployment.size, - file_count: deployment.file_count - } - end - - # TODO: remove support for legacy storage in 14.3 https://gitlab.com/gitlab-org/gitlab/-/issues/328712 - # we support this till 14.3 to allow people to still use legacy storage if something goes very wrong - # on self-hosted installations, and we'll need some time to fix it - def legacy_source - return unless ::Settings.pages.local_store.enabled - - { - type: 'file', - path: File.join(project.full_path, 'public/') - } - end end end |