diff options
Diffstat (limited to 'cgit')
| -rw-r--r-- | cgit/Dockerfile | 35 | ||||
| -rw-r--r-- | cgit/about.html | 4 | ||||
| -rw-r--r-- | cgit/cgit.png | bin | 0 -> 1462 bytes | |||
| -rw-r--r-- | cgit/cgitrc | 25 | ||||
| -rw-r--r-- | cgit/css_variable_colors.sh | 30 | ||||
| -rw-r--r-- | cgit/everforest.css | 49 | ||||
| -rw-r--r-- | cgit/favicon.png | bin | 0 -> 6713 bytes | |||
| -rw-r--r-- | cgit/nginx.conf (renamed from cgit/site.template) | 4 |
8 files changed, 139 insertions, 8 deletions
diff --git a/cgit/Dockerfile b/cgit/Dockerfile index e89b8d3..007fe23 100644 --- a/cgit/Dockerfile +++ b/cgit/Dockerfile @@ -1,8 +1,27 @@ +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 cgit fcgiwrap envsubst + && apk add --no-cache fcgiwrap envsubst \ + && tar -xvf /cgit-1.3.tar.gz RUN apk update && apk update @@ -11,12 +30,20 @@ RUN chmod +x /docker-entrypoint.d/40-fcgiwrap.sh COPY cgitrc /etc/ -COPY site.template / -RUN sed "s/\$DOMAIN/$DOMAIN/g" /site.template > /etc/nginx/conf.d/default.conf -RUN rm /site.template +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 # diff --git a/cgit/about.html b/cgit/about.html new file mode 100644 index 0000000..ede0cb5 --- /dev/null +++ b/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/cgit/cgit.png b/cgit/cgit.png Binary files differnew file mode 100644 index 0000000..65cb7da --- /dev/null +++ b/cgit/cgit.png diff --git a/cgit/cgitrc b/cgit/cgitrc index ecd0083..6abeaf5 100644 --- a/cgit/cgitrc +++ b/cgit/cgitrc @@ -1,7 +1,28 @@ # Needed to avoid duplicating URI in every href virtual-root=/ +# Enable us "ignoring" specific repositories +enable-git-config=1 + +# Self explanatory +enable-http-clone=1 + +# Remove .git suffix +remove-suffix=1 + +# Needs to be mountpoint of the gitolite volume scan-path=/var/lib/git/repositories project-list=/var/lib/git/projects.list -#enable-index-links=1 -repo.ignore=1 + +# Requires python +#source-filter=/usr/lib/cgit/filters/syntax-high.py +#about-filter=/usr/lib/cgit/filters/about-formatting.sh + +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/cgit/css_variable_colors.sh b/cgit/css_variable_colors.sh new file mode 100644 index 0000000..9ef2818 --- /dev/null +++ b/cgit/css_variable_colors.sh @@ -0,0 +1,30 @@ +#!/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}" +sed -i -Ee 's/#333\>/var(--color-fg)/g' "${CGIT_CSS_PATH}" + +sed -i -Ee 's/#ccc\>/var(--color-white-dim)/g' "${CGIT_CSS_PATH}" +sed -i -Ee 's/#000\>/var(--color-fg-bright)/g' "${CGIT_CSS_PATH}" + +sed -i -Ee 's/#777\>/var(--color-white-dim)/g' "${CGIT_CSS_PATH}" +sed -i -Ee 's/#f7f7f7\>/var(--color-bg-bright)/g' "${CGIT_CSS_PATH}" + +sed -i -Ee 's/#eee\>/var(--color-black-bright)/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-green)/g' "${CGIT_CSS_PATH}" +# ago, days +sed -i -Ee 's/#040\>/var(--color-green-bright)/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-yellow-bright)/g' "${CGIT_CSS_PATH}" +# ago, years +sed -i -Ee 's/#bbb\>/var(--color-white)/g' "${CGIT_CSS_PATH}" + diff --git a/cgit/everforest.css b/cgit/everforest.css new file mode 100644 index 0000000..60c64f3 --- /dev/null +++ b/cgit/everforest.css @@ -0,0 +1,49 @@ +:root { + + /* Regular */ + --color-black: #1e2326; + --color-red: #e67e80; + --color-green: #a7c080; + --color-yellow: #dbbc7f; + --color-blue: #7fbbb3; + --color-purple: #d699b6; + --color-turquoise: #7fbbb3; + --color-white: #d3c6aa; + + /* Bright */ + --color-black-bright: #4f5b58; + --color-red-bright: #e66868; + --color-green-bright: #93b259; + --color-yellow-bright: #dfa000; + --color-blue-bright: #3a94c5; + --color-purple-bright: #df69ba; + --color-turquoise-bright: #3a94c5; + --color-white-bright: #ffffff; + + --color-white-dim: #7a8478; + + + --color-fg: #d3c6aa; + --color-bg: #3c4841; /*#272e33;*/ + --color-fg-bright: #fff; + --color-bg-bright: #374145; + --color-fg-sel: #fff; + --color-bg-sel: #414b50; + + --color-accent: var(--color-green); + --color-header: var(--color-accent); + --color-list-point: var(--color-accent); + + --color-var(--color-blue): +} + +body { + background-color: var(--color-bg); + color: var(--color-fg); +} + +div#cgit table.tabs td.form input, +div#cgit table.tabs td.form select { + background-color: var(--color-bg-bright); + color: var(--color-fg-bright); +} diff --git a/cgit/favicon.png b/cgit/favicon.png Binary files differnew file mode 100644 index 0000000..da6269e --- /dev/null +++ b/cgit/favicon.png diff --git a/cgit/site.template b/cgit/nginx.conf index c1962d9..7b03929 100644 --- a/cgit/site.template +++ b/cgit/nginx.conf @@ -7,12 +7,12 @@ server { access_log /var/log/nginx/cgit-access.log; error_log /var/log/nginx/cgit-error.log; - root /usr/share/webapps/cgit; + root /var/www/htdocs/cgit; try_files $uri @cgit; location @cgit { include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /usr/share/webapps/cgit/cgit.cgi; + fastcgi_param SCRIPT_FILENAME /var/www/htdocs/cgit/cgit.cgi; fastcgi_pass unix:/run/fcgiwrap.socket; fastcgi_param PATH_INFO $uri; |
