diff options
Diffstat (limited to 'terminaldweller.com')
-rw-r--r-- | terminaldweller.com/cgit/cgit.conf | 9 | ||||
-rw-r--r-- | terminaldweller.com/cgit/cgit/Dockerfile | 7 | ||||
-rw-r--r-- | terminaldweller.com/cgit/cgit/cgitrc | 143 | ||||
-rw-r--r-- | terminaldweller.com/cgit/docker-compose.yaml | 12 | ||||
-rw-r--r-- | terminaldweller.com/haproxy/haproxy.cfg | 17 |
5 files changed, 166 insertions, 22 deletions
diff --git a/terminaldweller.com/cgit/cgit.conf b/terminaldweller.com/cgit/cgit.conf index ac59b7a..caf8876 100644 --- a/terminaldweller.com/cgit/cgit.conf +++ b/terminaldweller.com/cgit/cgit.conf @@ -1,9 +1,8 @@ -server.modules += ( "mod_cgi", "mod_rewrite" ) +server.modules += ( "mod_cgi", "mod_rewrite", "mod_openssl" ) -#$SERVER["socket"] == ":443" { -$SERVER["socket"] == ":80" { - #ssl.engine = "enable" - #ssl.pemfile = "/etc/lighttpd/ssl/git.example.com.pem" +$SERVER["socket"] == ":443" { + ssl.engine = "enable" + ssl.pemfile = "/etc/certs/git.pem" server.name = "git.terminaldweller.com" server.document-root = "/usr/share/webapps/cgit/" diff --git a/terminaldweller.com/cgit/cgit/Dockerfile b/terminaldweller.com/cgit/cgit/Dockerfile index 8646b5c..7ef7134 100644 --- a/terminaldweller.com/cgit/cgit/Dockerfile +++ b/terminaldweller.com/cgit/cgit/Dockerfile @@ -1,2 +1,5 @@ -FROM alpine:3.16 -RUN apk add && apk add --no-cache busybox-initscripts cgit git spawn-fcgi fcgiwrap highlight nginx +FROM woahbase/alpine-cgit:x86_64 +RUN apk add && apk add --no-cache python3 py3-pip +RUN pip3 install pygments +RUN pip3 install md2html +RUN pip3 install markdown diff --git a/terminaldweller.com/cgit/cgit/cgitrc b/terminaldweller.com/cgit/cgit/cgitrc index a2c216e..8306a30 100644 --- a/terminaldweller.com/cgit/cgit/cgitrc +++ b/terminaldweller.com/cgit/cgit/cgitrc @@ -1,19 +1,140 @@ +# +## cgit config +# +# +# Enable caching of up to 1000 output entries +# cache-size=5 + +## ttl for root page +cache-root-ttl=5 + +## ttl for repo summary page +cache-repo-ttl=5 + +## ttl for other dynamic pages +cache-dynamic-ttl=5 + +## ttl for static pages (addressed by SHA-1) +cache-static-ttl=-1 + +# css css=/cgit/cgit.css -# logo=/cgit.png +logo=/cgit/cgit.png -# git repos go here -scan-path=/home/git/repositories +# Enable ASCII art commit history graph on the log pages +enable-commit-graph=1 -virtual-root=/ +enable-follow-links=1 +enable-subject-links=1 +enable-index-links=1 + +enable-git-config=1 +enable-html-serving=1 + +enable-http-clone=1 +enable-git-clone=1 + +enable-index-owner=0 +enable-gitweb-owner=1 + +enable-log-filecount=1 +enable-log-linecount=1 + +enable-remote-branches=1 +enable-tree-linenumbers=1 + +# summary info +summary-branches=10 +summary-log=10 +summary-tags=10 + +# Sort by age/name +repository-sort=name +branch-sort=age +commit-sort=age -# automatically render READMEs -about-file=/usr/lib/cgit/filters/about-formatting.sh -readme:=README.md +# Enable statistics per week, month and quarter +max-stats=year -# robots +# show local time not utc +local-time=1 + +root-title=cGit +root-desc=Keep ALL the stuff in VERSION CONTROL!! +root-readme=/var/www/about.html +# footer=/var/www/footer.html + +# if you do not want that webcrawler (like google) index your site robots=noindex, nofollow -# include=/etc/gitrepos +# if cgit messes up links, use a virtual-root. For example has cgit.example.org/ this value: +virtual-root=/ + +side-by-side-diffs=0 + +# needs python-pygments +source-filter=/usr/lib/cgit/filters/syntax-highlighting.py + +# Format markdown, restructuredtext, manpages, text files, and html files through the right converters +about-filter=/usr/lib/cgit/filters/about-formatting.sh + +# available snaps +snapshots=tar.gz zip + +# Specify some default clone urls using macro expansion +clone-url=ssh://git@hostname.local:64822~repositories/$CGIT_REPO_URL git@hostname.local:/home/git/repositories/$CGIT_REPO_URL + +## +## List of common mimetypes +## + +mimetype.gif=image/gif +mimetype.html=text/html +mimetype.jpg=image/jpeg +mimetype.jpeg=image/jpeg +mimetype.pdf=application/pdf +mimetype.png=image/png +mimetype.svg=image/svg+xml + +## +### Search for these files in the root of the default branch of repositories +### for coming up with the about page: +### +readme=:README.md +readme=:readme.md +readme=:README.mkd +readme=:readme.mkd +readme=:README.rst +readme=:readme.rst +readme=:README.html +readme=:readme.html +readme=:README.htm +readme=:readme.htm +readme=:README.txt +readme=:readme.txt +readme=:README +readme=:readme +readme=:INSTALL.md +readme=:install.md +readme=:INSTALL.mkd +readme=:install.mkd +readme=:INSTALL.rst +readme=:install.rst +readme=:INSTALL.html +readme=:install.html +readme=:INSTALL.htm +readme=:install.htm +readme=:INSTALL.txt +readme=:install.txt +readme=:INSTALL +readme=:install + +# sections +section-from-path=1 +section-sort=1 -# syntax highlighting -source-filter=/usr/lib/cgit/filters/syntax-highlighting-edited.sh +# repos +max-repo-count=99999 +remove-suffix=1 +scan-hidden-path=1 +scan-path=/home/git/repositories/ diff --git a/terminaldweller.com/cgit/docker-compose.yaml b/terminaldweller.com/cgit/docker-compose.yaml index d963383..a578b71 100644 --- a/terminaldweller.com/cgit/docker-compose.yaml +++ b/terminaldweller.com/cgit/docker-compose.yaml @@ -1,24 +1,28 @@ version: "3" services: cgit: - image: woahbase/alpine-cgit:x86_64 + image: cgit + build: + context: ./cgit/ networks: - cgitnet ports: - - "8041:80" + - "127.0.0.1:8041:80" - "8042:22" + - "8043:443" restart: unless-stopped environment: - PGID=1000 - PUID=1000 volumes: - # - ./cgit/cgitrc:/etc/cgitrc:ro + - ./cgit/cgitrc:/etc/cgitrc:ro - storage:/home/git/repositories - ./data/ssh:/etc/ssh # - ./data/web:/var/www # - /etc/hosts:/etc/hosts:ro # - /etc/localtime:/etc/localtime:ro - # - ./cgit.conf:/etc/lighttpd/conf.d/cgit.conf + - ./cgit.conf:/etc/lighttpd/cgit.conf:ro + - /etc/letsencrypt/archive/git.terminaldweller.com/ssl.pem:/etc/certs/git.pem:ro bootstrap: image: bootstrap build: diff --git a/terminaldweller.com/haproxy/haproxy.cfg b/terminaldweller.com/haproxy/haproxy.cfg index 6b2e93d..b659cb3 100644 --- a/terminaldweller.com/haproxy/haproxy.cfg +++ b/terminaldweller.com/haproxy/haproxy.cfg @@ -43,6 +43,7 @@ frontend http acl devourer-host hdr_sub(host) -i mila.terminaldweller.com acl discord-host hdr_sub(host) -i discord.terminaldweller.com acl rssgen-host hdr_sub(host) -i rssgen.terminaldweller.com + acl git-host hdr_sub(host) -i git.terminaldweller.com acl mila-api-acl url_beg /mila acl crypto-api-acl url_beg /crypto acl http ssl_fc,not @@ -56,6 +57,7 @@ frontend http http-request redirect scheme https code 301 if http api-host !letsencrypt-acl http-request redirect scheme https code 301 if http devourer-host !letsencrypt-acl http-request redirect scheme https code 301 if http searx-host !letsencrypt-acl + http-request redirect scheme https code 301 if http git-host !letsencrypt-acl # http-request redirect scheme https code 301 if http rssgen-host !letsencrypt-acl #Conditions @@ -69,6 +71,7 @@ frontend http use_backend api-mila-backend-cert if letsencrypt-acl api-host use_backend searx-backend-cert if letsencrypt-acl searx-host use_backend searx-backend-cert if letsencrypt-acl rssgen-host + use_backend searx-backend-cert if letsencrypt-acl git-host # use_backend editor-backend-cert if letsencrypt-acl editor-host use_backend certbot-backend if letsencrypt-acl !chat-host !blog-host !api-host use_backend blog-backend if blog-host @@ -76,6 +79,7 @@ frontend http use_backend api-backend if api-host use_backend searx-backend if searx-host use_backend rssgen-backend if rssgen-host + use_backend git-backend if git-host #use_backend chat-backend if chat-host default_backend blog-backend @@ -94,6 +98,7 @@ frontend https acl api-host-s req.ssl_sni -i api.terminaldweller.com acl mila-api-host-s req.ssl_sni -i mila.terminaldweller.com acl searx-host-s req.ssl_sni -i searx.terminaldweller.com + acl git-host-s req.ssl_sni -i git.terminaldweller.com acl cargo-host-s req.ssl_sni -i cargo.terminaldweller.com acl editor-host-s req.ssl_sni -i editor.terminaldweller.com acl editorsave-host-s req.ssl_sni -i editorsave.terminaldweller.com @@ -110,6 +115,7 @@ frontend https use_backend cargo-backend-s if cargo-host-s use_backend editor-backend-s if editor-host-s use_backend editorsave-backend-s if editorsave-host-s + use_backend git-backend-s if git-host-s #frontend jabber5222 # bind *:5222 @@ -325,9 +331,11 @@ backend searx-backend mode http server searx-host 130.185.121.80:8080 backend searx-backend-s + #balance roundrobin mode tcp option tcp-check server searx-host-s 130.185.121.80:8081 maxconn 10 + #server searx-host-s 192.99.102.52:8081 maxconn 10 backend cargo-backend-s mode tcp @@ -348,3 +356,12 @@ backend rssgen-backend mode http option forwardfor server rssgen-host 130.185.121.80:3000 check + +backend git-backend + mode http + option forwardfor + server git-host 130.185.121.80:8042 +backend git-backend-s + mode tcp + option tcp-check + server git-host-s 130.185.121.80:8043 check |