Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix runtime.exs when DNS is nil #675

Merged
merged 1 commit into from
Jun 4, 2022
Merged

Conversation

conectado
Copy link
Collaborator

By using get_env instead of fetch_env when setting wireguard_dns if WIREGUARD_DNS is not set we will get nil instead of an error.

Using this, instead of the server erroring when setting:

default['firezone']['wireguard']['dns'] = nil

in /etc/firezone/firezone.rb.

The server keeps working and when creating a device now we see:

image

And the generated config is:

[Interface]
PrivateKey = dM/Ypyj/tGe6wgMFcqz/x/gFCQbRw7EljRIH+DEpJSU=
Address = 10.3.2.3/32,fd00::3:2:3/128
MTU = 1420


[Peer]
PresharedKey = Ex8+nbN/7sfYvvBMNg0hQVTNyVYkZsUfYGSIl7T1O18=
PublicKey = aTiAuuEeHlQzMle1pdrYBlXnFO2nBpFe+mko0YUbIhw=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 190.19.29.102:51820
PersistentKeepalive = 0

Note that no dns is added to the config.

This fix was tested on Ubuntu 20.04 in a production enviroment.

Fixes #670

By using `get_env` instead of `fetch_env` if WIREGUARD_DNS is not set
wireguard_dns will be nil instead of throwing an error.

Closes firezone#670
@conectado conectado requested a review from jamilbk June 3, 2022 14:32
@jamilbk jamilbk merged commit 4455b42 into firezone:master Jun 4, 2022
@jamilbk jamilbk added the kind/bug Something isn't working label Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow nil DNS server list
2 participants