mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 10:18:51 +00:00
Fix DNS config not changing
This commit is contained in:
@@ -85,7 +85,7 @@
|
||||
[Interface]
|
||||
PrivateKey = <%= @device.private_key %>
|
||||
Address = <%= FzHttp.Devices.ipv4_address(@device) %>/32, <%= FzHttp.Devices.ipv6_address(@device) %>/128
|
||||
DNS = 1.1.1.1, 1.0.0.1
|
||||
DNS = <%= @device.dns_servers %>
|
||||
|
||||
[Peer]
|
||||
PublicKey = <%= @device.server_public_key %>
|
||||
|
||||
@@ -6,6 +6,8 @@ defmodule FzHttpWeb.DeviceLive.ShowTest do
|
||||
|
||||
@valid_params %{"device" => %{"name" => "new_name"}}
|
||||
@invalid_params %{"device" => %{"name" => ""}}
|
||||
@dns_servers "8.8.8.8, 8.8.4.4"
|
||||
@dns_servers_change %{"device" => %{"dns_servers" => @dns_servers}}
|
||||
|
||||
test "shows device details", %{authed_conn: conn, device: device} do
|
||||
path = Routes.device_show_path(conn, :show, device)
|
||||
@@ -37,6 +39,21 @@ defmodule FzHttpWeb.DeviceLive.ShowTest do
|
||||
assert flash["info"] == "Device updated successfully."
|
||||
end
|
||||
|
||||
test "allows dns_servers changes", %{authed_conn: conn, device: device} do
|
||||
path = Routes.device_show_path(conn, :edit, device)
|
||||
{:ok, view, _html} = live(conn, path)
|
||||
|
||||
view
|
||||
|> form("#edit-device")
|
||||
|> render_submit(@dns_servers_change)
|
||||
|
||||
flash = assert_redirected(view, Routes.device_show_path(conn, :show, device))
|
||||
assert flash["info"] == "Device updated successfully."
|
||||
|
||||
{:ok, _view, html} = live(conn, path)
|
||||
assert html =~ "DNS = #{@dns_servers}"
|
||||
end
|
||||
|
||||
test "prevents empty names", %{authed_conn: conn, device: device} do
|
||||
path = Routes.device_show_path(conn, :edit, device)
|
||||
{:ok, view, _html} = live(conn, path)
|
||||
|
||||
@@ -31,8 +31,8 @@ defmodule FzVpn.CLI.Sandbox do
|
||||
@default_returned
|
||||
end
|
||||
|
||||
def set_peer(pubkey, ip) do
|
||||
Logger.debug("`set_peer` called with #{pubkey}, #{ip}")
|
||||
def set_peer(pubkey, {ipv4, ipv6}) do
|
||||
Logger.debug("`set_peer` called with #{pubkey}, {#{ipv4}, #{ipv6}}")
|
||||
@default_returned
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user