summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apache2/conf-available/local-cgit.conf27
-rw-r--r--cgit/apache2/conf-available/local-cgit-legacy.conf (renamed from apache2/conf-available/local-cgit-legacy.conf)0
-rw-r--r--cgit/apache2/conf-available/local-cgit.conf15
-rw-r--r--cgit/uwsgi/local-git.ini21
4 files changed, 36 insertions, 27 deletions
diff --git a/apache2/conf-available/local-cgit.conf b/apache2/conf-available/local-cgit.conf
deleted file mode 100644
index 100720c..0000000
--- a/apache2/conf-available/local-cgit.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-AddDefaultCharset UTF-8
-
-<Directory /srv/git>
- Options None
- AllowOverride None
- Require all granted
-</Directory>
-
-<Directory /usr/lib/cgit>
- Options ExecCgi FollowSymLinks
- AllowOverride None
- Require all granted
-</Directory>
-
-
-<Directory /usr/share/cgit>
- Options None
- AllowOverride None
- Require all granted
-</Directory>
-
-RewriteEngine on
-
-RewriteRule ^/(cgit-css/)?(cgit\.(css|png)|favicon\.ico|robots.txt)$ /usr/share/cgit/$2 [last]
-
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(/.*)?$ /usr/lib/cgit/cgit.cgi$1 [T=application/x-httpd-cgi,L,NS]
diff --git a/apache2/conf-available/local-cgit-legacy.conf b/cgit/apache2/conf-available/local-cgit-legacy.conf
index 3a0f593..3a0f593 100644
--- a/apache2/conf-available/local-cgit-legacy.conf
+++ b/cgit/apache2/conf-available/local-cgit-legacy.conf
diff --git a/cgit/apache2/conf-available/local-cgit.conf b/cgit/apache2/conf-available/local-cgit.conf
new file mode 100644
index 0000000..fb47228
--- /dev/null
+++ b/cgit/apache2/conf-available/local-cgit.conf
@@ -0,0 +1,15 @@
+AddDefaultCharset UTF-8
+
+<Directory /usr/share/cgit>
+ Options None
+ AllowOverride None
+ Require all granted
+</Directory>
+
+Alias /cgit-css/ /usr/share/cgit/
+Alias /favicon.ico /usr/share/cgit/favicon.ico
+Alias /robots.txt /usr/share/cgit/robots.txt
+
+<LocationMatch ^/(?!cgit-css/.*|facicon\.ico|robots\.txt)>
+ ProxyPass unix:/run/uwsgi/app/local-git/socket|uwsgi://local-git
+</LocationMatch>
diff --git a/cgit/uwsgi/local-git.ini b/cgit/uwsgi/local-git.ini
new file mode 100644
index 0000000..0b9c27c
--- /dev/null
+++ b/cgit/uwsgi/local-git.ini
@@ -0,0 +1,21 @@
+[uwsgi]
+
+# serve via uwsgi protocol to frontend webserver
+# * load CGI plugin as default modifier1 to ease frontend setup
+plugins = 0:cgi,router_cache
+
+threads = 8
+offload-threads = 8
+
+# serve static files directly (even better: serve by frontend webserver)
+check-static-docroot = 1
+static-map = /cgit-css/=/usr/share/cgit/
+static-map = /favicon.ico=/usr/share/cgit/favicon.ico
+static-map = /robots.txt=/usr/share/cgit/robots.txt
+
+cgi = /usr/lib/cgit/cgit.cgi
+
+; cache indexes
+cache2 = name=indexes,items=100
+route = /$ cache:key=${REQUEST_URI},name=indexes
+route = /$ cachestore:key=${REQUEST_URI},name=indexes