meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
git:gitlab:pages [2020/04/09 13:43] niziakgit:gitlab:pages [2020/06/03 11:17] (current) niziak
Line 1: Line 1:
 +====== Pages ======
 +
 Support for domains and certificates is disabled. Ask your system's administrator to enable it.  Support for domains and certificates is disabled. Ask your system's administrator to enable it. 
  
Line 11: Line 13:
 gitlab_pages['enable'] = true gitlab_pages['enable'] = true
 gitlab_pages['inplace_chroot'] = true gitlab_pages['inplace_chroot'] = true
 +pages_external_url "http://doc.gitlab.org"
 </file> </file>
 +
 +Apply changes:
 +<code bash>
 +gitlab-ctl reconfigure
 +gitlab-ctl restart
 +# or after minitor changes:
 +gitlab-ctl restart gitlab-pages
 +</code>
 +
 +Log tails:
 +<code bash>gitlab-ctl tail gitlab-pages</code>
 +
  
 ====== Enable artifact preview ====== ====== Enable artifact preview ======
Line 24: Line 39:
  
  
-===== Headline =====+===== Issues ===== 
 + 
 +When ''inplace_chroot'' is used (needed for Docker/LXC where full chroot is not possible because access right problems), 2 issues has to be resolved. 
 +More about side effect of using ''inplace_chroot'': [[https://gitlab.com/gitlab-org/gitlab-pages#caveats]] 
 + 
 +===== No DNS resolution ===== 
 + 
 +Provide ''resolv.conf'' inside chrooted environment: 
 +<code bash> 
 +mkdir -p /var/opt/gitlab/gitlab-rails/shared/pages/etc 
 +cp /etc/resolv.conf /var/opt/gitlab/gitlab-rails/shared/pages/etc/ 
 +</code> 
 +NOTE: read side effects of this solution: [[https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4243]] 
 + 
 +Another solution is to force requests to IP address - check solution below [[git:gitlab:pages#provide_url_to_gitlab_artifact_server]]
  
 ===== SSL cert is not trusted ===== ===== SSL cert is not trusted =====
  
-Put your own CA cert to ''/etc/gitlab/trusted-certs''+Gitlab pages try to download artifact from main Gitlab server using main URL with https.  
 +When main gitlab instance is servered with not trusted certificate, gitlab pages cannot download it. 
 +Solution is to provide ''cacerts.pem'' inside chrooted environment 
 +<code bash> 
 +mkdir -p /var/opt/gitlab/gitlab-rails/shared/pages/opt/gitlab/embedded/ssl/certs
 +cp /opt/gitlab/embedded/ssl/certs/cacert.pem /var/opt/gitlab/gitlab-rails/shared/pages/opt/gitlab/embedded/ssl/certs/ 
 +cat /opt/gitlab/embedded/ssl/certs/cacert.pem /usr/local/share/ca-certificates/my_own_CA.crt > /var/opt/gitlab/gitlab-rails/shared/pages/opt/gitlab/embedded/ssl/certs/cacert.pem 
 +</code> 
 + 
 +Another solution is to force requests to IP address - check solution below [[git:gitlab:pages#provide_url_to_gitlab_artifact_server]] 
 + 
 +===== Provide URL to gitlab artifact server ===== 
 +IT can only work if there is no redirect from ''http'' to ''https''
 +<file ruby | /etc/gitlab/gitlab.rb> 
 +gitlab_pages['artifacts_server'] = true 
 +gitlab_pages['artifacts_server_url'] = 'http://127.0.0.1/api/v4/' 
 +</file> 
 + 
 + 
 + 
 + 
 +====== gitlabpages: more mime types ====== 
 +By default gitlab-pages shows only some files inside browser. Most of files (like .log) are server as ''application/octet-stream''
 +Accoring to Gitlab MR [[https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/57|MR]] and this [[https://gitlab.com/gitlab-org/gitlab-pages/-/issues/30||issue]] 
 +gitlab-pages daemon is now using embedded, compiled-in mime databse [[https://gitlab.com/lupine/go-mimedb|go-mimedb]], but it doesn't work. 
 + 
 +Digging inside gitlab-pages binary ''/opt/gitlab/embedded/bin/gitlab-pages'' shows strings related to default system mime database: 
 +  * ''/etc/mime.types'' 
 +  * ''/etc/apache/mime.types'' 
 +  * ''/etc/apache2/mime.types''