diff --git a/.tool-versions b/.tool-versions index 4624a3f38..6cee0bf9f 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,7 +1,7 @@ # These are used for the dev environment. # This should match the versions used in the built product. nodejs 20.14.0 -elixir 1.17.2-otp-27 +elixir 1.18.2-otp-27 erlang 27.2.1 terraform 1.10.4 diff --git a/elixir/Dockerfile b/elixir/Dockerfile index a539ae9d5..e7a9a042c 100644 --- a/elixir/Dockerfile +++ b/elixir/Dockerfile @@ -1,8 +1,8 @@ ARG ALPINE_VERSION="3.20.5" ARG ERLANG_VERSION="27.2.1" ARG ERLANG_DOWNLOAD_SHA256="07982134e10637dde57cf9cdc6dda6f65425810229986136d184766d4db9eda3" -ARG ELIXIR_VERSION="1.17.2" -ARG ELIXIR_DOWNLOAD_SHA256="7bb8e6414b77c1707f39f620a2ad54f68d64846d663ec78069536854247fb1ab" +ARG ELIXIR_VERSION="1.18.2" +ARG ELIXIR_DOWNLOAD_SHA256="efc8d0660b56dd3f0c7536725a95f4d8b6be9f11ca9779d824ad79377753e916" FROM alpine:${ALPINE_VERSION} AS base diff --git a/elixir/apps/domain/lib/domain/accounts/config.ex b/elixir/apps/domain/lib/domain/accounts/config.ex index 3fc038d27..751b69cf7 100644 --- a/elixir/apps/domain/lib/domain/accounts/config.ex +++ b/elixir/apps/domain/lib/domain/accounts/config.ex @@ -3,7 +3,9 @@ defmodule Domain.Accounts.Config do @primary_key false embedded_schema do - embeds_many :clients_upstream_dns, ClientsUpstreamDNS, primary_key: false, on_replace: :delete do + embeds_many :clients_upstream_dns, ClientsUpstreamDNS, + primary_key: false, + on_replace: :delete do field :protocol, Ecto.Enum, values: [:ip_port, :dns_over_tls, :dns_over_http] field :address, :string end diff --git a/elixir/apps/domain/lib/domain/config/resolver.ex b/elixir/apps/domain/lib/domain/config/resolver.ex index 2e20d7bbd..f5a9d21ec 100644 --- a/elixir/apps/domain/lib/domain/config/resolver.ex +++ b/elixir/apps/domain/lib/domain/config/resolver.ex @@ -19,20 +19,19 @@ defmodule Domain.Config.Resolver do end end - @dialyzer {:nowarn_function, fetch_process_env: 1, resolve_process_env_value: 1} - defp resolve_process_env_value(key) do - pdict_key = {__MODULE__, key} - - case fetch_process_env(pdict_key) do - {:ok, {:env, value}} -> - {:ok, {{:env, env_key(key)}, value}} - - :error -> - :error - end - end - if Mix.env() == :test do + defp resolve_process_env_value(key) do + pdict_key = {__MODULE__, key} + + case fetch_process_env(pdict_key) do + {:ok, {:env, value}} -> + {:ok, {{:env, key}, value}} + + :error -> + :error + end + end + def fetch_process_env(pdict_key) do with :error <- fetch_process_value(pdict_key), :error <- fetch_process_value(Process.get(:last_caller_pid), pdict_key), @@ -74,7 +73,7 @@ defmodule Domain.Config.Resolver do end end else - def fetch_process_env(_pdict_key), do: :error + defp resolve_process_env_value(_key), do: :error end defp resolve_env_value(env_configurations, key, opts) do diff --git a/elixir/apps/domain/lib/domain/types/cidr.ex b/elixir/apps/domain/lib/domain/types/cidr.ex index 6d0d0e559..23034c823 100644 --- a/elixir/apps/domain/lib/domain/types/cidr.ex +++ b/elixir/apps/domain/lib/domain/types/cidr.ex @@ -58,7 +58,7 @@ defmodule Domain.Types.CIDR do end defp reset_right_bits(number, shift) do - number >>> shift <<< shift + (number >>> shift) <<< shift end defp fill_right_bits(number, shift) do diff --git a/elixir/apps/domain/test/domain/policies/condition/evaluator_test.exs b/elixir/apps/domain/test/domain/policies/condition/evaluator_test.exs index 6ce404826..10ce9aaad 100644 --- a/elixir/apps/domain/test/domain/policies/condition/evaluator_test.exs +++ b/elixir/apps/domain/test/domain/policies/condition/evaluator_test.exs @@ -490,7 +490,10 @@ defmodule Domain.Policies.Condition.EvaluatorTest do assert parse_days_of_week_time_ranges(["M/true/UTC"]) == {:ok, %{"M" => [{~T[00:00:00], ~T[23:59:59], "UTC"}]}} - assert parse_days_of_week_time_ranges(["M/true/UTC", "W/19:00:00-22:00:00,22-23/US/Pacific"]) == + assert parse_days_of_week_time_ranges([ + "M/true/UTC", + "W/19:00:00-22:00:00,22-23/US/Pacific" + ]) == {:ok, %{ "M" => [ diff --git a/elixir/apps/web/lib/web/live/groups/edit_actors.ex b/elixir/apps/web/lib/web/live/groups/edit_actors.ex index 20da00b29..186e3c5f5 100644 --- a/elixir/apps/web/lib/web/live/groups/edit_actors.ex +++ b/elixir/apps/web/lib/web/live/groups/edit_actors.ex @@ -143,7 +143,7 @@ defmodule Web.Groups.EditActors do
<.button_with_confirmation id="save_changes" - style={(@added == %{} and @removed == %{} && "disabled") || "primary"} + style={((@added == %{} and @removed == %{}) && "disabled") || "primary"} confirm_style="primary" class="m-4" on_confirm="submit" diff --git a/elixir/apps/web/lib/web/live/settings/billing.ex b/elixir/apps/web/lib/web/live/settings/billing.ex index 5ff3d7a95..212bf45f6 100644 --- a/elixir/apps/web/lib/web/live/settings/billing.ex +++ b/elixir/apps/web/lib/web/live/settings/billing.ex @@ -112,8 +112,8 @@ defmodule Web.Settings.Billing do <:value> @account.limits.users_count && "text-red-500" + (not is_nil(@users_count) and + @users_count > @account.limits.users_count) && "text-red-500" ]}> {@users_count} used @@ -127,8 +127,8 @@ defmodule Web.Settings.Billing do <:value> @account.limits.monthly_active_users_count && "text-red-500" + (not is_nil(@active_users_count) and + @active_users_count > @account.limits.monthly_active_users_count) && "text-red-500" ]}> {@active_users_count} used @@ -143,8 +143,8 @@ defmodule Web.Settings.Billing do <:value> @account.limits.service_accounts_count && "text-red-500" + (not is_nil(@service_accounts_count) and + @service_accounts_count > @account.limits.service_accounts_count) && "text-red-500" ]}> {@service_accounts_count} used @@ -158,8 +158,8 @@ defmodule Web.Settings.Billing do <:value> @account.limits.account_admin_users_count && "text-red-500" + (not is_nil(@admins_count) and + @admins_count > @account.limits.account_admin_users_count) && "text-red-500" ]}> {@admins_count} used @@ -173,8 +173,8 @@ defmodule Web.Settings.Billing do <:value> @account.limits.gateway_groups_count && "text-red-500" + (not is_nil(@gateway_groups_count) and + @gateway_groups_count > @account.limits.gateway_groups_count) && "text-red-500" ]}> {@gateway_groups_count} used diff --git a/elixir/apps/web/lib/web/live/settings/identity_providers/components.ex b/elixir/apps/web/lib/web/live/settings/identity_providers/components.ex index 877ba664e..bf93ff57d 100644 --- a/elixir/apps/web/lib/web/live/settings/identity_providers/components.ex +++ b/elixir/apps/web/lib/web/live/settings/identity_providers/components.ex @@ -293,7 +293,7 @@ defmodule Web.Settings.IdentityProviders.Components do ~H"""
<.ping_icon color={ - @provider.last_syncs_failed > 3 or (not is_nil(@provider.sync_disabled_at) && "danger") || + (@provider.last_syncs_failed > 3 or (not is_nil(@provider.sync_disabled_at) && "danger")) || "success" } /> diff --git a/elixir/apps/web/test/support/acceptance_case/auth.ex b/elixir/apps/web/test/support/acceptance_case/auth.ex index 4de6ba572..17680d535 100644 --- a/elixir/apps/web/test/support/acceptance_case/auth.ex +++ b/elixir/apps/web/test/support/acceptance_case/auth.ex @@ -104,7 +104,7 @@ defmodule Web.AcceptanceCase.Auth do def mock_client_sign_in_callback do test_pid = self() bypass = Bypass.open() - Domain.Config.put_env_override(:web, :client_handler, "http://localhost:#{bypass.port()}/") + Domain.Config.put_env_override(:web, :client_handler, "http://localhost:#{bypass.port}/") Bypass.expect_once(bypass, "GET", "/handle_client_sign_in_callback", fn conn -> conn = Plug.Conn.fetch_query_params(conn)