subspacecommunity / subspace

A fork of the simple WireGuard VPN server GUI community maintained

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--http-addr won't use ports >1023

benrr101 opened this issue · comments

Describe the bug
When I run subspace from the command line and specify that I'd like it to listen to http messages on ports >1023 (eg 8888), subspace will try to bind to port 80. If I try to do the same thing with a port <=1023, it will try to bind to the port I specified.

To Reproduce
Steps to reproduce the behavior:

  1. As a non-root user...
  2. Download the v1.5.0 package, extract, and build
  3. Run subspace --http-host mydomain.com --datadir ~/.subspace --http-addr :8888
  4. Receive error:
INFO[0000] Subspace version: 1.5.0 https://mydomain.com:1025/
FATA[0000] http server on port 80 failed: listen tcp :80: bind: permission denied

Expected behavior
At this stage, I expect a message to appear telling me that subspace is attempting to bind to port 8888.

Screenshots
N/A

Server
I'm building the binary to run without docker.
CentOS 7.8 x86_64
Go 1.16.6

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
My intention was to try to run subspace as a user other than root since I'm used to web servers like apache running as their own user to help isolate the process in case of hacks. This might not be possible anyways since wireguard seems to only like running as root. Nevertheless, this bug seems to preclude me from specifying a port >1023 even if I am running as root.

I'm not using root to perform this. I created an account named subspace that I intended to use, similar to apache having an apache user. So, yes, that's why I'm getting the permission denied.

But the error indicates that subspace is ignoring any ports >1023. I tried using :8888 and it failed to bind on port :80. This seems like a bug, or should at least be documented somewhere.