Initial commit: homelab dashboard

Elixir + Phoenix dashboard displaying public and internal homelab
services. Internal services are shown only when the request originates
from the local network, detected server-side via conn.remote_ip with
Traefik trusted as a proxy (RemoteIp plug).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
adyrem
2026-05-18 16:02:29 +02:00
commit f92c2247a0
47 changed files with 3874 additions and 0 deletions
@@ -0,0 +1,14 @@
defmodule HomelabDashboardWeb.ErrorHTMLTest do
use HomelabDashboardWeb.ConnCase, async: true
# Bring render_to_string/4 for testing custom views
import Phoenix.Template, only: [render_to_string: 4]
test "renders 404.html" do
assert render_to_string(HomelabDashboardWeb.ErrorHTML, "404", "html", []) == "Not Found"
end
test "renders 500.html" do
assert render_to_string(HomelabDashboardWeb.ErrorHTML, "500", "html", []) == "Internal Server Error"
end
end
@@ -0,0 +1,12 @@
defmodule HomelabDashboardWeb.ErrorJSONTest do
use HomelabDashboardWeb.ConnCase, async: true
test "renders 404" do
assert HomelabDashboardWeb.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}}
end
test "renders 500" do
assert HomelabDashboardWeb.ErrorJSON.render("500.json", %{}) ==
%{errors: %{detail: "Internal Server Error"}}
end
end
@@ -0,0 +1,8 @@
defmodule HomelabDashboardWeb.PageControllerTest do
use HomelabDashboardWeb.ConnCase
test "GET /", %{conn: conn} do
conn = get(conn, ~p"/")
assert html_response(conn, 200) =~ "Peace of mind from prototype to production"
end
end