Open eroper opened 3 years ago
I can confirm that this doesn't seem to work. The gateway and DNS server target seems okay though (wireguard server as single dns server).
I could confirm this in testing with and without docker-compose. Based on this line in "handlers.go" it looks like the actual subspace program is looking for an environment variable named "SUBSPACE_IPV4_PREF" instead of "SUBSPACE_IPV4_POOL". It worked in my tests when I set something like "SUBSPACE_IPV4_PREF=192.168.198.". You still need to keep the "SUBSPACE_IPV4_POOL" variable though, because "entrypoint.sh" sets iptables rules based on that.
The following docker-compose.yml worked fine for me:
version: "3.3"
services:
subspace:
image: subspacecommunity/subspace:latest
container_name: subspace
volumes:
- /opt/docker/subspace:/data
restart: always
environment:
- SUBSPACE_HTTP_HOST=wireguard.example.com
- SUBSPACE_LETSENCRYPT=true
- SUBSPACE_HTTP_INSECURE=false
- SUBSPACE_HTTP_ADDR=":80"
- SUBSPACE_NAMESERVERS=1.1.1.1,8.8.8.8
- SUBSPACE_LISTENPORT=51820
- SUBSPACE_IPV4_POOL=192.168.201.0/24
- SUBSPACE_IPV4_PREF=192.168.201.
- SUBSPACE_IPV4_CIDR=24
- SUBSPACE_IPV4_GW=192.168.201.1
- SUBSPACE_IPV6_NAT_ENABLED=0
cap_add:
- NET_ADMIN
network_mode: "host"
Upon further investigation, this line in "entrypoint.sh" basically sets the correct "SUBSPACE_IPV4_PREF" whenever "SUBSPACE_IPV4_GW" is left empty. So providing "SUBSPACE_IPV4_GW" basically leads to "SUBSPACE_IPV4_POOL" getting ignored in the main program, because the "SUBSPACE_IPV4_PREF" variable it expects is never set.
After providing SUBSPACE_IPV4_POOL as a docker-compose environment variable, I'm still ending up with peers defined in the default 10.99.98.3 space. Is this expected behavior?