From 5f193b72eb666755151faf15b71c4ffc45090745 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sun, 7 Aug 2022 01:09:35 -0400 Subject: Add cgit docker image Apache webserver (httpd) is setup minimally to host cgit on a website (sub)domain root. cgitrc config file is based on that from my previous installation, in my personal website. Signed-off-by: Malfurious --- docker/Dockerfile.cgit | 15 +++++++++++++++ docker/cgitrc | 23 +++++++++++++++++++++++ docker/httpd.conf | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 docker/Dockerfile.cgit create mode 100644 docker/cgitrc create mode 100644 docker/httpd.conf diff --git a/docker/Dockerfile.cgit b/docker/Dockerfile.cgit new file mode 100644 index 0000000..7108420 --- /dev/null +++ b/docker/Dockerfile.cgit @@ -0,0 +1,15 @@ +# 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 + +CMD ["/usr/bin/httpd", "-DFOREGROUND"] diff --git a/docker/cgitrc b/docker/cgitrc new file mode 100644 index 0000000..cfd8ba7 --- /dev/null +++ b/docker/cgitrc @@ -0,0 +1,23 @@ +# cgit config +# see cgitrc(5) for details + +css=/cgit.css +logo=/cgit.png +logo-link=/ + +root-title=index +root-desc=description + +clone-url=http://example.com/$CGIT_REPO_URL + +enable-blame=1 +enable-follow-links=1 +enable-index-links=1 +enable-index-owner=0 +enable-log-filecount=1 +enable-log-linecount=1 +remove-suffix=1 +snapshots=tar.gz + +section-from-path=1 +scan-path=/data/repositories/ diff --git a/docker/httpd.conf b/docker/httpd.conf new file mode 100644 index 0000000..50f88aa --- /dev/null +++ b/docker/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/" -- cgit v1.2.3