aboutsummaryrefslogtreecommitdiff
path: root/packages/crashbox-config/git/etc
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2018-10-22 04:02:44 -0700
committerJakob Odersky <jakob@odersky.com>2018-10-22 04:02:44 -0700
commit4d7a93c535ceeb720dc1873bfa61531099b611cb (patch)
tree5aa2c02bf756f72fecb5d7bf695a98edfdb417b2 /packages/crashbox-config/git/etc
downloadinfra-4d7a93c535ceeb720dc1873bfa61531099b611cb.tar.gz
infra-4d7a93c535ceeb720dc1873bfa61531099b611cb.tar.bz2
infra-4d7a93c535ceeb720dc1873bfa61531099b611cb.zip
Initial commit
Diffstat (limited to 'packages/crashbox-config/git/etc')
-rw-r--r--packages/crashbox-config/git/etc/cgitrc.d/crashbox63
-rw-r--r--packages/crashbox-config/git/etc/gh-mirror4
-rw-r--r--packages/crashbox-config/git/etc/nginx/sites-enabled/git.conf33
3 files changed, 100 insertions, 0 deletions
diff --git a/packages/crashbox-config/git/etc/cgitrc.d/crashbox b/packages/crashbox-config/git/etc/cgitrc.d/crashbox
new file mode 100644
index 0000000..e95ff11
--- /dev/null
+++ b/packages/crashbox-config/git/etc/cgitrc.d/crashbox
@@ -0,0 +1,63 @@
+#
+# cgit config
+# see cgitrc(5) for details
+#
+# https://git.zx2c4.com/cgit/tree/cgitrc.5.txt
+
+favicon=/crashbox.png
+logo=/crashbox.png
+root-title=git.crashbox.io
+root-desc=Git repositories hosted at crashbox.io
+root-readme=/var/lib/git/www/about.md
+clone-url=https://git.crashbox.io/$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
+mimetype-file=/etc/mime.types
+
+# Don't show owner on index page
+enable-index-owner=0
+
+# Enable blame page and create links to it from tree page
+enable-blame=1
+
+# Enable ASCII art commit history graph on the log pages
+enable-commit-graph=1
+
+# Show extra links for each repository on the index page
+enable-index-links=1
+
+# Show number of affected files per commit on the log pages
+enable-log-filecount=1
+
+# Show number of added/removed lines per commit on the log pages
+enable-log-linecount=1
+
+# Allow download of tar.gz, tar.bz2 and zip-files
+snapshots=tar.gz tar.bz2 zip
+
+# Highlight code
+source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
+
+# Format "about" files such as markdown readmes
+about-filter=/usr/lib/cgit/filters/about-formatting.sh
+readme=master:README.md
+
+# nginx handles negotiating git clones
+enable-http-clone=0
+
+section-from-path=-1
+
+# Remove ".git" suffix in listings
+remove-suffix=1
+
+# Base URL
+virtual-root=/
+
+scan-path=/srv/git
diff --git a/packages/crashbox-config/git/etc/gh-mirror b/packages/crashbox-config/git/etc/gh-mirror
new file mode 100644
index 0000000..4fc987b
--- /dev/null
+++ b/packages/crashbox-config/git/etc/gh-mirror
@@ -0,0 +1,4 @@
+users jodersky /srv/git/mirrors/github/jodersky
+orgs project-condor /srv/git/mirrors/github/project-condor
+orgs driver-oss /srv/git/mirrors/github/driver-oss
+orgs johnandjohn /srv/git/mirrors/github/johnandjohn
diff --git a/packages/crashbox-config/git/etc/nginx/sites-enabled/git.conf b/packages/crashbox-config/git/etc/nginx/sites-enabled/git.conf
new file mode 100644
index 0000000..7210dbc
--- /dev/null
+++ b/packages/crashbox-config/git/etc/nginx/sites-enabled/git.conf
@@ -0,0 +1,33 @@
+server {
+ server_name git.*;
+ listen 80;
+ listen [::]:80;
+ listen 443 ssl;
+ listen [::]:443 ssl;
+
+ root /var/lib/git/www;
+
+ # requests that should to go to git-http-backend
+ location ~ ^.*/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ {
+ root /srv/git;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
+ fastcgi_param GIT_PROJECT_ROOT /srv/git;
+ fastcgi_param GIT_HTTP_EXPORT_ALL "";
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_pass unix:/run/fcgiwrap.socket;
+ }
+
+ location @cgit {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
+ fastcgi_param CGIT_CONFIG /etc/cgitrc.d/crashbox;
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_pass unix:/run/fcgiwrap.socket;
+ }
+
+ location / {
+ try_files $uri @cgit;
+ }
+
+}