]> Untitled Git - gitweb.git/commitdiff
Initial version of gitweb
authorClifton Palmer <clifton.james.palmer@protonmail.com>
Thu, 12 Dec 2024 17:10:07 +0000 (11:10 -0600)
committerClifton Palmer <clifton.james.palmer@protonmail.com>
Thu, 12 Dec 2024 17:10:07 +0000 (11:10 -0600)
.gitignore [new file with mode: 0644]
cgi/Dockerfile [new file with mode: 0644]
docker-compose.yml [new file with mode: 0644]
gitweb.conf [new file with mode: 0644]
web/Dockerfile [new file with mode: 0644]
web/default.conf [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1377554
--- /dev/null
@@ -0,0 +1 @@
+*.swp
diff --git a/cgi/Dockerfile b/cgi/Dockerfile
new file mode 100644 (file)
index 0000000..1718c8a
--- /dev/null
@@ -0,0 +1,10 @@
+FROM nginx:1.27-alpine
+
+RUN apk add --no-cache git git-gitweb fcgiwrap perl-cgi
+
+RUN mkdir -p /srv/git
+RUN git config --global --add safe.directory "/srv/git/*"
+
+EXPOSE 9000
+CMD ["-s", "tcp:0.0.0.0:9000", "-f"]
+ENTRYPOINT ["fcgiwrap"]
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644 (file)
index 0000000..373c3ae
--- /dev/null
@@ -0,0 +1,19 @@
+# requires variable config loading, such as:
+# docker stack deploy -c <(docker-compose config) proxy
+
+version: '3'
+services:
+    web:
+        build: web
+        image: cjpalmer/gitweb:0.1.0
+        volumes:
+        - /srv/git:/srv/git:ro
+        - ./gitweb.conf:/etc/gitweb.conf
+        ports:
+        - 80:80
+    cgi:
+        build: cgi
+        image: cjpalmer/gitweb-cgi:0.1.0
+        volumes:
+        - /srv/git:/srv/git:ro
+        - ./gitweb.conf:/etc/gitweb.conf
diff --git a/gitweb.conf b/gitweb.conf
new file mode 100644 (file)
index 0000000..c0189ad
--- /dev/null
@@ -0,0 +1,30 @@
+# path to git projects (<project>.git)
+$projectroot = "/srv/git";
+
+# directory to use for temp files
+$git_temp = "/tmp";
+
+# target of the home link on top of all pages
+$home_link = $my_uri || "/";
+
+# html text to include at home page
+$home_text = "indextext.html";
+
+# file with project list; by default, simply scan the projectroot dir.
+$projects_list = $projectroot;
+
+# stylesheet to use
+@stylesheets = ("static/gitweb.css");
+
+# javascript code for gitweb
+$javascript = "static/gitweb.js";
+
+# logo to use
+$logo = "static/git-logo.png";
+
+# the 'favicon'
+$favicon = "static/git-favicon.png";
+
+# git-diff-tree(1) options to use for generated patches
+#@diff_opts = ("-M");
+@diff_opts = ();
diff --git a/web/Dockerfile b/web/Dockerfile
new file mode 100644 (file)
index 0000000..8741e70
--- /dev/null
@@ -0,0 +1,8 @@
+FROM nginx:1.27-alpine
+
+RUN apk add --no-cache git git-gitweb fcgiwrap
+
+RUN mkdir -p /srv/git
+RUN git config --global --add safe.directory "/srv/git/*"
+
+COPY default.conf /etc/nginx/conf.d/
diff --git a/web/default.conf b/web/default.conf
new file mode 100644 (file)
index 0000000..85659c9
--- /dev/null
@@ -0,0 +1,16 @@
+server {
+    listen 80;
+    root /usr/share/gitweb;
+
+    location /static {
+        sendfile on;
+        tcp_nopush on;
+    }
+    location / {
+        fastcgi_pass cgi:9000;
+        fastcgi_param SCRIPT_FILENAME   /usr/share/gitweb/gitweb.cgi;
+        fastcgi_param PATH_INFO         $uri;
+        fastcgi_param GITWEB_CONFIG     /etc/gitweb.conf;
+        include fastcgi_params;
+   }
+}