towerops/lib/towerops_web/controllers/debug_controller.ex
Graham McIntire 61a06fc11c
Add firmware version tracking system
- Add firmware context module with upsert, query, and logging functions
- Add FirmwareVersionFetcherWorker to fetch MikroTik RSS daily
- Add Oban cron schedules (2 AM dev, 4 AM prod)
- Add version change detection to Discovery module
- Track firmware history with PubSub broadcasts
- All tests passing

Phase 3-5 of firmware tracking implementation complete.
Next: LiveView UI indicators.
2026-02-01 10:46:27 -06:00

31 lines
744 B
Elixir

defmodule ToweropsWeb.DebugController do
@moduledoc """
Debug endpoints for development environment only.
"""
use ToweropsWeb, :controller
@doc """
Display all request headers for debugging cloudflared visitor location headers.
Only available in development environment.
"""
def headers(conn, _params) do
# Extract all request headers
headers = Map.new(conn.req_headers)
conn
|> put_resp_content_type("application/json")
|> send_resp(
200,
Jason.encode!(
%{
headers: headers,
remote_ip: conn.remote_ip |> :inet.ntoa() |> to_string(),
request_path: conn.request_path,
method: conn.method
},
pretty: true
)
)
end
end