]> quire.kejadlen.dev Git - quire.git/commitdiff
Stand up gitweb as interim web view
authorAlpha Chen <alpha@kejadlen.dev>
Mon, 27 Apr 2026 16:27:51 +0000 (09:27 -0700)
committerAlpha Chen <alpha@kejadlen.dev>
Mon, 27 Apr 2026 16:34:20 +0000 (09:34 -0700)
Gitweb ships with git (already built from source), so adding it is
just a build step, lighttpd, perl, and two config files. The container
entrypoint is now lighttpd instead of quire serve — SSH dispatch via
docker exec still works since quire stays on the PATH.

All gitweb additions are tagged TODO(vys) for easy grep when the
native web view replaces them.

Assisted-by: GLM-5.1 via pi
Dockerfile
conf/gitweb.conf [new file with mode: 0644]
conf/lighttpd.conf [new file with mode: 0644]
docs/host/README.md

index 7b71f15c7f38985a17ebc0881ed78c3649d9e67f..375e3a7110e888c29c827ff8c4b3d9874a978ec7 100644 (file)
@@ -26,7 +26,10 @@ RUN curl -fsSL https://github.com/git/git/archive/refs/tags/v${GIT_VERSION}.tar.
     | tar xz \
     && cd git-${GIT_VERSION} \
     && make -j$(nproc) prefix=/usr/local NO_TCLTK=1 NO_GETTEXT= \
-    && make prefix=/usr/local install
+    && make prefix=/usr/local install \
+    && make -j$(nproc) prefix=/usr/local NO_TCLTK=1 NO_GETTEXT= gitweb \
+    && make prefix=/usr/local install-gitweb
+# TODO(vys): remove gitweb build when quire serve has its own web view
 
 # Cargo-chef stage for dependency caching.
 FROM rust:1.88-trixie AS chef
@@ -64,10 +67,16 @@ RUN apt-get update \
         ca-certificates \
         libcurl4 \
         libexpat1 \
+        lighttpd \
+        perl \
     && rm -rf /var/lib/apt/lists/*
+# TODO(vys): lighttpd and perl are interim deps for gitweb; remove both
+# when quire serve has its own web view.
 
 COPY --from=git-builder /usr/local/bin/git /usr/local/bin/git
 COPY --from=git-builder /usr/local/libexec/git-core/ /usr/local/libexec/git-core/
+COPY --from=git-builder /usr/local/share/gitweb/ /usr/local/share/gitweb/
+# TODO(vys): remove the gitweb COPY above with gitweb
 COPY --from=builder /build/quire /usr/local/bin/quire
 
 # Configure git hooks globally so all repos inherit the post-receive dispatch.
@@ -83,5 +92,10 @@ RUN mkdir -p /var/quire/repos /var/quire/runs
 
 WORKDIR /var/quire
 
-ENTRYPOINT ["quire"]
-CMD ["serve"]
+# TODO(vys): everything below is interim gitweb scaffolding — remove when
+# quire serve has its own web view. Restore ENTRYPOINT ["quire"] / CMD ["serve"].
+COPY conf/gitweb.conf /etc/gitweb.conf
+COPY conf/lighttpd.conf /etc/lighttpd/lighttpd.conf
+
+EXPOSE 8080
+ENTRYPOINT ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"]
diff --git a/conf/gitweb.conf b/conf/gitweb.conf
new file mode 100644 (file)
index 0000000..1a45558
--- /dev/null
@@ -0,0 +1,7 @@
+# Interim gitweb config — remove when quire serve has its own web view.
+# See TODO(vys) in the Dockerfile.
+
+our $projectroot = "/var/quire/repos";
+
+our $feature{'blame'}{'default'} = [1];
+our $feature{'highlight'}{'default'} = [1];
diff --git a/conf/lighttpd.conf b/conf/lighttpd.conf
new file mode 100644 (file)
index 0000000..e44672a
--- /dev/null
@@ -0,0 +1,13 @@
+# Interim lighttpd config — remove when quire serve has its own web view.
+# See TODO(vys) in the Dockerfile.
+
+server.document-root = "/usr/local/share/gitweb"
+server.port = 8080
+server.modules = ("mod_cgi")
+
+# Write runtime files to /tmp since the container runs as a non-root user.
+server.pid-file = "/tmp/lighttpd.pid"
+server.errorlog = "/tmp/lighttpd-error.log"
+
+index-file.names = ("gitweb.cgi")
+cgi.assign = (".cgi" => "")
index 1f56d8fb9594c07c968ebd0db8adbc638de0e214..00fe1db7f5a8e3c66f4d6844680f020b4ec788c8 100644 (file)
@@ -33,7 +33,7 @@ Reference configs for dispatching SSH connections into the quire container.
            --user "$(id -u git):$(id -g git)" \
            -e HOME=/tmp \
            -v /var/quire:/var/quire \
-           -p 127.0.0.1:3000:3000 \
+           -p 127.0.0.1:8080:8080 \
            quire
 
    In a compose file, the equivalent is `user: "${QUIRE_UID}:${QUIRE_GID}"`
@@ -63,6 +63,9 @@ otherwise match a container user. `HOME=/tmp` is set because the host
 uid has no `/etc/passwd` entry inside the container, and git needs a
 writable `HOME` for its config probing.
 
-The HTTP port (3000) is published to host loopback only. A reverse proxy
+The HTTP port (8080) is published to host loopback only. A reverse proxy
 on the host terminates TLS and reverse-proxies to it; nothing else
 should reach it directly.
+
+Currently the container runs lighttpd + gitweb as an interim web view.
+This will be replaced by `quire serve` once the built-in web view is ready.