Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Bugfix: enable nameservers fallback when no DNS configured explicitly for SSO (#5530)
Adam Rutkowski69b180dc21cb
diff --git a/config/runtime.exs b/config/runtime.exsindex a23500b42b..2e928176e5 100644--- a/config/runtime.exs+++ b/config/runtime.exs@@ -315,9 +315,9 @@ sso_saml_adapter =sso_verification_nameservers =case get_var_from_path_or_env(config_dir, "SSO_VERIFICATION_NAMESERVERS") donil ->- []+ nil- some ->+ some when is_binary(some) ->some|> String.split(",")|> Enum.map(fn addr ->diff --git a/extra/lib/plausible/auth/sso/domain/verification.ex b/extra/lib/plausible/auth/sso/domain/verification.exindex f7f48192cc..d4996f8ef3 100644--- a/extra/lib/plausible/auth/sso/domain/verification.ex+++ b/extra/lib/plausible/auth/sso/domain/verification.ex@@ -74,12 +74,20 @@ defmodule Plausible.Auth.SSO.Domain.Verification dorecord_value = to_charlist("#{@prefix}=#{domain_identifier}")timeout = Keyword.get(opts, :timeout, 5_000)- nameservers = Keyword.get(opts, :nameservers, [])- opts = [timeout: timeout, nameservers: nameservers]+ nameservers = Keyword.get(opts, :nameservers)++ lookup_opts =+ case nameservers do+ nil ->+ [timeout: timeout]++ [_ | _] ->+ [timeout: timeout, nameservers: nameservers]+ endsso_domain|> to_charlist()- |> :inet_res.lookup(:in, :txt, opts, timeout)+ |> :inet_res.lookup(:in, :txt, lookup_opts, timeout)|> Enum.find_value(false, fn[^record_value] -> true_ -> false