diff --git a/.github/workflows/docker_release.yml b/.github/workflows/docker_release.yml index 0c08caa360..0ccea6cb41 100644 --- a/.github/workflows/docker_release.yml +++ b/.github/workflows/docker_release.yml @@ -37,7 +37,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 + uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 with: images: | ${{env.REGISTRY}}/eyra/${{github.event.inputs.bundle}} @@ -47,7 +47,7 @@ jobs: # type=raw,value=latest,enable={{is_default_branch}} - name: Build and push Docker image - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 + uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 with: context: core push: true diff --git a/.github/workflows/release-debian.yml b/.github/workflows/release-debian.yml index 129b0a428d..bca573269e 100644 --- a/.github/workflows/release-debian.yml +++ b/.github/workflows/release-debian.yml @@ -1,77 +1,75 @@ -name: Release - Debian +name: Release on: + push: + branches: + - master + - feature/* + workflow_dispatch: inputs: + branch: + description: "Branch to release from" + required: true + default: "feature/debian-and-upgrades-melle" bundle: description: "Bundle ID (next, self)" required: true default: "next" jobs: - tagged-release: - runs-on: ubuntu-latest - container: debian:12 + build-release: + runs-on: ubuntu-20.04 env: MIX_ENV: prod steps: - name: Checkout uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch || github.ref }} - - name: Add Debian 11 repository and install OpenSSL 1.1 - run: | - echo "deb http://deb.debian.org/debian bullseye main" | tee -a /etc/apt/sources.list.d/bullseye.list - apt update - apt install -y libssl1.1 - rm /etc/apt/sources.list.d/bullseye.list - apt update - - - name: Install Node.js + - name: Set TAG and VERSION + id: vars run: | - apt-get update - apt-get install -y curl git build-essential - curl -fsSL https://deb.nodesource.com/setup_18.x | bash - - apt-get install -y nodejs + TAG="${{ inputs.bundle || 'next' }}_$(date +%F)_${{ github.run_number }}" + echo "TAG=$TAG" >> $GITHUB_ENV + echo "VERSION=$TAG" >> $GITHUB_ENV + shell: bash - - name: Tag name - id: tag - run: echo "TAG=${{ github.event.inputs.bundle }}_$(date +%F)_${{ github.run_number }}" >> $GITHUB_ENV + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - id: setup-elixir - uses: erlef/setup-elixir@v1 + - name: Build Docker Image (dev target) with cache + uses: docker/build-push-action@v5 with: - otp-version: "25.3.2.7" - elixir-version: "1.14.0" + context: . + file: ./Dockerfile + target: dev + tags: next-platform:latest + push: false + load: true + cache-from: type=gha + cache-to: type=gha,mode=max - - name: Setup the Elixir project + - name: Run build inside Docker run: | - mix deps.get - working-directory: core - - - name: Build Frontend - run: | - ./scripts/build-frontend - working-directory: core - - - name: Build release - run: | - ./scripts/build-release - working-directory: core - env: - BUNDLE: ${{ github.event.inputs.bundle }} - VERSION: ${{ env.TAG }} + docker run --rm \ + -e MIX_ENV=$MIX_ENV \ + -e BUNDLE=${{ inputs.bundle || 'next' }} \ + -e VERSION=${{ env.VERSION }} \ + -v ${{ github.workspace }}:/app \ + next-platform:latest \ + bash -c "cd /app/core && ./scripts/build-frontend && ./scripts/build-release" - name: Archive release - run: | - tar cfj "../${{ env.TAG }}.tar.bz2" "${{ env.TAG }}" + run: tar cfj "../${{env.VERSION}}.tar.bz2" "${{env.VERSION}}" working-directory: core - - name: Publish Release - uses: softprops/action-gh-release@v2 + - uses: softprops/action-gh-release@v2 with: - tag_name: "${{ env.TAG }}" + tag_name: "${{env.VERSION}}" prerelease: false fail_on_unmatched_files: true files: | - ${{ env.TAG }}.tar.bz2 + ${{env.VERSION}}.tar.bz2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3143267d..378f237817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ ## \#7 unreleased +## \#6.2 unreleased + +* Added: AppSignal support + ## \#6.1 2024-11-19 * Fixed: Memory issues by temporary removing Sentry support diff --git a/Dockerfile b/Dockerfile index afdc82fb4b..e9f2645a69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM debian:12 +# ====================== +# Builder Stage +# ====================== +FROM debian:12 AS builder WORKDIR /root @@ -14,39 +17,29 @@ RUN apt-get update && apt-get install -y \ libncurses-dev \ && rm -rf /var/lib/apt/lists/* -RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ - locale-gen +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 -ENV LANG=en_US.UTF-8 -ENV LANGUAGE=en_US:en -ENV LC_ALL=en_US.UTF-8 +RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2 +ENV PATH="/root/.asdf/bin:/root/.asdf/shims:${PATH}" - -RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2 \ - && echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc \ - && echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc - -RUN echo "export PATH=\"$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH\"" >> ~/.bashrc - -RUN bash -c "source ~/.bashrc && \ - asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git && \ +RUN asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git && \ asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git && \ - asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git" - + asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git COPY .tool-versions /root/.tool-versions +RUN asdf install +RUN asdf reshim -RUN bash -c "source ~/.bashrc && asdf install" - -RUN echo "source ~/.bashrc" >> ~/.profile - -RUN bash -c "source ~/.bashrc && mix local.hex --force && mix local.rebar --force" +RUN mix local.hex --force && mix local.rebar --force +RUN chmod -R a+rX /root/.asdf COPY ./core /app/core WORKDIR /app/core -RUN bash -c "source ~/.bashrc && mix deps.get" +# ====================== +# Dev Stage +# ====================== +FROM builder AS dev CMD ["tail", "-f", "/dev/null"] - - diff --git a/Makefile b/Makefile index 2f91d3ac5b..f6863b871d 100644 --- a/Makefile +++ b/Makefile @@ -53,12 +53,17 @@ docs: ${MIX_PROJECTS:%=%/docs} .PHONY: FORCE +dockermigrate: + $(MAKE) dockermix cmd="ecto.migrate" -deps: - docker compose exec app cd /app/core && mix deps.get +dockerdeps: + $(MAKE) dockermix cmd="deps.get" -run: - docker compose exec app bash -c "source ~/.bashrc && mix run" +dockerrun: + $(MAKE) dockermix cmd="run" -bash: - docker compose exec app bash \ No newline at end of file +dockermix: + $(MAKE) dockerbash cmd="mix $(cmd)" + +dockerbash: + docker compose exec app bash -c "source ~/.bashrc && $(cmd)" \ No newline at end of file diff --git a/banking_proxy/mix.exs b/banking_proxy/mix.exs index d090468cac..aa71fe34cb 100644 --- a/banking_proxy/mix.exs +++ b/banking_proxy/mix.exs @@ -39,7 +39,7 @@ defmodule BankingProxy.MixProject do {:ranch, "~> 2.1"}, # Dev and test deps {:mox, "~> 1.0", only: :test}, - {:credo, "~> 1.6", only: [:dev, :test], runtime: false}, + {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, # {:exsync, "~> 0.2", only: :dev}, {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.26", only: [:dev, :test], runtime: false} diff --git a/banking_proxy/mix.lock b/banking_proxy/mix.lock index 84d42560ba..6dbf4aca7e 100644 --- a/banking_proxy/mix.lock +++ b/banking_proxy/mix.lock @@ -1,17 +1,17 @@ %{ - "bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, + "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, - "credo": {:hex, :credo, "1.6.7", "323f5734350fd23a456f2688b9430e7d517afb313fbd38671b8a4449798a7854", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "41e110bfb007f7eda7f897c10bf019ceab9a0b269ce79f015d54b0dcf4fc7dd3"}, + "credo": {:hex, :credo, "1.7.10", "6e64fe59be8da5e30a1b96273b247b5cf1cc9e336b5fd66302a64b25749ad44d", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "71fbc9a6b8be21d993deca85bf151df023a3097b01e09a2809d460348561d8cd"}, "dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"}, "earmark_parser": {:hex, :earmark_parser, "1.4.32", "fa739a0ecfa34493de19426681b23f6814573faee95dfd4b4aafe15a7b5b32c6", [:mix], [], "hexpm", "b8b0dd77d60373e77a3d7e8afa598f325e49e8663a51bcc2b88ef41838cca755"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"}, "exsync": {:hex, :exsync, "0.2.4", "5cdc824553e0f4c4bf60018a9a6bbd5d3b51f93ef8401a0d8545f93127281d03", [:mix], [{:file_system, "~> 0.2", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "f7622d8bb98abbe473aa066ae46f91afdf7a5346b8b89728404f7189d2e80896"}, - "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, + "file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"}, "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, "httpoison": {:hex, :httpoison, "1.8.2", "9eb9c63ae289296a544842ef816a85d881d4a31f518a0fec089aaa744beae290", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "2bb350d26972e30c96e2ca74a1aaf8293d61d0742ff17f01e0279fef11599921"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, - "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"}, + "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"}, diff --git a/core/assets/package-lock.json b/core/assets/package-lock.json index 790b88b3e5..deded35a6a 100644 --- a/core/assets/package-lock.json +++ b/core/assets/package-lock.json @@ -13,7 +13,7 @@ "lodash": "^4.17.21", "pdfjs-dist": "^3.11.174", "stringify": "^5.2.0", - "trix": "^2.1.4" + "trix": "^2.1.9" }, "devDependencies": { "prettier": "2.7.1", @@ -45,6 +45,12 @@ "node-pre-gyp": "bin/node-pre-gyp" } }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "optional": true + }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -266,6 +272,14 @@ "node": ">=8" } }, + "node_modules/dompurify": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.3.tgz", + "integrity": "sha512-U1U5Hzc2MO0oW3DF+G9qYN0aT7atAou4AgI0XjWz061nyBPbdxkfdhfy5uMgGn6+oLFCfn44ZGbdDqCzVmlOWA==", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -912,9 +926,12 @@ "optional": true }, "node_modules/trix": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/trix/-/trix-2.1.4.tgz", - "integrity": "sha512-f0AGnqBV8J2qW+fCtVU71JmvzjcxnO5Xbbd6Cl2KrHVRpgXKDqNGTmDmQzNHWU7T2OgtwHwvNiN+OIf3Z3KmHQ==" + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/trix/-/trix-2.1.9.tgz", + "integrity": "sha512-Hm02gmsFLjQ+gcFNUW0iwGibYpQpklBCnBUj4z5013W+q6eiZPA9d9HmeJK8jd+BMbqMq7OsVEGclrBrbl4MJw==", + "dependencies": { + "dompurify": "^3.2.0" + } }, "node_modules/uglify-js": { "version": "3.0.28", diff --git a/core/assets/package.json b/core/assets/package.json index adf042ee40..6c726c8587 100644 --- a/core/assets/package.json +++ b/core/assets/package.json @@ -11,7 +11,7 @@ "lodash": "^4.17.21", "pdfjs-dist": "^3.11.174", "stringify": "^5.2.0", - "trix": "^2.1.4" + "trix": "^2.1.9" }, "devDependencies": { "prettier": "2.7.1", diff --git a/core/bundles/next/lib/account/session_controller.ex b/core/bundles/next/lib/account/session_controller.ex index 3a936e0cd2..2402330758 100644 --- a/core/bundles/next/lib/account/session_controller.ex +++ b/core/bundles/next/lib/account/session_controller.ex @@ -1,6 +1,6 @@ defmodule Next.Account.SessionController do use CoreWeb, :controller - import CoreWeb.Gettext + use Gettext, backend: CoreWeb.Gettext alias Systems.Account diff --git a/core/bundles/next/lib/account/signin_page_builder.ex b/core/bundles/next/lib/account/signin_page_builder.ex index f3731b2c55..9eafd013f1 100644 --- a/core/bundles/next/lib/account/signin_page_builder.ex +++ b/core/bundles/next/lib/account/signin_page_builder.ex @@ -1,5 +1,5 @@ defmodule Next.Account.SigninPageBuilder do - import CoreWeb.Gettext + use Gettext, backend: CoreWeb.Gettext import Frameworks.Utility.List import Core.FeatureFlags diff --git a/core/bundles/next/lib/menu/items.ex b/core/bundles/next/lib/menu/items.ex index cc26ac090f..ab8f4da478 100644 --- a/core/bundles/next/lib/menu/items.ex +++ b/core/bundles/next/lib/menu/items.ex @@ -2,7 +2,7 @@ defmodule Next.Menu.Items do use CoreWeb, :verified_routes @behaviour CoreWeb.Menu.ItemsProvider - import CoreWeb.Gettext + use Gettext, backend: CoreWeb.Gettext @impl true def values() do diff --git a/core/bundles/next/start_pages.ex b/core/bundles/next/start_pages.ex index 77051bf1af..451e684c4a 100644 --- a/core/bundles/next/start_pages.ex +++ b/core/bundles/next/start_pages.ex @@ -16,7 +16,7 @@ defmodule Next.StartPages do defmacro __using__(_opts) do quote do - import CoreWeb.Gettext + use Gettext, backend: CoreWeb.Gettext unquote do for {id, %{domain: domain}} <- Next.StartPages.pages() do diff --git a/core/bundles/self/lib/account/session_controller.ex b/core/bundles/self/lib/account/session_controller.ex index 7f390661f9..4a30c361dd 100644 --- a/core/bundles/self/lib/account/session_controller.ex +++ b/core/bundles/self/lib/account/session_controller.ex @@ -1,6 +1,6 @@ defmodule Self.Account.SessionController do use CoreWeb, :controller - import CoreWeb.Gettext + use Gettext, backend: CoreWeb.Gettext alias Systems.Account diff --git a/core/bundles/self/lib/menu/items.ex b/core/bundles/self/lib/menu/items.ex index 1b3443aa3e..2dc3537acc 100644 --- a/core/bundles/self/lib/menu/items.ex +++ b/core/bundles/self/lib/menu/items.ex @@ -2,7 +2,7 @@ defmodule Self.Menu.Items do @behaviour CoreWeb.Menu.ItemsProvider use CoreWeb, :verified_routes - import CoreWeb.Gettext + use Gettext, backend: CoreWeb.Gettext @impl true def values() do diff --git a/core/bundles/self/start_pages.ex b/core/bundles/self/start_pages.ex index 938af1488e..54ca060a1a 100644 --- a/core/bundles/self/start_pages.ex +++ b/core/bundles/self/start_pages.ex @@ -15,7 +15,7 @@ defmodule Self.StartPages do defmacro __using__(_opts) do quote do - import CoreWeb.Gettext + use Gettext, backend: CoreWeb.Gettext unquote do for {id, %{domain: domain}} <- Self.StartPages.pages() do diff --git a/core/config/config.exs b/core/config/config.exs index 0c56fb5721..8d89b830e3 100644 --- a/core/config/config.exs +++ b/core/config/config.exs @@ -145,7 +145,7 @@ config :core, :assignment, external_panels: ~w(liss ioresearch generic) config :core, :storage, services: ~w(builtin yoda) config :core, BankingClient, - host: 'localhost', + host: "localhost", port: 5555, cacertfile: "../banking_proxy/certs/ca_certificate.pem", certfile: "../banking_proxy/certs/client_certificate.pem", diff --git a/core/config/dev.exs b/core/config/dev.exs index 8142ae2b50..aa66c7cfd1 100644 --- a/core/config/dev.exs +++ b/core/config/dev.exs @@ -18,11 +18,25 @@ config :bcrypt_elixir, :log_rounds, 1 config :logger, level: :debug # Configure your database +cacertfile = System.get_env("DB_CA_PATH") + +verify_mode = + case System.get_env("DB_TLS_VERIFY") do + "verify_peer" -> :verify_peer + "verify_none" -> :verify_none + _ -> :verify_peer + end + config :core, Core.Repo, username: "postgres", password: "postgres", database: "next_dev", hostname: "db", + ssl: [ + cacertfile: cacertfile, + verify: :verify_peer, + server_name_indication: to_charlist("db") + ], show_sensitive_data_on_connection_error: true, pool_size: 10 diff --git a/core/config/runtime.exs b/core/config/runtime.exs index 3bd2debdae..701c79acf7 100644 --- a/core/config/runtime.exs +++ b/core/config/runtime.exs @@ -83,18 +83,42 @@ if config_env() == :prod do config :core, :azure_storage_backend, sas_token: sas_token end + # DATABASE + cacertfile = System.get_env("DB_CA_PATH") + + verify_mode = + case System.get_env("DB_TLS_VERIFY") do + "verify_peer" -> :verify_peer + "verify_none" -> :verify_none + _ -> :verify_peer + end + database_url = System.get_env("DB_URL") + db_host = System.fetch_env!("DB_HOST") if database_url do - config :core, Core.Repo, url: database_url + config :core, Core.Repo, + url: database_url, + ssl: [ + cacertfile: cacertfile, + verify: verify_mode, + server_name_indication: to_charlist(db_host) + ] else config :core, Core.Repo, username: System.get_env("DB_USER"), password: System.get_env("DB_PASS"), database: System.get_env("DB_NAME"), - hostname: System.get_env("DB_HOST") + hostname: System.get_env("DB_HOST"), + ssl: [ + cacertfile: cacertfile, + verify: verify_mode, + server_name_indication: to_charlist(db_host) + ] end + # END DATABASE + config :core, GoogleSignIn, redirect_uri: "#{base_url}/google-sign-in/auth", client_id: System.get_env("GOOGLE_SIGN_IN_CLIENT_ID"), @@ -117,6 +141,15 @@ if config_env() == :prod do access_key: System.get_env("UNSPLASH_ACCESS_KEY"), app_name: System.get_env("UNSPLASH_APP_NAME") + if push_api_key = System.get_env("APPSIGNAL_PUSH_API_KEY") do + config :appsignal, :config, + otp_app: :core, + name: "Next", + env: app_domain, + push_api_key: push_api_key, + active: true + end + config :core, :storage, services: System.get_env("STORAGE_SERVICES", "builtin, yoda") diff --git a/core/frameworks/pixel/components/button.ex b/core/frameworks/pixel/components/button.ex index fc170915f0..ccc162593f 100644 --- a/core/frameworks/pixel/components/button.ex +++ b/core/frameworks/pixel/components/button.ex @@ -96,7 +96,7 @@ defmodule Frameworks.Pixel.Button do attr(:bg_color, :string, default: "bg-primary") def primary(assigns) do - Logger.warning("Deprecation notice: Use button.dynamic instead") + # FIXME: Deprecation notice: Use button.dynamic instead ~H""" @@ -118,7 +118,7 @@ defmodule Frameworks.Pixel.Button do attr(:icon, :string, default: "/images/back.svg") def back(assigns) do - Logger.warning("Deprecation notice: Use button.dynamic instead") + # FIXME: Deprecation notice: Use button.dynamic instead ~H""" @@ -144,7 +144,7 @@ defmodule Frameworks.Pixel.Button do attr(:label, :string, required: true) def delete(assigns) do - Logger.warning("Deprecation notice: Use button.dynamic instead") + # FIXME: Deprecation notice: Use button.dynamic instead ~H""" @@ -219,7 +219,7 @@ defmodule Frameworks.Pixel.Button do attr(:text_color, :string, default: "text-white") def primary_label(assigns) do - Logger.warning("Deprecation notice: Use button.dynamic instead") + # FIXME: Deprecation notice: Use button.dynamic instead ~H"""