From 6ce94f8b22f954e7f8531b5eb1848eb4ad56a4a4 Mon Sep 17 00:00:00 2001 From: nwittstruck Date: Fri, 15 Nov 2024 20:41:55 +0100 Subject: [PATCH 1/3] chore: upgrade elixir, otp and debian --- .github/workflows/on_push_branch__execute_ci_cd.yml | 12 ++++++------ Dockerfile | 6 +++--- mix.exs | 2 +- priv/gettext/de/LC_MESSAGES/default.po | 10 +++++----- priv/gettext/default.pot | 10 +++++----- priv/gettext/en/LC_MESSAGES/default.po | 10 +++++----- test/mindwendel/idea_test.exs | 3 ++- 7 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/on_push_branch__execute_ci_cd.yml b/.github/workflows/on_push_branch__execute_ci_cd.yml index 8e302166..492475b3 100644 --- a/.github/workflows/on_push_branch__execute_ci_cd.yml +++ b/.github/workflows/on_push_branch__execute_ci_cd.yml @@ -15,7 +15,7 @@ jobs: # Currently, this need to be synced manually with the Dockerfile. In the future, the workflow should be changed, # so that a development container is built from the Dockerfile, pushed, and then re-used in the following steps. # This would also remove the need to install cmake manually in each step: - container: hexpm/elixir:1.15.8-erlang-26.2.5-debian-bullseye-20240513-slim + container: hexpm/elixir:1.17.3-erlang-27.1.2-debian-bookworm-20241111-slim steps: # See https://github.com/actions/checkout @@ -39,7 +39,7 @@ jobs: # Containers must run in Linux based operating systems runs-on: ubuntu-latest # Docker Hub image that `container-job` executes in - container: hexpm/elixir:1.15.8-erlang-26.2.5-debian-bullseye-20240513-slim + container: hexpm/elixir:1.17.3-erlang-27.1.2-debian-bookworm-20241111-slim needs: build_deps @@ -95,7 +95,7 @@ jobs: check_mix_format: runs-on: ubuntu-latest - container: hexpm/elixir:1.15.8-erlang-26.2.5-debian-bullseye-20240513-slim + container: hexpm/elixir:1.17.3-erlang-27.1.2-debian-bookworm-20241111-slim needs: build_deps @@ -116,7 +116,7 @@ jobs: check_mix_gettext_extract_up_to_date: runs-on: ubuntu-latest - container: hexpm/elixir:1.15.8-erlang-26.2.5-debian-bullseye-20240513-slim + container: hexpm/elixir:1.17.3-erlang-27.1.2-debian-bookworm-20241111-slim needs: build_deps @@ -137,7 +137,7 @@ jobs: check_mix_sobelow: runs-on: ubuntu-latest - container: hexpm/elixir:1.15.8-erlang-26.2.5-debian-bullseye-20240513-slim + container: hexpm/elixir:1.17.3-erlang-27.1.2-debian-bookworm-20241111-slim needs: build_deps @@ -159,7 +159,7 @@ jobs: check_mix_credo: runs-on: ubuntu-latest - container: hexpm/elixir:1.15.8-erlang-26.2.5-debian-bullseye-20240513-slim + container: hexpm/elixir:1.17.3-erlang-27.1.2-debian-bookworm-20241111-slim needs: build_deps diff --git a/Dockerfile b/Dockerfile index 91d8c2f6..77c67803 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,9 @@ # - https://pkgs.org/ - resource for finding needed packages # - Ex: hexpm/elixir:1.13.1-erlang-24.2-debian-bullseye-20210902-slim # -ARG ELIXIR_VERSION=1.15.8 -ARG OTP_VERSION=26.2.5 -ARG DEBIAN_VERSION=bullseye-20240513-slim +ARG ELIXIR_VERSION=1.17.3 +ARG OTP_VERSION=27.1.2 +ARG DEBIAN_VERSION=bookworm-20241111-slim ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}" ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}" diff --git a/mix.exs b/mix.exs index f2a45514..7603dd72 100644 --- a/mix.exs +++ b/mix.exs @@ -5,7 +5,7 @@ defmodule Mindwendel.MixProject do [ app: :mindwendel, version: "0.2.9", - elixir: "~> 1.15.8", + elixir: "~> 1.17", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, aliases: aliases(), diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index 94e55ed6..6fd797a0 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -103,7 +103,7 @@ msgstr "Keine Ideen? Hier gibts Gedankenanstöße!" msgid "Idea created successfully" msgstr "Idee erstellt" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:53 +#: lib/mindwendel_web/templates/layout/root.html.heex:53 #, elixir-autogen, elixir-format msgid "New brainstorming" msgstr "Neues Brainstorming" @@ -154,7 +154,7 @@ msgstr "Sortiere nach Label" msgid "Sort by likes" msgstr "Sortiere nach Likes" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:66 +#: lib/mindwendel_web/templates/layout/root.html.heex:66 #, elixir-autogen, elixir-format msgid "Your brainstormings" msgstr "Deine Brainstormings" @@ -332,7 +332,7 @@ msgstr "Achtung: Brainstormings werden %{available_until} nach dem letzten Zugri msgid "Allow users to change the order of ideas" msgstr "Nutzern das Verschieben und Sortieren von Ideen erlauben" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:29 +#: lib/mindwendel_web/templates/layout/root.html.heex:29 #, elixir-autogen, elixir-format msgid "Back" msgstr "Zurück" @@ -558,14 +558,14 @@ msgstr "Zeige Idee" msgid "Your comment" msgstr "Kommentar" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:86 #: lib/mindwendel_web/controllers/static_page_html/home.html.heex:75 +#: lib/mindwendel_web/templates/layout/root.html.heex:86 #, elixir-autogen, elixir-format msgid "Legal Disclosure" msgstr "Impressum" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:82 #: lib/mindwendel_web/controllers/static_page_html/home.html.heex:76 +#: lib/mindwendel_web/templates/layout/root.html.heex:82 #, elixir-autogen, elixir-format msgid "Privacy" msgstr "Datenschutzerklärung" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 36aad09c..ce5580c0 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -102,7 +102,7 @@ msgstr "" msgid "Idea created successfully" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:53 +#: lib/mindwendel_web/templates/layout/root.html.heex:53 #, elixir-autogen, elixir-format msgid "New brainstorming" msgstr "" @@ -153,7 +153,7 @@ msgstr "" msgid "Sort by likes" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:66 +#: lib/mindwendel_web/templates/layout/root.html.heex:66 #, elixir-autogen, elixir-format msgid "Your brainstormings" msgstr "" @@ -331,7 +331,7 @@ msgstr "" msgid "Allow users to change the order of ideas" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:29 +#: lib/mindwendel_web/templates/layout/root.html.heex:29 #, elixir-autogen, elixir-format msgid "Back" msgstr "" @@ -557,14 +557,14 @@ msgstr "" msgid "Your comment" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:86 #: lib/mindwendel_web/controllers/static_page_html/home.html.heex:75 +#: lib/mindwendel_web/templates/layout/root.html.heex:86 #, elixir-autogen, elixir-format msgid "Legal Disclosure" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:82 #: lib/mindwendel_web/controllers/static_page_html/home.html.heex:76 +#: lib/mindwendel_web/templates/layout/root.html.heex:82 #, elixir-autogen, elixir-format msgid "Privacy" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 326202e6..a490ebf3 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -103,7 +103,7 @@ msgstr "" msgid "Idea created successfully" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:53 +#: lib/mindwendel_web/templates/layout/root.html.heex:53 #, elixir-autogen, elixir-format msgid "New brainstorming" msgstr "" @@ -154,7 +154,7 @@ msgstr "" msgid "Sort by likes" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:66 +#: lib/mindwendel_web/templates/layout/root.html.heex:66 #, elixir-autogen, elixir-format msgid "Your brainstormings" msgstr "" @@ -332,7 +332,7 @@ msgstr "" msgid "Allow users to change the order of ideas" msgstr "Allow users to change the order of ideas" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:29 +#: lib/mindwendel_web/templates/layout/root.html.heex:29 #, elixir-autogen, elixir-format msgid "Back" msgstr "" @@ -558,14 +558,14 @@ msgstr "" msgid "Your comment" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:86 #: lib/mindwendel_web/controllers/static_page_html/home.html.heex:75 +#: lib/mindwendel_web/templates/layout/root.html.heex:86 #, elixir-autogen, elixir-format msgid "Legal Disclosure" msgstr "" -#: lib/mindwendel_web/components/../templates/layout/root.html.heex:82 #: lib/mindwendel_web/controllers/static_page_html/home.html.heex:76 +#: lib/mindwendel_web/templates/layout/root.html.heex:82 #, elixir-autogen, elixir-format msgid "Privacy" msgstr "" diff --git a/test/mindwendel/idea_test.exs b/test/mindwendel/idea_test.exs index f7c4cd35..35dd05f6 100644 --- a/test/mindwendel/idea_test.exs +++ b/test/mindwendel/idea_test.exs @@ -87,8 +87,9 @@ defmodule Mindwendel.IdeaTest do end end - @tag :skip describe "#update_idea" do + @describetag :skip + setup do %{idea: Factory.insert!(:idea)} end From 37cd3e0c60f791b182525d7d8c805a9bd2760a72 Mon Sep 17 00:00:00 2001 From: nwittstruck Date: Fri, 15 Nov 2024 21:22:20 +0100 Subject: [PATCH 2/3] chore: ssl_opts are deprecated, use ssl instead --- config/runtime.exs | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/config/runtime.exs b/config/runtime.exs index b2407d85..f2fce0d1 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -48,25 +48,18 @@ if config_env() != :test do # disable on prod, because logger_json will take care of this. set to :debug for test and dev ecto_log_level = if config_env() == :prod, do: false, else: :debug - # default ssl_opts: - ssl_opts = [ - verify: :verify_peer, - depth: 3, - versions: [:"tlsv1.3"], - server_name_indication: String.to_charlist(System.get_env("DATABASE_HOST")), - customize_hostname_check: [ - match_fun: :public_key.pkix_verify_hostname_match_fun(:https) - ] - ] - # either use system certificates or specify files: - ssl_opts = - if System.get_env("DATABASE_CERT_FILE") do - Logger.info("Loading DATABASE_CERT_FILE") - ssl_opts ++ [cacertfile: System.get_env("DATABASE_CERT_FILE")] + ssl_config = + if System.get_env("DATABASE_SSL", "true") == "true" do + if System.get_env("DATABASE_CERT_FILE") do + Logger.info("Loading DATABASE_CERT_FILE") + [cacertfile: System.get_env("DATABASE_CERT_FILE")] + else + Logger.info("Loading System Certificates") + [cacerts: :public_key.cacerts_get()] + end else - Logger.info("Loading System Certificates") - ssl_opts ++ [cacerts: :public_key.cacerts_get()] + nil end config :mindwendel, Mindwendel.Repo, @@ -79,8 +72,7 @@ if config_env() != :test do url: System.get_env("DATABASE_URL"), timeout: String.to_integer(System.get_env("DATABASE_TIMEOUT", "15000")), log: ecto_log_level, - ssl: System.get_env("DATABASE_SSL", "true") == "true", - ssl_opts: ssl_opts + ssl: ssl_config secret_key_base = System.get_env("SECRET_KEY_BASE") || From 6907e8d13fbe04c23edd3c538baf1638f805d101 Mon Sep 17 00:00:00 2001 From: Jannik Streek Date: Sun, 17 Nov 2024 08:56:26 +0100 Subject: [PATCH 3/3] update buildpacks and tool file --- .tool-versions | 4 ++-- elixir_buildpack.config | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.tool-versions b/.tool-versions index ce2be6cc..078acc98 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -elixir 1.15.8-otp-26 -erlang 26.2.5 \ No newline at end of file +elixir 1.17.3-otp-27 +erlang 27.1.2 \ No newline at end of file diff --git a/elixir_buildpack.config b/elixir_buildpack.config index 0f03649f..85483878 100644 --- a/elixir_buildpack.config +++ b/elixir_buildpack.config @@ -1,3 +1,3 @@ -elixir_version=1.15.8 -erlang_version=26.2.5 +elixir_version=1.17.3 +erlang_version=27.1.2 release=false \ No newline at end of file