subspacecommunity / subspace

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

SUBSPACE_ALLOWED_IPS env var not used in docker #79

Open mzupan opened 4 years ago

mzupan commented 4 years ago

Describe the bug There is the following section in handlers.go to set a split tunnel like vpn via allowed IPs

https://github.com/subspacecommunity/subspace/blob/master/handlers.go#L406

To Reproduce

sudo docker stop subspace
sudo docker rm subspace
docker create \
    --name subspace \
    --restart always \
    --network host \
    --cap-add NET_ADMIN \
    --volume /data:/data \
    --env SUBSPACE_IPV4_POOL="10.99.97.0/24" \
    --env SUBSPACE_IPV4_GW="10.99.97.1" \
    --env SUBSPACE_ALLOWED_IPS="10.60.0.0/18,10.20.0.0/16,10.99.97.0/24" \
    --env SUBSPACE_HTTP_INSECURE="true" \
    --env SUBSPACE_LETSENCRYPT="false" \
    subspace:test
sudo docker start subspace
sudo docker logs -f subspace

Expected behavior The allowed ips should be setup in the config

brndnmg commented 4 years ago

It works for me AllowedIPS is set to env variable when downloading the client configuration file

mzupan commented 4 years ago

I have set the env var when running docker. I even cleared the volume and restarted

root@ip-10-60-14-105:/data# docker exec -it subspace env | grep ALLOW
SUBSPACE_ALLOWED_IPS=10.60.0.0/18,10.20.0.0/16,10.99.97.0/24