From f4dde3803de5a9e6093ff1b327a9e582096f807d Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 2 Feb 2026 15:53:57 -0600 Subject: Allow changing title and subtitle --- Dockerfile | 9 ++++++--- cgitrc | 11 ----------- cgitrc.template | 17 +++++++++++++++++ entrypoint.sh | 8 ++++++++ 4 files changed, 31 insertions(+), 14 deletions(-) delete mode 100644 cgitrc create mode 100644 cgitrc.template create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 0316d5d..8a17307 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ FROM alpine WORKDIR /root COPY Caddyfile . COPY supervisord.conf . -COPY cgitrc /etc/ -RUN apk add --no-cache cgit git caddy fcgiwrap supervisor py3-markdown py3-pygments -ENTRYPOINT supervisord -c supervisord.conf +COPY entrypoint.sh . +COPY cgitrc.template /etc/ +RUN apk add --no-cache cgit git caddy fcgiwrap supervisor py3-markdown py3-pygments envsubst; \ + envsubst < /etc/cgitrc.template > /etc/cgitrc +CMD ["supervisord", "-c", "supervisord.conf"] +ENTRYPOINT ["./entrypoint.sh"] diff --git a/cgitrc b/cgitrc deleted file mode 100644 index b35d83c..0000000 --- a/cgitrc +++ /dev/null @@ -1,11 +0,0 @@ -# Highlight source code with python pygments-based highlighter -source-filter=/usr/lib/cgit/filters/syntax-highlighting.py - -# Format markdown, restructuredtext, manpages, text files, and html files -# through the right converters -about-filter=/usr/lib/cgit/filters/about-formatting.sh - -remove-suffix=1 - -readme=:README.md -scan-path=/repos diff --git a/cgitrc.template b/cgitrc.template new file mode 100644 index 0000000..506f53e --- /dev/null +++ b/cgitrc.template @@ -0,0 +1,17 @@ +# Set the title and heading of the repository index page +root-title=$CGIT_TITLE + +# Set a subheading for the repository index page +root-desc=$CGIT_SUBTITLE + +# Highlight source code with python pygments-based highlighter +source-filter=/usr/lib/cgit/filters/syntax-highlighting.py + +# Format markdown, restructuredtext, manpages, text files, and html files +# through the right converters +about-filter=/usr/lib/cgit/filters/about-formatting.sh + +remove-suffix=1 + +readme=:README.md +scan-path=/repos diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..9acff7c --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +echo "Generating cgitrc..." +envsubst < /etc/cgitrc.template > /etc/cgitrc + +echo "Starting application..." +exec "$@" -- cgit v1.2.3