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
Temporarily disable accept_traffic_until actions (#3730)
hq158afe3376f24
diff --git a/config/runtime.exs b/config/runtime.exsindex c7925b4144..7347ea5b10 100644--- a/config/runtime.exs+++ b/config/runtime.exs@@ -527,7 +527,7 @@ base_queues = [google_analytics_imports: 1,analytics_imports: 1,domain_change_transition: 1,- check_accept_traffic_until: 1+ check_accept_traffic_until: 0]cloud_queues = [diff --git a/lib/plausible/site/gate_keeper.ex b/lib/plausible/site/gate_keeper.exindex e552f16374..48f8eced53 100644--- a/lib/plausible/site/gate_keeper.ex+++ b/lib/plausible/site/gate_keeper.ex@@ -43,17 +43,10 @@ defmodule Plausible.Site.GateKeeper doenddefp policy(domain, opts) when is_binary(domain) do- with from_cache <- Cache.get(domain, Keyword.get(opts, :cache_opts, [])),- site = %Site{owner: %{accept_traffic_until: accept_traffic_until}} <- from_cache do- if not is_nil(accept_traffic_until) and- Date.after?(Date.utc_today(), accept_traffic_until) do- :payment_required- else- check_rate_limit(site, opts)- end+ if site = Cache.get(domain, Keyword.get(opts, :cache_opts, [])) do+ check_rate_limit(site, opts)else- _ ->- @policy_for_non_existing_sites+ @policy_for_non_existing_sitesendenddiff --git a/test/plausible/ingestion/event_test.exs b/test/plausible/ingestion/event_test.exsindex 8388a4f6b9..5d82cb0305 100644--- a/test/plausible/ingestion/event_test.exs+++ b/test/plausible/ingestion/event_test.exs@@ -117,6 +117,7 @@ defmodule Plausible.Ingestion.EventTest doassert dropped.drop_reason == :dc_ipend+ @tag :skiptest "event pipeline drops events for site with accept_trafic_until in the past" doyesterday = Date.add(Date.utc_today(), -1)diff --git a/test/plausible/site/gate_keeper_test.exs b/test/plausible/site/gate_keeper_test.exsindex 13b590968e..d6372d5ff8 100644--- a/test/plausible/site/gate_keeper_test.exs+++ b/test/plausible/site/gate_keeper_test.exs@@ -14,6 +14,7 @@ defmodule Plausible.Site.GateKeeperTest doassert {:deny, :not_found} = GateKeeper.check("example.com", opts)end+ @tag :skiptest "sites with accepted_traffic_until < now are denied", %{test: test, opts: opts} dodomain = "expired.example.com"yesterday = Date.utc_today() |> Date.add(-1)