more infrastructure

This commit is contained in:
Rudolf Polzer 2010-11-20 18:38:59 +01:00
parent 66a73f0dfa
commit 83cd09a1f8
6 changed files with 133 additions and 0 deletions

View File

@ -0,0 +1 @@
*/5 * * * * gitmirror sh /root/git-mirror-update.sh

View File

@ -0,0 +1,5 @@
#!/bin/sh
exec 2>&1
echo 'git-daemon starting.'
exec chpst -ugitdaemon \
"$(git --exec-path)"/git-daemon --verbose --base-path=/var/cache/git /var/cache/git

View File

@ -0,0 +1,28 @@
#!/bin/sh
set -e
exec >/dev/null 2>&1
me=/var/tmp/git-mirror-lock
if ! lockfile-create "$me"; then
exit 1
fi
lockfile-touch "$me" & lockpid=$!
trap 'kill $lockpid || true; cd "$mepwd"; lockfile-remove "$me"' EXIT
trap 'exit 1' INT TERM
mkdir -p /var/cache/git/xonotic
cd /var/cache/git/xonotic
ssh xonotic@git.xonotic.org ./send-git-configs.sh | tar xvf -
for X in /var/cache/git/*/*.git; do
cd "$X"
git config remote.origin.fetch "+refs/*:refs/*"
git config remote.origin.mirror "true"
git config remote.origin.url "git://git.xonotic.org/${X#/var/cache/git/}"
git fetch
git remote prune origin
git gc --auto
touch git-daemon-export-ok
done

View File

@ -0,0 +1,20 @@
# TODO: turn this into a REAL diff
# what we did: we added the line with @ stuff
# replace invalid utf8 character with SUBSTITUTION sequence
sub esc_html {
my $str = shift;
my %opts = @_;
return undef unless defined $str;
$str = to_utf8($str);
$str = $cgi->escapeHTML($str);
$str =~ s/@/@/g;
if ($opts{'-nbsp'}) {
$str =~ s/ / /g;
}
$str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg;
return $str;
}

View File

@ -0,0 +1,60 @@
# path to git projects (<project>.git)
$projectroot = "/var/cache/git";
# directory to use for temp files
$git_temp = "/tmp";
# target of the home link on top of all pages
#$home_link = $my_uri || "/";
# html text to include at home page
$home_text = "indextext.html";
# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;
# stylesheet to use
$stylesheet = "/gitweb/gitweb.css";
# logo to use
$logo = "/gitweb/git-logo.png";
# the 'favicon'
$favicon = "/gitweb/git-favicon.png";
$feature{'blame'}{'override'} = 1;
$feature{'blame'}{'default'} = [1];
$feature{'snapshot'}{'override'} = 1;
$feature{'snapshot'}{'default'} = [0];
$feature{'search'}{'default'} = [0];
$feature{'grep'}{'override'} = 1;
$feature{'grep'}{'default'} = [0];
$feature{'pickaxe'}{'override'} = 1;
$feature{'pickaxe'}{'default'} = [0];
$feature{'show-sizes'}{'override'} = 1;
$feature{'show-sizes'}{'default'} = [1];
$feature{'pathinfo'}{'default'} = [0];
$feature{'forks'}{'default'} = [1];
$feature{'actions'}{'default'} = [
("merge-request", "http://nl.git.xonotic.org/merge-request/?n=%n&h=%h&hb=%b", "tree")
];
$feature{'ctags'}{'default'} = [0];
$feature{'patches'}{'override'} = 0;
$feature{'patches'}{'default'} = [64];
$feature{'avatar'}{'override'} = 0;
$feature{'avatar'}{'default'} = [''];
$feature{'timed'}{'default'} = [0];
$feature{'javascript-actions'}{'default'} = [1];

View File

@ -0,0 +1,19 @@
<VirtualHost *:80>
ServerName de.git.xonotic.org
SetEnv GIT_PROJECT_ROOT /var/cache/git
AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/cache/git/$1
AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/cache/git/$1
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/info/[^/]+ | \
git-(upload|receive)-pack))$" \
/usr/lib/git-core/git-http-backend/$1
DocumentRoot /var/www-gitweb/
Options FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
Alias /gitweb /var/www-gitweb/
</VirtualHost>