subspacecommunity / subspace

A fork of the simple WireGuard VPN server GUI community maintained
MIT License
1.8k stars 131 forks source link

Docker image ignores SUBSPACE_IPV4_POOL environment variable #97

Closed jerrac closed 4 years ago

jerrac commented 4 years ago

Describe the bug The Docker image appears to ignore the ipv4 pool environment variable.

The SUBSPACE_IPV4_POOL variable is supposed to let you set what set of ip addresses your vpn clients end up with, right?

To Reproduce Create a container based on a docker-compose file like this:

version: "3.3"
services:
  subspace:
    image: subspacecommunity/subspace:latest
    container_name: subspace
    volumes:
#      - /usr/bin/wg:/usr/bin/wg
      - /srv/subspace/data:/data
    restart: always
    environment:
      - SUBSPACE_HTTP_HOST=dynamicdnshostname
      - SUBSPACE_LETSENCRYPT=false
      - SUBSPACE_HTTP_INSECURE=true
      - SUBSPACE_HTTP_ADDR=":80"
      - SUBSPACE_NAMESERVER=192.168.1.1
      - SUBSPACE_LISTENPORT=51820
      - SUBSPACE_IPV4_POOL=192.168.11.0/24
#      - SUBSPACE_IPV6_POOL=fd00::10:97:0/64
      - SUBSPACE_IPV4_GW=192.168.11.1
#      - SUBSPACE_IPV6_GW=fd00::10:97:1
      - SUBSPACE_IPV6_NAT_ENABLED=0
    cap_add:
      - NET_ADMIN
    network_mode: "host"

Go through initial set up via the web ui.

Add a device.

Export the wg0.conf file.

Inside the conf file, the 10.99 pool is still in use.

[Interface]
PrivateKey = blah
DNS = 10.99.97.1, fd00::10:97:1
Address = 10.99.97.2/24,fd00::10:97:2/64

[Peer]
PublicKey = blah

Endpoint =dynamicdnshostname:51820
AllowedIPs = 0.0.0.0/0, ::/0

Expected behavior The ip addresses in the .conf file should be in the 192.168.11.0/24 address space.

Additional context Host: Ubuntu 18.04 VM.

# docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
subspacecommunity/subspace   latest              775877692d00        3 days ago          38.4MB
jack1902 commented 4 years ago

Relates to: #90

jack1902 commented 4 years ago

99 fixed this issue, if this is still happening for you. Please re-open this issue

jerrac commented 4 years ago

Please reopen. (Unless the docker image hasn't been updated yet, in which case let me know, and I'll try again later.)

I pulled the latest Docker image and it did not fix the problem. I see the same behavior as I described in my initial post.