diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-18 12:18:11 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-01-31 22:53:55 +0000 |
commit | 4afab3d4b64bf4aac228306636bb1b477debe8ce (patch) | |
tree | 9f26dd9ad06ab3976b328b330b4cc0e13185fc0d /app/models/project.rb | |
parent | 6bb7a19c2b4b130438cc4f24512feac9941a9b02 (diff) | |
download | gitlab-ce-4afab3d4b64bf4aac228306636bb1b477debe8ce.tar.gz |
Revert "Store pages in shared/pages/fqdn/fqdn/public or shared/pages/fqdn/subpath/public - makes it simpler to implement CNAMEs in future"
This reverts commit 86a2a78f0d13a678899460638add6b862059433e.
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 9cdd01e433d..a1888c089ce 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1137,7 +1137,6 @@ class Project < ActiveRecord::Base issues.opened.count end -<<<<<<< HEAD def visibility_level_allowed_as_fork?(level = self.visibility_level) return true unless forked? @@ -1163,23 +1162,22 @@ class Project < ActiveRecord::Base ensure_runners_token! end - def pages_host - "#{namespace.path}.#{Settings.pages.host}" - end - def pages_url if Dir.exist?(public_pages_path) - url = Gitlab.config.pages.url.sub(Settings.pages.host, pages_host) + host = "#{namespace.path}.#{Settings.pages.host}" + url = Gitlab.config.pages.url.sub(/^https?:\/\//) do |prefix| + "#{prefix}#{namespace.path}." + end # If the project path is the same as host, leave the short version - return url if pages_host == path + return url if host == path "#{url}/#{path}" end end def pages_path - File.join(Settings.pages.path, pages_host, path) + File.join(Settings.pages.path, path_with_namespace) end def public_pages_path |