mirror of
https://github.com/plausible/analytics.git
synced 2024-11-27 09:16:25 +03:00
HOTFIX: add domain blacklist
This commit is contained in:
parent
bd7de59a9c
commit
015dcfa051
@ -129,6 +129,11 @@ log_level =
|
||||
|> get_var_from_path_or_env("LOG_LEVEL", "warn")
|
||||
|> String.to_existing_atom()
|
||||
|
||||
domain_blacklist =
|
||||
config_dir
|
||||
|> get_var_from_path_or_env("DOMAIN_BLACKLIST", "")
|
||||
|> String.split(",")
|
||||
|
||||
is_selfhost =
|
||||
config_dir
|
||||
|> get_var_from_path_or_env("SELFHOST", "true")
|
||||
@ -174,7 +179,8 @@ config :plausible,
|
||||
site_limit: site_limit,
|
||||
site_limit_exempt: site_limit_exempt,
|
||||
is_selfhost: is_selfhost,
|
||||
custom_script_name: custom_script_name
|
||||
custom_script_name: custom_script_name,
|
||||
domain_blacklist: domain_blacklist
|
||||
|
||||
config :plausible, :selfhost,
|
||||
disable_authentication: disable_auth,
|
||||
|
@ -71,7 +71,7 @@ defmodule PlausibleWeb.Api.ExternalController do
|
||||
|
||||
ua = parse_user_agent(conn)
|
||||
|
||||
if is_bot?(ua) do
|
||||
if is_bot?(ua) || params["domain"] in Application.get_env(:plausible, :domain_blacklist) do
|
||||
:ok
|
||||
else
|
||||
uri = params["url"] && URI.parse(params["url"])
|
||||
|
Loading…
Reference in New Issue
Block a user