diff options
author | redfish | 2020-07-17 22:14:44 -0400 |
---|---|---|
committer | redfish | 2020-07-17 22:14:44 -0400 |
commit | ee67c9fd530c42cb1b8773d0b94a8a4ea1329827 (patch) | |
tree | f28fa78ecbd02889cef50d6eec83a1d7daed1adf | |
parent | 5d21b69f10d31101a693abb2cf2a356ee2329a48 (diff) | |
download | aur-ee67c9fd530c42cb1b8773d0b94a8a4ea1329827.tar.gz |
service, no conf, patch for pet.
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 14 | ||||
-rw-r--r-- | stemns.conf | 0 | ||||
-rw-r--r-- | stemns.install | 18 | ||||
-rw-r--r-- | stemns.service | 11 | ||||
-rw-r--r-- | stream-id.patch | 29 |
7 files changed, 67 insertions, 13 deletions
@@ -10,11 +10,12 @@ pkgbase = stemns license = BSD depends = python-stem optdepends = tor: anonymizing overlay network - backup = etc/stemns.conf source = stemns-68d437491c0308545e149181768cd98e45c1ac82.tar.gz::https://github.com/namecoin/StemNS/archive/68d437491c0308545e149181768cd98e45c1ac82.tar.gz - source = stemns.conf + source = stemns.service + source = stream-id.patch sha512sums = 74fbab5a741a77ab13419620a970ce75517bbf81392bdac2fb174ab6547ae7ce624d9112d533bf1d48a8af0abb5926606f4fe2ce3ecccd551aad8d37d0324cf2 - sha512sums = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e + sha512sums = 75bc2987995aed6143a44677908f847d7537c6c1870263a92b7ac16a0c40f779391a7442c40a7815dba8f18e16e75dd2957a285e2d13076c9c93439b06294e39 + sha512sums = 28b4b4f91b290c2b8c791ba5cf7b81d5bc15327d01383d71e77c92d3f15314b5a8d49c9810c4f33c38fdea6514f1789dbb9faecc66adade62b95439d2131294b pkgname = stemns diff --git a/.gitignore b/.gitignore index 56fc6ef0acb9..145bd987a110 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.tar.gz *.pkg.tar.zst +*.pkg.tar.xz pkg/ src/ @@ -18,17 +18,23 @@ optdepends=( ) makedepends=() install=stemns.install -backup=("etc/stemns.conf") source=($pkgname-${_commit}.tar.gz::https://github.com/namecoin/StemNS/archive/${_commit}.tar.gz - stemns.conf) + stemns.service + stream-id.patch) + +prepare() { + cd $srcdir/$_name-$_commit + patch -p1 < $srcdir/stream-id.patch +} package() { + install -Dm 644 -t "$pkgdir/usr/lib/systemd/system/" stemns.service cd $srcdir/$_name-$_commit install -Dm 644 -t "$pkgdir/opt/$pkgname" *.py install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" README.md - install -Dm 644 "$srcdir"/stemns.conf "$pkgdir/etc/stemns.conf" } sha512sums=('74fbab5a741a77ab13419620a970ce75517bbf81392bdac2fb174ab6547ae7ce624d9112d533bf1d48a8af0abb5926606f4fe2ce3ecccd551aad8d37d0324cf2' - 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e') + '75bc2987995aed6143a44677908f847d7537c6c1870263a92b7ac16a0c40f779391a7442c40a7815dba8f18e16e75dd2957a285e2d13076c9c93439b06294e39' + '28b4b4f91b290c2b8c791ba5cf7b81d5bc15327d01383d71e77c92d3f15314b5a8d49c9810c4f33c38fdea6514f1789dbb9faecc66adade62b95439d2131294b') diff --git a/stemns.conf b/stemns.conf deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/stemns.conf +++ /dev/null diff --git a/stemns.install b/stemns.install index c94b267f401d..f89b7df3bc60 100644 --- a/stemns.install +++ b/stemns.install @@ -1,8 +1,14 @@ post_install() { - echo ">>> To configure Tor, add to /etc/tor/torrc :" - echo ">>> __LeaveStreamsUnattached 1" - echo ">>> Then, if you are running Tor as a service, reload it:" - echo ">>> sudo systemctl reload tor" - echo ">>> To change the Tor control port to a non-default value," - echo ">>> edit /opt/stemns/settings_port.py" + getent passwd stemns &>/dev/null || { + echo -n ">>> Creating stemns user... " + useradd --system --user-group -m --home /var/lib/stemns stemns + echo "done" + } # NOTE: we do not autoremove user due to security concerns (Arch policy) + + echo ">>> To configure Tor, add to /etc/tor/torrc :" + echo ">>> __LeaveStreamsUnattached 1" + echo ">>> Then, if you are running Tor as a service, reload it:" + echo ">>> sudo systemctl reload tor" + echo ">>> To change the Tor control port to a non-default value," + echo ">>> edit /opt/stemns/settings_port.py" } diff --git a/stemns.service b/stemns.service new file mode 100644 index 000000000000..739556941e0a --- /dev/null +++ b/stemns.service @@ -0,0 +1,11 @@ +[Unit] +Description=Name resolution service plugin for Tor + +[Service] +User=stemns +Group=stemns +ExecStart=/usr/bin/python /opt/stemns/poc.py +Restart=on-failure + +[Install] +WantedBy=default.target diff --git a/stream-id.patch b/stream-id.patch new file mode 100644 index 000000000000..6eee03812f9b --- /dev/null +++ b/stream-id.patch @@ -0,0 +1,29 @@ +--- a/ns_always_txtorcon.py 2020-04-06 01:09:10.000000000 -0400 ++++ b/ns_always_txtorcon.py 2020-07-17 21:51:59.113577894 -0400 +@@ -9,7 +9,7 @@ + line = sys.stdin.readline() + args = line.split() + if args[0] == 'RESOLVE': +- query_id, nm = args[1:] ++ query_id, nm, _ = args[1:] + print('RESOLVED {} 0 timaq4ygg2iegci7.onion'.format(query_id)) + elif args[0] == 'CANCEL': + query_id = args[1] +--- a/ns_petname.py 2020-04-06 01:09:10.000000000 -0400 ++++ b/ns_petname.py 2020-07-17 21:52:47.073582702 -0400 +@@ -1,5 +1,5 @@ + # this is a Tor Proposition 279-compliant name resolution provider +-# that sends any .onion request to txtorcon's documentation site. ++# that resolves a predefined set of .pet.onion domains. + + import sys + +@@ -17,7 +17,7 @@ + args = line.split() + + if args[0] == 'RESOLVE': +- query_id, nm = args[1:] ++ query_id, nm, _ = args[1:] + try: + new_name = pet_names[nm] + print('RESOLVED {} 0 {}'.format(query_id, new_name)) |