base: add tor service setup and config

the tor service provides hidden services for bitcoin and lightning.
in the latter case, both P2P and RPC/REST.

the commit also starts a new directory files. the idea is to mirror
config files layout in the target system.
dev
alex 2 years ago
parent 8be9658774
commit a605b757d0
Signed by: x1ddos
GPG Key ID: 540189B756BF5B12

@ -9,6 +9,8 @@ rootdir="$SYSUPDATES_ROOTDIR"
# base os # base os
cd "$rootdir" cd "$rootdir"
./base/voidlinux.sh || exit 1 ./base/voidlinux.sh || exit 1
cd "$rootdir"
./base/tor.sh || exit_code=$?
# nakamochi daemon and gui (ndg) # nakamochi daemon and gui (ndg)
cd "$rootdir" cd "$rootdir"

@ -0,0 +1,13 @@
#!/bin/sh
# the script installs tor and its config file from files/etc/tor/torrc.
set -e
xbps-install -y tor
conffile=etc/tor/torrc
test -f /$conffile && diff /$conffile files/$conffile
if [ $? -ne 0 ]; then
cp /$conffile /$conffile.orig
cp files/$conffile /$conffile
ln -sfT /etc/sv/tor /var/service/tor
# don't touch the service if on manual control
test ! -f /etc/sv/tor/down && sv restart tor
fi

@ -0,0 +1,19 @@
# tor daemon configuration based on
# https://gitlab.torproject.org/tpo/core/tor/-/blob/main/src/config/torrc.sample.in
#
# NOTE: this file is auto-updated by nakamochi sysupdates
# https://git.qcode.ch/nakamochi/sysupdates
User tor
Log notice syslog
DataDirectory /ssd/tor
# bitcoin P2P service over tor
HiddenServiceDir /ssd/tor/bitcoind/
HiddenServicePort 8333 127.0.0.1:8334
# lnd lightning P2P, RPC and REST over tor
HiddenServiceDir /ssd/tor/lnd/
HiddenServicePort 9735 127.0.0.1:9735
HiddenServicePort 10009 127.0.0.1:10009
HiddenServicePort 10010 127.0.0.1:10010
Loading…
Cancel
Save