HelloZeroNet / HelloZeroNet/ZeroNet

[issue] Zeronet ignores tor = always if started through systemd

Open
#1,387 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
18.8k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

### Step 1: Please describe your environment

* ZeroNet version: 0.6.2 (3408)
* Operating system: Raspbian Stretch
* Web browser: Waterfox 56.1.0
* Tor status: always
* Opened port: no
* Special configuration:

### Step 2: Describe the problem:
If I start zeronet by a systemd unit on bootup, it doesn't connect to Tor.

#### Steps to reproduce:

1. create a zeronet.service file at /lib/systemd/system/
2. put in this
```
[Unit]
Description=Zeronet daemon
Wants=tor.service
After=network.target tor.service

[Service]
EnvironmentFile=/home/pi/ZeroNet-master/zeronet.conf
ExecStart=/home/pi/ZeroNet-master/zeronet.py --tor always
User=
TimeoutStopSec=30min

[Install]
WantedBy=multi-user.target
```

3. execute
```
sudo systemctl daemon-reload
sudo systemctl enable zeronet.service
sudo reboot
```

#### Observed Results:

It displays this
![grafik](https://user-images.githubusercontent.com/30392780/38772669-b5652842-403c-11e8-897a-9e85d4d6c8c9.png)
error message in the top right corner but it's working fine. It just connects to the zeronet without tor and. The errorlog states:
```
[2018-04-14 15:57:15,386] WARNING TorManager Tor controller connect error: error: [Errno 111] Connection refused in TorManager.py line 170 > _socket2.py line 228
[2018-04-14 15:57:15,386] INFO TorManager Starting self-bundled Tor, due to Tor proxy port 127.0.0.1:9050 check error: No connection
```

#### Expected Results:

Zeronet shouldn't establish any connection when Tor isn't reachable and should try to reconnect to Tor if it wasn't available during the initialization.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with TorManager.py around line 170 and the zeronet.py startup path invoked by the systemd unit. Reproduce the boot-time failure with the supplied service configuration, then trace Tor availability handling. Done means ZeroNet does not fall back to a non-Tor connection when Tor is unavailable and retries once Tor becomes reachable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.