From 4c50005038d79173c6577deda73f8ca49f74fa19 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 3 Jan 2026 00:27:05 -0800 Subject: feat: Initial commit --- .gitignore | 2 ++ Dockerfile | 22 +++++++++++++++ cgitrc | 27 +++++++++++++++++++ custom.css | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lighttpd.conf | 33 +++++++++++++++++++++++ 5 files changed, 170 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 cgitrc create mode 100644 custom.css create mode 100644 lighttpd.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6224e9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +git +*.bak diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7c4c8f7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM debian:bookworm-slim + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + git \ + ca-certificates \ + cgit \ + highlight \ + lighttpd \ + && rm -rf /var/lib/apt/lists/* +RUN mkdir -p /var/www/html /git + +COPY cgitrc /etc/cgitrc +COPY custom.css /var/www/html/custom.css +COPY lighttpd.conf /etc/lighttpd/lighttpd.conf + +RUN chown -R www-data:www-data /var/www && \ + chmod -R 755 /var/www + +EXPOSE 80 + +CMD ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"] diff --git a/cgitrc b/cgitrc new file mode 100644 index 0000000..cab2fa2 --- /dev/null +++ b/cgitrc @@ -0,0 +1,27 @@ +# https://git.causal.agency/src/tree/www/git.causal.agency/cgitrc + +root-title=git +root-desc=“Stay hungry, stay foolish.” +logo= + +clone-url=https://$HTTP_HOST/$CGIT_REPO_URL +snapshots=tar.gz zip + +enable-blame=1 +enable-commit-graph=1 +enable-subject-links=1 +enable-follow-links=1 +enable-index-owner=0 +repository-sort=age +branch-sort=age + +css=/custom.css + +remove-suffix=1 +enable-git-config=1 +scan-path=/git + +# cache-root=/cache/cgit +# cache-size=1024 + +virtual-root=/ diff --git a/custom.css b/custom.css new file mode 100644 index 0000000..2575349 --- /dev/null +++ b/custom.css @@ -0,0 +1,86 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +@import url("cgit.css"); + +* { line-height: 1.25em; } + +div#cgit { + max-width: 117ch; + margin: auto; + font-family: monospace; + -moz-tab-size: 4; + tab-size: 4; +} + +div#cgit table#header td.sub { + border-top: none; +} +div#cgit table#header td.sub.right { + padding-right: 1em; +} +div#cgit table.tabs { + border-bottom: none; +} +div#cgit div.content { + border-bottom: none; +} +div#cgit table.list th a { + color: inherit; +} +div#cgit table.list tr:nth-child(even) { + background: inherit; +} +div#cgit table.list tr:hover { + background: inherit; +} +div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { + background: inherit; +} + +div#cgit table.blob td.linenumbers a:target { + color: goldenrod; + text-decoration: underline; + outline: none; +} + +div#cgit div#summary { + max-width: 80ch; +} + +/* for hilex(1) */ +div#cgit pre .Ke { color: dimgray; } +div#cgit pre .Ma { color: green; } +div#cgit pre .Co { color: navy; } +div#cgit pre .St { color: teal; } +div#cgit pre .Fo { color: teal; font-weight: bold; } +div#cgit pre .Su { color: olive; } + +/* for htagml(1) */ +div#cgit pre a.tag { color: inherit; text-decoration: underline; } +div#cgit pre a.tag:target { color: goldenrod; outline: none; } + +/* for mandoc(1) */ +table.head, table.foot { width: 100%; } +td.head-rtitle, td.foot-os { text-align: right; } +td.head-vol { text-align: center; } +div.Pp { margin: 1ex 0ex; } +div.Nd, div.Bf, div.Op { display: inline; } +span.Pa, span.Ad { font-style: italic; } +span.Ms { font-weight: bold; } +dl.Bl-diag > dt { font-weight: bold; } +code.Nm, code.Fl, code.Cm, code.Ic, code.In, code.Fd, code.Fn, +code.Cd { font-weight: bold; font-family: inherit; } + +h1.Sh { font-size: 1.5em; } +table.Nm td:first-child { padding-right: 1ch; } +code.Fl { white-space: nowrap; } +span.RsT { font-style: italic; } +dl.Bl-tag:not(.Bl-compact) > dt { margin-top: 1em; } +ul.Bl-bullet:not(.Bl-compact) > li { margin-top: 1em; } +div.Bd-indent { margin-left: 4ch; } +table.Bl-column { width: 100%; } +table.foot { margin-top: 1em; } + +div#cgit a.permalink { color: inherit; } \ No newline at end of file diff --git a/lighttpd.conf b/lighttpd.conf new file mode 100644 index 0000000..822f7c2 --- /dev/null +++ b/lighttpd.conf @@ -0,0 +1,33 @@ +server.modules = ( + "mod_access", + "mod_cgi", + "mod_alias", + "mod_rewrite", + "mod_setenv" +) + +server.document-root = "/var/www/html" +server.port = 80 +server.errorlog = "-" + +cgi.assign = ( ".cgi" => "" ) + +alias.url = ( + "/cgit.cgi" => "/usr/lib/cgit/cgit.cgi" +) + +url.rewrite-once = ( + "^/(cgit\\.css|cgit\\.png|custom\\.css)$" => "$0", + "^/$" => "/cgit.cgi", + "^/(.*)$" => "/cgit.cgi/$1" +) + +setenv.add-environment = ( + "GIT_PROJECT_ROOT" => "/git", + "GIT_HTTP_EXPORT_ALL" => "1" +) + +mimetype.assign = ( + ".css" => "text/css", + ".txt" => "text/plain" +) -- cgit v1.2.3