summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandr Savca <alexandr.savca89@gmail.com>2020-12-13 18:06:17 +0200
committerAlexandr Savca <alexandr.savca89@gmail.com>2020-12-13 18:21:04 +0200
commit986d0276c783a4da9af47284656a7c0e6890ab41 (patch)
tree9fdff5c1a0b1915b4cc9855d9bf280e239d041ec
parent84c746737f2fa6d4412ab5fc8427a7f876bdd376 (diff)
downloadcontrib-986d0276c783a4da9af47284656a7c0e6890ab41.tar.gz
contrib-986d0276c783a4da9af47284656a7c0e6890ab41.tar.xz
tor: initial commit, v0.4.4.6
-rw-r--r--tor/.footprint28
-rw-r--r--tor/.signature6
-rw-r--r--tor/Pkgfile45
-rw-r--r--tor/README30
-rwxr-xr-xtor/pre-install8
-rw-r--r--tor/rc.tor43
6 files changed, 160 insertions, 0 deletions
diff --git a/tor/.footprint b/tor/.footprint
new file mode 100644
index 000000000..eebf5b9f7
--- /dev/null
+++ b/tor/.footprint
@@ -0,0 +1,28 @@
+drwxr-xr-x root/root etc/
+drwxr-xr-x root/root etc/rc.d/
+-rwxr-x--- root/root etc/rc.d/tor
+drwxr-xr-x root/root etc/tor/
+-rw------- tor/tor etc/tor/torrc
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/tor
+-rwxr-xr-x root/root usr/bin/tor-gencert
+-rwxr-xr-x root/root usr/bin/tor-print-ed-signing-cert
+-rwxr-xr-x root/root usr/bin/tor-resolve
+-rwxr-xr-x root/root usr/bin/torify
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man1/
+-rw-r--r-- root/root usr/share/man/man1/tor-gencert.1.gz
+-rw-r--r-- root/root usr/share/man/man1/tor-print-ed-signing-cert.1.gz
+-rw-r--r-- root/root usr/share/man/man1/tor-resolve.1.gz
+-rw-r--r-- root/root usr/share/man/man1/tor.1.gz
+-rw-r--r-- root/root usr/share/man/man1/torify.1.gz
+drwxr-xr-x root/root usr/share/tor/
+-rw-r--r-- root/root usr/share/tor/geoip
+-rw-r--r-- root/root usr/share/tor/geoip6
+drwxr-xr-x root/root var/
+drwxr-xr-x root/root var/lib/
+drwx------ tor/tor var/lib/tor/
+drwxr-xr-x root/root var/log/
+drwx------ tor/tor var/log/tor/
diff --git a/tor/.signature b/tor/.signature
new file mode 100644
index 000000000..fa21ee744
--- /dev/null
+++ b/tor/.signature
@@ -0,0 +1,6 @@
+untrusted comment: verify with /etc/ports/contrib.pub
+RWSagIOpLGJF3+KXodp/P3GaFE7lhc16JsaWSey+RDAThEyAMfSHmHZ5LctJOpu/8RCxOdaLTbVXZs2b7sv5d0HhspXO01VTRQQ=
+SHA256 (Pkgfile) = 7f64a2d9ffb27ada9de06b9526cb8d672986c2134298239b232b315c1e130809
+SHA256 (.footprint) = 8dacf6216fbd3b37d314b191dcbf9c2d073a58fd4bff4b3f9031e15784c6b315
+SHA256 (tor-0.4.4.6.tar.gz) = 5f154c155803adf5c89e87cab53017b6908c5ebe50c65839e8cf4fbd2abe1fdc
+SHA256 (rc.tor) = ca0c0fdc632c5464e69fcc37daddd21bd097597e9e224a13acfb45f9884c4f1d
diff --git a/tor/Pkgfile b/tor/Pkgfile
new file mode 100644
index 000000000..0e98ad34b
--- /dev/null
+++ b/tor/Pkgfile
@@ -0,0 +1,45 @@
+# Description: Anonymizing overlay network
+# URL: https://www.torproject.org
+# Maintainer: Alexandr Savca, alexandrsavca89 at gmail dot com
+# Depends on: libcap libevent libseccomp
+
+name=tor
+version=0.4.4.6
+release=1
+source=(https://www.torproject.org/dist/$name-$version.tar.gz
+ rc.tor)
+
+build() {
+ cd $name-$version
+
+ export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --enable-system-torrc \
+ --disable-libfuzzer \
+ --disable-android \
+ --disable-html-manual \
+ --disable-rust \
+ --disable-zstd-advanced-apis
+
+ make V=1
+ make DESTDIR=$PKG install
+
+ # data
+ install -dm0700 -o tor -g tor $PKG/var/lib/tor
+ install -dm0700 -o tor -g tor $PKG/var/log/tor
+
+ # config
+ install -m600 -o tor -g tor $PKG/etc/tor/torrc.sample $PKG/etc/tor/torrc
+ rm $PKG/etc/tor/torrc.sample
+ sed -i \
+ -e 's/^#Log notice file/Log notice file/' \
+ -e 's/^#DataDirectory/DataDirectory/' \
+ $PKG/etc/tor/torrc
+
+ # service
+ install -Dm0750 $SRC/rc.tor $PKG/etc/rc.d/tor
+}
diff --git a/tor/README b/tor/README
new file mode 100644
index 000000000..41505b9af
--- /dev/null
+++ b/tor/README
@@ -0,0 +1,30 @@
+README for tor
+
+PRECAUTION
+
+ Make sure you edit /etc/pkgadd.conf and add the following lines:
+
+ UPGRADE ^var/lib/tor/.*$ NO
+ UPGRADE ^etc/tor/torrc$ NO
+ UPGRADE ^etc/tor/torifyrc$ NO
+
+ Failure to do so will result in the loss of your tor data and
+ configuration upon update!
+
+ If you edit the torrc file for extra logging, make sure you:
+ chmod 0640 /var/log/tor/* files, for security reasons.
+
+PRE-INSTALL
+
+ Tor expects to have a user and group dedicated to it.
+ pre-install script takes care of this.
+
+NOTES
+
+ DNS
+ ---
+
+ If you want to use Tor DNS as default nameserver on port 53,
+ dont forget to allow non-root process to bind a privileged port:
+
+ sudo setcap 'cap_net_bind_service=+ep' /usr/bin/tor
diff --git a/tor/pre-install b/tor/pre-install
new file mode 100755
index 000000000..b00990533
--- /dev/null
+++ b/tor/pre-install
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+/usr/bin/getent group tor || /usr/sbin/groupadd -r tor
+/usr/bin/getent passwd tor || /usr/sbin/useradd -r -d /var/lib/tor -s /bin/false tor
+
+/usr/bin/passwd -l tor
+
+# End of file
diff --git a/tor/rc.tor b/tor/rc.tor
new file mode 100644
index 000000000..34271a5b4
--- /dev/null
+++ b/tor/rc.tor
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# /etc/rc.d/tor: start/stop tor daemon
+#
+
+SSD=/sbin/start-stop-daemon
+PROG=/usr/bin/tor
+PID=/var/run/tor.pid
+OPTS=
+
+case $1 in
+start)
+ $SSD --start --make-pidfile --pidfile $PID --chuid tor:tor \
+ --exec $PROG --background -- $OPTS
+ ;;
+stop)
+ $SSD --stop --retry 10 --pidfile $PID --remove-pidfile
+ ;;
+reload)
+ $SSD --stop --signal HUP --pidfile $PID
+ ;;
+restart)
+ $0 stop
+ $0 start
+ ;;
+check-config)
+ su tor -c "$PROG --verify-config"
+ ;;
+status)
+ $SSD --status --pidfile $PID
+ case $? in
+ 0) echo "$PROG is running with pid $(cat $PID)" ;;
+ 1) echo "$PROG is not running but the pid file $PID exists" ;;
+ 3) echo "$PROG is not running" ;;
+ 4) echo "Unable to determine the program status" ;;
+ esac
+ ;;
+*)
+ echo "usage: $0 [start|stop|reload|restart|check-config|status]"
+ ;;
+esac
+
+# End of file

Generated by cgit