summaryrefslogtreecommitdiff
path: root/repo/tor
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-06-03 13:05:13 +0100
committerdavidovski <david@davidovski.xyz>2022-06-03 13:05:13 +0100
commit66c326b6d65388e9f1003715ad9675505f01f9d2 (patch)
tree40d7355cccfa3464902cf339a563e744c28a7101 /repo/tor
parentfccdaa986f67f820df2914bef851d5fed77abac8 (diff)
added porting from alpine linux
Diffstat (limited to 'repo/tor')
-rw-r--r--repo/tor/0002-disable-wildcard-escaping-test_patch2
-rw-r--r--repo/tor/tor.post-upgrade21
-rw-r--r--repo/tor/tor.pre-install5
-rw-r--r--repo/tor/tor.xibuild36
4 files changed, 46 insertions, 18 deletions
diff --git a/repo/tor/0002-disable-wildcard-escaping-test_patch b/repo/tor/0002-disable-wildcard-escaping-test_patch
index ee4f280..9cc0ff1 100644
--- a/repo/tor/0002-disable-wildcard-escaping-test_patch
+++ b/repo/tor/0002-disable-wildcard-escaping-test_patch
@@ -1,7 +1,7 @@
This will only fail on aarch64 and s390x, for some reason.
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
-@@ -4633,21 +4633,6 @@ test_util_glob(void *ptr)
+@@ -4611,21 +4611,6 @@ test_util_glob(void *ptr)
TEST("file1"PATH_SEPARATOR"*");
EXPECT_EMPTY();
diff --git a/repo/tor/tor.post-upgrade b/repo/tor/tor.post-upgrade
new file mode 100644
index 0000000..ff00aab
--- /dev/null
+++ b/repo/tor/tor.post-upgrade
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+ver_new="$1"
+ver_old="$2"
+
+if [ "$(apk version -t "$ver_old" "0.2.8.7-r0")" = "<" ]; then
+ cat 1>&2 <<-EOF
+ *
+ * Tor runscript has been updated to start tor under unprivileged user "tor"
+ * by default. If it fails to start due to permissions error, then change owner
+ * of files in the DataDirectory (default is /var/lib/tor) to the tor user:
+ * chown -R tor /var/lib/tor
+ *
+ * If you need tor to bind a privileged port (e.g. 80), then add "User tor"
+ * to /etc/tor/torrc. Tor will be started under root, but then setuid to the
+ * tor user and drop privileges.
+ *
+ EOF
+fi
+
+exit 0
diff --git a/repo/tor/tor.pre-install b/repo/tor/tor.pre-install
new file mode 100644
index 0000000..cdeb7b4
--- /dev/null
+++ b/repo/tor/tor.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+adduser -S -D -H -h /var/lib/tor -s /sbin/nologin -g tor tor 2>/dev/null
+
+exit 0
diff --git a/repo/tor/tor.xibuild b/repo/tor/tor.xibuild
index 8441516..8f3e197 100644
--- a/repo/tor/tor.xibuild
+++ b/repo/tor/tor.xibuild
@@ -3,42 +3,44 @@
NAME="tor"
DESC="Anonymous network connectivity"
-MAKEDEPS="make "
-DEPS="libcap libseccomp libevent openssl cacerts zlib xz zstd "
+MAKEDEPS=" libcap libseccomp libevent openssl1.1-compat ca-certificates zlib xz zstd"
-PKG_VER=0.4.7.7
+PKG_VER=0.4.6.10
SOURCE="https://www.torproject.org/dist/tor-$PKG_VER.tar.gz"
-ADDITIONAL="torrc.sample.patch tor.initd tor.confd"
+
+ADDITIONAL="
+0002-disable-wildcard-escaping-test_patch
+tor.confd
+tor.initd
+torrc.sample.patch
+"
prepare () {
apply_patches
}
-build () {
- ./configure \
+build() {
+ ./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
- --disable-html-manual
+ --disable-html-manual \
+ --enable-zstd
make
-
}
-package () {
- make DESTDIR="$PKG_DEST" install
- install -dm0755 -o "tor" \
+package() {
+ make DESTDIR="$PKG_DEST" install
+
+ install -dm0755 -o "$pkgusers" \
"$PKG_DEST"/var/lib/"tor" \
"$PKG_DEST"/var/log/"tor"
- install -Dm0755 "tor".initd \
+ install -Dm0755 "$BUILD_ROOT"/"tor".initd \
"$PKG_DEST"/etc/init.d/"tor"
- install -Dm0644 "tor".confd \
+ install -Dm0644 "$BUILD_ROOT"/"tor".confd \
"$PKG_DEST"/etc/conf.d/"tor"
}
-postinstall () {
- adduser -S -D -H -h /var/lib/tor -s /sbin/nologin -g tor tor 2>/dev/null
- return 0
-}