summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKokaKiwi2023-11-01 15:07:11 +0100
committerKokaKiwi2023-11-01 15:07:11 +0100
commit8d4d666a01379f0613354851b0a8841f278f31a8 (patch)
tree1f31dfec413a52bb43b57146543c6ca39a3bd66b
parentdcd71818e6e6fc9e7fe19f2236ebd40f0d0f31d3 (diff)
downloadaur-8d4d666a01379f0613354851b0a8841f278f31a8.tar.gz
upgpkg: tor-unstable 0.4.8.7-1
upstream release (until new unstable release) Upstream-Tag: https://gitlab.torproject.org/tpo/core/tor/-/tags/tor-0.4.8.7 Upstream-Changes: https://gitlab.torproject.org/tpo/core/tor/-/blob/tor-0.4.8.7/ChangeLog
-rw-r--r--.SRCINFO45
-rw-r--r--PKGBUILD97
-rw-r--r--tor.service32
-rw-r--r--tor.sysusers1
-rw-r--r--tor.tmpfiles1
-rw-r--r--torrc189
-rw-r--r--torrc.patch29
7 files changed, 163 insertions, 231 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7818eb818308..9425dbab0572 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,31 +1,52 @@
pkgbase = tor-unstable
pkgdesc = Anonymizing overlay network.
- pkgver = 0.4.2.4_rc
+ pkgver = 0.4.8.7
pkgrel = 1
url = http://www.torproject.org/
install = tor.install
arch = i686
arch = x86_64
arch = armv7h
- license = BSD
+ license = GPL3
makedepends = ca-certificates
- depends = libevent
+ makedepends = systemd
depends = bash
- depends = libseccomp
+ depends = libcap.so
+ depends = libcrypto.so
+ depends = libevent
+ depends = liblzma.so
+ depends = libseccomp.so
+ depends = libssl.so
+ depends = libsystemd.so
+ depends = libz.so
+ depends = libzstd.so
optdepends = torsocks: for torify
provides = tor
conflicts = tor
backup = etc/tor/torrc
- backup = etc/tor/torrc-dist
- source = https://www.torproject.org/dist/tor-0.4.2.4-rc.tar.gz
- source = https://www.torproject.org/dist/tor-0.4.2.4-rc.tar.gz.asc
- source = torrc
+ source = https://dist.torproject.org/tor-0.4.8.7.tar.gz
+ source = https://dist.torproject.org/tor-0.4.8.7.tar.gz.sha256sum
+ source = https://dist.torproject.org/tor-0.4.8.7.tar.gz.sha256sum.asc
+ source = torrc.patch
source = tor.service
+ source = tor.sysusers
+ source = tor.tmpfiles
validpgpkeys = 2133BC600AB133E1D826D173FE43009C4607B1FB
- sha256sums = a09530838c5e6316a4ad55cf9c0ae0c76f147b419c69da2f129666a8666849dc
+ validpgpkeys = B74417EDDF22AC9F9E90F49142E86A2A11F48D36
+ validpgpkeys = 1C1BC007A9F607AA8152C040BEA7B180B1491921
+ sha256sums = b20d2b9c74db28a00c07f090ee5b0241b2b684f3afdecccc6b8008931c557491
+ sha256sums = fb351aaa3cf3e3b405f0f88545e8f284ab68daeaefaafefeed259347d0ad33c4
sha256sums = SKIP
- sha256sums = 44093eaf790c6c1cad8690ee002829481fb9b22ca58663f524f5792521222406
- sha256sums = 05383ab3c9879b7d77eadeeb8e9824c471ff7a5a7501996efaa573a7547fa4da
+ sha256sums = e450b141cbe657a152d56a931ff1eb76c6b17dbe7354b3fa188d8a5043779f11
+ sha256sums = 6354475c4ee4de0c1204ccc6ae20dea8e812f83f3134ee2d665592a2cfe327e5
+ sha256sums = 04eec05b4e61efccc58c5da657363f0c1059d7f122cb15c32331a201af2d7f94
+ sha256sums = 07bedb17660a3673b31b0005b6505065c90b32f2c6b28b969241da675560f926
+ b2sums = 4d0cde752a729c64e380663e4438398fe768a8657e9aa3246bdf0ec9a4b4e01e277cb594ae0cb44cc66ea8c6080f2e58c6daf1bf01dc51b678d228e8e38fc971
+ b2sums = d52ba96072b94775ce6d5cb3e31590af5d78cb63aa5c9097ebe526addd850aae54cdd21a49822e41444144b0cb0d7709492f7c42f53873706a4b09d844ad92ce
+ b2sums = SKIP
+ b2sums = 770da249c40981c3937383f17e6e4432667868505876fd673312e669f2c46a0810aab579b654a8eed4a6ea573a0844fbe79d8145f358eb47fd7bc5dd89a32554
+ b2sums = 79d35290cd40e407d3102366d585d37e3b50b41e30b7046f8b1c6a7ee199137701b3c5c4e63f5967d6185b66d675b71157d1ef673648162921323732bb0546cf
+ b2sums = 9053da53926f2120ac57b6c1442238f5bbd89bf9270347c4e00b721b39939bebc6adfcf814a9d7289dfd14d085d91c193529305336db93190da5b7f586a031df
+ b2sums = 5d55d9a7e42b6ce78b8ab985bab37afe8f0bacddb5abd895c4a490adb8f98b9422f90b40066fef05ecf37b7b21e80aadc615c4b7f6e12b05581304113a1b1f1d
pkgname = tor-unstable
-
diff --git a/PKGBUILD b/PKGBUILD
index cd81d27f3614..926f7ab94963 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,46 +5,93 @@
# Contributor: simo <simo@archlinux.org>
pkgname=tor-unstable
-pkgver=0.4.2.4_rc
+pkgver=0.4.8.7
pkgrel=1
pkgdesc='Anonymizing overlay network.'
arch=('i686' 'x86_64' 'armv7h')
url='http://www.torproject.org/'
-license=('BSD')
-depends=('libevent' 'bash' 'libseccomp')
+license=('GPL3')
+depends=(
+ 'bash'
+ 'libcap.so'
+ 'libcrypto.so'
+ 'libevent'
+ 'liblzma.so'
+ 'libseccomp.so'
+ 'libssl.so'
+ 'libsystemd.so'
+ 'libz.so'
+ 'libzstd.so'
+)
optdepends=('torsocks: for torify')
-makedepends=('ca-certificates')
-conflicts=(tor)
-provides=(tor)
-backup=('etc/tor/torrc'
- 'etc/tor/torrc-dist')
+makedepends=('ca-certificates' 'systemd')
+conflicts=('tor')
+provides=('tor')
+backup=('etc/tor/torrc')
install='tor.install'
-source=("https://www.torproject.org/dist/${pkgname/-unstable/}-${pkgver/_/-}.tar.gz"{,.asc}
- 'torrc'
- 'tor.service')
-sha256sums=('a09530838c5e6316a4ad55cf9c0ae0c76f147b419c69da2f129666a8666849dc'
+source=("https://dist.torproject.org/tor-${pkgver/_/-}.tar.gz"{,.sha256sum{,.asc}}
+ 'torrc.patch'
+ 'tor.service'
+ 'tor.sysusers'
+ 'tor.tmpfiles')
+sha256sums=('b20d2b9c74db28a00c07f090ee5b0241b2b684f3afdecccc6b8008931c557491'
+ 'fb351aaa3cf3e3b405f0f88545e8f284ab68daeaefaafefeed259347d0ad33c4'
'SKIP'
- '44093eaf790c6c1cad8690ee002829481fb9b22ca58663f524f5792521222406'
- '05383ab3c9879b7d77eadeeb8e9824c471ff7a5a7501996efaa573a7547fa4da')
-validpgpkeys=('2133BC600AB133E1D826D173FE43009C4607B1FB')
+ 'e450b141cbe657a152d56a931ff1eb76c6b17dbe7354b3fa188d8a5043779f11'
+ '6354475c4ee4de0c1204ccc6ae20dea8e812f83f3134ee2d665592a2cfe327e5'
+ '04eec05b4e61efccc58c5da657363f0c1059d7f122cb15c32331a201af2d7f94'
+ '07bedb17660a3673b31b0005b6505065c90b32f2c6b28b969241da675560f926')
+b2sums=('4d0cde752a729c64e380663e4438398fe768a8657e9aa3246bdf0ec9a4b4e01e277cb594ae0cb44cc66ea8c6080f2e58c6daf1bf01dc51b678d228e8e38fc971'
+ 'd52ba96072b94775ce6d5cb3e31590af5d78cb63aa5c9097ebe526addd850aae54cdd21a49822e41444144b0cb0d7709492f7c42f53873706a4b09d844ad92ce'
+ 'SKIP'
+ '770da249c40981c3937383f17e6e4432667868505876fd673312e669f2c46a0810aab579b654a8eed4a6ea573a0844fbe79d8145f358eb47fd7bc5dd89a32554'
+ '79d35290cd40e407d3102366d585d37e3b50b41e30b7046f8b1c6a7ee199137701b3c5c4e63f5967d6185b66d675b71157d1ef673648162921323732bb0546cf'
+ '9053da53926f2120ac57b6c1442238f5bbd89bf9270347c4e00b721b39939bebc6adfcf814a9d7289dfd14d085d91c193529305336db93190da5b7f586a031df'
+ '5d55d9a7e42b6ce78b8ab985bab37afe8f0bacddb5abd895c4a490adb8f98b9422f90b40066fef05ecf37b7b21e80aadc615c4b7f6e12b05581304113a1b1f1d')
+validpgpkeys=(
+ '2133BC600AB133E1D826D173FE43009C4607B1FB' # Nick Mathewson
+ 'B74417EDDF22AC9F9E90F49142E86A2A11F48D36' # David Goulet
+ '1C1BC007A9F607AA8152C040BEA7B180B1491921' # Alexander Færøy
+)
+
+prepare() {
+ sha256sum -c "tor-${pkgver/_/-}.tar.gz.sha256sum"
+
+ cd "tor-${pkgver/_/-}"
+
+ patch -Np1 -i "$srcdir/torrc.patch"
+}
+
build() {
- cd "${srcdir}/${pkgname/-unstable/}-${pkgver/_/-}"
+ cd "tor-${pkgver/_/-}"
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --enable-gpl
- ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
}
-package() {
- cd "${srcdir}/${pkgname/-unstable/}-${pkgver/_/-}"
+check() {
+ cd "tor-${pkgver/_/-}"
- make DESTDIR="${pkgdir}" install
+ make check
+}
- install -dm0700 "${pkgdir}/var/lib/tor"
+package() {
+ cd "tor-${pkgver/_/-}"
- mv "${pkgdir}/etc/tor/torrc.sample" "${pkgdir}/etc/tor/torrc-dist"
- install -Dm0644 "${srcdir}/torrc" "${pkgdir}/etc/tor/torrc"
+ make DESTDIR="$pkgdir" install
+ mv "$pkgdir"/etc/tor/torrc{.sample,}
- install -Dm0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ # install arch custom files
+ install -Dm 644 "$srcdir"/*.service -t "$pkgdir"/usr/lib/systemd/system
+ install -Dm 644 "$srcdir"/tor.sysusers "$pkgdir"/usr/lib/sysusers.d/tor.conf
+ install -Dm 644 "$srcdir"/tor.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/tor.conf
- install -Dm0644 "${srcdir}/tor.service" "${pkgdir}/usr/lib/systemd/system/tor.service"
+ install -Dm 644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
+
+# vim: ts=2 sw=2 et:
diff --git a/tor.service b/tor.service
index 264a956240ea..1515b75efbd8 100644
--- a/tor.service
+++ b/tor.service
@@ -1,13 +1,35 @@
+# tor.service -- this systemd configuration file for Tor sets up a
+# relatively conservative, hardened Tor service. You may need to
+# edit it if you are making changes to your Tor configuration that it
+# does not allow. Package maintainers: this should be a starting point
+# for your tor.service; it is not the last point.
+
[Unit]
-Description=Anonymizing Overlay Network
-After=network.target
+Description=Anonymizing overlay network for TCP
+After=syslog.target network.target nss-lookup.target
[Service]
-User=tor
-Type=simple
+Type=notify
+NotifyAccess=all
+ExecStartPre=/usr/bin/tor -f /etc/tor/torrc --verify-config
ExecStart=/usr/bin/tor -f /etc/tor/torrc
+ExecReload=/bin/kill -HUP ${MAINPID}
KillSignal=SIGINT
-LimitNOFILE=8192
+TimeoutSec=60
+Restart=on-failure
+WatchdogSec=1m
+LimitNOFILE=32768
+
+# Hardening
+PrivateTmp=yes
+PrivateDevices=yes
+ProtectHome=yes
+ProtectSystem=full
+ReadOnlyDirectories=/
+ReadWriteDirectories=-/var/lib/tor
+ReadWriteDirectories=-/var/log/tor
+NoNewPrivileges=yes
+CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_NET_BIND_SERVICE CAP_DAC_READ_SEARCH CAP_KILL
[Install]
WantedBy=multi-user.target
diff --git a/tor.sysusers b/tor.sysusers
new file mode 100644
index 000000000000..1f039ff576fc
--- /dev/null
+++ b/tor.sysusers
@@ -0,0 +1 @@
+u tor 43 - /var/lib/tor
diff --git a/tor.tmpfiles b/tor.tmpfiles
new file mode 100644
index 000000000000..ed8beb4b772d
--- /dev/null
+++ b/tor.tmpfiles
@@ -0,0 +1 @@
+d /var/lib/tor 0700 tor tor - -
diff --git a/torrc b/torrc
deleted file mode 100644
index 19e05970aabb..000000000000
--- a/torrc
+++ /dev/null
@@ -1,189 +0,0 @@
-## Configuration file for a typical Tor user
-## Last updated 22 April 2012 for Tor 0.2.3.14-alpha.
-## (may or may not work for much older or much newer versions of Tor.)
-##
-## Lines that begin with "## " try to explain what's going on. Lines
-## that begin with just "#" are disabled commands: you can enable them
-## by removing the "#" symbol.
-##
-## See 'man tor', or https://www.torproject.org/docs/tor-manual.html,
-## for more options you can use in this file.
-##
-## Tor will look for this file in various places based on your platform:
-## https://www.torproject.org/docs/faq#torrc
-
-## Tor opens a socks proxy on port 9050 by default -- even if you don't
-## configure one below. Set "SocksPort 0" if you plan to run Tor only
-## as a relay, and not make any local application connections yourself.
-#SocksPort 9050 # Default: Bind to localhost:9050 for local connections.
-#SocksPort 192.168.0.1:9100 # Bind to this adddress:port too.
-
-## Entry policies to allow/deny SOCKS requests based on IP address.
-## First entry that matches wins. If no SocksPolicy is set, we accept
-## all (and only) requests that reach a SocksPort. Untrusted users who
-## can access your SocksPort may be able to learn about the connections
-## you make.
-#SocksPolicy accept 192.168.0.0/16
-#SocksPolicy reject *
-
-## Logs go to stdout at level "notice" unless redirected by something
-## else, like one of the below lines. You can have as many Log lines as
-## you want.
-##
-## We advise using "notice" in most cases, since anything more verbose
-## may provide sensitive information to an attacker who obtains the logs.
-##
-## Send all messages of level 'notice' or higher to /var/log/tor/notices.log
-#Log notice file /var/log/tor/notices.log
-## Send every possible message to /var/log/tor/debug.log
-#Log debug file /var/log/tor/debug.log
-## Use the system log instead of Tor's logfiles
-Log notice syslog
-## To send all messages to stderr:
-#Log debug stderr
-
-## Uncomment this to start the process in the background... or use
-## --runasdaemon 1 on the command line. This is ignored on Windows;
-## see the FAQ entry if you want Tor to run as an NT service.
-#RunAsDaemon 1
-
-## The directory for keeping all the keys/etc. By default, we store
-## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
-DataDirectory /var/lib/tor
-
-## The port on which Tor will listen for local connections from Tor
-## controller applications, as documented in control-spec.txt.
-#ControlPort 9051
-## If you enable the controlport, be sure to enable one of these
-## authentication methods, to prevent attackers from accessing it.
-#HashedControlPassword 16:872860B76453A77D60CA2BB8C1A7042072093276A3D701AD684053EC4C
-#CookieAuthentication 1
-
-############### This section is just for location-hidden services ###
-
-## Once you have configured a hidden service, you can look at the
-## contents of the file ".../hidden_service/hostname" for the address
-## to tell people.
-##
-## HiddenServicePort x y:z says to redirect requests on port x to the
-## address y:z.
-
-#HiddenServiceDir /var/lib/tor/hidden_service/
-#HiddenServicePort 80 127.0.0.1:80
-
-#HiddenServiceDir /var/lib/tor/other_hidden_service/
-#HiddenServicePort 80 127.0.0.1:80
-#HiddenServicePort 22 127.0.0.1:22
-
-################ This section is just for relays #####################
-#
-## See https://www.torproject.org/docs/tor-doc-relay for details.
-
-## Required: what port to advertise for incoming Tor connections.
-#ORPort 9001
-## If you want to listen on a port other than the one advertised in
-## ORPort (e.g. to advertise 443 but bind to 9090), you can do it as
-## follows. You'll need to do ipchains or other port forwarding
-## yourself to make this work.
-#ORPort 443 NoListen
-#ORPort 127.0.0.1:9090 NoAdvertise
-
-## The IP address or full DNS name for incoming connections to your
-## relay. Leave commented out and Tor will guess.
-#Address noname.example.com
-
-## If you have multiple network interfaces, you can specify one for
-## outgoing traffic to use.
-# OutboundBindAddress 10.0.0.5
-
-## A handle for your relay, so people don't have to refer to it by key.
-#Nickname ididnteditheconfig
-
-## Define these to limit how much relayed traffic you will allow. Your
-## own traffic is still unthrottled. Note that RelayBandwidthRate must
-## be at least 20 KB.
-## Note that units for these config options are bytes per second, not bits
-## per second, and that prefixes are binary prefixes, i.e. 2^10, 2^20, etc.
-#RelayBandwidthRate 100 KB # Throttle traffic to 100KB/s (800Kbps)
-#RelayBandwidthBurst 200 KB # But allow bursts up to 200KB/s (1600Kbps)
-
-## Use these to restrict the maximum traffic per day, week, or month.
-## Note that this threshold applies separately to sent and received bytes,
-## not to their sum: setting "4 GB" may allow up to 8 GB total before
-## hibernating.
-##
-## Set a maximum of 4 gigabytes each way per period.
-#AccountingMax 4 GB
-## Each period starts daily at midnight (AccountingMax is per day)
-#AccountingStart day 00:00
-## Each period starts on the 3rd of the month at 15:00 (AccountingMax
-## is per month)
-#AccountingStart month 3 15:00
-
-## Contact info to be published in the directory, so we can contact you
-## if your relay is misconfigured or something else goes wrong. Google
-## indexes this, so spammers might also collect it.
-#ContactInfo Random Person <nobody AT example dot com>
-## You might also include your PGP or GPG fingerprint if you have one:
-#ContactInfo 0xFFFFFFFF Random Person <nobody AT example dot com>
-
-## Uncomment this to mirror directory information for others. Please do
-## if you have enough bandwidth.
-#DirPort 9030 # what port to advertise for directory connections
-## If you want to listen on a port other than the one advertised in
-## DirPort (e.g. to advertise 80 but bind to 9091), you can do it as
-## follows. below too. You'll need to do ipchains or other port
-## forwarding yourself to make this work.
-#DirPort 80 NoListen
-#DirPort 127.0.0.1:9091 NoAdvertise
-## Uncomment to return an arbitrary blob of html on your DirPort. Now you
-## can explain what Tor is if anybody wonders why your IP address is
-## contacting them. See contrib/tor-exit-notice.html in Tor's source
-## distribution for a sample.
-#DirPortFrontPage /etc/tor/tor-exit-notice.html
-
-## Uncomment this if you run more than one Tor relay, and add the identity
-## key fingerprint of each Tor relay you control, even if they're on
-## different networks. You declare it here so Tor clients can avoid
-## using more than one of your relays in a single circuit. See
-## https://www.torproject.org/docs/faq#MultipleRelays
-## However, you should never include a bridge's fingerprint here, as it would
-## break its concealability and potentionally reveal its IP/TCP address.
-#MyFamily $keyid,$keyid,...
-
-## A comma-separated list of exit policies. They're considered first
-## to last, and the first match wins. If you want to _replace_
-## the default exit policy, end this with either a reject *:* or an
-## accept *:*. Otherwise, you're _augmenting_ (prepending to) the
-## default exit policy. Leave commented to just use the default, which is
-## described in the man page or at
-## https://www.torproject.org/documentation.html
-##
-## Look at https://www.torproject.org/faq-abuse.html#TypicalAbuses
-## for issues you might encounter if you use the default exit policy.
-##
-## If certain IPs and ports are blocked externally, e.g. by your firewall,
-## you should update your exit policy to reflect this -- otherwise Tor
-## users will be told that those destinations are down.
-##
-## For security, by default Tor rejects connections to private (local)
-## networks, including to your public IP address. See the man page entry
-## for ExitPolicyRejectPrivate if you want to allow "exit enclaving".
-##
-#ExitPolicy accept *:6660-6667,reject *:* # allow irc ports but no more
-#ExitPolicy accept *:119 # accept nntp as well as default exit policy
-#ExitPolicy reject *:* # no exits allowed
-
-## Bridge relays (or "bridges") are Tor relays that aren't listed in the
-## main directory. Since there is no complete public list of them, even an
-## ISP that filters connections to all the known Tor relays probably
-## won't be able to block all the bridges. Also, websites won't treat you
-## differently because they won't know you're running Tor. If you can
-## be a real relay, please do; but if not, be a bridge!
-#BridgeRelay 1
-## By default, Tor will advertise your bridge to users through various
-## mechanisms like https://bridges.torproject.org/. If you want to run
-## a private bridge, for example because you'll give out your bridge
-## address manually to your friends, uncomment this line:
-#PublishServerDescriptor 0
-
diff --git a/torrc.patch b/torrc.patch
new file mode 100644
index 000000000000..9d35ceeeabba
--- /dev/null
+++ b/torrc.patch
@@ -0,0 +1,29 @@
+--- a/src/config/torrc.sample.in
++++ b/src/config/torrc.sample.in
+@@ -11,6 +11,7 @@
+ ##
+ ## Tor will look for this file in various places based on your platform:
+ ## https://support.torproject.org/tbb/tbb-editing-torrc/
++User tor
+
+ ## Tor opens a SOCKS proxy on port 9050 by default -- even if you don't
+ ## configure one below. Set "SOCKSPort 0" if you plan to run Tor only
+@@ -39,7 +40,7 @@
+ ## Send every possible message to @LOCALSTATEDIR@/log/tor/debug.log
+ #Log debug file @LOCALSTATEDIR@/log/tor/debug.log
+ ## Use the system log instead of Tor's logfiles
+-#Log notice syslog
++Log notice syslog
+ ## To send all messages to stderr:
+ #Log debug stderr
+
+@@ -50,7 +51,7 @@
+
+ ## The directory for keeping all the keys/etc. By default, we store
+ ## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
+-#DataDirectory @LOCALSTATEDIR@/lib/tor
++DataDirectory @LOCALSTATEDIR@/lib/tor
+
+ ## The port on which Tor will listen for local connections from Tor
+ ## controller applications, as documented in control-spec.txt.
+