From: Rudolf Polzer Date: Wed, 15 Dec 2010 11:38:08 +0000 (+0100) Subject: Merge branch 'master' of git://git.xonotic.org/xonotic/xonotic X-Git-Tag: xonotic-v0.1.0preview~16 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=97fe16d7d3bf7c97873cc5ef52730fee817a6f72;hp=0e918e479f02465659a8863aec44d1fbb3151ae0 Merge branch 'master' of git://git.xonotic.org/xonotic/xonotic --- diff --git a/all b/all index c912afa0..f37a17f6 100755 --- a/all +++ b/all @@ -1437,13 +1437,7 @@ case "$cmd" in release-prepare) #"$SELF" each git clean -fxd case "$RELEASETYPE" in - beta) - msg "Building a BETA" - ;; - release) - msg "Building a RELEASE" - ;; - *) + '') $ECHO >&2 -n "$ESC[2J$ESC[H" msg "" msg "" @@ -1485,6 +1479,12 @@ case "$cmd" in # (YYYYMMDD) exit 1 ;; + release) + msg "Building a FINISHED RELEASE" + ;; + *) + msg "Building a $RELEASETYPE" + ;; esac verbose rm -rf Xonotic Xonotic*.zip verbose mkdir -p Xonotic @@ -1652,15 +1652,7 @@ case "$cmd" in verbose "$SELF" update-maps ;; release-qc) - case "$RELEASETYPE" in - beta) - verbose make -C Xonotic/source FTEQCC="../../../fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 clean all - # back out of: source/qcsrc/server - ;; - release) - verbose make -C Xonotic/source FTEQCC="../../../fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 FTEQCCFLAGS_WATERMARK= clean all - ;; - esac + verbose make -C Xonotic/source FTEQCC="../../../fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 clean all verbose rm -f Xonotic/source/*/fteqcc.log ;; release-buildpk3-transform-raw) @@ -1741,8 +1733,10 @@ case "$cmd" in patch=$(($gv - $major * 10000 - $minor * 100)) versionstr="$major.$minor.$patch" case "$RELEASETYPE" in - beta) - versionstr="$versionstr""beta" + release) + ;; + *) + versionstr="$versionstr$RELEASETYPE" ;; esac verbose sed -i " @@ -1750,6 +1744,13 @@ case "$cmd" in s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/; s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/; " defaultXonotic.cfg + case "$RELEASETYPE" in + release) + echo "" >> defaultXonotic.cfg + echo "// nicer menu" >> defaultXonotic.cfg + echo "set menu_watermark \"\"" >> defaultXonotic.cfg + ;; + esac ( verbose cd gfx/menu/luminos verbose cp "$d0"/mediasource/gfx/menu/luminos_versionbuilder/background_l2.svg . @@ -1847,12 +1848,6 @@ case "$cmd" in Xonotic/data/xonotic-$stamp-data-low.pk3 \ Xonotic/data/xonotic-$stamp-maps-low.pk3 \ Xonotic/data/xonotic-$stamp-music-low.pk3 -# verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip -# verbose mkzip0 Xonotic-$stamp-high.zip \ -# Xonotic/data/xonotic-$stamp-data-raw.pk3 \ -# Xonotic/data/xonotic-$stamp-maps-raw.pk3 \ -# Xonotic/data/xonotic-$stamp-music.pk3 \ -# Xonotic/data/xonotic-$stamp-nexcompat.pk3 verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-lowdds.zip verbose mkzip0 Xonotic-$stamp-lowdds.zip \ Xonotic/data/xonotic-$stamp-data-lowdds.pk3 \ diff --git a/misc/infrastructure/keygen/.htaccess b/misc/infrastructure/keygen/.htaccess new file mode 100644 index 00000000..aeafa217 --- /dev/null +++ b/misc/infrastructure/keygen/.htaccess @@ -0,0 +1,15 @@ +Options +ExecCGI +DirectoryIndex response.d0ir + + SetHandler cgi-script + +# allow,deny: accept = A && !D +# deny,allow: accept = !(D && !A) == A || !D + + Order allow,deny + deny from all + + + Order allow,deny + deny from all + diff --git a/misc/infrastructure/keygen/config.pl b/misc/infrastructure/keygen/config.pl new file mode 100644 index 00000000..28f9a79f --- /dev/null +++ b/misc/infrastructure/keygen/config.pl @@ -0,0 +1,20 @@ +%ca = ( + 0 => + { + name => "Xonotic official", + check => sub + { + my ($inc) = @_; + return 0 if ($inc >= 0) && check_dnsbl([qr/.*:.*:.*/], [], ['torexit.dan.me.uk', 'aspews.ext.sorbs.net']); + return 0 if ($inc >= 0) && check_banlist('http://rm.endoftheinternet.org/~xonotic/bans/?action=list&servers=*'); + return 0 if check_sql('dbi:mysql:dbname=xonotic_ca', 'xonotic_ca', '************', 'ip', $inc); + 1; + } + }, + 15 => + { + name => "Xonotic testing", + check => sub { 1; } + } +); +$default_ca = 15; diff --git a/misc/infrastructure/keygen/crypto-keygen-standalone b/misc/infrastructure/keygen/crypto-keygen-standalone new file mode 100755 index 00000000..852b24bc Binary files /dev/null and b/misc/infrastructure/keygen/crypto-keygen-standalone differ diff --git a/misc/infrastructure/keygen/response.d0ir b/misc/infrastructure/keygen/response.d0ir new file mode 100755 index 00000000..fe65eb8b --- /dev/null +++ b/misc/infrastructure/keygen/response.d0ir @@ -0,0 +1,211 @@ +#!/usr/bin/perl + +use strict; +use CGI; +use LWP::Simple; +use MIME::Base64; +use File::Temp; +use DBI; +my $cgi = CGI->new(); + +sub error($) +{ + my ($err) = @_; + print "Content-type: text/plain\n\nd0er $err"; + exit 0; +} + +sub check_dnsbl($$@) +{ + my ($goodpatterns, $badpatterns, $list) = @_; + + my $name = $ENV{REMOTE_HOST} . "."; + my $addr = $ENV{REMOTE_ADDR}; + + # check goodpatterns + for(@$goodpatterns) + { + return 0 + if $name =~ /^(??{$_})$/ || $addr =~ /^(??{$_})$/; + } + # check badpatterns + for(@$badpatterns) + { + return -1 + if $name =~ /^(??{$_})$/ || $addr =~ /^(??{$_})$/; + } + + # is he tor? + my $h = gethostbyname $addr; + return -1 + if not defined $h; + + my $blprefix = join '.', reverse unpack 'C4', $h; + my $i = 0; + for(@$list) + { + ++$i; + my $hn = "$blprefix.$_."; + my $h2 = gethostbyname $hn; + next + if not defined $h2; + return -1; + } + + return 0; +} + +# create table ip ( id INT AUTO_INCREMENT PRIMARY KEY, ip VARCHAR(64), t DATETIME, error BOOLEAN, INDEX(ip), INDEX(t), INDEX(error) ); +our $__CACHED_DBH__; + +sub check_sql($$$$$) +{ + my ($dsn, $u, $p, $tbl, $inc) = @_; + my $ip = $ENV{REMOTE_ADDR}; + my $DBH = ($__CACHED_DBH__ ? $__CACHED_DBH__ : ($__CACHED_DBH__ = DBI->connect($dsn, $u, $p, { RaiseError => 1, AutoCommit => 0 }))) + or die "DBI/DBD: $!"; + $DBH->do("set character set utf8"); + $DBH->do("set names utf8"); + if($inc < 0) + { + $DBH->do("update $tbl set error=true where ip=?", undef, $ip); + $DBH->commit(); + $DBH->disconnect(); + return 0; + } + elsif($inc == 0) + { + my $status = $DBH->selectrow_arrayref("select count(*) from $tbl where ip=? and error=false and t>date_sub(now(), interval 7 day)", undef, $ip) + or die "DBI/DBD: $!"; + $DBH->disconnect(); + return $status->[0] ? -1 : 0; + } + else + { + my $status = $DBH->selectall_arrayref("select error, t>date_sub(now(), interval 7 day) from $tbl where ip=?", undef, $ip) + or die "DBI/DBD: $!"; + if(@$status) + { + if($status->[0][0] || !$status->[0][1]) # error, or after interval + { + $DBH->do("update $tbl set error=false, t=now() where ip=?", undef, $ip); + $DBH->commit(); + $DBH->disconnect(); + return 0; + } + else # too soon + { + $DBH->disconnect(); + return -1; + } + } + else + { + $DBH->do("insert into $tbl(ip, error, t) values(?, false, now())", undef, $ip); + $DBH->commit(); + $DBH->disconnect(); + return 0; + } + } +} + +sub check_banlist($) +{ + my ($s) = @_; + my $ip = $ENV{REMOTE_ADDR}; + my @s = split /\n/, get $s; + for(0..@s/4-1) + { + my $i = $s[4*$_]; + return 1 if "$ip." =~ /^\Q$i\E\./; + } + return 0; +} + +our %ca = (); +our $default_ca = 0; + +do 'config.pl'; + +if((my $key = $cgi->param('key'))) +{ + local $| = 1; + undef local $/; + + my $ca = $cgi->param('ca'); + $ca = $default_ca if not defined $ca; + error "Invalid CA" if not defined $ca{$ca}; + error "Not allowed" if not $ca{$ca}->{check}->(1); + my $tempfh = undef; + eval + { + $tempfh = File::Temp->new(); + binmode $tempfh; + my $fh = $cgi->upload('key'); + if($fh) + { + binmode $fh; + print $tempfh $_ for <$fh>; + } + else + { + $key =~ s/ /+/g; + $key = decode_base64($key); + print $tempfh $key; + } + seek $tempfh, 0, 0; + + $ENV{REQUESTFILE} = $tempfh->filename; + $ENV{RESPONSEFILE} = $tempfh->filename; + $ENV{SECRET} = "key_$ca.d0sk"; + open my $errfh, '-|', './crypto-keygen-standalone -P "$SECRET" -j "$REQUESTFILE" -o "$RESPONSEFILE" 2>&1' + or die "cannot start crypto-keygen-standalone"; + my $err = <$errfh>; + close $errfh + or die "xonotic-keygen failed: $err"; + 1; + } + or do + { + $ca{$ca}->{check}->(-1); + die "$@"; + }; + + print "Content-type: application/octet-stream\n\n"; + binmode STDOUT; + print for <$tempfh>; +} +else +{ + print < + + + Xonotic keygen + + +

