Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

optional ipv6 for repo (#1661)

Eric Sullivan0ac26cb0fc8d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ab2b641b9..284728604f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
- If a session was started without a screen_size it is updated if an event with screen_size occurs
- Added `LISTEN_IP` configuration parameter plausible/analytics#1189
- The breakdown endpoint with the property query `property=event:goal` returns custom goal properties (within `props`)
+- Added IPv6 Ecto support (via the environment-variable `ECTO_IPV6`)
### Fixed
- UI fix where multi-line text in pills would not be underlined properly on small screens.
diff --git a/config/runtime.exs b/config/runtime.exs
index 46372f0ace..64a6054f70 100644
--- a/config/runtime.exs
+++ b/config/runtime.exs
@@ -207,8 +207,12 @@ config :plausible, PlausibleWeb.Endpoint,
http: [port: port, ip: listen_ip, transport_options: [max_connections: :infinity]],
secret_key_base: secret_key_base
+maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: []
+
if is_nil(db_socket_dir) do
- config :plausible, Plausible.Repo, url: db_url
+ config :plausible, Plausible.Repo,
+ url: db_url,
+ socket_options: maybe_ipv6
else
config :plausible, Plausible.Repo,
socket_dir: db_socket_dir,