From 84ce7a90d0f0afddbec1f4b7fc31168de53db01d Mon Sep 17 00:00:00 2001 From: sh <37271604+shumvgolove@users.noreply.github.com> Date: Sun, 18 Sep 2022 15:36:02 +0300 Subject: [PATCH] readme: add tor configuration (#524) * readme: add tor configuration * update docs Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --- README.md | 2 ++ scripts/tor/README.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 scripts/tor/README.md diff --git a/README.md b/README.md index b8f3928a8..478856615 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ You can run your SMP server as a Linux process, optionally using a service manag - Run `smp-server start` to start SMP server, or you can configure a service manager to run it as a service. +- Optionally, `smp-server` can be setup for having an onion address in `tor` network. See: [`scripts/tor`](./scripts/tor/). In this case, the server address can have both public and onion hostname pointing to the same server, to allow two people connect when only one of them is using Tor. The server address would be: `smp://@,` + See [this section](#smp-server) for more information. Run `smp-server -h` and `smp-server init -h` for explanation of commands and options. Docker diff --git a/scripts/tor/README.md b/scripts/tor/README.md new file mode 100644 index 000000000..20b0d5a7c --- /dev/null +++ b/scripts/tor/README.md @@ -0,0 +1,37 @@ +1. Install `tor` following [official guide](https://community.torproject.org/onion-services/setup/install/). + +2. Modify `/etc/tor/torrc` configuration file: + +```sh +... +# Disable anonymous mode for better connectivity +## Needed for HiddenServiceNonAnonymousMode +SOCKSPort 0 +## Needed for HiddenServiceSingleHopMode +HiddenServiceNonAnonymousMode 1 +## Flag to disable anonymous mode +## This option reduces the latency of server connection, but it makes server itself not anonymous, +## it only protects the anonymity of the users connecting to the server. +## In case your server address has both public and onion hostnames it is not anonymous anyway, +## so this is what you want. +HiddenServiceSingleHopMode 1 + +# Specify folder for smp-tor +## Folder for keys, address, etc. +HiddenServiceDir /var/lib/tor/simplex-smp/ +## Map smp port (5223) to tor +HiddenServicePort 5223 localhost:5223 +... +``` + +3. Restart `tor` system service: + +``` +sudo systemctl restart tor +``` + +4. Onion address can be obtained from following file: + +```sh +sudo cat /var/lib/tor/simplex-smp/hostname +```