A Simple Gitweb — Un-Google
A 2026 goal of mine is to un-Google — more broadly, to shed my ties to big tech.
I’ve been investigating a method for sharing source code that doesn’t involve any of that.
Given a remote server, I can use something like gitolite to administer and control access to repositories I want to share. And I can use gitweb for browser-based access to repositories I want visible in a browser.
Here I created a compose file:
version: "3"
services:
proxy:
image: docker.io/jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
environment:
- TRUST_DOWNSTREAM_PROXY=false
container_name: nginx-proxy
volumes:
- /usr/share/nginx/html:/usr/share/nginx/html:rw
- /etc/nginx/vhost.d:/etc/nginx/vhost.d:rw
- /opt/srv/certs:/etc/nginx/certs:rw
- /run/podman/podman.sock:/tmp/docker.sock:ro
labels:
- com.github.nginx-proxy.nginx
gitweb:
image: docker.io/mlan/gitweb
container_name: gitweb-app
expose:
- 80
environment:
- VIRTUAL_HOST=gitweb.hemminger.haus
- VIRTUAL_PORT=80
- LETSENCRYPT_HOST=gitweb.hemminger.haus
- LETSENCRYPT_EMAIL=<le@moi>
- PROJECTROOT=/home/git/repositories/
- PROJECTS_LIST=/home/git/projects.list
volumes:
- /home/git/repositories:/home/git/repositories:ro
- /home/git/projects.list:/home/git/projects.list:ro
letsencrypt:
image: docker.io/jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-proxy-acme
environment:
- NGINX_PROXY_CONTAINER=nginx-proxy
- DEFAULT_EMAIL=<le@moi>
volumes:
- /opt/srv/certs:/etc/nginx/certs:rw
- /usr/share/nginx/html:/usr/share/nginx/html:rw
- /etc/nginx/vhost.d:/etc/nginx/vhost.d:rw
- /run/podman/podman.sock:/var/run/docker.sock:ro
- /opt/srv/acme:/etc/acme.sh:rw
The containers communicate via the docker (podman) socket, so bringing up the gitweb container triggers an event in the proxy, which is acted on by the letsencrypt container to submit for an SSL certificate. With these three containers I can run gitweb and get an SSL cert.
I wonder if I could achieve the same functionality with only two containers? I suspect the proxy container could serve gitweb content itself. Similarly, the proxy companion runs a polling process that isn’t demanding — it could probably be rolled in. On the other hand, the three containers split functionality logically as it stands: the letsencrypt container handles certs, the proxy container manages events and proxies requests, and gitweb serves web assets. It’s also extensible should I want to add another service.