Skip to content
Snippets Groups Projects
Commit 7cd195b1 authored by Matthias Fechner's avatar Matthias Fechner
Browse files

www/gitlab-ce: simplify gitlab-pages documentation and add doce for it

How to configure Gitlab-Pages (currently without TLS) can be found here:
https://gitlab.fechner.net/mfechner/Gitlab-docu/-/blob/master/install/16.0-freebsd.md#9-gitlab-pages

I will check later if TLS configuration is even required if a TLS proxy
like haproxy is in front of nginx.
parent 197b4b59
No related branches found
No related tags found
No related merge requests found
PORTNAME= gitlab-ce
PORTVERSION= 16.0.1
PORTREVISION= 1
CATEGORIES= www devel
MAINTAINER= mfechner@FreeBSD.org
......@@ -415,14 +416,16 @@ post-install:
@${ECHO_CMD} "@dir ${WWWDIR_REL}/qa/tmp" >> ${TMPPLIST}
@${ECHO_CMD} "@dir ${WWWDIR_REL}/spec/support/gitlab-git-test.git/refs/heads" >> ${TMPPLIST}
@${ECHO_CMD} "@dir ${WWWDIR_REL}/spec/support/gitlab-git-test.git/refs/tags" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,755) ${WWWDIR_REL}/shared" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared/artifacts" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared/artifacts/tmp" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared/artifacts/tmp/cache" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared/artifacts/tmp/uploads" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared/artifacts/tmp/work" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,770) ${WWWDIR_REL}/shared/packages" >> ${TMPPLIST}
@${ECHO_CMD} "@group gitlab-pages" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,770) ${WWWDIR_REL}/shared/pages" >> ${TMPPLIST}
@${ECHO_CMD} "@group www" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared/terraform_state" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared/tmp" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(,,700) ${WWWDIR_REL}/shared/lfs-objects" >> ${TMPPLIST}
......
--- config/gitlab.yml.example.orig 2023-05-18 16:48:55 UTC
--- config/gitlab.yml.example.orig 2023-05-22 18:44:12 UTC
+++ config/gitlab.yml.example
@@ -456,7 +456,7 @@ production: &base
## GitLab Pages
pages:
enabled: false
- access_control: false
+ access_control: true
# The location where pages are stored (default: shared/pages).
# path: shared/pages
@@ -466,9 +466,9 @@ production: &base
host: example.com
port: 80 # Set to 443 if you serve the pages with HTTPS
https: false # Set to true if you serve the pages with HTTPS
- artifacts_server: true # Set to false if you want to disable online view of HTML artifacts
- # external_http: ["1.1.1.1:80", "[2001::1]:80"] # If defined, enables custom domain support in GitLab Pages
- # external_https: ["1.1.1.1:443", "[2001::1]:443"] # If defined, enables custom domain and certificate support in GitLab Pages
+ artifacts_server: false # Set to false if you want to disable online view of HTML artifacts
+ external_http: ["127.0.0.1:8090"] # If defined, enables custom domain support in GitLab Pages
+ # external_https: ["127.0.0.1:8090"] # If defined, enables custom domain and certificate support in GitLab Pages
# File that contains the shared secret key for verifying access for gitlab-pages.
# Default is '.gitlab_pages_secret' relative to Rails.root (i.e. root of the GitLab app).
@@ -1192,14 +1192,14 @@ production: &base
# real path not the symlink.
storages: # You must have at least a `default` storage path.
......
PORTNAME= gitlab-pages
PORTVERSION= 16.0.1
PORTREVISION= 1
DISTVERSIONPREFIX= v
CATEGORIES= www
MASTER_SITES+= https://gitlab.com/gitlab-org/gitlab-pages/-/raw/v${DISTVERSION}/
......@@ -22,11 +23,27 @@ GL_COMMIT= 8cda253ced465c7c9764332d7f5210ea3c976236
GO_BUILDFLAGS= -ldflags="-X 'main.VERSION=${PORTVERSION}' -X 'main.REVISION=${GL_COMMIT}'"
PLIST_FILES= bin/gitlab-pages
USE_RC_SUBR= gitlab_pages
USERS= gitlab-pages
GROUPS= gitlab-pages
post-patch:
${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/gitlab-pages.conf.sample
do-install:
@${MKDIR} ${STAGEDIR}${DATADIR}
${MKDIR} ${STAGEDIR}${DATADIR}/bin
(cd ${WRKDIR}/bin/ && ${COPYTREE_BIN} . ${STAGEDIR}${DATADIR}/bin)
.for x in gitlab-pages.conf.sample
${INSTALL_DATA} ${WRKSRC}/${x} ${STAGEDIR}${DATADIR}/
.endfor
post-install:
${FIND} -s ${STAGEDIR}${DATADIR} -not -type d | ${SORT} | \
${SED} -e 's#^${STAGEDIR}${PREFIX}/##' | \
${SED} -E -e '/sample$$/ s#^#@sample #; \
s#${DATADIR_REL}/bin#@(,,555) ${DATADIR_REL}/bin#; ' >> ${TMPPLIST}
cat ${TMPPLIST}
.include <bsd.port.mk>
......@@ -31,6 +31,7 @@ load_rc_config $name
: ${gitlab_pages_user:="gitlab-pages"}
: ${gitlab_pages_group:="gitlab-pages"}
: ${gitlab_pages_logfile:="/var/log/gitlab_pages.log"}
: ${gitlab_pages_args:="-config=%%PREFIX%%/share/gitlab-pages/gitlab-pages.conf"}
export HOME=${gitlab_pages_dir}
export PATH=${PATH}:%%PREFIX%%/bin
......@@ -38,24 +39,10 @@ export PATH=${PATH}:%%PREFIX%%/bin
pidfile="/var/run/${name}.pid"
gitlab_pages_chdir="${gitlab_pages_dir}"
procname=%%PREFIX%%/bin/gitlab-pages
procname=%%PREFIX%%/share/gitlab-pages/bin/gitlab-pages
start_precmd="gitlab_pages_startprecmd"
start_cmd="gitlab_pages_startcmd"
list_cmd="listfunc"
register_cmd="registerfunc"
listfunc()
{
cd ${gitlab_pages_chdir} ; \
su -m ${gitlab_pages_user} -c "env HOME=${gitlab_pages_dir} %%PREFIX%%/bin/gitlab-pages list"
}
registerfunc()
{
cd ${gitlab_pages_chdir} ; \
su -m ${gitlab_pages_user} -c "env HOME=${gitlab_pages_dir} %%PREFIX%%/bin/gitlab-pages register"
}
gitlab_pages_startprecmd()
{
......@@ -70,8 +57,7 @@ gitlab_pages_startprecmd()
gitlab_pages_startcmd()
{
cd ${gitlab_pages_chdir} ; \
daemon -u ${gitlab_pages_user} -p ${pidfile} /usr/local/bin/gitlab-pages ${gitlab_pages_args} run < /dev/null >> ${gitlab_pages_logfile} 2>> ${gitlab_pages_logfile}
daemon -u ${gitlab_pages_user} -p ${pidfile} ${procname} ${gitlab_pages_args} run < /dev/null >> ${gitlab_pages_logfile} 2>> ${gitlab_pages_logfile}
}
extra_commands="list register"
run_rc_command $1
--- gitlab-pages.conf.sample.orig 2023-05-30 05:09:18 UTC
+++ gitlab-pages.conf.sample
@@ -0,0 +1,6 @@
+listen-http=:8090
+pages-root=%%PREFIX%%/www/gitlab-ce/shared/pages
+api-secret-key=%%PREFIX%%/www/gitlab-ce/.gitlab_pages_secret
+pages-domain=pages.example.com
+internal-gitlab-server=https://gitlab.example.com
+
for detailed installation/configuration instruction please see e.g. here:
https://gitlab.fechner.net/mfechner/Gitlab-docu/-/blob/master/install/16.0-freebsd.md#9-gitlab-pages
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment