From 0ac26cb0fc8d37458f8ab72d7638e398dcad5534 Mon Sep 17 00:00:00 2001 From: Eric Sullivan Date: Wed, 16 Feb 2022 22:26:26 -0500 Subject: [PATCH] optional ipv6 for repo (#1661) * optional ipv6 for repo * changelog --- CHANGELOG.md | 1 + config/runtime.exs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ab2b641b..284728604 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 46372f0ac..64a6054f7 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,