From ba4da49423faaf49500f1b3366909e404f7862ff Mon Sep 17 00:00:00 2001 From: Malfurious Date: Fri, 15 Sep 2023 13:03:34 -0400 Subject: cgit: Consolidate config files into a single directory Continue cleaning the folder structure from the previous merge. Signed-off-by: Malfurious --- .gitignore | 1 + cgit/cgitrc | 38 ++++++++++++++++++++++++++++++++++++++ cgit/httpd.conf | 35 +++++++++++++++++++++++++++++++++++ docker/.gitignore | 1 - docker/cgitrc | 38 -------------------------------------- docker/httpd.conf | 35 ----------------------------------- 6 files changed, 74 insertions(+), 74 deletions(-) create mode 100644 .gitignore create mode 100644 cgit/cgitrc create mode 100644 cgit/httpd.conf delete mode 100644 docker/.gitignore delete mode 100644 docker/cgitrc delete mode 100644 docker/httpd.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2fa7496 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pub diff --git a/cgit/cgitrc b/cgit/cgitrc new file mode 100644 index 0000000..6df01d2 --- /dev/null +++ b/cgit/cgitrc @@ -0,0 +1,38 @@ +# cgit config +# see cgitrc(5) for details +# +# possible todos: header, footer + +css=/cgit.css +logo=/cgit.png +logo-link=/ + +root-title=NormalMode.org Repositories +root-desc=Public repositories hosted on normalmode.org + +clone-url=https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL ssh://gitolite@$HTTP_HOST/$CGIT_REPO_URL + +enable-blame=1 +enable-follow-links=1 +enable-git-config=1 +enable-http-clone=1 +enable-index-links=1 +enable-index-owner=1 +enable-log-filecount=1 +enable-log-linecount=1 +enable-tree-linenumbers=1 + +section-sort=1 +repository-sort=age +branch-sort=age +agefile=agefile + +max-repo-count=512 +max-stats=year + +snapshots=tar.gz zip +remove-suffix=1 +section-from-path=-1 +strict-export=gl-creator + +scan-path=/data/repositories/ diff --git a/cgit/httpd.conf b/cgit/httpd.conf new file mode 100644 index 0000000..50f88aa --- /dev/null +++ b/cgit/httpd.conf @@ -0,0 +1,35 @@ +# https://httpd.apache.org/docs/current/ +# https://httpd.apache.org/docs/current/mod/directives.html + +LoadModule alias_module modules/mod_alias.so +LoadModule authz_core_module modules/mod_authz_core.so +LoadModule cgid_module modules/mod_cgid.so +LoadModule mpm_event_module modules/mod_mpm_event.so +LoadModule unixd_module modules/mod_unixd.so + +ServerRoot "/etc/httpd" +ServerAdmin webmaster@example.com +ServerName localhost +Listen 80 +User http +Group http + +ErrorLog "/var/log/httpd/error_log" +LogLevel warn + + + AllowOverride None + Require all denied + + + + AllowOverride None + Options ExecCGI FollowSymlinks + Require all granted + + +Alias /cgit.css "/usr/share/webapps/cgit/cgit.css" +Alias /cgit.png "/usr/share/webapps/cgit/cgit.png" +Alias /favicon.ico "/usr/share/webapps/cgit/favicon.ico" + +ScriptAlias / "/usr/share/webapps/cgit/cgit.cgi/" diff --git a/docker/.gitignore b/docker/.gitignore deleted file mode 100644 index 2fa7496..0000000 --- a/docker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pub diff --git a/docker/cgitrc b/docker/cgitrc deleted file mode 100644 index 6df01d2..0000000 --- a/docker/cgitrc +++ /dev/null @@ -1,38 +0,0 @@ -# cgit config -# see cgitrc(5) for details -# -# possible todos: header, footer - -css=/cgit.css -logo=/cgit.png -logo-link=/ - -root-title=NormalMode.org Repositories -root-desc=Public repositories hosted on normalmode.org - -clone-url=https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL ssh://gitolite@$HTTP_HOST/$CGIT_REPO_URL - -enable-blame=1 -enable-follow-links=1 -enable-git-config=1 -enable-http-clone=1 -enable-index-links=1 -enable-index-owner=1 -enable-log-filecount=1 -enable-log-linecount=1 -enable-tree-linenumbers=1 - -section-sort=1 -repository-sort=age -branch-sort=age -agefile=agefile - -max-repo-count=512 -max-stats=year - -snapshots=tar.gz zip -remove-suffix=1 -section-from-path=-1 -strict-export=gl-creator - -scan-path=/data/repositories/ diff --git a/docker/httpd.conf b/docker/httpd.conf deleted file mode 100644 index 50f88aa..0000000 --- a/docker/httpd.conf +++ /dev/null @@ -1,35 +0,0 @@ -# https://httpd.apache.org/docs/current/ -# https://httpd.apache.org/docs/current/mod/directives.html - -LoadModule alias_module modules/mod_alias.so -LoadModule authz_core_module modules/mod_authz_core.so -LoadModule cgid_module modules/mod_cgid.so -LoadModule mpm_event_module modules/mod_mpm_event.so -LoadModule unixd_module modules/mod_unixd.so - -ServerRoot "/etc/httpd" -ServerAdmin webmaster@example.com -ServerName localhost -Listen 80 -User http -Group http - -ErrorLog "/var/log/httpd/error_log" -LogLevel warn - - - AllowOverride None - Require all denied - - - - AllowOverride None - Options ExecCGI FollowSymlinks - Require all granted - - -Alias /cgit.css "/usr/share/webapps/cgit/cgit.css" -Alias /cgit.png "/usr/share/webapps/cgit/cgit.png" -Alias /favicon.ico "/usr/share/webapps/cgit/favicon.ico" - -ScriptAlias / "/usr/share/webapps/cgit/cgit.cgi/" -- cgit v1.2.3 From 2ec1cd2ef77ef5b725c5db2755806459e19cec11 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 16 Sep 2023 06:06:37 -0400 Subject: cgit: Port Dockerfile for alpine base Move the cgit image off of archlinux for the same reasons as gitolite. However, in this case, debian isn't necessary, and going with alpine will give even smaller images. As is, it seems simpler to port the config files over to alpine anyway. See 90858ead45f6 for more context. Signed-off-by: Malfurious --- cgit/Dockerfile | 12 ++++++++++++ docker/Dockerfile.cgit | 16 ---------------- 2 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 cgit/Dockerfile delete mode 100644 docker/Dockerfile.cgit diff --git a/cgit/Dockerfile b/cgit/Dockerfile new file mode 100644 index 0000000..9e1c442 --- /dev/null +++ b/cgit/Dockerfile @@ -0,0 +1,12 @@ +# https://git.zx2c4.com/cgit/ + +FROM alpine + +RUN apk --no-cache upgrade +RUN apk --no-cache add apache2 cgit + +COPY httpd.conf /etc/apache2/ +COPY cgitrc /etc/ + +EXPOSE 80 +CMD ["/usr/sbin/httpd", "-DFOREGROUND"] diff --git a/docker/Dockerfile.cgit b/docker/Dockerfile.cgit deleted file mode 100644 index 768a53d..0000000 --- a/docker/Dockerfile.cgit +++ /dev/null @@ -1,16 +0,0 @@ -# https://git.zx2c4.com/cgit/ -# https://wiki.archlinux.org/title/Cgit - -FROM archlinux - -# Install cgit and webserver -RUN pacman-key --init -RUN pacman -Syu --needed --noconfirm apache cgit - -# Copy configuration files -# Back-end datastore is expected to be mounted to /data (read-only) -COPY httpd.conf /etc/httpd/conf/httpd.conf -COPY cgitrc /etc/cgitrc - -EXPOSE 80 -CMD ["/usr/bin/httpd", "-DFOREGROUND"] -- cgit v1.2.3 From 8d112c09f0dd433a55bca9c477dd307f5aeaac3a Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 16 Sep 2023 06:32:15 -0400 Subject: cgit: Update user and file paths for alpine distro Signed-off-by: Malfurious --- cgit/httpd.conf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cgit/httpd.conf b/cgit/httpd.conf index 50f88aa..e8ee772 100644 --- a/cgit/httpd.conf +++ b/cgit/httpd.conf @@ -1,20 +1,20 @@ # https://httpd.apache.org/docs/current/ # https://httpd.apache.org/docs/current/mod/directives.html -LoadModule alias_module modules/mod_alias.so -LoadModule authz_core_module modules/mod_authz_core.so -LoadModule cgid_module modules/mod_cgid.so -LoadModule mpm_event_module modules/mod_mpm_event.so -LoadModule unixd_module modules/mod_unixd.so +LoadModule alias_module /usr/lib/apache2/mod_alias.so +LoadModule authz_core_module /usr/lib/apache2/mod_authz_core.so +LoadModule cgid_module /usr/lib/apache2/mod_cgid.so +LoadModule mpm_event_module /usr/lib/apache2/mod_mpm_event.so +LoadModule unixd_module /usr/lib/apache2/mod_unixd.so -ServerRoot "/etc/httpd" +ServerRoot "/etc/apache2" ServerAdmin webmaster@example.com ServerName localhost Listen 80 -User http -Group http +User apache +Group apache -ErrorLog "/var/log/httpd/error_log" +ErrorLog "/var/log/apache2/error_log" LogLevel warn -- cgit v1.2.3 From 5dc31a2d88cb799e487c4aacfe1b4be32e59d391 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 16 Sep 2023 06:46:29 -0400 Subject: cgit: Update scan-path / repository mount location Since the data volume now only contains git repositories, rather than the whole gitolite host home directory, there is no need to mount to a nested path. Anticipate moving the mount point, and change the cgit scan path to /repositories. Signed-off-by: Malfurious --- cgit/cgitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgit/cgitrc b/cgit/cgitrc index 6df01d2..fca5fec 100644 --- a/cgit/cgitrc +++ b/cgit/cgitrc @@ -35,4 +35,4 @@ remove-suffix=1 section-from-path=-1 strict-export=gl-creator -scan-path=/data/repositories/ +scan-path=/repositories/ -- cgit v1.2.3 From 51b47c3d0eb8e9c638d002aec566ef158ff5d0cd Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 16 Sep 2023 06:47:56 -0400 Subject: cgit: Update SSH clone URLs The username used to access gitolite has changed from 'gitolite' to 'git'. Reflect this in the cgit UI. Signed-off-by: Malfurious --- cgit/cgitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgit/cgitrc b/cgit/cgitrc index fca5fec..34bbe81 100644 --- a/cgit/cgitrc +++ b/cgit/cgitrc @@ -10,7 +10,7 @@ logo-link=/ root-title=NormalMode.org Repositories root-desc=Public repositories hosted on normalmode.org -clone-url=https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL ssh://gitolite@$HTTP_HOST/$CGIT_REPO_URL +clone-url=https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL ssh://git@$HTTP_HOST/$CGIT_REPO_URL enable-blame=1 enable-follow-links=1 -- cgit v1.2.3