mirror of
https://gitlab.com/xonotic/xonotic
synced 2025-03-05 10:57:31 +00:00
more infrastructure
This commit is contained in:
parent
66a73f0dfa
commit
83cd09a1f8
1
misc/infrastructure/mirror/crontab.part
Normal file
1
misc/infrastructure/mirror/crontab.part
Normal file
@ -0,0 +1 @@
|
||||
*/5 * * * * gitmirror sh /root/git-mirror-update.sh
|
5
misc/infrastructure/mirror/etc::svc::git-daemon::run
Executable file
5
misc/infrastructure/mirror/etc::svc::git-daemon::run
Executable 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
|
28
misc/infrastructure/mirror/git-mirror-update.sh
Executable file
28
misc/infrastructure/mirror/git-mirror-update.sh
Executable 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
|
20
misc/infrastructure/mirror/gitweb.cgi.patch
Normal file
20
misc/infrastructure/mirror/gitweb.cgi.patch
Normal 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;
|
||||
}
|
||||
|
60
misc/infrastructure/mirror/gitweb.conf
Normal file
60
misc/infrastructure/mirror/gitweb.conf
Normal 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];
|
19
misc/infrastructure/mirror/htttpd.conf.vhost
Normal file
19
misc/infrastructure/mirror/htttpd.conf.vhost
Normal 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>
|
Loading…
Reference in New Issue
Block a user