Xonotic keygen

+
+ To generate and sign a key IN GAME, follow these steps on the console: +
    +
  1. crypto_keygen $default_ca http://rm.endoftheinternet.org/~xonotic/keygen/?ca=$default_ca&key=
  2. +
+ To generate and sign a key MANUALLY, follow these steps on a UNIX command line: +
    +
  1. ./xonotic-keygen -p key_$default_ca.d0pk -o key_$default_ca.d0si
  2. +
  3. ./xonotic-keygen -p key_$default_ca.d0pk -I key_$default_ca.d0si -o request.d0iq -O camouflage.d0ic +
  4. Upload the request.d0iq file:
  5. +
  6. Save the response.d0ir file you are getting
  7. +
  8. ./xonotic-keygen -p key_$default_ca.d0pk -I key_$default_ca.d0si -c camouflage.d0ic -J response.d0ir -o key_$default_ca.d0si
  9. +
  10. Delete request.d0iq, camouflage.d0ic, response.d0ir
  11. +
+ Your key_$default_ca.d0si key is now signed. +
+ To use another CA, please enter its number here before using this page: + + + +EOF +} diff --git a/savecore.gdb b/savecore.gdb index 28ae11ac..4cad4cf1 100644 --- a/savecore.gdb +++ b/savecore.gdb @@ -1,6 +1,7 @@ handle SIGHUP nostop print pass handle SIGINT nostop print pass handle SIGCONT nostop print pass +handle SIGSTOP nostop print pass handle SIGTSTP nostop print pass handle SIGTRAP nostop print nopass run diff --git a/server/server.cfg b/server/server.cfg index 8ac9c554..6cca0dbe 100644 --- a/server/server.cfg +++ b/server/server.cfg @@ -113,6 +113,7 @@ ///////////////////////////////////////////////////////////////////// // "Obvious" mutators that are allowed on a "pure" server //g_minstagib 0 // set to 1 for MinstaGib +g_weapon_stay 0 // set to 1, 2 or 3 for different weapon-stay modes (1 = traditional, 2 = no ammo but allow throwing, 3 = ghost weapon stay) ///////////////////////////////////////////////////////////////////// @@ -120,7 +121,8 @@ // enable some mutators you'd like //g_cloaked 0 // set to 1 for transparent hard to see players -//g_grappling_hook 0 // set to 1 to enable the hook +//g_grappling_hook 0 // set to 1 to enable the hook (allowed on "pure" server in MinstaGib) +//g_jetpack 0 // set to 1 to enable the jetpack (allowed on "pure" server in MinstaGib) //g_laserguided_missile 0 // set to 1 for laser guided missiles in the RL //g_midair 0 // set to 1 to make only midair damage count //g_vampire 0 // set to 1 to give players the damage they cause as health