Skip to content

Commit 48771e3

Browse files
committed
Unify cgit configuration
1 parent 1d201e6 commit 48771e3

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

recipes/files/etc/apache2/conf-available/cgit.conf

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"
2-
RedirectMatch ^/cgit$ /cgit/
31
Alias /cgit-css "/usr/share/cgit/"
2+
ScriptAlias / "/usr/lib/cgit/cgit.cgi/"
3+
RedirectMatch ^/cgit$ /cgit/
44
<Directory "/usr/lib/cgit/">
55
AllowOverride None
66
Options ExecCGI FollowSymlinks
77
Require all granted
8+
RLimitNPROC 5
9+
10+
RewriteEngine On
11+
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
12+
RewriteRule ^/ruby\.git/commit/?$ https://github.com/ruby/ruby/commit/%1 [R=permanent,L,NE,QSD]
13+
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
14+
RewriteRule ^/ruby\.git/commit/(.*)$ https://github.com/ruby/ruby/blob/%1/$1 [R=permanent,L,NE,QSD]
15+
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
16+
RewriteRule ^/ruby\.git/tree/(.*)$ https://github.com/ruby/ruby/blob/%1/$1 [R=permanent,L,NE,QSD]
17+
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})(&showmsg=1)?$
18+
RewriteRule ^/ruby\.git/log/(.*)$ https://github.com/ruby/ruby/commits/%1/$1 [R=permanent,L,NE,QSD]
819

920
Order Allow,Deny
1021
Allow from all

recipes/files/etc/apache2/sites-available/git.ruby-lang.org.conf

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,13 @@
1818

1919
TimeOut 300
2020

21-
RewriteEngine On
22-
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
23-
RewriteRule ^/ruby\.git/commit/?$ https://github.com/ruby/ruby/commit/%1 [R=permanent,L,NE,QSD]
24-
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
25-
RewriteRule ^/ruby\.git/commit/(.*)$ https://github.com/ruby/ruby/blob/%1/$1 [R=permanent,L,NE,QSD]
26-
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
27-
RewriteRule ^/ruby\.git/tree/(.*)$ https://github.com/ruby/ruby/blob/%1/$1 [R=permanent,L,NE,QSD]
28-
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})(&showmsg=1)?$
29-
RewriteRule ^/ruby\.git/log/(.*)$ https://github.com/ruby/ruby/commits/%1/$1 [R=permanent,L,NE,QSD]
30-
31-
Alias /cgit-css "/usr/share/cgit/"
32-
Alias /robots.txt "/var/www/git.ruby-lang.org/robots.txt"
21+
# Alias /robots.txt "/var/www/git.ruby-lang.org/robots.txt"
22+
DocumentRoot /var/www/git.ruby-lang.org
3323

3424
ScriptAlias /webhook "/home/git/git.ruby-lang.org/cgi-bin/webhook.cgi/"
3525
<Directory "/home/git/git.ruby-lang.org/cgi-bin/">
3626
AllowOverride None
3727
Options ExecCGI FollowSymlinks
3828
Require all granted
3929
</Directory>
40-
41-
ScriptAlias / "/usr/lib/cgit/cgit.cgi/"
42-
<Directory "/usr/lib/cgit/">
43-
AllowOverride None
44-
Options ExecCGI FollowSymlinks
45-
Require all granted
46-
RLimitNPROC 5
47-
</Directory>
4830
</VirtualHost>

0 commit comments

Comments
 (0)