summaryrefslogtreecommitdiff
path: root/opt/tor
diff options
context:
space:
mode:
authorrawnix ports <ports@rawnix.org>2026-09-26 18:19:05 +0000
committerrawnix ports <ports@rawnix.org>2026-09-26 18:19:05 +0000
commitc82e88dd00d1b0b7fcfb4e5628d99611388cef6f (patch)
tree56d864b5a5c6c145edd96178ae219a8f90e191a6 /opt/tor
downloadports-c82e88dd00d1b0b7fcfb4e5628d99611388cef6f.tar.gz
sync 2026-09-26 18:19 UTC
1672 files changed, 151396 insertions(+)
Diffstat (limited to 'opt/tor')
-rw-r--r--opt/tor/.footprint28
-rw-r--r--opt/tor/.signature6
-rw-r--r--opt/tor/MAKEPKG136
3 files changed, 170 insertions, 0 deletions
diff --git a/opt/tor/.footprint b/opt/tor/.footprint
new file mode 100644
index 0000000..a489278
--- /dev/null
+++ b/opt/tor/.footprint
@@ -0,0 +1,28 @@
+drwxr-xr-x root/root etc/
+drwxr-xr-x root/root etc/sv/
+drwxr-xr-x root/root etc/sv/tor/
+-rw-r--r-- root/root etc/sv/tor/down (EMPTY)
+-rwxr-xr-x root/root etc/sv/tor/finish
+-rwxr-xr-x root/root etc/sv/tor/run
+drwxr-xr-x root/root etc/sv/tor/log/
+-rwxr-xr-x root/root etc/sv/tor/log/run
+drwxr-x--- root/root etc/tor/
+-rw-r--r-- root/root etc/tor/torrc
+-rw-r--r-- root/root etc/tor/torrc.sample
+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/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/
+drwxr-xr-x root/root var/lib/pkg/
+drwxr-xr-x root/root var/lib/pkg/meta/
+-rw-r--r-- root/root var/lib/pkg/meta/tor
+drwx------ root/root var/lib/tor/
diff --git a/opt/tor/.signature b/opt/tor/.signature
new file mode 100644
index 0000000..010ae41
--- /dev/null
+++ b/opt/tor/.signature
@@ -0,0 +1,6 @@
+RWTZ9IduCSQ/mOMJnJRv0d5NJSnUGx6/CY2vR82RMLCbARAhOlsXpzY1xtmY1FPBQKp1y4wZm163U0DvRX0SzgNa0GcGemvz/QE=
+
+SHA256 (MAKEPKG) = f745e61c44c2917e33b74120749b402f07603e1c8e3514206015bc9703f808c0
+SHA256 (.footprint) = 345c66e50a55210b3e8474ffed837fa64e62354e7faad791bf0f39e70de40864
+SHA256 (tor-0.4.9.13.tar.gz) = 5e748d3272cdf44a7d7741173f371c8def3d96eecb77e93c89c50663ce9cc792
+SHA256 (tor#0.4.9.13-2.pkg.tar.gz) = c220fcee9fb7a2ad11511dcede664e2a088e3f2fc9ee6531791905c901d3500d
diff --git a/opt/tor/MAKEPKG b/opt/tor/MAKEPKG
new file mode 100644
index 0000000..4722926
--- /dev/null
+++ b/opt/tor/MAKEPKG
@@ -0,0 +1,136 @@
+#!/bin/mkpkg
+# description: Anonymous communication network - core daemon
+# url: https://www.torproject.org/
+
+name=tor
+version=0.4.9.13
+release=2
+depends=(libressl libevent zlib)
+groups=(tor:user:tor:/var/lib/tor:700:903:903)
+services=(tor)
+permissions=(
+ /etc/tor:root:tor:750
+ /usr/bin/tor:root:tor:750
+ /usr/bin/tor-resolve:root:tor:750
+ /usr/bin/tor-gencert:root:tor:750
+ /usr/bin/tor-print-ed-signing-cert:root:tor:750
+ /etc/tor/torrc:root:tor:640
+)
+source=(https://dist.torproject.org/$name-$version.tar.gz)
+sha256sums=(
+ "5e748d3272cdf44a7d7741173f371c8def3d96eecb77e93c89c50663ce9cc792"
+)
+
+build() {
+ cd $name-$version
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --disable-systemd \
+ --disable-lzma \
+ --disable-zstd \
+ --disable-asciidoc \
+ --disable-html-manual \
+ --disable-manpage \
+ --disable-unittests \
+ --enable-pic \
+ --with-tor-user=tor \
+ --with-tor-group=tor \
+ --with-openssl-dir=/ \
+ --with-libevent-dir=/usr
+ make
+ make DESTDIR=$PKG install
+
+ # Remove docs
+ rm -rf $PKG/usr/share/doc
+
+ # Config directory
+ install -d -m 750 $PKG/etc/tor
+
+ # Hardened torrc
+ printf '%s\n' \
+ '## rawnix Tor configuration' \
+ '## See tor(1) for options' \
+ '' \
+ 'DataDirectory /var/lib/tor' \
+ 'PidFile /run/tor/tor.pid' \
+ '' \
+ '# Logging' \
+ 'Log notice stderr' \
+ '' \
+ '# SOCKS port for local applications (e.g. browser)' \
+ 'SocksPort 9050 IsolateDestAddr IsolateDestPort' \
+ '' \
+ '# DNS resolution through Tor' \
+ 'DNSPort 5353' \
+ 'AutomapHostsOnResolve 1' \
+ 'VirtualAddrNetworkIPv4 10.192.0.0/10' \
+ '' \
+ '# Transparent proxy port' \
+ 'TransPort 9040 IsolateClientAddr IsolateClientProtocol IsolateDestAddr IsolateDestPort' \
+ '' \
+ '# Hardening' \
+ 'Sandbox 0' \
+ 'NoExec 1' \
+ 'SafeLogging 1' \
+ '' \
+ '# Disable relay/exit functionality' \
+ 'ClientOnly 1' \
+ '' \
+ '# Connection padding to resist traffic analysis' \
+ 'ConnectionPadding 1' \
+ '' \
+ '# Reject plaintext on SOCKS' \
+ 'WarnPlaintextPorts 23,109,110,143' \
+ 'RejectPlaintextPorts 23,109,110,143' \
+ > $PKG/etc/tor/torrc
+
+ # Data directory
+ install -d -m 700 $PKG/var/lib/tor
+}
+
+post_build() {
+ # runit service - touch down file so tor does not auto-start
+ install -d $PKG/etc/sv/tor/log
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'exec 2>&1' \
+ '' \
+ '# Prepare runtime directories' \
+ 'install -d -m 750 -o tor -g tor /run/tor' \
+ 'install -d -m 700 -o tor -g tor /var/lib/tor' \
+ '' \
+ '# Verify config before starting' \
+ 'chpst -u tor:tor tor --verify-config -f /etc/tor/torrc || exit 1' \
+ '' \
+ '# Start tor in foreground' \
+ 'exec chpst -u tor:tor tor -f /etc/tor/torrc --RunAsDaemon 0' \
+ > $PKG/etc/sv/tor/run
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'rm -rf /run/tor' \
+ > $PKG/etc/sv/tor/finish
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'mkdir -p /var/log/tor' \
+ 'exec svlogd -tt /var/log/tor' \
+ > $PKG/etc/sv/tor/log/run
+
+ chmod 755 $PKG/etc/sv/tor/run
+ chmod 755 $PKG/etc/sv/tor/finish
+ chmod 755 $PKG/etc/sv/tor/log/run
+
+ # Service disabled by default - must explicitly: rm /etc/sv/tor/down
+ touch $PKG/etc/sv/tor/down
+}
+
+signify() {
+ untrusted comment: public key
+ RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
+}
+
+# vim: filetype=sh