diff options
Diffstat (limited to 'gitolite/cgit')
| -rw-r--r-- | gitolite/cgit/40-fcgiwrap.sh | 10 | ||||
| -rw-r--r-- | gitolite/cgit/Dockerfile | 50 | ||||
| -rw-r--r-- | gitolite/cgit/about-formatting.sh | 34 | ||||
| -rw-r--r-- | gitolite/cgit/about.html | 4 | ||||
| -rw-r--r-- | gitolite/cgit/cgit.png | bin | 0 -> 1462 bytes | |||
| -rw-r--r-- | gitolite/cgit/cgitrc | 37 | ||||
| -rw-r--r-- | gitolite/cgit/css_variable_colors.sh | 35 | ||||
| -rw-r--r-- | gitolite/cgit/everforest.css | 61 | ||||
| -rw-r--r-- | gitolite/cgit/favicon.ico | bin | 0 -> 432254 bytes | |||
| -rw-r--r-- | gitolite/cgit/favicon.png | bin | 0 -> 6713 bytes | |||
| -rw-r--r-- | gitolite/cgit/nginx.conf | 22 |
11 files changed, 253 insertions, 0 deletions
diff --git a/gitolite/cgit/40-fcgiwrap.sh b/gitolite/cgit/40-fcgiwrap.sh new file mode 100644 index 0000000..3f788af --- /dev/null +++ b/gitolite/cgit/40-fcgiwrap.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -ex + +# start fastcgiwrap +rm -f /run/fcgiwrap.socket +nohup fcgiwrap -s unix:/run/fcgiwrap.socket & +while ! [ -S /run/fcgiwrap.socket ]; do sleep .2; done +chown nginx:www-data /run/fcgiwrap.socket +#chmod g+rwx /run/fcgiwrap.socket +#test -f nohup.out && rm -f ./nohup.out diff --git a/gitolite/cgit/Dockerfile b/gitolite/cgit/Dockerfile new file mode 100644 index 0000000..0c41144 --- /dev/null +++ b/gitolite/cgit/Dockerfile @@ -0,0 +1,50 @@ +FROM nginx:1.29.7-alpine-slim AS build + +RUN set -x \ + && apk add --no-cache gcc make curl linux-headers musl-dev zlib-dev libressl-dev libintl musl-libintl + +RUN wget 'https://git.zx2c4.com/cgit/snapshot/cgit-1.3.tar.xz' \ + && tar -xvf cgit-1.3.tar.xz + +WORKDIR /cgit-1.3 +RUN make get-git \ + && DESTDIR=pkg NO_REGEX=NeedsStartEnd make install + +WORKDIR /cgit-1.3/pkg +RUN tar -czvf cgit-1.3.tar.gz . + + +FROM nginx:1.29.7-alpine-slim +COPY --from=build /cgit-1.3/pkg/cgit-1.3.tar.gz /cgit-1.3.tar.gz + +ARG DOMAIN=localhost + +RUN set -x \ + && apk add --no-cache fcgiwrap py3-pygments \ + && tar -xvf /cgit-1.3.tar.gz + +RUN apk update && apk update + +COPY 40-fcgiwrap.sh /docker-entrypoint.d/ +RUN chmod +x /docker-entrypoint.d/40-fcgiwrap.sh + +COPY cgitrc /etc/ + +COPY nginx.conf / +RUN sed "s/\$DOMAIN/$DOMAIN/g" /nginx.conf > /etc/nginx/conf.d/default.conf +RUN rm /nginx.conf + +RUN addgroup nginx www-data + +COPY about.html /var/www/htdocs/cgit/ +COPY cgit.png /var/www/htdocs/cgit/logo.png +COPY favicon.ico /var/www/htdocs/cgit/ + +COPY css_variable_colors.sh / +COPY everforest.css /var/www/htdocs/cgit/ +RUN sh css_variable_colors.sh + +#RUN sed -i -Ee 's/pid\s+.*;/pid \/tmp\/nginx.pid;/' /etc/nginx/nginx.conf +#RUN sed -i -Ee 's/error_log\s+.*;/error_log \/dev\/stdout;/' /etc/nginx/nginx.conf +# +#USER nginx diff --git a/gitolite/cgit/about-formatting.sh b/gitolite/cgit/about-formatting.sh new file mode 100644 index 0000000..0cd0e5d --- /dev/null +++ b/gitolite/cgit/about-formatting.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# This may be used with the about-filter or repo.about-filter setting in cgitrc. +# It passes formatting of about pages to differing programs, depending on the usage. + +# Markdown support requires python and markdown-python. +# RestructuredText support requires python and docutils. +# Man page support requires groff. + +# The following environment variables can be used to retrieve the configuration +# of the repository for which this script is called: +# CGIT_REPO_URL ( = repo.url setting ) +# CGIT_REPO_NAME ( = repo.name setting ) +# CGIT_REPO_PATH ( = repo.path setting ) +# CGIT_REPO_OWNER ( = repo.owner setting ) +# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) +# CGIT_REPO_SECTION ( = section setting ) +# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) + +cd "$(dirname $0)/html-converters/" +case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in + *.markdown|*.mdown|*.md|*.mkd) cmark-gfm --to html \ + -e footnotes \ + -e table \ + -e strikethrough \ + -e autolink \ + -e tagfilter \ + -e tasklist \ + --width 80 <(cat -); ;; + *.rst) exec ./rst2html; ;; + *.[1-9]) exec ./man2html; ;; + *.htm|*.html) exec cat; ;; + *.txt|*) exec ./txt2html; ;; +esac diff --git a/gitolite/cgit/about.html b/gitolite/cgit/about.html new file mode 100644 index 0000000..ede0cb5 --- /dev/null +++ b/gitolite/cgit/about.html @@ -0,0 +1,4 @@ +<h2>Disclaimer</h2> +I request that none of this code, in part or in full, be hosted on Github, +Sourceforge, or any other proprietary platform. This request is made out of +respect for both me, the developer and for you, the user. diff --git a/gitolite/cgit/cgit.png b/gitolite/cgit/cgit.png Binary files differnew file mode 100644 index 0000000..65cb7da --- /dev/null +++ b/gitolite/cgit/cgit.png diff --git a/gitolite/cgit/cgitrc b/gitolite/cgit/cgitrc new file mode 100644 index 0000000..cbfa6a9 --- /dev/null +++ b/gitolite/cgit/cgitrc @@ -0,0 +1,37 @@ +repository-sort=age +clone-url=https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL +enable-http-clone=1 + +# Needed to avoid duplicating URI in every href +virtual-root=/ + +# Extra <head> +head-include=/usr/lib/cgit/include.html + +# Enable us "ignoring" specific repositories +enable-git-config=1 + +# Self explanatory +enable-http-clone=1 + +# Remove .git suffix +remove-suffix=1 + +readme=:README.md +about-filter=/usr/local/lib/cgit/filters/about-formatting.sh + +# Needs to be mountpoint of the gitolite volume +project-list=/var/lib/git/projects.list +scan-path=/var/lib/git/repositories + +# Requires python +#source-filter=/usr/lib/cgit/filters/syntax-high.py + +root-title=Personal projects +root-desc=A brief collection +root-readme=/var/www/htdocs/cgit/about.html +local-time=1 + +css=/everforest.css +css=/cgit.css +logo=/logo.png diff --git a/gitolite/cgit/css_variable_colors.sh b/gitolite/cgit/css_variable_colors.sh new file mode 100644 index 0000000..fbab0cc --- /dev/null +++ b/gitolite/cgit/css_variable_colors.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +CGIT_CSS_PATH=/var/www/htdocs/cgit/cgit.css +sed -i -Ee 's/\<white\>/var(--color-bg)/g' "${CGIT_CSS_PATH}" +sed -i -Ee 's/\<blue\>/var(--color-accent)/g' "${CGIT_CSS_PATH}" +sed -i -Ee 's/\<black\>/var(--color-fg)/g' "${CGIT_CSS_PATH}" + +# Diffs? +sed -i -Ee 's/\<green\>/var(--color-green)/g' "${CGIT_CSS_PATH}" +sed -i -Ee 's/#009\>/var(--color-blue)/g' "${CGIT_CSS_PATH}" +sed -i -Ee 's/\<red\>/var(--color-red)/g' "${CGIT_CSS_PATH}" + +sed -i -Ee 's/#333\>/var(--color-fg)/g' "${CGIT_CSS_PATH}" + +sed -i -Ee 's/#ccc\>/var(--color-bg-2)/g' "${CGIT_CSS_PATH}" +sed -i -Ee 's/#000\>/var(--color-fg)/g' "${CGIT_CSS_PATH}" + +sed -i -Ee 's/#777\>/var(--color-white)/g' "${CGIT_CSS_PATH}" +sed -i -Ee 's/#f7f7f7\>/var(--color-bg-1)/g' "${CGIT_CSS_PATH}" + +sed -i -Ee 's/#eee\>/var(--color-bg-2)/g' "${CGIT_CSS_PATH}" + +# links +sed -i -Ee 's/#00f\>/var(--color-accent)/g' "${CGIT_CSS_PATH}" + +# ago, minutes, hours +sed -i -Ee 's/#080\>/var(--color-blue)/g' "${CGIT_CSS_PATH}" +# ago, days +sed -i -Ee 's/#040\>/var(--color-green)/g' "${CGIT_CSS_PATH}" +# ago, weeks +sed -i -Ee 's/#444\>/var(--color-yellow)/g' "${CGIT_CSS_PATH}" +# ago, months +sed -i -Ee 's/#888\>/var(--color-bg-yellow)/g' "${CGIT_CSS_PATH}" +# ago, years +sed -i -Ee 's/#bbb\>/var(--color-grey)/g' "${CGIT_CSS_PATH}" diff --git a/gitolite/cgit/everforest.css b/gitolite/cgit/everforest.css new file mode 100644 index 0000000..46333e3 --- /dev/null +++ b/gitolite/cgit/everforest.css @@ -0,0 +1,61 @@ +:root { + --color-bg-dim: #1e2326; + --color-bg-0: #272e33; + --color-bg-1: #2e383c; + --color-bg-2: #374145; + --color-bg-3: #414b50; + --color-bg-4: #495156; + --color-bg-5: #4f5b58; + --color-bg-red: #493b40; + --color-bg-yellow: #45443c; + --color-bg-green: #3c4841; + --color-bg-blue: #384b55; + --color-bg-purple: #463f48; + --color-bg-visual: #4c3743; + + /* Regular */ + --color-fg: #d3c6aa; + --color-red: #e67e80; + --color-yellow: #dbbc7f; + --color-green: #a7c080; + --color-blue: #7fbbb3; + --color-purple: #d699b6; + --color-aqua: #83c092; + --color-orange: #e69875; + --color-grey-0: #7a8478; + --color-grey-1: #859289; + --color-grey-2: #9da9a0; + --color-grey: var(--color-grey-2); + + --color-black: var(--color-bg-dim); + --color-turquoise: var(--color-aqua); + --color-white: var(--color-grey); + + + --color-bg: var(--color-bg-0); + --color-fg-sel: var(--color-fg); + --color-bg-sel: var(--color-bg-visual); + + --color-accent: var(--color-green); + --color-header-0: var(--color-red); + --color-header-1: var(--color-orange); + --color-header-2: var(--color-yellow); + --color-header-3: var(--color-green); + --color-header-4: var(--color-blue); + --color-header-5: var(--color-purple); + --color-header-delim:var(--color-grey-1); + + --color-list-point-0: var(--color-red); + --color-list-point-1: var(--color-orange); + --color-list-point-2: var(--color-yellow); + --color-list-point-3: var(--color-green); + --color-list-point-4: var(--color-blue); + --color-list-point-5: var(--color-purple); + + --color-var(--color-blue): +} + +body { + background-color: var(--color-bg); + color: var(--color-fg); +} diff --git a/gitolite/cgit/favicon.ico b/gitolite/cgit/favicon.ico Binary files differnew file mode 100644 index 0000000..f4d51ba --- /dev/null +++ b/gitolite/cgit/favicon.ico diff --git a/gitolite/cgit/favicon.png b/gitolite/cgit/favicon.png Binary files differnew file mode 100644 index 0000000..da6269e --- /dev/null +++ b/gitolite/cgit/favicon.png diff --git a/gitolite/cgit/nginx.conf b/gitolite/cgit/nginx.conf new file mode 100644 index 0000000..f4a115b --- /dev/null +++ b/gitolite/cgit/nginx.conf @@ -0,0 +1,22 @@ +server { + server_name $DOMAIN; + + listen [::]:80; + listen 80; + + access_log /var/log/nginx/cgit-access.log; + error_log /var/log/nginx/cgit-error.log; + + root /var/www/htdocs/cgit; + try_files $uri @cgit; + + location @cgit { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /var/www/htdocs/cgit/cgit.cgi; + fastcgi_pass unix:/run/fcgiwrap/fcgiwrap.sock; + + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + } +} |
