From: Michael Tremer Date: Fri, 19 Jul 2013 09:40:14 +0000 (+0200) Subject: tor: New package. X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=b312967ce3f9d66dbc6b8521d70725eafd1b68e3 tor: New package. --- diff --git a/config/backup/includes/tor b/config/backup/includes/tor new file mode 100644 index 000000000..02fc3edea --- /dev/null +++ b/config/backup/includes/tor @@ -0,0 +1 @@ +/etc/tor diff --git a/config/rootfiles/common/armv5tel/initscripts b/config/rootfiles/common/armv5tel/initscripts index ff6d73188..25fca8db4 100644 --- a/config/rootfiles/common/armv5tel/initscripts +++ b/config/rootfiles/common/armv5tel/initscripts @@ -126,6 +126,7 @@ etc/rc.d/init.d/teamspeak etc/rc.d/init.d/template #etc/rc.d/init.d/tftpd etc/rc.d/init.d/tmpfs +#etc/rc.d/init.d/tor etc/rc.d/init.d/udev etc/rc.d/init.d/udev_retry etc/rc.d/init.d/upnpd diff --git a/config/rootfiles/common/i586/initscripts b/config/rootfiles/common/i586/initscripts index 55cee863d..3aca59ece 100644 --- a/config/rootfiles/common/i586/initscripts +++ b/config/rootfiles/common/i586/initscripts @@ -128,6 +128,7 @@ etc/rc.d/init.d/teamspeak etc/rc.d/init.d/template #etc/rc.d/init.d/tftpd etc/rc.d/init.d/tmpfs +#etc/rc.d/init.d/tor #etc/rc.d/init.d/transmission etc/rc.d/init.d/udev etc/rc.d/init.d/udev_retry diff --git a/config/rootfiles/packages/tor b/config/rootfiles/packages/tor new file mode 100644 index 000000000..7f4502f30 --- /dev/null +++ b/config/rootfiles/packages/tor @@ -0,0 +1,25 @@ +#etc/logrotate.d +etc/logrotate.d/tor +etc/rc.d/init.d/tor +#etc/tor +etc/tor/tor-tsocks.conf +etc/tor/torrc +usr/bin/tor +usr/bin/tor-gencert +usr/bin/tor-resolve +usr/bin/torify +#usr/share/doc/tor +#usr/share/doc/tor/tor-gencert.html +#usr/share/doc/tor/tor-resolve.html +#usr/share/doc/tor/tor.html +#usr/share/doc/tor/torify.html +#usr/share/man/man1/tor-gencert.1 +#usr/share/man/man1/tor-resolve.1 +#usr/share/man/man1/tor.1 +#usr/share/man/man1/torify.1 +usr/share/tor +usr/share/tor/defaults-torrc +usr/share/tor/geoip +var/ipfire/backup/addons/includes/tor +var/lib/tor +var/log/tor diff --git a/config/tor/defaults-torrc b/config/tor/defaults-torrc new file mode 100644 index 000000000..703d821fe --- /dev/null +++ b/config/tor/defaults-torrc @@ -0,0 +1,3 @@ +DataDirectory /var/lib/tor +User nobody +Log notice syslog diff --git a/config/tor/tor.logrotate b/config/tor/tor.logrotate new file mode 100644 index 000000000..49fe00294 --- /dev/null +++ b/config/tor/tor.logrotate @@ -0,0 +1,13 @@ +/var/log/tor/*.log { + daily + rotate 5 + compress + delaycompress + missingok + notifempty + create 0640 nobody nobody + sharedscripts + postrotate + /etc/init.d/tor reload >/dev/null 2>&1 || : + endscript +} diff --git a/lfs/tor b/lfs/tor new file mode 100644 index 000000000..559ca5b02 --- /dev/null +++ b/lfs/tor @@ -0,0 +1,110 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 0.2.3.25 + +THISAPP = tor-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +PROG = tor +PAK_VER = 1 + +DEPS = "libevent2" + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = a1c364189a9a66ed9daa8e6436489daf + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist: + @$(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && \ + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-tor-user=nobody \ + --with-tor-group=nobody + + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && make install + + # Install configuration file. + mv /etc/tor/torrc{.sample,} + + mkdir -pv /var/lib/tor /var/log/tor + chown nobody:nobody /var/lib/tor + + # Logrotate + mkdir -pv /etc/logrotate.d + install -v -m 644 $(DIR_SRC)/config/tor/tor.logrotate \ + /etc/logrotate.d/tor + + # Defaults + mkdir -pv /usr/share/tor + install -v -m 644 $(DIR_SRC)/config/tor/defaults-torrc \ + /usr/share/tor/defaults-torrc + + install -v -m 644 $(DIR_SRC)/config/backup/includes/tor \ + /var/ipfire/backup/addons/includes/tor + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index 8ca36bf9c..e2dc1700d 100755 --- a/make.sh +++ b/make.sh @@ -779,6 +779,7 @@ buildipfire() { ipfiremake perl-File-Tail ipfiremake perl-TimeDate ipfiremake swatch + ipfiremake tor echo Build on $HOSTNAME > $BASEDIR/build/var/ipfire/firebuild cat /proc/version >> $BASEDIR/build/var/ipfire/firebuild echo >> $BASEDIR/build/var/ipfire/firebuild diff --git a/src/initscripts/init.d/tor b/src/initscripts/init.d/tor new file mode 100644 index 000000000..6ae03130e --- /dev/null +++ b/src/initscripts/init.d/tor @@ -0,0 +1,48 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/tor +# +# Description : Anonymizing overlay network for TCP +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +case "${1}" in + start) + boot_mesg "Starting tor..." + loadproc /usr/bin/tor \ + --runasdaemon 1 \ + --defaults-torrc /usr/share/tor/defaults-torrc \ + -f /etc/tor/torrc \ + --quiet + ;; + + stop) + boot_mesg "Stopping tor..." + killproc /usr/bin/tor + ;; + + reload) + boot_mesg "Reloading tor..." + reloadproc /usr/bin/tor + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + statusproc /usr/bin/tor + ;; + + *) + echo "Usage: ${0} {start|stop|reload|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/tor