+
Enter your current password to make these changes.
diff --git a/apps/fz_http/lib/fz_http_web/live/account_live/show.html.heex b/apps/fz_http/lib/fz_http_web/live/account_live/show.html.heex
index ca145f4bb..1088b4ae7 100644
--- a/apps/fz_http/lib/fz_http_web/live/account_live/show.html.heex
+++ b/apps/fz_http/lib/fz_http_web/live/account_live/show.html.heex
@@ -1,11 +1,11 @@
<%= if @live_action == :edit do %>
<%= live_modal(
- FzHttpWeb.AccountLive.FormComponent,
- return_to: Routes.account_show_path(@socket, :show),
- title: "Edit Account",
- id: "user-#{@current_user.id}",
- user: @current_user,
- action: @live_action) %>
+ FzHttpWeb.AccountLive.FormComponent,
+ return_to: Routes.account_show_path(@socket, :show),
+ title: "Edit Account",
+ id: "user-#{@current_user.id}",
+ user: @current_user,
+ action: @live_action) %>
<% end %>
<%= render FzHttpWeb.SharedView, "heading.html", page_title: @page_title %>
@@ -13,44 +13,63 @@
<%= render FzHttpWeb.SharedView, "flash.html", assigns %>
-
-
-
-
+
+
+
Details
+
-
-
- <%= render FzHttpWeb.SharedView, "user_details.html", user: @current_user %>
-
-
-
-
+
+ <%= live_patch(to: Routes.account_show_path(@socket, :edit), class: "button") do %>
+
+
+
+ Change Email or Password
+ <% end %>
+
+ <%= render FzHttpWeb.SharedView, "user_details.html", user: @current_user %>
+
+
+
+
+ Active Sessions
+
+
+
+
+ Your active Firezone web sessions. Each row corresponds to an open browser
+ tab connected to Firezone.
+
+
+
+
+
+
+ Came Online
+ Last Signed In
+ Remote IP
+ User Agent
+
+
+
+
+
+
+
+
+
+
+ Danger Zone
+
+
+ <%# This is purposefully a synchronous form in order to easily clear the session %>
+ <%= form_for @changeset, Routes.user_path(@socket, :delete), [id: "delete-account", method: :delete], fn _f -> %>
+ <%= submit(class: "button is-danger", data: [confirm: "Are you sure?"]) do %>
+
+
+
+ Delete Your Account
+ <% end %>
+ <% end %>
diff --git a/apps/fz_http/lib/fz_http_web/live/connectivity_check_live/index.html.heex b/apps/fz_http/lib/fz_http_web/live/connectivity_check_live/index.html.heex
index 14a93d4db..15813f27e 100644
--- a/apps/fz_http/lib/fz_http_web/live/connectivity_check_live/index.html.heex
+++ b/apps/fz_http/lib/fz_http_web/live/connectivity_check_live/index.html.heex
@@ -3,12 +3,14 @@
<%= render FzHttpWeb.SharedView, "flash.html", assigns %>
-
+
Firezone periodically checks for WAN connectivity to the Internet and logs
the result here. This is used to determine the public IP address of this
server for populating the default endpoint field in device configurations.
+
+
diff --git a/apps/fz_http/lib/fz_http_web/live/connectivity_check_live/index_live.ex b/apps/fz_http/lib/fz_http_web/live/connectivity_check_live/index_live.ex
index e7edfe244..1f5cac6cd 100644
--- a/apps/fz_http/lib/fz_http_web/live/connectivity_check_live/index_live.ex
+++ b/apps/fz_http/lib/fz_http_web/live/connectivity_check_live/index_live.ex
@@ -11,7 +11,7 @@ defmodule FzHttpWeb.ConnectivityCheckLive.Index do
{:ok,
socket
|> assign_defaults(params, session, &load_data/2)
- |> assign(:page_title, "Connectivity Checks")}
+ |> assign(:page_title, "WAN Connectivity Checks")}
end
defp load_data(_params, socket) do
diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex b/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex
index cff620908..26017dcea 100644
--- a/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex
+++ b/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex
@@ -3,11 +3,11 @@
<%= render FzHttpWeb.SharedView, "flash.html", assigns %>
-
+
<%= render FzHttpWeb.SharedView, "devices_table.html", devices: @devices, socket: @socket %>
-
+
Add Device
diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/index_live.ex b/apps/fz_http/lib/fz_http_web/live/device_live/index_live.ex
index cc0ab0d5c..316cd87cd 100644
--- a/apps/fz_http/lib/fz_http_web/live/device_live/index_live.ex
+++ b/apps/fz_http/lib/fz_http_web/live/device_live/index_live.ex
@@ -11,7 +11,7 @@ defmodule FzHttpWeb.DeviceLive.Index do
{:ok,
socket
|> assign_defaults(params, session, &load_data/2)
- |> assign(:page_title, "All Devices")}
+ |> assign(:page_title, "Devices")}
end
def handle_event("create_device", _params, socket) do
diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex b/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex
index 93a44505d..d277e6b82 100644
--- a/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex
+++ b/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex
@@ -8,104 +8,125 @@
action: @live_action) %>
<% end %>
-<%= render FzHttpWeb.SharedView, "heading.html", page_title: @page_title %>
+<%= render FzHttpWeb.SharedView, "heading.html", page_title: "Devices -> #{@page_title}" %>
<%= render FzHttpWeb.SharedView, "flash.html", assigns %>
-
-
-
-
-
-
-
- User
- <%= link(@user.email, to: Routes.user_show_path(@socket, :show, @user)) %>
- Name
- <%= @device.name %>
-
- Interface IP
-
- <%= FzHttp.Devices.ipv4_address(@device) %>,
- <%= FzHttp.Devices.ipv6_address(@device) %>
-
-
- Allowed IPs
- <%= @allowed_ips %>
-
- DNS Servers
- <%= @dns_servers || "None" %>
-
- Endpoint
- <%= @endpoint %>
-
- Public key
- <%= @device.public_key %>
-
- Private key
- <%= @device.private_key %>
-
- Server public key
- <%= @device.server_public_key %>
-
-
-
-
-
+
+
+
Details
-
-
-
-
-
- Add the following to your WireGuard configuration file:
-
-
-[Interface]
-PrivateKey = <%= @device.private_key %>
-Address = <%= FzHttp.Devices.ipv4_address(@device) %>/32, <%= FzHttp.Devices.ipv6_address(@device) %>/128
-<%= @dns_servers %>
+
+ <%= live_patch(to: Routes.device_show_path(@socket, :edit, @device), class: "button") do %>
+
+
+
+ Edit
+ <% end %>
+
+
-[Peer]
-PublicKey = <%= @device.server_public_key %>
-AllowedIPs = <%= @allowed_ips %>
-Endpoint = <%= @endpoint %>:<%= @wireguard_port %>
-
-
- Or scan the QR code with your mobile phone:
-
-
-
-
-
-
+
+
+
+ User
+ <%= link(@user.email, to: Routes.user_show_path(@socket, :show, @user)) %>
+
+
+
+ Name
+ <%= @device.name %>
+
+
+
+ Interface IP
+
+ <%= FzHttp.Devices.ipv4_address(@device) %>,
+ <%= FzHttp.Devices.ipv6_address(@device) %>
+
+
+
+
+ Allowed IPs
+ <%= @allowed_ips %>
+
+
+
+ DNS Servers
+ <%= @dns_servers || "None" %>
+
+
+
+ Endpoint
+ <%= @endpoint %>
+
+
+
+ Public key
+ <%= @device.public_key %>
+
+
+
+ Private key
+ <%= @device.private_key %>
+
+
+
+ Server public key
+ <%= @device.server_public_key %>
+
+
+
+
+
+
+
+
+
WireGuard Configuration
+
+
+ <%= link(
+ to: Routes.device_path(@socket, :download_config, @device),
+ class: "button") do %>
+
+
+
+ Download Configuration
+ <% end %>
+
+
+
+
+
+
+
+ Generating QR code...
+
+
+
+
+ Danger Zone
+
+
+
+
+
+
+ Delete Device <%= @device.name %>
+
+
diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/show_live.ex b/apps/fz_http/lib/fz_http_web/live/device_live/show_live.ex
index 2f7ac4ef4..9ef7f0a66 100644
--- a/apps/fz_http/lib/fz_http_web/live/device_live/show_live.ex
+++ b/apps/fz_http/lib/fz_http_web/live/device_live/show_live.ex
@@ -6,19 +6,19 @@ defmodule FzHttpWeb.DeviceLive.Show do
alias FzHttp.{Devices, Users}
- @impl true
+ @impl Phoenix.LiveView
def mount(params, session, socket) do
{:ok,
socket
|> assign_defaults(params, session, &load_data/2)}
end
- @impl true
+ @impl Phoenix.LiveView
def handle_params(_params, _url, socket) do
{:noreply, socket}
end
- @impl true
+ @impl Phoenix.LiveView
def handle_event("delete_device", %{"device_id" => device_id}, socket) do
device = Devices.get_device!(device_id)
@@ -46,39 +46,18 @@ defmodule FzHttpWeb.DeviceLive.Show do
device = Devices.get_device!(id)
if device.user_id == socket.assigns.current_user.id do
- assign(
- socket,
+ socket
+ |> assign(
device: device,
user: Users.get_user!(device.user_id),
page_title: device.name,
allowed_ips: Devices.allowed_ips(device),
- dns_servers: dns_servers(device),
+ dns_servers: Devices.dns_servers(device),
endpoint: Devices.endpoint(device),
- wireguard_port: Application.fetch_env!(:fz_vpn, :wireguard_port)
+ config: Devices.as_config(device)
)
else
not_authorized(socket)
end
end
-
- defp dns_servers(device) when is_struct(device) do
- dns_servers = Devices.dns_servers(device)
-
- if dns_servers_empty?(dns_servers) do
- ""
- else
- "DNS = #{dns_servers}"
- end
- end
-
- defp dns_servers_empty?(nil), do: true
-
- defp dns_servers_empty?(dns_servers) when is_binary(dns_servers) do
- len =
- dns_servers
- |> String.trim()
- |> String.length()
-
- len == 0
- end
end
diff --git a/apps/fz_http/lib/fz_http_web/live/modal_component.ex b/apps/fz_http/lib/fz_http_web/live/modal_component.ex
index fa0489450..3c6cd5b86 100644
--- a/apps/fz_http/lib/fz_http_web/live/modal_component.ex
+++ b/apps/fz_http/lib/fz_http_web/live/modal_component.ex
@@ -6,22 +6,24 @@ defmodule FzHttpWeb.ModalComponent do
@impl true
def render(assigns) do
- ~L"""
-
-
- <%= live_component(@socket, @component, @opts) %>
+
+ <%= live_component(@component, @opts) %>