diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 34 | ||||
-rw-r--r-- | apache | 24 | ||||
-rw-r--r-- | cgitrc | 14 | ||||
-rw-r--r-- | cgitrepos | 7 | ||||
-rwxr-xr-x | config | 8 |
6 files changed, 89 insertions, 0 deletions
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 @@ -0,0 +1,24 @@ +[MODE: -*- apache -*- :] + +[HTTPS: +<IfModule mod_ssl.c>:] +<VirtualHost *:[HTTP:80:][HTTPS:443:]> + 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:] +</VirtualHost> +[HTTPS: +</IfModule>:] @@ -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 @@ -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/* |