Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

happy tcp #4245

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
happy tcp
  • Loading branch information
ruslandoga committed Jun 19, 2024
commit 9024ef041ec85f11e8c1eb2417e9429135f4d759
19 changes: 18 additions & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,18 @@ config :plausible, PlausibleWeb.Endpoint,
websocket_url: websocket_url,
secure_cookie: secure_cookie

maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: []
maybe_ipv6 =
if get_var_from_path_or_env(config_dir, "ECTO_IPV6") do
if config_env() in [:ce, :ce_dev, :ce_test] do
Logger.warning(
"ECTO_IPV6 is no longer necessary as all TCP connections now try IPv6 automatically with IPv4 fallback"
)
end

[:inet6]
else
[]
end

db_cacertfile = get_var_from_path_or_env(config_dir, "DATABASE_CACERTFILE", CAStore.file_path())

Expand Down Expand Up @@ -368,6 +379,12 @@ maybe_ch_ipv6 =
get_var_from_path_or_env(config_dir, "ECTO_CH_IPV6", "false")
|> String.to_existing_atom()

if maybe_ch_ipv6 && config_env() in [:ce, :ce_dev, :ce_test] do
Logger.warning(
"ECTO_CH_IPV6 is no longer necessary as all TCP connections now try IPv6 automatically with IPv4 fallback"
)
end

ch_cacertfile = get_var_from_path_or_env(config_dir, "CLICKHOUSE_CACERTFILE")

ch_transport_opts = [
Expand Down
1 change: 1 addition & 0 deletions lib/plausible/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ defmodule Plausible.Application do

def start(_type, _args) do
on_ee(do: Plausible.License.ensure_valid_license())
on_ce(do: :inet_db.set_tcp_module(:happy_tcp))

children = [
Plausible.Cache.Stats,
Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ defmodule Plausible.MixProject do
{:sweet_xml, "~> 0.7.4"},
{:zstream, "~> 0.6.4"},
{:con_cache, "~> 1.1.0"},
{:req, "~> 0.5.0"}
{:req, "~> 0.5.0"},
{:happy_tcp, github: "ruslandoga/happy_tcp", only: [:ce, :ce_dev, :ce_test]}
]
end

Expand Down