about summary refs log tree commit diff
path: root/bundles/git/files/Caddyfile
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2026-04-09 11:04:46 +0900
committerRobert Günzler <r@gnzler.io>2026-04-22 14:36:52 +0900
commitf87c066685098da9a67dd410104cbba8c5fdcdbd (patch)
tree5fe9d3c916931959d267123973e3123b1740a5e1 /bundles/git/files/Caddyfile
parentaa913b59b3e5048fec396ee4b50288f740cdfccf (diff)
deploy cgit
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to 'bundles/git/files/Caddyfile')
-rw-r--r--bundles/git/files/Caddyfile58
1 files changed, 58 insertions, 0 deletions
diff --git a/bundles/git/files/Caddyfile b/bundles/git/files/Caddyfile
new file mode 100644
index 0000000..99a011e
--- /dev/null
+++ b/bundles/git/files/Caddyfile
@@ -0,0 +1,58 @@
+# vim: noet ts=2 sw=2
+{
+	admin off
+	auto_https off
+	http_port {$CADDY_HTTP_PORT:1414}
+}
+
+http:// {
+	encode zstd gzip
+
+	handle /healthz {
+		respond OK 200
+	}
+
+	handle /custom.css {
+		root * /var/www/cgit/
+		file_server
+	}
+
+	@static_paths {
+		path /robots.txt
+		path /cgit.css
+		path /cgit.png
+	}
+	handle @static_paths {
+		root * /usr/share/webapps/cgit/
+		file_server
+	}
+
+	handle {
+		reverse_proxy unix//run/fcgiwrap/fcgiwrap.sock {
+			transport fastcgi {
+				env DOCUMENT_ROOT /usr/share/webapps/cgit/
+				env SCRIPT_FILENAME /usr/share/webapps/cgit/cgit.cgi
+			}
+		}
+	}
+
+	log {
+		format filter {
+			wrap console {
+				time_format wall_milli
+				level_format color
+			}
+			fields {
+				common_log delete
+				request>headers>Accept-Encoding delete
+				request>headers>Accept-Language delete
+				request>headers>Connection delete
+				request>headers>Authorization delete
+				request>remote_addr ip_mask {
+					ipv4 24
+					ipv6 32
+				}
+			}
+		}
+	}
+}