diff options
Diffstat (limited to 'contrib')
55 files changed, 132 insertions, 2330 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am index c42892a85d..5aae2c819e 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -1,12 +1,10 @@ -SUBDIRS = osx suse -DIST_SUBDIRS = osx suse +SUBDIRS = suse +DIST_SUBDIRS = suse confdir = $(sysconfdir)/tor -EXTRA_DIST = exitlist tor-tsocks.conf torify.1 tor.nsi.in tor.sh torctl rc.subr cross.sh tor-mingw.nsi.in package_nsis-mingw.sh tor.ico tor-ctrl.sh linux-tor-prio.sh tor-exit-notice.html +EXTRA_DIST = exitlist tor-tsocks.conf tor.nsi.in tor.sh torctl rc.subr cross.sh tor-mingw.nsi.in package_nsis-mingw.sh tor.ico tor-ctrl.sh linux-tor-prio.sh tor-exit-notice.html conf_DATA = tor-tsocks.conf bin_SCRIPTS = torify - -man_MANS = torify.1 diff --git a/contrib/auto-naming/README b/contrib/auto-naming/README index 77e6af6483..e2f9ff8c2a 100644 --- a/contrib/auto-naming/README +++ b/contrib/auto-naming/README @@ -1,65 +1,6 @@ -=== AUTONAMING FOR TOR === - Tor directory authorities may maintain a binding of server identities -(their long term identity key) and nicknames. In their status documents -they may for each router they know tell if this is indeed the owner of -that nickname or not. - -This toolset allows automatic maintaining of a binding list of nicknames -to identity keys, implementing Tor proposal 123[1]. - -The rules are simple: - - A router claiming to be Bob is named (i.e. added to the binding list) - if there currently does not exist a different binding for that - nickname, the router has been around for a bit (2 weeks), no other - router has used that nickname in a while (1 month). - - A binding is removed if the server that owns it has not been seen - in a long time (6 months). - - -=== REQUIREMENTS === - - * ruby, and its postgres DBI interface (Debian packages: ruby, ruby1.8, libdbi-ruby1.8, libdbd-pg-ruby1.8) - * postgres (tested with >= 8.1) - * cron - -=== SETUP === - - * copy this tree some place, like into a 'auto-naming' directory in your Tor's - data directory - * create a database and a user, modifying db-config.rb accordingly - * initialize the database by executing the sql statements in create-db.sql - * setup a cronjob that feeds the current consensus to the process-consensus - script regularly. - * once the database is sufficiently populated, maybe a month or so after the - previous step, setup a cronjob to regularly build the binding list using - the build-approved-routers script. You probably want to append a manually - managed list of rejections to that file and give it to tor as its - "approved-routers" file. - The Sample-Makefile and Sample-crontab demonstrate the method used at tor26. - - -1. https://tor-svn.freehaven.net/svn/tor/trunk/doc/spec/proposals/123-autonaming.txt - - - - -Copyright (c) 2007 Peter Palfrader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +(their long term identity key) and nicknames. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The auto-naming scripts have been moved to svn in +projects/tor-naming/auto-naming/trunk/ -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/contrib/auto-naming/Sample-Makefile b/contrib/auto-naming/Sample-Makefile deleted file mode 100644 index e3e0351df8..0000000000 --- a/contrib/auto-naming/Sample-Makefile +++ /dev/null @@ -1,20 +0,0 @@ - -all: ../approved-routers - -update: - wget -q -O - http://tor.noreply.org/tor/status-vote/current/consensus | \ - ./process-consensus - -.PHONY: approved-routers-auto -approved-routers-auto: - ./build-approved-routers > "$@" - -.INTERMEDIATE: approved-routers -approved-routers: approved-routers-auto /etc/tor/approved-routers - cat $^ > "$@" - -../approved-routers: approved-routers - if ! diff -q "$<" "$@"; then \ - mv "$<" "$@" &&\ - (! [ -e /var/run/tor/tor.pid ] || kill -HUP `cat /var/run/tor/tor.pid`) ; \ - fi diff --git a/contrib/auto-naming/Sample-crontab b/contrib/auto-naming/Sample-crontab deleted file mode 100644 index b50c07bb81..0000000000 --- a/contrib/auto-naming/Sample-crontab +++ /dev/null @@ -1,3 +0,0 @@ -MAILTO=admin -# cronjob for tor naming -23 * * * * make -s -C auto-naming update && make -s -C auto-naming diff --git a/contrib/auto-naming/build-approved-routers b/contrib/auto-naming/build-approved-routers deleted file mode 100755 index 805321f208..0000000000 --- a/contrib/auto-naming/build-approved-routers +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/ruby - -# build-approved-routers - create a name-binding list for use at a Tor -# directory authority -# -# Copyright (c) 2007 Peter Palfrader -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -require "yaml" - -require 'db' -require 'db-config' - -verbose = ARGV.first == "-v" - -db = Db.new($CONFIG['database']['dbhost'], $CONFIG['database']['dbname'], $CONFIG['database']['user'], $CONFIG['database']['password']) - -db.transaction_begin -named = db.query2(" - SELECT fingerprint, router_id, nickname_id, nick, first_seen, last_seen - FROM router NATURAL JOIN router_claims_nickname NATURAL JOIN nickname - WHERE named") -while (n=named.next) do - puts "# (r##{n['router_id']},n##{n['nickname_id']}); first_seen: #{n['first_seen']}, last_seen: #{n['last_seen']}" - fpr = n['fingerprint'].split(/(....)/).delete_if{|x| x=="" }.join(' ') - puts "#{n['nick']} #{fpr}" -end -db.transaction_commit diff --git a/contrib/auto-naming/create-db.sql b/contrib/auto-naming/create-db.sql deleted file mode 100644 index 86e3e63911..0000000000 --- a/contrib/auto-naming/create-db.sql +++ /dev/null @@ -1,50 +0,0 @@ - -CREATE TABLE router ( - router_id SERIAL PRIMARY KEY, - fingerprint CHAR(40) NOT NULL, - UNIQUE(fingerprint) -); --- already created implicitly due to unique contraint --- CREATE INDEX router_fingerprint ON router(fingerprint); - -CREATE TABLE nickname ( - nickname_id SERIAL PRIMARY KEY, - nick VARCHAR(30) NOT NULL, - UNIQUE(nick) -); --- already created implicitly due to unique contraint --- CREATE INDEX nickname_nick ON nickname(nick); - -CREATE TABLE router_claims_nickname ( - router_id INTEGER NOT NULL REFERENCES router(router_id) ON DELETE CASCADE, - nickname_id INTEGER NOT NULL REFERENCES nickname(nickname_id) ON DELETE CASCADE, - first_seen TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - last_seen TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - named BOOLEAN NOT NULL DEFAULT 'false', - UNIQUE(router_id, nickname_id) -); -CREATE INDEX router_claims_nickname_router_id ON router_claims_nickname(router_id); -CREATE INDEX router_claims_nickname_nickname_id ON router_claims_nickname(nickname_id); -CREATE INDEX router_claims_nickname_first_seen ON router_claims_nickname(first_seen); -CREATE INDEX router_claims_nickname_last_seen ON router_claims_nickname(last_seen); - - --- Copyright (c) 2007 Peter Palfrader --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and associated documentation files (the "Software"), to deal --- in the Software without restriction, including without limitation the rights --- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --- copies of the Software, and to permit persons to whom the Software is --- furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --- SOFTWARE. diff --git a/contrib/auto-naming/db-config.rb b/contrib/auto-naming/db-config.rb deleted file mode 100644 index b1508c1b70..0000000000 --- a/contrib/auto-naming/db-config.rb +++ /dev/null @@ -1,8 +0,0 @@ -$CONFIG = {} unless $CONFIG -$CONFIG['database'] = {} unless $CONFIG['database'] - -# if you use postgres' "ident sameuser" auth set dbhost to '' -$CONFIG['database']['dbhost'] = 'localhost'; -$CONFIG['database']['dbname'] = 'tornaming'; -$CONFIG['database']['user'] = 'tornaming'; -$CONFIG['database']['password'] = 'x'; diff --git a/contrib/auto-naming/db.rb b/contrib/auto-naming/db.rb deleted file mode 100644 index 822a26bad7..0000000000 --- a/contrib/auto-naming/db.rb +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/ruby - -# Copyright (c) 2006, 2007 Peter Palfrader -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -require "dbi" - -class WeaselDbQueryHandle - def initialize(sth) - @sth = sth - end - - def next() - row = @sth.fetch_hash - if row - return row - else - @sth.finish - return nil - end - end -end - -class Db - def initialize(host, database, user, password) - @dbh = DBI.connect("dbi:Pg:#{database}:#{host}", user, password); - @dbh['AutoCommit'] = false - @transaction = false - @pre_initial_transaction=true - end - - def do(query,*args) - @dbh.do(query,*args) - end - def transaction_begin() - @dbh.do("BEGIN") unless @pre_initial_transaction - @transaction = true - @pre_initial_transaction=false - end - def transaction_commit() - @dbh.do("COMMIT") - @transaction = false - end - def transaction_rollback() - @dbh.do("ROLLBACK") - end - def get_primarykey_name(table); - #return 'ref'; - return table+'_id'; - end - - def update(table, values, keys) - cols = [] - vals = [] - values.each_pair{ |k,v| - cols << "#{k}=?" - vals << v - } - - wheres = [] - keys.each_pair{ |k,v| - wheres << "#{k}=?" - vals << v - } - - throw "update value set empty" unless cols.size > 0 - throw "where clause empty" unless wheres.size > 0 - - query = "UPDATE #{table} SET #{cols.join(',')} WHERE #{wheres.join(' AND ')}" - transaction_begin unless transaction_before=@transaction - r = @dbh.do(query, *vals) - transaction_commit unless transaction_before - return r - end - - def update_row(table, values) - pk_name = get_primarykey_name(table); - throw "Ref not defined" unless values[pk_name] - return update(table, values.clone.delete_if{|k,v| k == pk_name}, { pk_name => values[pk_name] }); - end - def insert(table, values) - cols = values.keys - vals = values.values - qmarks = values.values.collect{ '?' } - - query = "INSERT INTO #{table} (#{cols.join(',')}) VALUES (#{qmarks.join(',')})" - transaction_begin unless transaction_before=@transaction - @dbh.do(query, *vals) - transaction_commit unless transaction_before - end - - def insert_row(table, values) - pk_name = get_primarykey_name(table); - if values[pk_name] - insert(table, values) - else - transaction_begin unless transaction_before=@transaction - row = query_row("SELECT nextval(pg_get_serial_sequence('#{table}', '#{pk_name}')) AS newref"); - throw "No newref?" unless row['newref'] - values[pk_name] = row['newref'] - insert(table, values); - transaction_commit unless transaction_before - end - end - def delete_row(table, ref) - pk_name = get_primarykey_name(table); - query = "DELETE FROM #{table} WHERE #{pk_name}=?" - transaction_begin unless transaction_before=@transaction - @dbh.do(query, ref) - transaction_commit unless transaction_before - end - def query(query, *params) - sth = @dbh.execute(query, *params) - while row = sth.fetch_hash - yield row - end - sth.finish - end - # nil if no results - # hash if one match - # throw otherwise - def query_row(query, *params) - sth = @dbh.execute(query, *params) - - row = sth.fetch_hash - if row == nil - sth.finish - return nil - elsif sth.fetch_hash != nil - sth.finish - throw "More than one result when querying for #{query}" - else - sth.finish - return row - end - end - def query_all(query, *params) - sth = @dbh.execute(query, *params) - - rows = sth.fetch_all - return nil if rows.size == 0 - return rows - end - def query2(query, *params) - sth = @dbh.execute(query, *params) - return WeaselDbQueryHandle.new(sth) - end -end diff --git a/contrib/auto-naming/process-consensus b/contrib/auto-naming/process-consensus deleted file mode 100755 index dc9d207e43..0000000000 --- a/contrib/auto-naming/process-consensus +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/ruby - -# process-consensus - read a current consensus document, inserting the -# information into a database then calling -# update-named-status.rb to update the name-binding -# flags -# -# Copyright (c) 2007 Peter Palfrader -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -require "yaml" - -require 'db' -require 'db-config' -require 'update-named-status' - -$db = Db.new($CONFIG['database']['dbhost'], $CONFIG['database']['dbname'], $CONFIG['database']['user'], $CONFIG['database']['password']) - -$router_cache = {} -$nickname_cache = {} - -def parse_consensus consensus - ts = nil - routers = [] - consensus.each do |line| - (key, value) = line.split(' ',2) - case key - when "valid-after", "published": ts = DateTime.parse(value) - when "r": - (nick, fpr, _) = value.split(' ', 3) - nick.downcase! - next if nick == 'unnamed' - routers << { - 'nick' => nick, - 'fingerprint' => (fpr+'=').unpack('m').first.unpack('H*').first - } - end - end - throw "Did not find a timestamp" unless ts - throw "Did not find any routers" unless routers.size > 0 - return ts, routers -end - -def insert_routers_into_db(router, table, field, value) - pk = table+'_id' - row = $db.query_row("SELECT #{pk} FROM #{table} WHERE #{field}=?", value) - if row - return row[pk] - else - r = { field => value } - $db.insert_row( table, r ) - return r[pk] - end -end - -def handle_one_consensus(c) - puts "parsing..." if $verbose - timestamp, routers = parse_consensus c - puts "storing..." if $verbose - - routers.each do |router| - fpr = router['fingerprint'] - nick = router['nick'] - $router_cache[fpr] = router_id = ($router_cache[fpr] or insert_routers_into_db(router, 'router', 'fingerprint', router['fingerprint'])) - $nickname_cache[nick] = nickname_id = ($nickname_cache[nick] or insert_routers_into_db(router, 'nickname', 'nick', router['nick'])) - - row = $db.update( - 'router_claims_nickname', - { 'last_seen' => timestamp.to_s }, - { 'router_id' => router_id, 'nickname_id' => nickname_id} ) - case row - when 0: - $db.insert('router_claims_nickname', - { - 'first_seen' => timestamp.to_s, - 'last_seen' => timestamp.to_s, - 'router_id' => router_id, 'nickname_id' => nickname_id} ) - when 1: - else - throw "Update of router_claims_nickname returned unexpected number of affected rows(#{row})" - end - end -end - -$db.transaction_begin -if ARGV.first == '-v' - $verbose = true - ARGV.shift -end - -if ARGV.size == 0 - handle_one_consensus STDIN.readlines - do_update $verbose -else - ARGV.each do |filename| - puts filename if $verbose - handle_one_consensus File.new(filename).readlines - puts "updating..." if $verbose - do_update $verbose - end -end -$db.transaction_commit diff --git a/contrib/auto-naming/update-named-status.rb b/contrib/auto-naming/update-named-status.rb deleted file mode 100755 index b58b24d58f..0000000000 --- a/contrib/auto-naming/update-named-status.rb +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/ruby - -# update-named-status.rb - update the named status of routers in our database -# -# Copyright (c) 2007 Peter Palfrader -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -require "yaml" - -require 'db' -require 'db-config' - -def do_update(verbose) - now = $db.query_row("SELECT max(last_seen) AS max FROM router_claims_nickname")['max'] - unless now - STDERR.puts "Could not find the latest last_seen timestamp. Is the database empty still?" - return - end - now = "TIMESTAMP '" + now.to_s + "'" - - denamed = $db.do(" - UPDATE router_claims_nickname - SET named=false - WHERE named - AND last_seen < #{now} - INTERVAL '6 months'") - puts "de-named: #{denamed}" if verbose - - named = $db.do(" - UPDATE router_claims_nickname - SET named=true - WHERE NOT named - AND first_seen < #{now} - INTERVAL '2 weeks' - AND last_seen > #{now} - INTERVAL '2 days' - AND NOT EXISTS (SELECT * - FROM router_claims_nickname AS innertable - WHERE named - AND router_claims_nickname.nickname_id=innertable.nickname_id) "+ # if that nickname is already named, we lose. - " AND NOT EXISTS (SELECT * - FROM router_claims_nickname AS innertable - WHERE router_claims_nickname.nickname_id=innertable.nickname_id - AND router_claims_nickname.router_id <> innertable.router_id - AND last_seen > #{now} - INTERVAL '1 month') ") # if nobody else wanted that nickname in the last month we are set - puts "named: #{named}" if verbose -end - -if __FILE__ == $0 - $db = Db.new($CONFIG['database']['dbhost'], $CONFIG['database']['dbname'], $CONFIG['database']['user'], $CONFIG['database']['password']) - verbose = ARGV.first == "-v" - - $db.transaction_begin - do_update verbose - $db.transaction_commit -end diff --git a/contrib/checkOptionDocs.pl b/contrib/checkOptionDocs.pl index ca3fba55e3..23e57b4897 100755 --- a/contrib/checkOptionDocs.pl +++ b/contrib/checkOptionDocs.pl @@ -1,27 +1,17 @@ #!/usr/bin/perl -w -# $Id use strict; my %options = (); my %descOptions = (); my %torrcSampleOptions = (); -my %torrcCompleteOptions = (); my %manPageOptions = (); # Load the canonical list as actually accepted by Tor. -my $mostRecentOption; open(F, "./src/or/tor --list-torrc-options |") or die; while (<F>) { next if m!\[notice\] Tor v0\.!; if (m!^([A-Za-z0-9_]+)!) { - $mostRecentOption = lc $1; - $options{$mostRecentOption} = 1; - } elsif (m!^ !) { - $descOptions{$mostRecentOption} = 1; - if (m!\{DEPRECATED\}!) { - delete $descOptions{$mostRecentOption}; - delete $options{$mostRecentOption}; - } + $options{$1} = 1; } else { print "Unrecognized output> "; print; @@ -29,7 +19,7 @@ while (<F>) { } close F; -# Load the contents of torrc.sample and torrc.complete +# Load the contents of torrc.sample sub loadTorrc { my ($fname, $options) = @_; local *F; @@ -37,7 +27,7 @@ sub loadTorrc { while (<F>) { next if (m!##+!); if (m!#([A-Za-z0-9_]+)!) { - $options->{lc $1} = 1; + $options->{$1} = 1; } } close F; @@ -45,23 +35,14 @@ sub loadTorrc { } loadTorrc("./src/config/torrc.sample.in", \%torrcSampleOptions); -loadTorrc("./src/config/torrc.complete.in", \%torrcCompleteOptions); # Try to figure out what's in the man page. my $considerNextLine = 0; -open(F, "./doc/tor.1.in") or die; +open(F, "./doc/tor.1.txt") or die; while (<F>) { - if ($considerNextLine and - m!^\\fB([A-Za-z0-9_]+)!) { - $manPageOptions{lc $1} = 1; - next; - } - - if (m!^\.(?:SH|TP|PP)!) { - $considerNextLine = 1; next; - } else { - $considerNextLine = 0; + if (m!^\*\*([A-Za-z0-9_]+)\*\*!) { + $manPageOptions{$1} = 1; } } close F; @@ -78,11 +59,9 @@ sub subtractHashes { 0; } -subtractHashes("No online docs", \%options, \%descOptions); +# subtractHashes("No online docs", \%options, \%descOptions); # subtractHashes("Orphaned online docs", \%descOptions, \%options); -subtractHashes("Not in torrc.complete.in", \%options, \%torrcCompleteOptions); -subtractHashes("Orphaned in torrc.complete.in", \%torrcCompleteOptions, \%options); subtractHashes("Orphaned in torrc.sample.in", \%torrcSampleOptions, \%options); subtractHashes("Not in man page", \%options, \%manPageOptions); diff --git a/contrib/checkSpace.pl b/contrib/checkSpace.pl index 37f079c52b..6eb32e5620 100755 --- a/contrib/checkSpace.pl +++ b/contrib/checkSpace.pl @@ -20,6 +20,10 @@ for $fn (@ARGV) { if (/\t/) { print " TAB:$fn:$.\n"; } + ## Warn about markers that don't have a space in front of them + if (/^[a-zA-Z_][a-zA-Z_0-9]*:/) { + print "nosplabel:$fn:$.\n"; + } ## Warn about trailing whitespace. if (/ +$/) { print "Space\@EOL:$fn:$.\n"; @@ -28,11 +32,15 @@ for $fn (@ARGV) { if ($C && /\s(?:if|while|for|switch)\(/) { print " KW(:$fn:$.\n"; } - ## Warn about #else #if instead of #elif. - if (($lastline =~ /^\# *else/) and ($_ =~ /^\# *if/)) { + ## Warn about #else #if instead of #elif. + if (($lastline =~ /^\# *else/) and ($_ =~ /^\# *if/)) { print " #else#if:$fn:$.\n"; - } - $lastline = $_; + } + $lastline = $_; + ## Warn about unnecessary empty lines. + if ($lastnil && /^\s*}\n/) { + print " UnnecNL:$fn:$.\n"; + } ## Warn about multiple empty lines. if ($lastnil && /^$/) { print " DoubleNL:$fn:$.\n"; @@ -42,9 +50,8 @@ for $fn (@ARGV) { $lastnil = 0; } ## Terminals are still 80 columns wide in my world. I refuse to - ## accept double-line lines. Except, of course, svn Id tags - ## can make us go long. - if (/^.{80}/ && !/\$Id: /) { + ## accept double-line lines. + if (/^.{80}/) { print " Wide:$fn:$.\n"; } ### Juju to skip over comments and strings, since the tests diff --git a/contrib/cross.sh b/contrib/cross.sh index e660be780d..a6085a400f 100755 --- a/contrib/cross.sh +++ b/contrib/cross.sh @@ -1,5 +1,4 @@ #!/bin/bash -# $Id$ # Copyright 2006 Michael Mohr with modifications by Roger Dingledine # See LICENSE for licensing information. @@ -186,7 +185,7 @@ if [ ! -z $STRIP ] then ${HOST_TRIPLET}strip \ src/or/tor \ - src/or/test \ + src/test/test \ src/tools/tor-resolve fi diff --git a/contrib/id_to_fp.c b/contrib/id_to_fp.c index 73395e16c1..55b025dfaf 100644 --- a/contrib/id_to_fp.c +++ b/contrib/id_to_fp.c @@ -1,5 +1,4 @@ /* Copyright 2006 Nick Mathewson; see LICENSE for licensing information */ -/* $Id$ */ /* id_to_fp.c : Helper for directory authority ops. When somebody sends us * a private key, this utility converts the private key into a fingerprint diff --git a/contrib/nagios-check-tor-authority-cert b/contrib/nagios-check-tor-authority-cert index 0e2c1d06c4..46dc7284b7 100755 --- a/contrib/nagios-check-tor-authority-cert +++ b/contrib/nagios-check-tor-authority-cert @@ -8,8 +8,6 @@ # Usage: nagios-check-tor-authority-cert <authority identity fingerprint> # e.g.: nagios-check-tor-authority-cert A9AC67E64B200BBF2FA26DF194AC0469E2A948C6 -# $Id$ - # Copyright (c) 2008 Peter Palfrader <peter@palfrader.org> # # Permission is hereby granted, free of charge, to any person obtaining diff --git a/contrib/osx/Makefile.am b/contrib/osx/Makefile.am deleted file mode 100644 index 3231801c16..0000000000 --- a/contrib/osx/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -# XXX Is this define necessary, or is it redundant with the -# one from the top-level configure? -RD -confdir = $(sysconfdir)/Tor - -EXTRA_DIST = ReadMe.rtf StartupParameters.plist Tor TorBundleDesc.plist.in \ - TorBundleInfo.plist.in TorBundleWelcome.rtf TorDesc.plist.in \ - TorInfo.plist.in TorStartupDesc.plist.in TorStartupInfo.plist \ - package.sh TorPostflight addsysuser Tor_Uninstaller.applescript \ - uninstall_tor_bundle.sh package_list.txt tor_logo.gif TorPreFlight diff --git a/contrib/osx/ReadMe.rtf b/contrib/osx/ReadMe.rtf deleted file mode 100644 index cf335c3880..0000000000 --- a/contrib/osx/ReadMe.rtf +++ /dev/null @@ -1,7 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\margl1440\margr1440\vieww9000\viewh9000\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\fs24 \cf0 Tor is a toolset for a wide range of organizations and people who want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, and more. Tor also provides a platform on which software developers can build new applications with built-in anonymity, safety, and privacy features.} diff --git a/contrib/osx/StartupParameters.plist b/contrib/osx/StartupParameters.plist deleted file mode 100644 index 0537b435dc..0000000000 --- a/contrib/osx/StartupParameters.plist +++ /dev/null @@ -1,13 +0,0 @@ -{ - Description = "Tor"; - Provides = ("tor"); - Requires = ("Network"); - Uses = ("Network"); - OrderPreference = "Last"; - Messages = - { - start = "Starting Tor"; - stop = "Stopping Tor"; - }; -} - diff --git a/contrib/osx/Tor b/contrib/osx/Tor deleted file mode 100755 index 0660fd7c8d..0000000000 --- a/contrib/osx/Tor +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -TORLOC=/Library/StartupItems/Tor/Tor.loc - -if [ -f $TORLOC ]; then - TORDIR=`cat /Library/StartupItems/Tor/Tor.loc` - if [ "x$TORDIR" = "x" -o ! -d $TORDIR -o ! -x $TORDIR/tor ]; then - TORDIR=/Library/Tor - fi -else - TORDIR=/Library/Tor -fi -TORCONF=$TORDIR/torrc -TORDATA=$TORDIR/var/lib/tor -TORPID=/var/run/Tor.pid -TORUSER=_tor -TORGROUP=daemon -TORCMD=$TORDIR/tor -TORLOG=/var/log/tor.log - -## Determine OSX Version -# map version to name -if [ -x /usr/bin/sw_vers ]; then -# This is poor, yet functional. We don't care about the 3rd number in -# the OS version - OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2` - case "$OSVER" in - "10.6") ARCH="universal";; - "10.5") ARCH="universal";; - "10.4") ARCH="universal";; - "10.3") ARCH="ppc";; - "10.2") ARCH="ppc";; - "10.1") ARCH="ppc";; - "10.0") ARCH="ppc";; - esac -else - ARCH="unknown" -fi - -if [ $ARCH != "universal" ]; then - export EVENT_NOKQUEUE=1 -fi - -## -# Tor Service -## - -. /etc/rc.common - -StartService () -{ - - if [ -f $TORCMD ]; then - if pid=$(GetPID Tor); then - return 0 - else - ConsoleMessage "Starting Tor Service" -# Tentative -# Making sure it is not running (I know it is not a best approarch) - killall tor 2>/dev/null - $TORCMD -f "$TORCONF" --runasdaemon 1 --pidfile "$TORPID" --datadirectory "$TORDATA" --user "$TORUSER" --group "$TORGROUP" --log "notice file $TORLOG" & - fi - fi -} - -StopService () -{ - if pid=$(GetPID Tor); then - ConsoleMessage "Stopping Tor Service" - kill -TERM "${pid}" -# Just for sanity (sometimes necessary.) - killall tor 2>/dev/null - else - ConsoleMessage "Tor Service not responding." -# Just for sanity (sometimes necessary.) - killall tor 2>/dev/null - fi -} - -RestartService () { StopService; StartService; } - -if [ "$#" = 0 ]; then - echo "Syntax: tor {start|stop}" - exit 1 -fi - -RunService "$1" diff --git a/contrib/osx/TorBundleDesc.plist.in b/contrib/osx/TorBundleDesc.plist.in deleted file mode 100644 index 3ea24d0120..0000000000 --- a/contrib/osx/TorBundleDesc.plist.in +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IFPkgDescriptionDeleteWarning</key> - <string></string> - <key>IFPkgDescriptionDescription</key> - <string>Bundled package of Tor @VERSION@.</string> - <key>IFPkgDescriptionTitle</key> - <string>Tor Expert Bundle</string> - <key>IFPkgDescriptionVersion</key> - <string>@VERSION@</string> -</dict> -</plist> diff --git a/contrib/osx/TorBundleInfo.plist.in b/contrib/osx/TorBundleInfo.plist.in deleted file mode 100644 index c7f497f392..0000000000 --- a/contrib/osx/TorBundleInfo.plist.in +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleName</key> - <string>Tor Bundle</string> - <key>CFBundleGetInfoString</key> - <string>Tor Bundle @VERSION@</string> - <key>CFBundleIdentifier</key> - <string>org.torproject.torbundle</string> - <key>CFBundleShortVersionString</key> - <string>@VERSION@</string> - <key>IFPkgFlagComponentDirectory</key> - <string>../.contained_packages</string> - <key>IFPkgFlagPackageList</key> - <array> - <dict> - <key>IFPkgFlagPackageLocation</key> - <string>Tor.pkg</string> - <key>IFPkgFlagPackageSelection</key> - <string>required</string> - </dict> - <dict> - <key>IFPkgFlagPackageLocation</key> - <string>torstartup.pkg</string> - <key>IFPkgFlagPackageSelection</key> - <string>selected</string> - </dict> - </array> - <key>IFPkgFormatVersion</key> - <real>0.10000000149011612</real> -</dict> -</plist> diff --git a/contrib/osx/TorBundleWelcome.rtf b/contrib/osx/TorBundleWelcome.rtf deleted file mode 100755 index 0afa90db54..0000000000 --- a/contrib/osx/TorBundleWelcome.rtf +++ /dev/null @@ -1,20 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Oblique;\f2\fswiss\fcharset77 Helvetica-Bold; -} -{\colortbl;\red255\green255\blue255;} -\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh9000\viewkind0 -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural - -\f0\fs24 \cf0 Welcome to the Tor Expert installer.\ -This will install Tor in your computer.\ -\ - -\f0\b0 \ -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f2\b \cf0 Tor -\f0\b0 is a system for using the Internet anonymously, and allowing\ -others to do so.\ -\ - For more information, please visit https://www.torproject.org/\ -\ diff --git a/contrib/osx/TorDesc.plist.in b/contrib/osx/TorDesc.plist.in deleted file mode 100644 index 6d7b154dd6..0000000000 --- a/contrib/osx/TorDesc.plist.in +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IFPkgDescriptionTitle</key> - <string>Tor</string> - <key>IFPkgDescriptionVersion</key> - <string>@VERSION@</string> -</dict> -</plist> diff --git a/contrib/osx/TorInfo.plist.in b/contrib/osx/TorInfo.plist.in deleted file mode 100644 index a5bc13f88b..0000000000 --- a/contrib/osx/TorInfo.plist.in +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleIdentifier</key> - <string>Tor @VERSION@</string> - <key>CFBundleGetInfoString</key> - <string>Tor @VERSION@</string> - <key>CFBundleName</key> - <string>Tor</string> - <key>CFBundleShortVersionString</key> - <string>@VERSION@</string> - <key>IFPkgFlagAllowBackRev</key> - <true/> - <key>IFPkgFlagAuthorizationAction</key> - <string>RootAuthorization</string> - <key>IFPkgFlagFollowLinks</key> - <true/> - <key>IFPkgFlagIsRequired</key> - <true/> - <key>IFPkgFlagRootVolumeOnly</key> - <true/> - <key>IfPkgFlagBackgroundScaling</key> - <string>proportional</string> - <key>IFPkgFlagBackgroundAlignment</key> - <string>bottomleft</string> -</dict> -</plist> diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight deleted file mode 100644 index 3f52b98501..0000000000 --- a/contrib/osx/TorPostflight +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh -# ==================================================================== -# TorPostFlight is distributed under this license -# -# Copyright (c) 2006 Andrew Lewman -# Copyright (c) 2008 The Tor Project -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# -# * Neither the names of the copyright owners nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ====================================================================== - -# TorPostflight gets invoked after any install or upgrade. - -ADDSYSUSER=$RECEIPT_PATH/addsysuser -if [ ! -x "$ADDSYSUSER" ]; then - echo "Could not find addsysuser script." - exit 1 -fi - -TORUSER=_tor -TORGROUP=daemon -TARGET=$2/Library/Tor -TORDIR=$TARGET/var/lib/tor -LOGFILE=/var/log/tor.log - -# Check defaults for TARGET -if [ "$TARGET" == "//Library/Tor" ]; then - TARGET=/Library/Tor -fi - -# Create user $TORUSER in group daemon. If it's already there, great. -$ADDSYSUSER $TORUSER "Tor System user" $TORDIR - -# Create the tor directory, if it doesn't exist. -if [ ! -d $TORDIR ]; then - mkdir -p $TORDIR -fi -# Check its permissions. -chown $TORUSER $TORDIR -chgrp daemon $TORDIR -chmod 700 $TORDIR - -if [ ! -f $LOGFILE ]; then - touch $LOGFILE - chown $TORUSER $LOGFILE - chgrp daemon $LOGFILE - chmod 660 $LOGFILE -fi - -# Create the configuration file only if there wasn't one already. -if [ ! -f $TARGET/torrc ]; then - cp $TARGET/torrc.sample $TARGET/torrc -fi - -# Put the geoip database into the datadir -if [ ! -f $TORDIR/geoip ]; then - cp $PACKAGE_PATH/Contents/Resources/geoip $TORDIR/geoip -fi - -# Ensure symbolic links -cd /usr/bin -if [ -e /usr/bin/tor -a ! -L /usr/bin/tor ]; then - mv tor tor_old -fi -if [ -e /usr/bin/tor-resolve -a ! -L /usr/bin/tor-resolve ]; then - mv tor-resolve tor-resolve_old -fi -ln -sf $TARGET/tor . -ln -sf $TARGET/tor-resolve . - -cd /usr/share/man/man1 -MAN1=$TARGET/share/man/man1 -#ln -sf $MAN1/*.1 . - -# Copy Documentation -if [ -d $PACKAGE_PATH/Contents/Resources/documents ];then - cp -r $PACKAGE_PATH/Contents/Resources/documents $TARGET/documents -fi - -# Copy Uninstaller -if [ -f $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript ]; then - cp $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript $TARGET/Tor_Uninstaller.applescript - chmod 550 $TARGET/Tor_Uninstaller.applescript -fi - -if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh ]; then - cp $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh $TARGET/uninstall_tor_bundle.sh - chmod 550 $TARGET/uninstall_tor_bundle.sh -fi - -if [ -f $PACKAGE_PATH/Contents/Resources/package_list.txt ]; then - cp $PACKAGE_PATH/Contents/Resources/package_list.txt $TARGET/package_list.txt -fi - -if [ -d /Library/StartupItems/Tor ]; then - rm -f /Library/StartupItems/Tor/Tor.loc - echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc -fi diff --git a/contrib/osx/TorPreFlight b/contrib/osx/TorPreFlight deleted file mode 100644 index 69dff3c1fd..0000000000 --- a/contrib/osx/TorPreFlight +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# =================================================================== -# -# TorPreFlight is distributed under this license: -# -# Copyright (c) 2006 Andrew Lewman -# Copyright (c) 2008 The Tor Project, Inc. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# -# * Neither the names of the copyright owners nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#=============================================================================== - -# TorPreFlight is invoked before the install begins - -# Figure out where Tor is installed -if [ -f /Library/StartupItems/Tor/Tor.loc ]; then - TORPATH=`cat /Library/StartupItems/Tor/Tor.loc` -else - TORPATH="/Library/Tor/" -fi - -# Backup all of Tor, just in case -if [ -d $TORPATH ]; then - cp $TORPATH/torrc $TORPATH/torrc.installer-saved -fi diff --git a/contrib/osx/TorStartupDesc.plist.in b/contrib/osx/TorStartupDesc.plist.in deleted file mode 100644 index b0a48fafe0..0000000000 --- a/contrib/osx/TorStartupDesc.plist.in +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IFPkgDescriptionTitle</key> - <string>Tor Startup Script</string> - <key>IFPkgDescriptionVersion</key> - <string>@VERSION@</string> -</dict> -</plist> diff --git a/contrib/osx/TorStartupInfo.plist b/contrib/osx/TorStartupInfo.plist deleted file mode 100644 index 08d92742a6..0000000000 --- a/contrib/osx/TorStartupInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleIdentifier</key> - <string>Tor Startup Script</string> - <key>CFBundleGetInfoString</key> - <string>Tor Startup Script</string> - <key>CFBundleName</key> - <string>Tor Startup Script</string> - <key>CFBundleShortVersionString</key> - <string>0.1</string> - <key>IFPkgFlagAllowBackRev</key> - <true/> - <key>IFPkgFlagAuthorizationAction</key> - <string>RootAuthorization</string> - <key>IFPkgFlagRestartAction</key> - <string>NoRestart</string> - <key>IFPkgFlagFollowLinks</key> - <true/> - <key>IFPkgFlagIsRequired</key> - <false/> - <key>IFPkgFlagRootVolumeOnly</key> - <true/> -</dict> -</plist> diff --git a/contrib/osx/Tor_Uninstaller.applescript b/contrib/osx/Tor_Uninstaller.applescript deleted file mode 100644 index 246e265bbe..0000000000 --- a/contrib/osx/Tor_Uninstaller.applescript +++ /dev/null @@ -1,68 +0,0 @@ --- Tor Uninstaller.applescript --- Tor Uninstaller - --- =============================================================================== --- Tor Uninstaller is distributed under this license: --- --- Copyright (c) 2005 Andrew Lewman ( pgp key: 31B0974B ) --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are --- met: --- --- * Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- --- * Redistributions in binary form must reproduce the above --- copyright notice, this list of conditions and the following disclaimer --- in the documentation and/or other materials provided with the --- distribution. --- --- * Neither the names of the copyright owners nor the names of its --- contributors may be used to endorse or promote products derived from --- this software without specific prior written permission. --- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- =============================================================================== - -on run - - -- Validate & find disk paths - set boot_disk to (path to startup disk) as string - set default_tor_path to boot_disk & "Library:Tor" - set default_privoxy_path to boot_disk & "Library:Privoxy" - set default_tor_startup_path to boot_disk & "Library:StartupItems:Tor" - set default_privoxy_startup_path to boot_disk & "Library:StartupItems:Privoxy" - set shell_script to default_tor_path & ":uninstall_tor_bundle.sh" - set doomed_path_list to {default_tor_path, default_privoxy_path, default_tor_startup_path, default_privoxy_startup_path} - - -- Display what we're removing and ask for validation - -- this is the simplest way to do this - set remove_me to display dialog "Welcome to the Tor + Privoxy Uninstaller. This program will remove:" & return & return & POSIX path of default_tor_path & return & POSIX path of default_privoxy_path & return & POSIX path of default_tor_startup_path & return & POSIX path of default_privoxy_startup_path & return & return & "If this looks correct, choose Yes. Otherwise, choose No." buttons {"Yes", "No"} default button "No" - - -- Run a shell script to do all the unix work since applescript can't see it at all - if button returned of result is "Yes" then - try - do shell script (POSIX path of shell_script) with administrator privileges - on error - display dialog "Too many errors, quitting." buttons {"Quit"} default button "Quit" with icon stop giving up after 3 - quit - end try - -- So Long and Thanks for all the Fish! - display dialog "Thank you for using tor!" buttons {"Ok"} giving up after 3 - else - display dialog "Thank you for your continued use of Tor & Privoxy" buttons {"You're welcome."} giving up after 3 - end if - -end run --- We're done
\ No newline at end of file diff --git a/contrib/osx/addsysuser b/contrib/osx/addsysuser deleted file mode 100755 index 50797f1ab0..0000000000 --- a/contrib/osx/addsysuser +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Original adduser 05 Feb 2002 by Jon L. Gardner -# -# Modified for Tor installer by Nick Mathewson -# 2007-06-12 Modified for leopard by Andrew Lewman -# Copyright (c) 2007 Andrew Lewman -# - - -ROOTPROP=/ - -if [ "`whoami`" != "root" ]; then - echo "You must be root to execute this script." - exit -fi -if [ "x$3" = "x" ]; then - echo 'Usage: addsysuser <username> "<full name>" <homedir>' - exit 0 -fi - -username=$1 -realname=$2 -homedir=$3 - -if [ -x /usr/bin/dscl ]; then - # Determine the gid of the daemon group - gid=`dscl . -read /groups/daemon gid` - if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; then - echo The account $username already exists. - exit 0 - fi - if [ -x /usr/bin/nidump ]; then - uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1` - else - _tmp=/tmp/_dsexport_tmp.txt.$$ - rm -f $_tmp - dsexport $_tmp '/Local/Default' 'dsRecTypeStandard:Users' > /dev/null 2>&1 - uiddef=`cat $_tmp | sed 's/\\\://g' | cut -d: -f6 | grep '^[0-9]' | sort -n | grep -v '^[56789]..' | grep -v '^....$' | tail -n 1` - rm -f $_tmp - fi - uiddef=`echo $uiddef + 1 | bc` - dscl . -create /users/$username uid $uiddef - # home is the local path to the home directory - home=/Users/$username - echo Creating account for $username... - dscl . -create /users/$username - dscl . -create /users/$username _writers_tim_passwd $username - dscl . -create /users/$username realname $realname - dscl . -create /users/$username _writers_passwd $username - dscl . -create /users/$username gid $gid - dscl . -create /users/$username home $homedir - dscl . -create /users/$username name $username - dscl . -create /users/$username passwd '*' - dscl . -create /users/$username shell /dev/null -else - # Determine the gid of the daemon group - gid=`niutil -readprop $ROOTPROP /groups/daemon gid` - if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then - echo The account $username already exists. - exit 0 - fi - # home is the local path to the home directory - home=/Users/$username - # defhome is what goes into NetInfo - defhome="/Network/Servers/MyServer/Users" - #echo "Determining next available system uid (please be patient)..." - # Uids over 500 are for system users. - uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1` - uiddef=`echo $uiddef + 1 |bc` - echo Creating account for $username... - niutil -create $ROOTPROP /users/$username - niutil -createprop $ROOTPROP /users/$username _writers_tim_passwd $username - niutil -createprop $ROOTPROP /users/$username realname $realname - niutil -createprop $ROOTPROP /users/$username _writers_passwd $username - niutil -createprop $ROOTPROP /users/$username uid $uiddef - #niutil -createprop $ROOTPROP /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>" - niutil -createprop $ROOTPROP /users/$username gid $gid - niutil -createprop $ROOTPROP /users/$username home $homedir - niutil -createprop $ROOTPROP /users/$username name $username - niutil -createprop $ROOTPROP /users/$username passwd '*' - niutil -createprop $ROOTPROP /users/$username shell /dev/null -fi diff --git a/contrib/osx/org.torproject.tor.plist b/contrib/osx/org.torproject.tor.plist deleted file mode 100644 index 4cfab9f1b7..0000000000 --- a/contrib/osx/org.torproject.tor.plist +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version=\"1.0\" encoding=\"UTF-8\"?> -<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" - \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"> -<plist version=\"1.0\"> -<dict> - <key>Label</key> - <string>org.torproject.tor</string> - <key>ProgramArguments</key> - <array> - <string>/usr/bin/tor</string> - <string>-f</string> - <string>/Library/Tor/torrc</string> - </array> - <key>RunAtLoad</key> - <true/> - <key>OnDemand</key> - <false/> - - <key>UserName</key> - <string>_tor</string> - <key>GroupName</key> - <string>daemon</string> - -</dict> - -</plist> diff --git a/contrib/osx/package.sh b/contrib/osx/package.sh deleted file mode 100644 index 040c7cd4c9..0000000000 --- a/contrib/osx/package.sh +++ /dev/null @@ -1,155 +0,0 @@ -#!/bin/sh -# $Id$ -# Copyright 2004-2005 Nick Mathewson. -# Copyright 2005-2007 Andrew Lewman -# Copyright 2008 The Tor Project, Inc. -# See LICENSE in Tor distribution for licensing information. - -# This script builds a Macintosh OS X metapackage containing 2 packages: -# - One for Tor. -# - One for Startup script for Tor. -# -# This script expects to be run from the toplevel makefile, with VERSION -# set to the latest Tor version, and Tor already built. -# - -# Read the documentation located in tor/doc/tor-osx-dmg-creation.txt on -# how to build Tor for OSX - -### -# Helpful info on OS X packaging: -# http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution/index.html -# man packagemaker - -# Make sure VERSION is set, so we don't name the package -# "Tor--$ARCH-Bundle.dmg" -if [ "XX$VERSION" = 'XX' ]; then - echo "VERSION not set." - exit 1 -fi - -## Determine OSX Version -# map version to name -if [ -x /usr/bin/sw_vers ]; then -# This is poor, yet functional. We don't care about the 3rd number in -# the OS version - OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2` - case "$OSVER" in - "10.6") ARCH="universal";; - "10.5") ARCH="universal";; - "10.4") ARCH="universal";; - "10.3") ARCH="ppc";; - "10.2") ARCH="ppc";; - "10.1") ARCH="ppc";; - "10.0") ARCH="ppc";; - *) ARCH="unknown";; - esac -else - ARCH="unknown" -fi - -# Where will we put our temporary files? -BUILD_DIR=/tmp/tor-osx-$$ -# Path to PackageMaker app. -PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker - -umask 022 - -echo I might ask you for your password now, so you can sudo. - -sudo rm -rf $BUILD_DIR -mkdir $BUILD_DIR || exit 1 -for subdir in tor_packageroot tor_resources \ - torstartup_packageroot \ - torbundle_resources \ - output; do - mkdir $BUILD_DIR/$subdir -done - -### Make Tor package. - -make install DESTDIR=$BUILD_DIR/tor_packageroot -cp contrib/osx/ReadMe.rtf $BUILD_DIR/tor_resources -chmod 755 contrib/osx/TorPostflight -cp contrib/osx/TorPostflight $BUILD_DIR/tor_resources/postflight -cp contrib/osx/addsysuser $BUILD_DIR/tor_resources/addsysuser -cp contrib/osx/Tor_Uninstaller.applescript $BUILD_DIR/tor_resources/Tor_Uninstaller.applescript -cp contrib/osx/uninstall_tor_bundle.sh $BUILD_DIR/tor_resources/uninstall_tor_bundle.sh -cp contrib/osx/package_list.txt $BUILD_DIR/tor_resources/package_list.txt -cp contrib/osx/tor_logo.gif $BUILD_DIR/tor_resources/background.gif -cp src/config/geoip $BUILD_DIR/tor_resources/geoip -cat <<EOF > $BUILD_DIR/tor_resources/Welcome.txt -Tor: an anonymous Internet communication system - -Tor is a system for using the internet anonymously, and allowing -others to do so. -EOF - -### Assemble documentation - -DOC=$BUILD_DIR/tor_resources/documents -mkdir $DOC -mkdir $DOC/howto -cp AUTHORS $DOC/AUTHORS.txt -groff doc/tor.1.in -T ps -m man | pstopdf -i -o $DOC/tor-reference.pdf -groff doc/tor-resolve.1 -T ps -m man | pstopdf -i -o $DOC/tor-resolve.pdf -mkdir $DOC/Advanced -cp doc/spec/*.txt $DOC/Advanced -cp doc/HACKING $DOC/Advanced/HACKING.txt -cp ChangeLog $DOC/Advanced/ChangeLog.txt - -find $BUILD_DIR/tor_packageroot -print0 |sudo xargs -0 chown root:wheel - -$PACKAGEMAKER -build \ - -p $BUILD_DIR/output/Tor.pkg \ - -f $BUILD_DIR/tor_packageroot \ - -r $BUILD_DIR/tor_resources \ - -i contrib/osx/TorInfo.plist \ - -d contrib/osx/TorDesc.plist - -### Make Startup Script package - -mkdir -p $BUILD_DIR/torstartup_packageroot/Library/StartupItems/Tor -cp contrib/osx/Tor contrib/osx/StartupParameters.plist \ - $BUILD_DIR/torstartup_packageroot/Library/StartupItems/Tor - -find $BUILD_DIR/torstartup_packageroot -print0 | sudo xargs -0 chown root:wheel - -$PACKAGEMAKER -build \ - -p $BUILD_DIR/output/torstartup.pkg \ - -f $BUILD_DIR/torstartup_packageroot \ - -i contrib/osx/TorStartupInfo.plist \ - -d contrib/osx/TorStartupDesc.plist - -### Assemble the metapackage. Packagemaker won't buld metapackages from -# the command line, so we need to do it by hand. - -MPKG=$BUILD_DIR/output/Tor-$VERSION-$ARCH-Bundle.mpkg -mkdir -p "$MPKG/Contents/Resources" -echo -n "pmkrpkg1" > "$MPKG/Contents/PkgInfo" -cp contrib/osx/ReadMe.rtf "$MPKG/Contents/Resources" -cp contrib/osx/TorBundleInfo.plist "$MPKG/Contents/Info.plist" -cp contrib/osx/TorBundleWelcome.rtf "$MPKG/Contents/Resources/Welcome.rtf" -cp contrib/osx/TorBundleDesc.plist "$MPKG/Contents/Resources/Description.plist" -cp contrib/osx/tor_logo.gif "$MPKG/Contents/Resources/background.gif" - -# Move all the subpackages into place. -mkdir $BUILD_DIR/output/.contained_packages -mv $BUILD_DIR/output/*.pkg $BUILD_DIR/OUTPUT/.contained_packages -( cd $BUILD_DIR/output/.contained_packages ) - -### Copy readmes and licenses into toplevel. -cp contrib/osx/ReadMe.rtf $BUILD_DIR/output/Tor\ ReadMe.rtf -cp LICENSE $BUILD_DIR/output/Tor\ License.txt - -### Package it all into a DMG - -find $BUILD_DIR/output -print0 | sudo xargs -0 chown root:wheel - -mv $BUILD_DIR/output "$BUILD_DIR/Tor-$VERSION-$ARCH-Bundle" -rm -f "Tor-$VERSION-$ARCH-Bundle.dmg" -USER="`whoami`" -sudo hdiutil create -format UDZO -imagekey zlib-level=9 -srcfolder "$BUILD_DIR/Tor-$VERSION-$ARCH-Bundle" "Tor-$VERSION-$ARCH-Bundle.dmg" -sudo chown "$USER" "Tor-$VERSION-$ARCH-Bundle.dmg" - -sudo rm -rf $BUILD_DIR diff --git a/contrib/osx/package_list.txt b/contrib/osx/package_list.txt deleted file mode 100644 index 6285dd0831..0000000000 --- a/contrib/osx/package_list.txt +++ /dev/null @@ -1,2 +0,0 @@ -Tor -torstartup diff --git a/contrib/osx/tor_logo.gif b/contrib/osx/tor_logo.gif Binary files differdeleted file mode 100644 index 8eea7ee2e4..0000000000 --- a/contrib/osx/tor_logo.gif +++ /dev/null diff --git a/contrib/osx/uninstall_tor_bundle.sh b/contrib/osx/uninstall_tor_bundle.sh deleted file mode 100755 index b7c439429e..0000000000 --- a/contrib/osx/uninstall_tor_bundle.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/sh -# -# not a psueber-pretty uninstall script for the Tor bundle package -# . this currently leaves ~/.tor, /var/log/tor and empty -# directories /Library/Tor, /Library/Privoxy (see comment below) -# . this relies on the fact that the startup items directories (if any) -# will be named the same as the package name (ie. Tor) -# -# -# version history -# initial version - 21 may, 2005 - loki der quaeler -# -# -# comments -# loki: because of the way the Tor package installs itself (the root directory -# is the filesystem root, as opposed to the much nicer way that privoxy -# installs itself with the privoxy home (/Library/Privoxy) as its -# install root directory), i thought it more prudent to leave empty -# directories laying around rather than try to incorrectly intuit from -# the bom contents what directories should exist and which ones could be -# deleted (ie, the Tor package has /Library listed in its bom -- -# obviously this is a Bad Thing(tm) to delete). -# + when the Tor installer is changed, this uninstaller could be modified. -# loki: /bin/ps, when run from a terminal window in osX, restricts information -# based on the width of the window. an 80 col window will stupidly cause -# the grep search for the privoxy pid to not find the pid, whereas the grep -# in a wider window succeeds. consider using killall. in the meantime, -# advise uninstall runners to drag wide their terminal window.. ugh -# - - -### this is the location of a file which contains all the actual package names -## (ie "Tor", "torstartup", ...) the list should be new-line-delimited. -PACKAGE_LIST_SRC=/Library/Tor/package_list.txt - -### this is the name of the user created in the install process of Tor -TOR_USER=_tor - -### these should be constant across all osX installs (so leave them be) -STARTUP_ITEMS_DIR=/Library/StartupItems -PKG_RCPT_BASE_DIR=/Library/Receipts -BOM_INTERMEDIATE_DIR=Contents/Resources -INFO_INTERMEDIATE_DIR=$BOM_INTERMEDIATE_DIR/English.lproj -TEMP_BOM_CONTENTS=/tmp/tor_uninst_scratch - -### make sure the script is being run as root, barf if not -if [ "`whoami`" != "root" ]; then - echo "Must be root to run the uninstall script." - exit -1 -fi - - -### check to see if tor is currently running, kill it if it is -## we grep on 'Tor/tor ' because 'tor' is too common (like in 'directory') -## -- this relies on the fact that tor has been started with command -## line arguments.. :-/ -TOR_PID=`ps -uax | grep 'Tor/tor ' | grep -v grep | awk '{print $2;}'` -if [ ${#TOR_PID} -gt 0 ]; then - echo ". Killing currently running tor process, pid is $TOR_PID" - kill -9 $TOR_PID -else - echo ". tor process appears to already be stopped" -fi - - -### check to see if privoxy is currently running, kill it if it is -PRIVOXY_PID=`ps -uax | grep privoxy | grep -v grep | awk '{print $2;}'` -if [ ${#PRIVOXY_PID} -gt 0 ]; then - echo ". Killing currently running privoxy process, pid is $PRIVOXY_PID" - kill -9 $PRIVOXY_PID -else - echo ". privoxy process appears to already be stopped" -fi - - -## grab each package name from the package list file -while read LINE; do - if [ ${#LINE} -gt 0 ]; then - PACKAGE_NAME=$LINE.pkg - PACKAGE_PATH=$PKG_RCPT_BASE_DIR/$PACKAGE_NAME - echo ". Uninstalling $PACKAGE_NAME" - if [ ! -d $PACKAGE_PATH ]; then - echo " . No receipt exists for this package -- skipping." - - continue - fi - - - ## get rid of the startup item if it exists - STARTUP_DIR=$STARTUP_ITEMS_DIR/$LINE - if [ -d $STARTUP_DIR ]; then - echo " . Deleting startup item $STARTUP_DIR" - rm -rf $STARTUP_DIR - fi - - - ## determine the root directory of the the relative paths specified in the bom - DEFAULT_LOC=`grep DefaultLocation $PACKAGE_PATH/$INFO_INTERMEDIATE_DIR/$LINE.info | awk '{print $2;}'` - if [ ${#DEFAULT_LOC} -eq 0 ]; then - echo "!! Could not find default location for $LINE package -- skipping package." - - continue - fi - - ## examine the list of installed items desribed in the bom - BOM_FILE=$PACKAGE_PATH/$BOM_INTERMEDIATE_DIR/$LINE.bom - lsbom $BOM_FILE > $TEMP_BOM_CONTENTS - while read BOM_ITEM; do - ## 3 column items describe just directories, 5 column items describe actual files - COL_COUNT=$(echo $BOM_ITEM | awk '{print NF;}') - if [ "$COL_COUNT" -eq 5 ]; then - FILE_NAME=$DEFAULT_LOC/$(echo $BOM_ITEM | awk '{print $1;}') - - echo " . Removing $FILE_NAME" - rm -rf $FILE_NAME - fi - done < $TEMP_BOM_CONTENTS - - ## remove package receipt - echo " . Removing package receipt $PACKAGE_PATH" - rm -rf $PACKAGE_PATH - fi -done < $PACKAGE_LIST_SRC - - -## nuke the user created by the install process. -echo ". Removing created user $TOR_USER" -if [ -x /usr/bin/dscl ]; then - dscl . -delete /users/$TOR_USER -else - niutil -destroy . /users/$TOR_USER -fi - -## clean up -echo ". Cleaning up" -rm -rf $TEMP_BOM_CONTENTS -rm -rf /Library/Privoxy/ /Library/StartupItems/Privoxy/ /Library/Tor/ /Library/StartupItems/Tor/ /Library/Torbutton/ /Library/Receipts/Privoxy.pkg /Library/Receipts/torbutton.pkg /Library/Receipts/Tor.pkg /Library/Receipts/Vidalia.pkg /Library/Receipts/TorStartup.pkg - -echo ". Finished" - diff --git a/contrib/polipo/Makefile.osx b/contrib/polipo/Makefile.osx deleted file mode 100644 index 55ed1c62f8..0000000000 --- a/contrib/polipo/Makefile.osx +++ /dev/null @@ -1,103 +0,0 @@ -PREFIX = /Library/Polipo -BINDIR = $(PREFIX)/bin -MANDIR = $(PREFIX)/man -INFODIR = $(PREFIX)/info -LOCAL_ROOT = $(PREFIX)/www -DISK_CACHE_ROOT = $(PREFIX)/cache - -CC = gcc -# CDEBUGFLAGS = -Os -g -Wall -std=gnu99 -CDEBUGFLAGS = -Os -g -Wall - -FILE_DEFINES = -DLOCAL_ROOT=\"$(LOCAL_ROOT)/\" \ - -DDISK_CACHE_ROOT=\"$(DISK_CACHE_ROOT)/\" - -# You may optionally also add any of the following to DEFINES: -# -# -DNO_DISK_CACHE to compile out the on-disk cache and local web server; -# -DNO_IPv6 to avoid using the RFC 3493 API and stick to stock -# Berkeley sockets; -# -DHAVE_IPv6 to force the use of the RFC 3493 API on systems other -# than GNU/Linux and BSD (let me know if it works); -# -DNO_FANCY_RESOLVER to compile out the asynchronous name resolution -# code; -# -DNO_STANDARD_RESOLVER to compile out the code that falls back to -# gethostbyname/getaddrinfo when DNS requests fail; -# -DNO_TUNNEL to compile out the code that handles CONNECT requests; -# -DNO_SOCKS to compile out the SOCKS gateway code. -# -DNO_FORBIDDEN to compile out the all of the forbidden URL code -# -DNO_REDIRECTOR to compile out the Squid-style redirector code - -DEFINES = $(FILE_DEFINES) $(PLATFORM_DEFINES) - -# Uncomment the UNIVERSAL, LDFLAGS, CFLAGS lines if you want universal binaries, otherwise -# you'll produce a binary only for your architecture and version of OSX -# UNIVERSAL = -O -g -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -# LDFLAGS = -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -# CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES) $(UNIVERSAL) -# If you uncommented the above CFLAGS, remove this next one. -CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES) - -SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \ - config.c local.c http.c client.c server.c auth.c tunnel.c \ - http_parse.c parse_time.c dns.c forbidden.c \ - md5import.c md5.c ftsimport.c fts_compat.c socks.c - -OBJS = util.o event.o io.o chunk.o atom.o object.o log.o diskcache.o main.o \ - config.o local.o http.o client.o server.o auth.o tunnel.o \ - http_parse.o parse_time.o dns.o forbidden.o \ - md5import.o ftsimport.o socks.o - -polipo: $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -o polipo $(OBJS) $(MD5LIBS) $(LDLIBS) - -ftsimport.o: ftsimport.c fts_compat.c - -md5import.o: md5import.c md5.c - -.PHONY: all install install.binary install.man - -all: polipo - -install: install.binary install.man - -install.binary: all - mkdir -p $(TARGET)$(BINDIR) - mkdir -p $(TARGET)$(LOCAL_ROOT) - mkdir -p $(TARGET)$(LOCAL_ROOT)/doc - mkdir -p $(TARGET)$(DISK_CACHE_ROOT) - cp -f polipo $(TARGET)$(BINDIR)/ - cp -f localindex.html $(TARGET)$(LOCAL_ROOT)/index.html - cp -f config.osx $(TARGET)$(LOCAL_ROOT)/config - texi2html polipo.texi && cp -f polipo.html $(TARGET)$(LOCAL_ROOT)/doc/index.html - groff polipo.man -T ps -m man | pstopdf -i -o $(TARGET)/polipo.pdf - mkdir -p /Library/StartupItems/Polipo - cp -f contrib/Polipo /Library/StartupItems/Polipo/ - cp -f contrib/StartupParameters.plist /Library/StartupItems/Polipo/ - echo "POLIPO=-YES-" >> /etc/hostconfig - -install.man: all - mkdir -p $(TARGET)$(MANDIR)/man1 - cp -f polipo.man $(TARGET)$(MANDIR)/man1/polipo.1 - -TAGS: $(SRCS) - etags $(SRCS) - -.PHONY: clean - -clean: - -rm -f polipo *.o *~ core TAGS gmon.out - -rm -f polipo.cp polipo.fn polipo.log polipo.vr - -rm -f polipo.cps polipo.info* polipo.pg polipo.toc polipo.vrs - -rm -f polipo.aux polipo.dvi polipo.ky polipo.ps polipo.tp - -rm -f polipo.dvi polipo.ps polipo.ps.gz polipo.pdf polipo.html - -rm -rf ./html/ - -rm -f polipo.man.html - -.PHONY: uninstall - -uninstall: - rm -rf /Library/Polipo - rm -rf /Library/StartupItems/Polipo - cp -f /etc/hostconfig /etc/hostconfig.polipo.saved - cat /etc/hostconfig.polipo.saved | grep -v POLIPO > /etc/hostconfig diff --git a/contrib/polipo/Makefile.osx-panther b/contrib/polipo/Makefile.osx-panther deleted file mode 100644 index d1d24d1f3c..0000000000 --- a/contrib/polipo/Makefile.osx-panther +++ /dev/null @@ -1,97 +0,0 @@ -PREFIX = /Library/Polipo -BINDIR = $(PREFIX)/bin -MANDIR = $(PREFIX)/man -INFODIR = $(PREFIX)/info -LOCAL_ROOT = $(PREFIX)/www -DISK_CACHE_ROOT = $(PREFIX)/cache - -CC = gcc -# CDEBUGFLAGS = -Os -g -Wall -std=gnu99 -CDEBUGFLAGS = -Os -g -Wall - -FILE_DEFINES = -DLOCAL_ROOT=\"$(LOCAL_ROOT)/\" \ - -DDISK_CACHE_ROOT=\"$(DISK_CACHE_ROOT)/\" - -# You may optionally also add any of the following to DEFINES: -# -# -DNO_DISK_CACHE to compile out the on-disk cache and local web server; -# -DNO_IPv6 to avoid using the RFC 3493 API and stick to stock -# Berkeley sockets; -# -DHAVE_IPv6 to force the use of the RFC 3493 API on systems other -# than GNU/Linux and BSD (let me know if it works); -# -DNO_FANCY_RESOLVER to compile out the asynchronous name resolution -# code; -# -DNO_STANDARD_RESOLVER to compile out the code that falls back to -# gethostbyname/getaddrinfo when DNS requests fail; -# -DNO_TUNNEL to compile out the code that handles CONNECT requests; -# -DNO_SOCKS to compile out the SOCKS gateway code. -# -DNO_FORBIDDEN to compile out the all of the forbidden URL code -# -DNO_REDIRECTOR to compile out the Squid-style redirector code - -DEFINES = $(FILE_DEFINES) $(PLATFORM_DEFINES) - -CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES) - -SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \ - config.c local.c http.c client.c server.c auth.c tunnel.c \ - http_parse.c parse_time.c dns.c forbidden.c \ - md5import.c md5.c ftsimport.c fts_compat.c socks.c - -OBJS = util.o event.o io.o chunk.o atom.o object.o log.o diskcache.o main.o \ - config.o local.o http.o client.o server.o auth.o tunnel.o \ - http_parse.o parse_time.o dns.o forbidden.o \ - md5import.o ftsimport.o socks.o - -polipo: $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -o polipo $(OBJS) $(MD5LIBS) $(LDLIBS) - -ftsimport.o: ftsimport.c fts_compat.c - -md5import.o: md5import.c md5.c - -.PHONY: all install install.binary install.man - -all: polipo - -install: install.binary install.man - -install.binary: all - mkdir -p $(TARGET)$(BINDIR) - mkdir -p $(TARGET)$(LOCAL_ROOT) - mkdir -p $(TARGET)$(LOCAL_ROOT)/doc - mkdir -p $(TARGET)$(DISK_CACHE_ROOT) - cp -f polipo $(TARGET)$(BINDIR)/ - cp -f localindex.html $(TARGET)$(LOCAL_ROOT)/index.html - cp -f config.osx $(TARGET)$(LOCAL_ROOT)/config - texi2html polipo.texi && cp -f polipo.html $(TARGET)$(LOCAL_ROOT)/doc/index.html - groff polipo.man -T ps -m man | pstopdf -i -o $(TARGET)/polipo.pdf - mkdir -p /Library/StartupItems/Polipo - cp -f contrib/Polipo /Library/StartupItems/Polipo/ - cp -f contrib/StartupParameters.plist /Library/StartupItems/Polipo/ - echo "POLIPO=-YES-" >> /etc/hostconfig - -install.man: all - mkdir -p $(TARGET)$(MANDIR)/man1 - cp -f polipo.man $(TARGET)$(MANDIR)/man1/polipo.1 - -TAGS: $(SRCS) - etags $(SRCS) - -.PHONY: clean - -clean: - -rm -f polipo *.o *~ core TAGS gmon.out - -rm -f polipo.cp polipo.fn polipo.log polipo.vr - -rm -f polipo.cps polipo.info* polipo.pg polipo.toc polipo.vrs - -rm -f polipo.aux polipo.dvi polipo.ky polipo.ps polipo.tp - -rm -f polipo.dvi polipo.ps polipo.ps.gz polipo.pdf polipo.html - -rm -rf ./html/ - -rm -f polipo.man.html - -.PHONY: uninstall - -uninstall: - rm -rf /Library/Polipo - rm -rf /Library/StartupItems/Polipo - cp -f /etc/hostconfig /etc/hostconfig.polipo.saved - cat /etc/hostconfig.polipo.saved | grep -v POLIPO > /etc/hostconfig diff --git a/contrib/polipo/Polipo b/contrib/polipo/Polipo deleted file mode 100644 index 14589c84db..0000000000 --- a/contrib/polipo/Polipo +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -## -# Polipo -## - -. /etc/rc.common - -StartService () -{ - if [ -f /Library/Polipo/bin/polipo ]; then - if pid=$(GetPID polipo); then - return 0 - else if [ "${POLIPO:=-NO-}" = "-YES-" ]; then - ConsoleMessage "Starting Polipo" - /Library/Polipo/bin/polipo -c /Library/Polipo/www/config - fi - fi - fi -} - -StopService () -{ - if pid=$(GetPID polipo); then - ConsoleMessage "Stopping Polipo" - kill -TERM "${pid}" - else - ConsoleMessage "Polipo not responding." -# Just for sanity (sometimes necessary.) - killall tor 2>/dev/null - fi -} - -RestartService () -{ - StopService - StartService -} - -RunService "$1" diff --git a/contrib/polipo/PolipoDesc.plist b/contrib/polipo/PolipoDesc.plist deleted file mode 100644 index 88b7612ffd..0000000000 --- a/contrib/polipo/PolipoDesc.plist +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IFPkgDescriptionTitle</key> - <string>Polipo</string> - <key>IFPkgDescriptionVersion</key> - <string>1.0.4</string> -</dict> -</plist> diff --git a/contrib/polipo/PolipoInfo.plist b/contrib/polipo/PolipoInfo.plist deleted file mode 100644 index aa018f2d9b..0000000000 --- a/contrib/polipo/PolipoInfo.plist +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleIdentifier</key> - <string>Polipo 1.0.4</string> - <key>CFBundleGetInfoString</key> - <string>Polipo 1.0.4</string> - <key>CFBundleName</key> - <string>Polipo</string> - <key>CFBundleSortVersionString</key> - <string>1.0.4</string> - <key>IFPkgFlagAllowBackRev</key> - <true/> - <key>IFPkgFlagAuthorizationAction</key> - <string>RootAuthorization</string> - <key>IFPkgFlagFollowLinks</key> - <true/> - <key>IFPkgFlagIsRequired</key> - <true/> - <key>IFPkgFlagRootVolumeOnly</key> - <true/> - <key>IfPkgFlagBackgroundScaling</key> - <string>proportional</string> - <key>IFPkgFlagBackgroundAlignment</key> - <string>bottomleft</string> -</dict> -</plist> diff --git a/contrib/polipo/PolipoPostflight b/contrib/polipo/PolipoPostflight deleted file mode 100644 index 0894caec6c..0000000000 --- a/contrib/polipo/PolipoPostflight +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# PolipoPostflight gets invoked after any install or upgrade. - -ADDSYSUSER=$RECEIPT_PATH/addsysuser -if [ ! -x "$ADDSYSUSER" ]; then - echo "Could not find addsysuser script." - exit 1 -fi - -POLIPOUSER=_polipo -POLIPOGROUP=daemon -TARGET=/Library/Polipo -LOGDIR=$TARGET/log - -# Create user $POLIPOUSER in group daemon. If it's already there, great. -$ADDSYSUSER $POLIPOUSER "Polipo System user" $POLIPODIR - -# Create the polipo direcpolipoy, if it doesn't exist. -if [ ! -d $POLIPODIR ]; then - mkdir -p $POLIPODIR -fi -if [ ! -d $LOGDIR ]; then - mkdir -p $LOGDIR -fi -# Check its permissions. -chown $POLIPOUSER $POLIPODIR -chgrp daemon $POLIPODIR -chmod 700 $POLIPODIR -chown $POLIPOUSER $LOGDIR -chgrp daemon $LOGDIR -chmod 700 $LOGDIR - -# Create the configuration file only if there wasn't one already. -if [ ! -f $TARGET/config]; then - cp $TARGET/config.osx $TARGET/config -fi - -cd /usr/share/man/man1 -MAN1=$TARGET/share/man/man1 - -if [ -d /Library/StartupItems/Polipo ]; then - find /Library/StartupItems/Polipo -print0 | xargs -0 chown root:wheel -fi - -# Copy Uninstaller -if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_polipo_bundle.sh ]; then - cp $PACKAGE_PATH/Contents/Resources/uninstall_polipo_bundle.sh $TARGET/uninstall_polipo_bundle.sh - chmod 755 $TARGET/uninstall_polipo_bundle.sh -fi diff --git a/contrib/polipo/README b/contrib/polipo/README index be3d4b63b3..1110ca2731 100644 --- a/contrib/polipo/README +++ b/contrib/polipo/README @@ -6,14 +6,14 @@ General Comments ---------------- These are some hacks for making polipo work and install a package native -to OSX or Windows. +to Windows. They need some work before they can be committed upstream: - - Merge the three makefiles into one with specific builds such as "make - dist-osx" or "make dist-win32" + - Change the Makefile so it has a specific build such as "make + dist-win32" - Configure the options for tor in polipo config, just leave them commented out for easy activation. - - Work out better polipo config options for Tor. + - Work out better polipo config options for Tor. As always, I'm happy to accept patches. @@ -45,12 +45,3 @@ choose Compile NSIS Script. You'll then create a polipo installer. The Polipo NSI installer assumes libgnurx-0.dll is in the same directory as polipo.exe. You'll need to copy libgnurx-0.dll into "./" in order to make the installation package. - ---------------------------------------------- -OSX Universal Binary and Installation package ---------------------------------------------- -1) Copy Makefile.osx over Makefile. -2) Run 'make'. -3) Copy the contents of this directory into a directory named "contrib". -4) Run './contrib/package.sh' -5) You should have a Polipo-version.dmg ready for installation. diff --git a/contrib/polipo/StartupParameters.plist b/contrib/polipo/StartupParameters.plist deleted file mode 100644 index 8309e930cb..0000000000 --- a/contrib/polipo/StartupParameters.plist +++ /dev/null @@ -1,11 +0,0 @@ -{ - Description = "Polipo"; - Provides = ("Polipo"); - Requires = ("NetworkExtensions","Resolver"); - OrderPreference = "Late"; - Messages = - { - start = "Starting Polipo"; - stop = "Stopping Polipo"; - }; -} diff --git a/contrib/polipo/addsysuser b/contrib/polipo/addsysuser deleted file mode 100644 index 7b167eac00..0000000000 --- a/contrib/polipo/addsysuser +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# Original adduser 05 Feb 2002 by Jon L. Gardner -# -# Modified for Tor installer by Nick Mathewson -# 2007-06-12 Modified for leopard by Andrew Lewman - - -ROOTPROP=/ - -if [ "`whoami`" != "root" ]; then -echo "You must be root to execute this script." -exit -fi -if [ "x$3" = "x" ]; then -echo 'Usage: addsysuser <username> "<full name>" <homedir>' -exit 0 -fi -username=$1 -realname=$2 -homedir=$3 -if [ -x /usr/bin/dscl ]; then - # Determine the gid of the daemon group - gid=`dscl . -read /groups/daemon gid` - if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; then - echo The account $username already exists. - exit 0 - fi - # home is the local path to the home directory - home=/Users/$username - echo Creating account for $username... - dscl . -create /users/$username - dscl . -create /users/$username _writers_tim_passwd $username - dscl . -create /users/$username realname $realname - dscl . -create /users/$username _writers_passwd $username - dscl . -create /users/$username gid $gid - dscl . -create /users/$username home $homedir - dscl . -create /users/$username name $username - dscl . -create /users/$username passwd '*' - dscl . -create /users/$username shell /dev/null -else - # Determine the gid of the daemon group - gid=`niutil -readprop $ROOTPROP /groups/daemon gid` - if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then - echo The account $username already exists. - exit 0 - fi - # home is the local path to the home directory - home=/Users/$username - # defhome is what goes into NetInfo - defhome="/Network/Servers/MyServer/Users" - #echo "Determining next available system uid (please be patient)..." - # Uids over 500 are for system users. - uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1` - uiddef=`echo $uiddef + 1 |bc` - echo Creating account for $username... - niutil -create $ROOTPROP /users/$username - niutil -createprop $ROOTPROP /users/$username _writers_tim_passwd $username - niutil -createprop $ROOTPROP /users/$username realname $realname - niutil -createprop $ROOTPROP /users/$username _writers_passwd $username - niutil -createprop $ROOTPROP /users/$username uid $uiddef - #niutil -createprop $ROOTPROP /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>" - niutil -createprop $ROOTPROP /users/$username gid $gid - niutil -createprop $ROOTPROP /users/$username home $homedir - niutil -createprop $ROOTPROP /users/$username name $username - niutil -createprop $ROOTPROP /users/$username passwd '*' - niutil -createprop $ROOTPROP /users/$username shell /dev/null -fi diff --git a/contrib/polipo/package.sh b/contrib/polipo/package.sh deleted file mode 100644 index 83f74212be..0000000000 --- a/contrib/polipo/package.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -# $Id: package.sh 8992 2006-12-23 03:12:09Z phobos $ -# Copyright 2004-2005 Nick Mathewson & Andrew Lewman. -# Copyright 2005-2008 Andrew Lewman -# This is licensed under the Modified BSD License. - -### -# Helpful info on OS X packaging: -# http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution/index.html -# man packagemaker - -VERSION="1.0.4" - -## Determine OSX Version -# map version to name -if [ -x /usr/bin/sw_vers ]; then -# This is poor, yet functional. We don't care about the 3rd number in -# the OS version - OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2` - case "$OSVER" in - "10.5") ARCH="universal";; - "10.4") ARCH="universal";; - "10.3") ARCH="ppc";; - "10.2") ARCH="ppc";; - "10.1") ARCH="ppc";; - "10.0") ARCH="ppc";; - *) ARCH="unknown";; - esac -else - ARCH="unknown" -fi - -# Where will we put our temporary files? -BUILD_DIR=/tmp/polipo-osx-$$ -# Path to PackageMaker app. -PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker - -umask 022 - -echo I might ask you for your password now, so you can sudo. - -sudo rm -rf $BUILD_DIR -mkdir $BUILD_DIR || exit 1 -for subdir in polipo_packageroot output; do - mkdir $BUILD_DIR/$subdir -done - -### Make Polipo package. -chmod 755 contrib/PolipoPostflight -mkdir -p $BUILD_DIR/polipo_packageroot/Library/Polipo/ -cp polipo $BUILD_DIR/polipo_packageroot/polipo -cp config.sample $BUILD_DIR/polipo_packageroot/config -cp contrib/PolipoPostflight $BUILD_DIR/polipo_packageroot/postflight -cp contrib/addsysuser $BUILD_DIR/polipo_packageroot/addsysuser -cp contrib/uninstall_polipo_bundle.sh $BUILD_DIR/polipo_packageroot/uninstall_polipo_bundle.sh -cp localindex.html $BUILD_DIR/polipo_packageroot/index.html -cat <<EOF > $BUILD_DIR/polipo_packageroot/Welcome.txt -Polipo: a caching web proxy - -Polipo is a small and fast caching web proxy (a web cache, an HTTP -proxy, a proxy server). -EOF - -### Assemble documentation - -groff polipo.man -T ps -m man | pstopdf -i -o $BUILD_DIR/polipo_packageroot/polipo.pdf -texi2html polipo.texi && cp polipo.html $BUILD_DIR/polipo_packageroot/polipo.html - -find $BUILD_DIR/polipo_packageroot -print0 |sudo xargs -0 chown root:wheel - -$PACKAGEMAKER -build \ - -p $BUILD_DIR/output/Polipo.pkg \ - -f $BUILD_DIR/polipo_packageroot \ - -i contrib/PolipoInfo.plist \ - -d contrib/PolipoDesc.plist - -### Package it all into a DMG - -find $BUILD_DIR/output -print0 | sudo xargs -0 chown root:wheel - -mv $BUILD_DIR/output "$BUILD_DIR/Polipo-$VERSION-$ARCH" -rm -f "Polipo-$VERSION-$ARCH-Bundle.dmg" -USER="`whoami`" -sudo hdiutil create -format UDZO -srcfolder "$BUILD_DIR/Polipo-$VERSION-$ARCH" "Polipo-$VERSION-$ARCH.dmg" -sudo chown "$USER" "Polipo-$VERSION-$ARCH.dmg" - -#sudo rm -rf $BUILD_DIR diff --git a/contrib/polipo/uninstall_polipo_bundle.sh b/contrib/polipo/uninstall_polipo_bundle.sh deleted file mode 100644 index 73507701a0..0000000000 --- a/contrib/polipo/uninstall_polipo_bundle.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh -# -# Original version 2005 by loki der quaeler -# Copyright 2007-2008 Andrew Lewman -# This is licensed under a Modified BSD license. - - -### this is the location of a file which contains all the actual package names -## (ie "Polipo", "polipostartup", ...) the list should be new-line-delimited. -PACKAGE_LIST_SRC="Polipo polipostartup" - -### this is the name of the user created in the install process of Polipo -POLIPO_USER=_polipo - -### these should be constant across all osX installs (so leave them be) -STARTUP_ITEMS_DIR=/Library/StartupItems -PKG_RCPT_BASE_DIR=/Library/Receipts -BOM_INTERMEDIATE_DIR=Contents/Resources -INFO_INTERMEDIATE_DIR=$BOM_INTERMEDIATE_DIR/English.lproj -TEMP_BOM_CONTENTS=/tmp/polipo_uninst_scratch - - -### make sure the script is being run as root, barf if not -if [ "`whoami`" != "root" ]; then - echo "Must be root to run the uninstall script." - exit -1 -fi - -### check to see if polipo is currently running, kill it if it is -## we grep on 'Polipo/polipo ' because 'polipo' is too common (like in 'direcpolipoy') -## -- this relies on the fact that polipo has been started with command -## line arguments.. :-/ -POLIPO_PID=`ps -uax | grep 'Polipo/polipo ' | grep -v grep | awk '{print $2;}'` -if [ ${#POLIPO_PID} -gt 0 ]; then - echo ". Killing currently running polipo process, pid is $POLIPO_PID" - kill -9 $POLIPO_PID -else - echo ". polipo process appears to already be stopped" -fi - - -## grab each package name from the package list file -while read LINE; do - if [ ${#LINE} -gt 0 ]; then - PACKAGE_NAME=$LINE.pkg - PACKAGE_PATH=$PKG_RCPT_BASE_DIR/$PACKAGE_NAME - echo ". Uninstalling $PACKAGE_NAME" - if [ ! -d $PACKAGE_PATH ]; then - echo " . No receipt exists for this package -- skipping." - - continue - fi - - - ## get rid of the startup item if it exists - STARTUP_DIR=$STARTUP_ITEMS_DIR/$LINE - if [ -d $STARTUP_DIR ]; then - echo " . Deleting startup item $STARTUP_DIR" - rm -rf $STARTUP_DIR - fi - - - ## determine the root direcpolipoy of the the relative paths specified in the bom - DEFAULT_LOC=`grep DefaultLocation $PACKAGE_PATH/$INFO_INTERMEDIATE_DIR/$LINE.info | awk '{print $2;}'` - if [ ${#DEFAULT_LOC} -eq 0 ]; then - echo "!! Could not find default location for $LINE package -- skipping package." - - continue - fi - - ## examine the list of installed items desribed in the bom - BOM_FILE=$PACKAGE_PATH/$BOM_INTERMEDIATE_DIR/$LINE.bom - lsbom $BOM_FILE > $TEMP_BOM_CONTENTS - while read BOM_ITEM; do - ## 3 column items describe just direcpolipoies, 5 column items describe actual files - COL_COUNT=$(echo $BOM_ITEM | awk '{print NF;}') - if [ "$COL_COUNT" -eq 5 ]; then - FILE_NAME=$DEFAULT_LOC/$(echo $BOM_ITEM | awk '{print $1;}') - - echo " . Removing $FILE_NAME" - rm -rf $FILE_NAME - fi - done < $TEMP_BOM_CONTENTS - - ## remove package receipt - echo " . Removing package receipt $PACKAGE_PATH" - rm -rf $PACKAGE_PATH - fi -done < $PACKAGE_LIST_SRC - -## nuke the user created by the install process. -echo ". Removing created user $POLIPO_USER" -niutil -destroy . /users/$POLIPO_USER - -## clean up -echo ". Cleaning up" -rm -rf $TEMP_BOM_CONTENTS -rm -rf /Library/Polipo/ /Library/StartupItems/Polipo/ -echo ". Finished" - diff --git a/contrib/privoxy-tor-toggle b/contrib/privoxy-tor-toggle deleted file mode 100644 index 8f9cd51bd9..0000000000 --- a/contrib/privoxy-tor-toggle +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# A script to turn Tor SOCKS4a in Privoxy on or off. - -CONFFILE=/etc/privoxy/config # privoxy config file. -TOR_REG="forward.*localhost:9050" # Regular expression to find Tor in privoxy -PRIVOXY="/etc/init.d/privoxy restart" # command to reload privoxy config file. -SED="/bin/sed" # sed command, of course. -GREP="/bin/grep" # grep command. - -usage () { -echo "\ -privoxy-tor-toggle: Change Privoxy's configuration to use/not use Tor. -Usage: - privoxy.tor <-- Switch Tor on or off. - privoxy.tor [on|off] <-- Set Tor on or off. - privoxy.tor status <-- Display Tor's current status. - privoxy.tor [-h|--help|-?] <-- Print usage. -" -} - -# Find out the current status of tor. Set $tor_status -get_status () { - gret=`$GREP -l -e "^$TOR_REG" $CONFFILE` - if [ x$gret = x ] ; then - tor_status=off; - else - tor_status=on; - fi - return -} - -# Turn tor on/off according to $1 -set_tor () { - tor_gate=$1 - get_status - if [ $tor_status = $tor_gate ] ; then - echo "Tor is already $1." - return - elif [ $tor_gate = flip ] ; then - if [ $tor_status = on ] ; then - tor_gate=off - elif [ $tor_status = off ] ; then - tor_gate=on - fi - fi - echo "Turning Tor $tor_gate..." - if [ $tor_gate = on ] ; then - reg=s/^#\($TOR_REG\)/\\1/ - $SED -i.bak -r "$reg" $CONFFILE - else - reg=s/^\($TOR_REG\)/#\\1/ - $SED -i.bak -r "$reg" $CONFFILE - fi - $PRIVOXY - return 0; -} - -if [ x$1 = x ] ; then - set_tor flip -elif [ $1 = on ] ; then - set_tor on -elif [ $1 = off ] ; then - set_tor off -elif [ $1 = status ] ; then - get_status - echo "Tor is $tor_status" -elif [ $1 = --help ] || [ $1 = -h ] || [ $1 = "-?" ] ; then - usage - exit 0 -else - echo "Unrecognized option: \"$1\"" -fi - diff --git a/contrib/proxy-some-domains b/contrib/proxy-some-domains deleted file mode 100644 index eb238a2feb..0000000000 --- a/contrib/proxy-some-domains +++ /dev/null @@ -1,52 +0,0 @@ -Subject: -Re: Anonymous/Nonymous Communication Coexisting? -From: -Kristian Köhntopp <kris@xn--khntopp-90a.de> -Date: -Fri, 10 Jun 2005 08:56:19 +0200 -To: -or-talk@freehaven.net - -On Wednesday 08 June 2005 04:20, yancm@sdf.lonestar.org wrote: - ->> Is it possible to have a single application, such as a web ->> browser or a p2p client behave normally with normal url's but ->> use tor if the url is an xyz.onion address? Or is it ->> everything or nothing? - - -This is basically a question of using your proxy or not. You can -control the behaviour of your browser in great detail writing a -proxy.pac program in Javascript and setting that program as the -proxy autoconfiguration URL in your browser. - -An example: - -kris@jordan01:~> cat /srv/www/htdocs/proxy.pac - -function FindProxyForURL(url, host) -{ - var proxy_yes = "PROXY jordan01.int.cinetic.de:3128"; - var proxy_no = "DIRECT"; - - // Redirect all accesses to mlan hosts to the mlan proxy - if (dnsDomainIs(host, ".mlan.cinetic.de")) { - return proxy_yes; - } - - // Everything else is direct - return proxy_no; -} - -So here the program checks if the destination is a mlan-Host, and -if so, uses the appropriate proxy on jordan for the access, -while all other accesses are direct. - -You could do a similar thing with .onion accesses with a trivial -modification. - -Docs: -http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html - -Kristian - diff --git a/contrib/rc.subr b/contrib/rc.subr index 117ae71d47..d757e89528 100644 --- a/contrib/rc.subr +++ b/contrib/rc.subr @@ -1,5 +1,4 @@ #!/bin/sh -# $Id$ # $FreeBSD: ports/security/tor-devel/files/tor.in,v 1.1 2006/02/17 22:21:25 mnag Exp $ # # (rc.subr written by Peter Thoenen for Net/FreeBSD) diff --git a/contrib/tor-0.1.2.17.tar.gz.metalink.in b/contrib/tor-0.1.2.17.tar.gz.metalink.in deleted file mode 100644 index 559748865d..0000000000 --- a/contrib/tor-0.1.2.17.tar.gz.metalink.in +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<metalink version="3.0" generator="Metalink Editor version 1.1.0" xmlns="http://www.metalinker.org/"> - <publisher> - <name>The Tor Project</name> - <url>https://www.torproject.org</url> - </publisher> - <license> - <name>BSD</name> - <url>http://opensource.org/licenses/bsd-license.php</url> - </license> - <identity>Tor</identity> - <version>@VERSION@</version> - <copyright>2007 The Tor Project, Inc.</copyright> - <description>Anonymity Online</description> - <files> - <file name="tor-@VERSION@.tar.gz"> - <size>1251636</size> - <language>en</language> - <os>Source</os> - <verification> - <hash type="md5">ef8fc7f45d167875c337063d437c9832</hash> - <hash type="sha1">01092fb75c407b5c1d7f33db069cf7641973d94d</hash> - <hash type="sha256">fc0fb0c2891ae09854a69512c6b4988964f2eaf62ce80ed6644cb21f87f6056a</hash> - <pieces type="sha1" length="262144"> - <hash piece="0">c778dd01e05734d57f769082545f9802386e42bb</hash> - <hash piece="1">39b172ed8b9290884c7bd129db633a79e28d5ae9</hash> - <hash piece="2">28d708e7489a1e9951e757443672535aedfa3abe</hash> - <hash piece="3">a7623e07081819a37300de0511bbdda0bdc960bd</hash> - <hash piece="4">f246021e55affe320a1f86eac5b049dd0caad828</hash> - </pieces> - </verification> - <resources> - <url type="http" location="at">http://tor.cypherpunks.at/dist/</url> - <url type="http" location="ca">http://tor.depthstrike.com/dist/</url> - <url type="http" location="ca">http://tor.hermetix.org/dist/</url> - <url type="http" location="ch">http://tor.boinc.ch/dist/</url> - <url type="http" location="cn">http://tor.anonymity.cn/dist/</url> - </resources> - </file> - </files> -</metalink> diff --git a/contrib/tor-mingw.nsi.in b/contrib/tor-mingw.nsi.in index 6deb8d96a4..a44961b027 100644 --- a/contrib/tor-mingw.nsi.in +++ b/contrib/tor-mingw.nsi.in @@ -8,8 +8,7 @@ !include "LogicLib.nsh" !include "FileFunc.nsh" !insertmacro GetParameters - -!define VERSION "0.2.1.25" +!define VERSION "0.2.2.19-alpha" !define INSTALLER "tor-${VERSION}-win32.exe" !define WEBSITE "https://www.torproject.org/" !define LICENSE "LICENSE" diff --git a/contrib/tor-resolve.py b/contrib/tor-resolve.py index 919bc876cc..47ae1a0c38 100755 --- a/contrib/tor-resolve.py +++ b/contrib/tor-resolve.py @@ -1,5 +1,4 @@ #!/usr/bin/python -#$Id$ import socket import struct diff --git a/contrib/tor.sh.in b/contrib/tor.sh.in index e169761a62..92f890681f 100644 --- a/contrib/tor.sh.in +++ b/contrib/tor.sh.in @@ -16,6 +16,15 @@ # description: Onion Router - A low-latency anonymous proxy # +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/tor +NAME=tor +DESC="tor daemon" +TORPIDDIR=/var/run/tor +TORPID=$TORPIDDIR/tor.pid +WAITFORDAEMON=60 +ARGS="" + # Library functions if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions @@ -23,9 +32,6 @@ elif [ -f /etc/init.d/functions ]; then . /etc/init.d/functions fi -# Increase open file descriptors a reasonable amount -ulimit -n 8192 - TORCTL=@BINDIR@/torctl # torctl will use these environment variables @@ -44,9 +50,47 @@ else SUPROG=/bin/su fi +# Raise ulimit based on number of file descriptors available (thanks, Debian) + +if [ -r /proc/sys/fs/file-max ]; then + system_max=`cat /proc/sys/fs/file-max` + if [ "$system_max" -gt "80000" ] ; then + MAX_FILEDESCRIPTORS=32768 + elif [ "$system_max" -gt "40000" ] ; then + MAX_FILEDESCRIPTORS=16384 + elif [ "$system_max" -gt "10000" ] ; then + MAX_FILEDESCRIPTORS=8192 + else + MAX_FILEDESCRIPTORS=1024 + cat << EOF + +Warning: Your system has very few filedescriptors available in total. + +Maybe you should try raising that by adding 'fs.file-max=100000' to your +/etc/sysctl.conf file. Feel free to pick any number that you deem appropriate. +Then run 'sysctl -p'. See /proc/sys/fs/file-max for the current value, and +file-nr in the same directory for how many of those are used at the moment. + +EOF + fi +else + MAX_FILEDESCRIPTORS=8192 +fi + +NICE="" + case "$1" in start) + if [ -n "$MAX_FILEDESCRIPTORS" ]; then + echo -n "Raising maximum number of filedescriptors (ulimit -n) to $MAX_FILEDESCRIPTORS" + if ulimit -n "$MAX_FILEDESCRIPTORS" ; then + echo "." + else + echo ": FAILED." + fi + fi + action $"Starting tor:" $TORCTL start RETVAL=$? ;; diff --git a/contrib/torify.1 b/contrib/torify.1 deleted file mode 100644 index b08d468451..0000000000 --- a/contrib/torify.1 +++ /dev/null @@ -1,32 +0,0 @@ -.TH torify 1 "" Jan-2009 "" -.\" manual page by Peter Palfrader -.SH NAME -.LP -torify \- wrapper for tsocks and tor - -.SH SYNOPSIS -\fBtorify\fP\ \fIapplication\fP\ [\fIapplication's\ arguments\fP] - -.SH DESCRIPTION -\fBtorify\fR is a simple wrapper that calls tsocks with a tor specific -configuration file. - -tsocks itself is a wrapper between the tsocks library and the application -that you would like to run socksified. - -Please note that since tsocks uses LD_PRELOAD, torify cannot be applied -to suid binaries. - -You should also be aware that the way tsocks currently works only TCP -connections are socksified. Be aware that this will in most circumstances -not include hostname lookups which would still be routed through your -normal system resolver to your usual resolving nameservers. The -\fBtor-resolve\fR(1) tool can be useful as a workaround in some cases. -The Tor FAQ at https://wiki.torproject.org/noreply/TheOnionRouter/TorFAQ might -have further information on this subject. - -.SH SEE ALSO -.BR tor (1), -.BR tor-resolve (1), -.BR tsocks (1), -.BR tsocks.conf (5). diff --git a/contrib/torify.in b/contrib/torify.in index 05645fd07c..d430da8ce7 100755 --- a/contrib/torify.in +++ b/contrib/torify.in @@ -3,43 +3,69 @@ # Wrapper script for use of the tsocks(8) transparent socksification library # See the tsocks(1) and torify(1) manpages. -# Copyright (c) 2004, 2006 Peter Palfrader +# Copyright (c) 2004, 2006, 2009 Peter Palfrader # Modified by Jacob Appelbaum <jacob@appelbaum.net> April 16th 2006 # May be distributed under the same terms as Tor itself +# taken from Debian's Developer's Reference, 6.4 +pathfind() { + OLDIFS="$IFS" + IFS=: + for p in $PATH; do + if [ -x "$p/$*" ]; then + IFS="$OLDIFS" + return 0 + fi + done + IFS="$OLDIFS" + return 1 +} -# Define and ensure we have tsocks -# XXX: what if we don't have which? -TSOCKS="`which tsocks`" -if [ ! -x "$TSOCKS" ] -then - echo "$0: Can't find tsocks in PATH. Perhaps you haven't installed it?" >&2 - exit 1 +# Check for any argument list +if [ "$#" = 0 ]; then + echo "Usage: $0 [-hv] <command> [<options>...]" >&2 + exit 1 fi -# Check for any argument list -if [ "$#" = 0 ] -then - echo "Usage: $0 <command> [<options>...]" >&2 - exit 1 +if [ "$#" = 1 ] && ( [ "$1" = "-h" ] || [ "$1" = "--help" ] ); then + echo "Usage: $0 [-hv] <command> [<options>...]" + exit 0 fi -if [ "$#" = 1 ] && ( [ "$1" = "-h" ] || [ "$1" = "--help" ] ) -then - echo "Usage: $0 <command> [<options>...]" - exit 0 + +if [ "$1" = "-v" ] || [ "$1" = "--verbose" ]; then + verbose=1 + shift 1 +else + verbose=0 fi -# Define our tsocks config file -TSOCKS_CONF_FILE="@CONFDIR@/tor-tsocks.conf" -export TSOCKS_CONF_FILE +if pathfind torsocks; then + ! [ "$verbose" -ge 1 ] || echo "Using torsocks as socksifier." >&2 -# Check that we've got a tsocks config file -if [ -r "$TSOCKS_CONF_FILE" ] -then - exec tsocks "$@" - echo "$0: Failed to exec tsocks $@" >&2 + exec torsocks "$@" + echo "$0: Failed to exec torsocks $@" >&2 exit 1 + +elif pathfind tsocks; then + ! [ "$verbose" -ge 1 ] || echo "Using tsocks as socksifier." >&2 + + # Define our tsocks config file + TSOCKS_CONF_FILE="/etc/tor/tor-tsocks.conf" + export TSOCKS_CONF_FILE + + # Check that we've got a tsocks config file + if [ -r "$TSOCKS_CONF_FILE" ] + then + echo "WARNING: tsocks is known to leak DNS and UDP data. If you had torsocks we would use that." >&2 + exec tsocks "$@" + echo "$0: Failed to exec tsocks $@" >&2 + exit 1 + else + echo "$0: Missing tsocks configuration file \"$TSOCKS_CONF_FILE\"." >&2 + exit 1 + fi + else - echo "$0: Missing tsocks configuration file \"$TSOCKS_CONF_FILE\"." >&2 + echo "$0: Can't find either tsocks or torsocks in your PATH. Perhaps you haven't installed either?" >&2 exit 1 fi |