fredliang44 / derper-docker

tailscale‘s selfhosted derp-server docker image
https://tailscale.com/kb/1118/custom-derp-servers/
GNU General Public License v3.0
243 stars 58 forks source link

Can't set DERP_STUN and DERP_VERIFY_CLIENTS to false #4

Closed tzhao11 closed 2 years ago

tzhao11 commented 2 years ago

derper seems to parse boolean argument solely based on whether the corresponding command line flag exists or not, regardless of its value, so passing in --stun false or --verify-clients false has no effect. We might need to stop passing these flags to derper when DERP_STUN and DERP_VERIFY_CLIENTS are not set to true.

I can't think of a clean way to do this without introducing an entrypoint script. Any ideas?

fredliang44 commented 2 years ago

thanks for your report, let me take a look.

fredliang44 commented 2 years ago

it seems derper using the "flag" package, switching to "=" seems to be working.

https://github.com/tailscale/tailscale/blob/bc537adb1a6a9794f7e74337880cc63c915d19f9/cmd/derper/derper.go#L123

image

fredliang44 commented 2 years ago

@tzhao11 I updated the command in the main branch, could you help me double check whether it works as expected now?

tzhao11 commented 2 years ago

@fredliang44 working as expected now. Thanks for the fix!