[Midnightbsd-cvs] mports [22069] trunk/security/tor: tor 0.2.8.9
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Fri Nov 4 18:20:42 EDT 2016
Revision: 22069
http://svnweb.midnightbsd.org/mports/?rev=22069
Author: laffer1
Date: 2016-11-04 18:20:42 -0400 (Fri, 04 Nov 2016)
Log Message:
-----------
tor 0.2.8.9
Modified Paths:
--------------
trunk/security/tor/Makefile
trunk/security/tor/distinfo
trunk/security/tor/files/pkg-message.in
trunk/security/tor/files/tor.in
trunk/security/tor/pkg-plist
Removed Paths:
-------------
trunk/security/tor/files/patch-configure
Modified: trunk/security/tor/Makefile
===================================================================
--- trunk/security/tor/Makefile 2016-11-04 22:06:21 UTC (rev 22068)
+++ trunk/security/tor/Makefile 2016-11-04 22:20:42 UTC (rev 22069)
@@ -1,12 +1,12 @@
# $MidnightBSD$
PORTNAME= tor
-DISTVERSION= 0.2.7.6
+DISTVERSION= 0.2.8.9
CATEGORIES= security net ipv6
MASTER_SITES= TOR
MAINTAINER= ports at MidnightBSD.org
-COMMENT= An anonymizing overlay network for TCP
+COMMENT= Anonymizing overlay network for TCP
LICENSE= bsd3
LICENSE_FILE= ${WRKSRC}/LICENSE
Modified: trunk/security/tor/distinfo
===================================================================
--- trunk/security/tor/distinfo 2016-11-04 22:06:21 UTC (rev 22068)
+++ trunk/security/tor/distinfo 2016-11-04 22:20:42 UTC (rev 22069)
@@ -1,2 +1,3 @@
-SHA256 (tor-0.2.7.6.tar.gz) = 493a8679f904503048114aca6467faef56861206bab8283d858f37141d95105d
-SIZE (tor-0.2.7.6.tar.gz) = 4869754
+TIMESTAMP = 1476740628
+SHA256 (tor-0.2.8.9.tar.gz) = 3f5c273bb887be4aff11f4d99b9e2e52d293b81ff4f6302b730161ff16dc5316
+SIZE (tor-0.2.8.9.tar.gz) = 5306773
Deleted: trunk/security/tor/files/patch-configure
===================================================================
--- trunk/security/tor/files/patch-configure 2016-11-04 22:06:21 UTC (rev 22068)
+++ trunk/security/tor/files/patch-configure 2016-11-04 22:20:42 UTC (rev 22069)
@@ -1,49 +0,0 @@
---- configure.orig 2012-06-15 03:10:31.000000000 -0400
-+++ configure 2012-06-17 08:46:34.000000000 -0400
-@@ -6319,6 +6319,7 @@
- fi
-
-
-+if false ; then
- trylibeventdir=""
-
- # Check whether --with-libevent-dir was given.
-@@ -6645,6 +6646,7 @@
- LIBS="$tor_saved_LIBS"
- LDFLAGS="$tor_saved_LDFLAGS"
- CPPFLAGS="$tor_saved_CPPFLAGS"
-+fi
-
-
-
-@@ -6707,6 +6709,7 @@
- fi
-
-
-+if false ; then
- if test "$enable_static_libevent" = "yes"; then
- if test "$tor_cv_library_libevent_dir" = "(system)"; then
- as_fn_error $? "\"You must specify an explicit --with-libevent-dir=x option when using --enable-static-libevent\"" "$LINENO" 5
-@@ -6716,6 +6719,7 @@
- else
- TOR_LIBEVENT_LIBS="-levent"
- fi
-+fi
-
- if test "$enable_bufferevents" = "yes" ; then
- if test "$ac_cv_header_event2_bufferevent_ssl_h" != "yes" ; then
-@@ -6794,12 +6798,14 @@
-
- $as_echo "#define USE_BUFFEREVENTS 1" >>confdefs.h
-
-+if false ; then
- if test "$enable_static_libevent" = "yes"; then
- TOR_LIBEVENT_LIBS="$TOR_LIBDIR_libevent/libevent_openssl.a $TOR_LIBEVENT_LIBS"
- else
- TOR_LIBEVENT_LIBS="-levent_openssl $TOR_LIBEVENT_LIBS"
- fi
- fi
-+fi
-
-
-
Modified: trunk/security/tor/files/pkg-message.in
===================================================================
--- trunk/security/tor/files/pkg-message.in 2016-11-04 22:06:21 UTC (rev 22068)
+++ trunk/security/tor/files/pkg-message.in 2016-11-04 22:20:42 UTC (rev 22069)
@@ -1,19 +1,22 @@
+================================================================================
To enable the tor server, set tor_enable="YES" in your /etc/rc.conf
and edit %%PREFIX%%/etc/tor/torrc as desired. (However, note that the
%%PREFIX%%/etc/rc.d/tor rc.subr script can override some torrc
options: see that script for details.) To use the torify script, install
-the net/torsocks port. After installing tor for the first time, or after
-a major update of tor, you should:
+the net/torsocks port.
-rm -r /var/db/tor /var/run/tor
-mkdir -p /var/db/tor/data /var/run/tor
-touch /var/log/tor
-chown -R _tor:_tor /var/db/tor /var/log/tor /var/run/tor
-chmod -R 700 /var/db/tor
+Tor users are strongly advised to prevent traffic analysis that
+exploits sequential IP IDs by setting:
-before starting the tor server. Tor users are strongly advised to prevent traffic
-analysis that exploits sequential IP IDs by setting:
-
sysctl net.inet.ip.random_id=1
(see sysctl.conf(5)).
+
+In order to run additional, independent instances of tor on the same machine
+set tor_instances="inst1 inst2 ..." in your /etc/rc.conf, and create the
+corresponding additional configuration files %%PREFIX%%/etc/tor/torrc at inst1, ...
+
+Alternatively, you can use the extended instance definition to specify all
+instance parameteres explicitly:
+inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir}
+================================================================================
Modified: trunk/security/tor/files/tor.in
===================================================================
--- trunk/security/tor/files/tor.in 2016-11-04 22:06:21 UTC (rev 22068)
+++ trunk/security/tor/files/tor.in 2016-11-04 22:20:42 UTC (rev 22069)
@@ -1,7 +1,6 @@
#!/bin/sh
#
-# $MidnightBSD$
-# $FreeBSD: head/security/tor/files/tor.in 382650 2015-03-30 11:58:44Z bf $
+# $FreeBSD: head/security/tor/files/tor.in 425102 2016-11-02 02:57:03Z jbeich $
#
# PROVIDE: tor
# REQUIRE: DAEMON FILESYSTEMS
@@ -12,13 +11,20 @@
# they are command line options.
#
# tor_enable (bool): Set it to "YES" to enable tor. Default: NO
+# tor_instances (str): List of instances. Default: ""
# tor_conf (str): Points to your torrc file.
# Default: %%PREFIX%%/etc/tor/torrc
-# tor_user (str): Tor daemon user. Default: _tor
+# tor_user (str): Tor daemon user. Default: %%USER%%
+# tor_group (str): Tor group. Default: %%GROUP%%
+# tor_pidfile (str): Tor pid file. Default: /var/run/tor/tor.pid
# tor_datadir (str): Tor datadir. Default: /var/db/tor
-# tor_logfile (str): Tor log file. Default: /var/log/tor
-# tor_loglevel (str): Tor log severity level. Default: notice
+# tor_disable_default_instance (str): Doesn't run the default instance.
+# Only valid when tor_instances is used.
+# Default: NO
#
+# The instance definition that tor_instances expects:
+# inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir}
+#
. /etc/rc.subr
@@ -28,24 +34,66 @@
load_rc_config ${name}
: ${tor_enable="NO"}
+: ${tor_instances=""}
: ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
-: ${tor_user="_tor"}
+: ${tor_user="%%USER%%"}
+: ${tor_group="%%GROUP%%"}
: ${tor_pidfile="/var/run/tor/tor.pid"}
-: ${tor_logfile="/var/log/tor"}
-: ${tor_loglevel="notice"}
: ${tor_datadir="/var/db/tor"}
+: ${tor_disable_default_instance="NO"}
+instance=${2}
+if [ -n "${instance}" ]; then
+ # extended instance: parameters are set explicitly
+ inst_def=${instance}
+ inst_name=${inst_def%%:*}
+ inst_def=${inst_def#$inst_name}
+ if [ -n "$inst_def" ]; then
+ inst_def=${inst_def#:}
+ tor_conf=${inst_def%%:*}
+ inst_def=${inst_def#$tor_conf:}
+ tor_user=${inst_def%%:*}
+ inst_def=${inst_def#$tor_user:}
+ tor_group=${inst_def%%:*}
+ inst_def=${inst_def#$tor_group:}
+ tor_pidfile=${inst_def%%:*}
+ tor_datadir=${inst_def#$tor_pidfile:}
+ if [ -z "${tor_conf}" -o -z "${tor_user}" -o -z "${tor_group}" -o -z "${tor_pidfile}" -o -z "${tor_datadir}" ]; then
+ warn "invalid tor instance ${inst_name} settings"
+ exit 1
+ fi
+ else
+ # regular instance: default parameters are used
+ tor_conf=${tor_conf}@${inst_name}
+ tor_pidfile=${tor_pidfile}@${inst_name}
+ tor_datadir=${tor_datadir}/instance@${inst_name}
+ fi
+ if ! [ -r ${tor_conf} ]; then
+ warn "tor instance ${inst_name} config file ${tor_conf} doesn't exist or isn't readable"
+ warn "you can copy the sample config %%PREFIX%%/etc/tor/torrc.sample and modify it"
+ exit 1
+ fi
+ if ! [ -d ${tor_datadir} ]; then
+ mkdir -p ${tor_datadir} &&
+ chown ${tor_user}:${tor_group} ${tor_datadir} &&
+ chmod 0700 ${tor_datadir} &&
+ echo "${name}: created the instance data directory ${tor_datadir}"
+ fi
+fi
+
+if [ -z "${instance}" -a -n "${tor_instances}" ]; then
+ for i in ${tor_instances}; do
+ %%PREFIX%%/etc/rc.d/tor $1 ${i} || warn "$1 failed for the tor instance $i"
+ done
+ checkyesno tor_disable_default_instance && return 0
+fi
+
required_files=${tor_conf}
required_dirs=${tor_datadir}
pidfile=${tor_pidfile}
command="%%PREFIX%%/bin/${name}"
-command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --+Log ${tor_loglevel}\ file\ ${tor_logfile}"
-extra_commands="log reload"
-log_cmd="${name}_log"
+command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir}"
+extra_commands="reload"
-tor_log() {
- cat ${tor_logfile}
-}
-
run_rc_command "$1"
Modified: trunk/security/tor/pkg-plist
===================================================================
--- trunk/security/tor/pkg-plist 2016-11-04 22:06:21 UTC (rev 22068)
+++ trunk/security/tor/pkg-plist 2016-11-04 22:20:42 UTC (rev 22069)
@@ -9,3 +9,6 @@
man/man1/torify.1.gz
%%DATADIR%%/geoip
%%DATADIR%%/geoip6
+ at dir(%%USER%%,%%GROUP%%,700) /var/run/tor
+ at dir(%%USER%%,%%GROUP%%,700) /var/log/tor
+ at dir(%%USER%%,%%GROUP%%,700) /var/db/tor
More information about the Midnightbsd-cvs
mailing list