From d48c1ce2af934c512f808150e95a60a3ace21640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Laboissi=C3=A8re?= Date: Sat, 10 Dec 2022 16:18:50 -0300 Subject: Initial commit --- .gitignore | 2 ++ Makefile | 34 ++++++++++++++++++++++++++++++++++ apache | 24 ++++++++++++++++++++++++ cgitrc | 14 ++++++++++++++ cgitrepos | 7 +++++++ config | 8 ++++++++ 6 files changed, 89 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 apache create mode 100644 cgitrc create mode 100644 cgitrepos create mode 100755 config diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..08350e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/HTTP +/HTTPS diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6d64923 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +APACHE_DIR = /etc/apache2/sites-available + +### The rules apache-(un|)install are intended to be run on the +### www.cefala.org server. The rule cgit-install is intended to be run +### on the git.cefala.org server. + +.PHONY: apache-install +apache-install: HTTP HTTPS + install --mode=644 HTTP $(APACHE_DIR)/cgit.conf + install --mode=644 HTTPS $(APACHE_DIR)/cgit-le-ssl.conf + /usr/sbin/a2ensite cgit + /usr/sbin/a2ensite cgit-le-ssl + /usr/sbin/a2enmod proxy + /usr/sbin/a2enmod proxy_http + /bin/systemctl restart apache2.service + +HTTP HTTPS: apache + slice -o$@uUNDEF":"$@ apache + +.PHONY: apache-uninstall +apache-uninstall: + /usr/sbin/a2ensite cgit + /usr/sbin/a2ensite cgit-le-ssl + rm $(APACHE_DIR)/cgit.conf + rm $(APACHE_DIR)/cgit-le-ssl.conf + /bin/systemctl restart apache2.service + +.PHONY: cgit-install +cgit-install: + sudo cp cgitrc cgitrepos /etc + +.PHONY: clean +clean: + rm -f HTTP HTTPS diff --git a/apache b/apache new file mode 100644 index 0000000..730b135 --- /dev/null +++ b/apache @@ -0,0 +1,24 @@ +[MODE: -*- apache -*- :] + +[HTTPS: +:] + + ServerAdmin cefala-admin@cefala.org + ServerName cgit.cefala.org + ProxyPass /cgit http://git.cefala.org/cgit/ + ProxyPassReverse /cgit http://git.cefala.org/cgit/ + ProxyPass /cgit-css http://git.cefala.org/cgit-css/ + ProxyPassReverse /cgit-css http://git.cefala.org/cgit-css/ + ProxyPass / http://git.cefala.org/cgit/ + ProxyPassReverse / http://git.cefala.org/cgit/ +[HTTP: + RewriteEngine on + RewriteCond %{SERVER_NAME} =cgit.cefala.org + RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]:] +[HTTPS: + Include /etc/letsencrypt/options-ssl-apache.conf + SSLCertificateFile /etc/letsencrypt/live/cgit.cefala.org/fullchain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/cgit.cefala.org/privkey.pem:] + +[HTTPS: +:] diff --git a/cgitrc b/cgitrc new file mode 100644 index 0000000..4306062 --- /dev/null +++ b/cgitrc @@ -0,0 +1,14 @@ +# -*- shell-script -*- + +# Locations of style files +css=/cgit-css/cgit.css +logo=/cgit-css/cgit.png + +# Prevent webcrawler (like google) index our site +robots=noindex, nofollow + +# Allow http transport git clone +enable-http-clone=1 + +# Allowed repos +include=/etc/cgitrepos diff --git a/cgitrepos b/cgitrepos new file mode 100644 index 0000000..bd202de --- /dev/null +++ b/cgitrepos @@ -0,0 +1,7 @@ +repo.url=git-scripts +repo.path=/var/git/cefala-admin/git-scripts.git +repo.desc=Git convenience scripts for git.cefala.org + +repo.url=cefala-cgit +repo.path=/var/git/cefala-admin/cefala-cgit.git +repo.desc=CGit access to the CEFALA repos diff --git a/config b/config new file mode 100755 index 0000000..9c67572 --- /dev/null +++ b/config @@ -0,0 +1,8 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "origin"] + url = cefala-admin@git.cefala.org:cefala-cgit.git + fetch = +refs/heads/*:refs/remotes/origin/* -- cgit v1.2.3