From 1312d84bb2a69131707cf4ca5d5199a141d85a37 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 1 May 2026 12:29:16 -0500 Subject: [PATCH] fix(aprs): handle empty APRS_DATABASE_URL and dedupe boot warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Empty-string env var (k8s secret resolves to '') was passing the nil check and handing Postgrex an empty URL — now treated the same as unset. - Drop runtime.exs warning; keep the single warning in application.ex where the supervisor decision is made. --- config/runtime.exs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/config/runtime.exs b/config/runtime.exs index 5a0a61dd..4e2d5f0f 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -359,20 +359,18 @@ if config_env() == :prod do # Optional secondary repo for read-only access to aprs.me's database. # Used by APRS-based 144 MHz calibration tooling. When the env var is - # unset we leave the AprsRepo unconfigured; Microwaveprop.Application - # logs a warning and skips starting it, and the rest of the app boots - # normally. + # unset OR an empty string (k8s secret resolves to "") we leave the + # AprsRepo unconfigured; Microwaveprop.Application is the single site + # that logs the skip and decides not to start it. case System.get_env("APRS_DATABASE_URL") do - nil -> - Logger.warning("APRS_DATABASE_URL not set — Microwaveprop.AprsRepo will not start; APRS calibration disabled.") - - :ok - - aprs_url -> + url when is_binary(url) and url != "" -> config :microwaveprop, Microwaveprop.AprsRepo, - url: aprs_url, + url: url, pool_size: String.to_integer(System.get_env("APRS_POOL_SIZE") || "2"), socket_options: maybe_ipv6 + + _ -> + :ok end config :microwaveprop, MicrowavepropWeb.Endpoint,