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

fix: allow IPv6 for DB_HOST #1250

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 8 additions & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ database = System.get_env("DB_NAME", "postgres")
port = System.get_env("DB_PORT", "5432")
slot_name_suffix = System.get_env("SLOT_NAME_SUFFIX")

socket_options =
case Realtime.Database.detect_ip_version(default_db_host) do
{:ok, ip_version} -> [ip_version]
{:error, reason} -> raise "Failed to detect IP version for DB_HOST: #{reason}"
end

config :realtime,
tenant_max_bytes_per_second:
System.get_env("TENANT_MAX_BYTES_PER_SECOND", "100000") |> String.to_integer(),
Expand Down Expand Up @@ -122,7 +128,8 @@ if config_env() != :test do
parameters: [
application_name: "supabase_mt_realtime"
],
after_connect: after_connect_query_args
after_connect: after_connect_query_args,
socket_options: socket_options

replica_repos = %{
Realtime.Repo.Replica.FRA => System.get_env("DB_HOST_REPLICA_FRA", default_db_host),
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Realtime.MixProject do
def project do
[
app: :realtime,
version: "2.33.69",
version: "2.33.70",
elixir: "~> 1.17.3",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down
Loading