mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
hotfix: reload dns config before sending it
This commit is contained in:
@@ -88,12 +88,14 @@ defmodule API.Client.Channel do
|
||||
end
|
||||
|
||||
def handle_info(:config_changed, socket) do
|
||||
account = Accounts.fetch_account_by_id!(socket.assigns.client.account_id)
|
||||
|
||||
:ok =
|
||||
push(socket, "config_changed", %{
|
||||
interface:
|
||||
Views.Interface.render(%{
|
||||
socket.assigns.client
|
||||
| account: socket.assigns.subject.account
|
||||
| account: account
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -242,10 +242,22 @@ defmodule API.Client.ChannelTest do
|
||||
|
||||
describe "handle_info/2 :config_changed" do
|
||||
test "sends updated configuration", %{
|
||||
account: account,
|
||||
client: client,
|
||||
socket: socket
|
||||
} do
|
||||
channel_pid = socket.channel_pid
|
||||
|
||||
Fixtures.Accounts.update_account(
|
||||
account,
|
||||
config: %{
|
||||
clients_upstream_dns: [
|
||||
%{protocol: "ip_port", address: "1.2.3.1"},
|
||||
%{protocol: "ip_port", address: "1.8.8.1:53"}
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
send(channel_pid, :config_changed)
|
||||
|
||||
assert_push "config_changed", %{interface: interface}
|
||||
@@ -254,8 +266,8 @@ defmodule API.Client.ChannelTest do
|
||||
ipv4: client.ipv4,
|
||||
ipv6: client.ipv6,
|
||||
upstream_dns: [
|
||||
%{protocol: :ip_port, address: "1.1.1.1:53"},
|
||||
%{protocol: :ip_port, address: "8.8.8.8:53"}
|
||||
%{protocol: :ip_port, address: "1.2.3.1:53"},
|
||||
%{protocol: :ip_port, address: "1.8.8.1:53"}
|
||||
]
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user