From 6aa3edf0ca29d0b31198bbb931ed437be92e427e Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 24 May 2015 15:44:46 +0200 Subject: Rename dir apache2/conf.available → apache2/conf-available. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apache2/conf-available/local-cgit-legacy.conf | 157 ++++++++++++++++++++++++++ apache2/conf-available/local-cgit.conf | 27 +++++ apache2/conf.available/local-cgit-legacy.conf | 157 -------------------------- apache2/conf.available/local-cgit.conf | 27 ----- 4 files changed, 184 insertions(+), 184 deletions(-) create mode 100644 apache2/conf-available/local-cgit-legacy.conf create mode 100644 apache2/conf-available/local-cgit.conf delete mode 100644 apache2/conf.available/local-cgit-legacy.conf delete mode 100644 apache2/conf.available/local-cgit.conf (limited to 'apache2') diff --git a/apache2/conf-available/local-cgit-legacy.conf b/apache2/conf-available/local-cgit-legacy.conf new file mode 100644 index 0000000..3a0f593 --- /dev/null +++ b/apache2/conf-available/local-cgit-legacy.conf @@ -0,0 +1,157 @@ +# Based on http://www.clearchain.com/blog/posts/cgit-upgrade-gitweb-retired +# +# Redirects mapping gitweb -> cgit +# +# Gitweb uses get targets seperated by ; +# +# /?...;...;... +# +# p = Project +# a = Action like ( +# blob, +# blob_plain, +# commitdiff, +# commit, +# history, +# log, +# rss|atom, +# shortlog, +# summary, +# tag, +# tree, +# snapshot +# ) +# h = SHA Hash +# hb= SHA Hash Tree Base +# f= file/dir +# sf= snapshot format +# +# Cgit uses the following: +# +# /project/action/?... +# +# action ( commit, log, diff, tree, tag, patch ) +# +# id = SHA Hash +# id2 = SHA Hash +# h = head +# +# Translation rules +# +# Project is a straight redirect +# --- +# /?p=(.+)\.git; /$1/ +# +# Action requires a mapping +# --- +# a=(blob|tree) /tree/ +# a=(blobdiff|commitdiff) /diff/ +# a=commit /commit/ +# a=(summary) / +# a=(shortlog|log|history) /log/ +# a=tag /tag/ +# a=blob_plain /blob/ +# a=rss|atom /atom +# +# Targets require mapping +# --- +# h=(.+) id=$1 +# f=(.+) /$1 +# hb=(.+) id2=$1 +# +# Now putting it all together +# +RewriteEngine On + +# blob +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob;h=([^;]+);hb=([^;]+);f=([^;]+) +RewriteRule ^/$ /%1.git/tree/%5?id=%3;id2=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob;f=([^;]+);h=([^;]+);hb=([^;]+) +RewriteRule ^/$ /%1.git/tree/%3?id=%4;id2=%5 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob;hb=([^;]+);f=([^;]+) +RewriteRule ^/$ /%1.git/tree/%4?id=%3 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob;f=([^;]+) +RewriteRule ^/$ /%1.git/tree/%3 [R=permanent,L,NE,QSD] + +# tree +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree;h=([^;]+);hb=([^;]+);f=([^;]+) +RewriteRule ^/$ /%1.git/tree/%5?id=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree;hb=([^;]+);f=([^;]+) +RewriteRule ^/$ /%1.git/tree/%4?id=%3 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree;h=([^;]+);hb=([^;]+) +RewriteRule ^/$ /%1.git/tree/?id=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree;hb=([^;]+) +RewriteRule ^/$ /%1.git/tree/?id=%3 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree +RewriteRule ^/$ /%1.git/tree/? [R=permanent,L,NE,QSD] + +# commitdiff +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blobdiff;h=([^;]+);hp=([^;]+);hb=([^;]+);f=([^;]+) +RewriteRule ^/$ /%1.git/diff/%6?id2=%4;id=%3;id3=%5 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=commitdiff;h=([^;]+);hp=([^;]+) +RewriteRule ^/$ /%1.git/diff/?id=%4;id2=%3 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=commitdiff;h=([^;]+) +RewriteRule ^/$ /%1.git/diff/?id=%3 [R=permanent,L,NE,QSD] + +# commit +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=commit;h=([^;]+) +RewriteRule ^/$ /%1.git/commit/?id=%3 [R=permanent,L,NE,QSD] + +# shortlog +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=shortlog;h=([^;]+) +RewriteRule ^/$ /%1.git/log/?id=%3 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=shortlog +RewriteRule ^/$ /%1.git/log/? [R=permanent,L,NE,QSD] + +# log +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=log;h=([^;]+) +RewriteRule ^/$ /%1.git/log/?id=%3 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=log +RewriteRule ^/$ /%1.git/log [R=permanent,L,NE,QSD] + +# history +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;h=([^;]+);hb=([^;]+);f=([^;]+) +RewriteRule ^/$ /%1.git/log/%5?id=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;f=([^;]+);h=([^;]+);hb=([^;]+) +RewriteRule ^/$ /%1.git/log/%3?id=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;f=([^;]+);h=([^;]+) +RewriteRule ^/$ /%1.git/log/%3?id=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;h=([^;]+);hb=([^;]+) +RewriteRule ^/$ /%1.git/log/?id=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;hb=([^;]+);f=([^;]+) +RewriteRule ^/$ /%1.git/log/%4?id=%3 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;hb=([^;]+) +RewriteRule ^/$ /%1.git/log/?id=%3 [R=permanent,L,NE,QSD] + +# tag +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tag;h=([^;]+) +RewriteRule ^/$ /%1.git/tag/?id=%4 [R=permanent,L,NE,QSD] + +# blob_plain +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob_plain;h=([^;]+);f=([^;]+) +RewriteRule ^/$ /%1.git/blob/%4?id=%3 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob_plain;f=([^;]+);hb=([^;]+) +RewriteRule ^/$ /%1.git/plain/%3?id2=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob_plain;f=([^;]+) +RewriteRule ^/$ /%1.git/plain/%3 [R=permanent,L,NE,QSD] + +# rss|atom +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=(rss|atom);h=refsheads/([^;]+) +RewriteRule ^/$ /%1.git/atom?h=%4 [R=permanent,L,NE,QSD] +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=(rss|atom) +RewriteRule ^/$ /%1.git/atom [R=permanent,L,NE,QSD] + +# snapshot +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=snapshot;h=([^;]+);sf=([^;]+) +RewriteRule ^/$ /%1.git/snapshot/%3.tar.gz [R=permanent,L,NE,QSD] + +# summary +RewriteCond %{QUERY_STRING} p=([^;]+)(\.git)(;a=summary)?$ +RewriteRule ^/$ /%1 [R=permanent,L,NE,QSD] + +# Failsafes in case nothing above matches, +# try at least to put the person in the project, else root of cgit +RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?.* +RewriteRule ^/$ /%1 [R=temp,L,NE,QSD] +RewriteCond %{QUERY_STRING} .+ +RewriteRule ^/.+ / [R=temp,L,NE,QSD] diff --git a/apache2/conf-available/local-cgit.conf b/apache2/conf-available/local-cgit.conf new file mode 100644 index 0000000..100720c --- /dev/null +++ b/apache2/conf-available/local-cgit.conf @@ -0,0 +1,27 @@ +AddDefaultCharset UTF-8 + + + Options None + AllowOverride None + Require all granted + + + + Options ExecCgi FollowSymLinks + AllowOverride None + Require all granted + + + + + Options None + AllowOverride None + Require all granted + + +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/apache2/conf.available/local-cgit-legacy.conf deleted file mode 100644 index 3a0f593..0000000 --- a/apache2/conf.available/local-cgit-legacy.conf +++ /dev/null @@ -1,157 +0,0 @@ -# Based on http://www.clearchain.com/blog/posts/cgit-upgrade-gitweb-retired -# -# Redirects mapping gitweb -> cgit -# -# Gitweb uses get targets seperated by ; -# -# /?...;...;... -# -# p = Project -# a = Action like ( -# blob, -# blob_plain, -# commitdiff, -# commit, -# history, -# log, -# rss|atom, -# shortlog, -# summary, -# tag, -# tree, -# snapshot -# ) -# h = SHA Hash -# hb= SHA Hash Tree Base -# f= file/dir -# sf= snapshot format -# -# Cgit uses the following: -# -# /project/action/?... -# -# action ( commit, log, diff, tree, tag, patch ) -# -# id = SHA Hash -# id2 = SHA Hash -# h = head -# -# Translation rules -# -# Project is a straight redirect -# --- -# /?p=(.+)\.git; /$1/ -# -# Action requires a mapping -# --- -# a=(blob|tree) /tree/ -# a=(blobdiff|commitdiff) /diff/ -# a=commit /commit/ -# a=(summary) / -# a=(shortlog|log|history) /log/ -# a=tag /tag/ -# a=blob_plain /blob/ -# a=rss|atom /atom -# -# Targets require mapping -# --- -# h=(.+) id=$1 -# f=(.+) /$1 -# hb=(.+) id2=$1 -# -# Now putting it all together -# -RewriteEngine On - -# blob -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob;h=([^;]+);hb=([^;]+);f=([^;]+) -RewriteRule ^/$ /%1.git/tree/%5?id=%3;id2=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob;f=([^;]+);h=([^;]+);hb=([^;]+) -RewriteRule ^/$ /%1.git/tree/%3?id=%4;id2=%5 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob;hb=([^;]+);f=([^;]+) -RewriteRule ^/$ /%1.git/tree/%4?id=%3 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob;f=([^;]+) -RewriteRule ^/$ /%1.git/tree/%3 [R=permanent,L,NE,QSD] - -# tree -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree;h=([^;]+);hb=([^;]+);f=([^;]+) -RewriteRule ^/$ /%1.git/tree/%5?id=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree;hb=([^;]+);f=([^;]+) -RewriteRule ^/$ /%1.git/tree/%4?id=%3 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree;h=([^;]+);hb=([^;]+) -RewriteRule ^/$ /%1.git/tree/?id=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree;hb=([^;]+) -RewriteRule ^/$ /%1.git/tree/?id=%3 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tree -RewriteRule ^/$ /%1.git/tree/? [R=permanent,L,NE,QSD] - -# commitdiff -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blobdiff;h=([^;]+);hp=([^;]+);hb=([^;]+);f=([^;]+) -RewriteRule ^/$ /%1.git/diff/%6?id2=%4;id=%3;id3=%5 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=commitdiff;h=([^;]+);hp=([^;]+) -RewriteRule ^/$ /%1.git/diff/?id=%4;id2=%3 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=commitdiff;h=([^;]+) -RewriteRule ^/$ /%1.git/diff/?id=%3 [R=permanent,L,NE,QSD] - -# commit -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=commit;h=([^;]+) -RewriteRule ^/$ /%1.git/commit/?id=%3 [R=permanent,L,NE,QSD] - -# shortlog -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=shortlog;h=([^;]+) -RewriteRule ^/$ /%1.git/log/?id=%3 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=shortlog -RewriteRule ^/$ /%1.git/log/? [R=permanent,L,NE,QSD] - -# log -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=log;h=([^;]+) -RewriteRule ^/$ /%1.git/log/?id=%3 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=log -RewriteRule ^/$ /%1.git/log [R=permanent,L,NE,QSD] - -# history -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;h=([^;]+);hb=([^;]+);f=([^;]+) -RewriteRule ^/$ /%1.git/log/%5?id=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;f=([^;]+);h=([^;]+);hb=([^;]+) -RewriteRule ^/$ /%1.git/log/%3?id=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;f=([^;]+);h=([^;]+) -RewriteRule ^/$ /%1.git/log/%3?id=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;h=([^;]+);hb=([^;]+) -RewriteRule ^/$ /%1.git/log/?id=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;hb=([^;]+);f=([^;]+) -RewriteRule ^/$ /%1.git/log/%4?id=%3 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=history;hb=([^;]+) -RewriteRule ^/$ /%1.git/log/?id=%3 [R=permanent,L,NE,QSD] - -# tag -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=tag;h=([^;]+) -RewriteRule ^/$ /%1.git/tag/?id=%4 [R=permanent,L,NE,QSD] - -# blob_plain -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob_plain;h=([^;]+);f=([^;]+) -RewriteRule ^/$ /%1.git/blob/%4?id=%3 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob_plain;f=([^;]+);hb=([^;]+) -RewriteRule ^/$ /%1.git/plain/%3?id2=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=blob_plain;f=([^;]+) -RewriteRule ^/$ /%1.git/plain/%3 [R=permanent,L,NE,QSD] - -# rss|atom -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=(rss|atom);h=refsheads/([^;]+) -RewriteRule ^/$ /%1.git/atom?h=%4 [R=permanent,L,NE,QSD] -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=(rss|atom) -RewriteRule ^/$ /%1.git/atom [R=permanent,L,NE,QSD] - -# snapshot -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?;a=snapshot;h=([^;]+);sf=([^;]+) -RewriteRule ^/$ /%1.git/snapshot/%3.tar.gz [R=permanent,L,NE,QSD] - -# summary -RewriteCond %{QUERY_STRING} p=([^;]+)(\.git)(;a=summary)?$ -RewriteRule ^/$ /%1 [R=permanent,L,NE,QSD] - -# Failsafes in case nothing above matches, -# try at least to put the person in the project, else root of cgit -RewriteCond %{QUERY_STRING} p=([^;]+?)(\.git)?.* -RewriteRule ^/$ /%1 [R=temp,L,NE,QSD] -RewriteCond %{QUERY_STRING} .+ -RewriteRule ^/.+ / [R=temp,L,NE,QSD] 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 - - - Options None - AllowOverride None - Require all granted - - - - Options ExecCgi FollowSymLinks - AllowOverride None - Require all granted - - - - - Options None - AllowOverride None - Require all granted - - -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] -- cgit v1.2.3