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

Update dependencies #210

Merged
merged 10 commits into from
Mar 4, 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
46 changes: 23 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ executors:
parameters:
erlang_version:
type: string
default: "24.3.4.5"
default: "26.2.2"
elixir_version:
type: string
default: "1.13.4"
default: "1.16.1"
env:
type: string
default: test
docker:
- image: hexpm/elixir:<< parameters.elixir_version >>-erlang-<< parameters.erlang_version >>-ubuntu-focal-20211006
- image: hexpm/elixir:<< parameters.elixir_version >>-erlang-<< parameters.erlang_version >>-ubuntu-jammy-20240125
- image: mongooseim/fcm-mock-server
- image: kamilwaz/apns-mock-server
working_directory: ~/app
Expand Down Expand Up @@ -68,7 +68,7 @@ commands:
name: Wait for APNS mock
command: dockerize -wait tcp://localhost:2197 -timeout 1m

- run: MIX_ENV=test mix do certs.dev, coveralls.circle
- run: MIX_ENV=test mix do local.rebar, certs.dev, coveralls.circle

- save_cache:
key: build-${CIRCLE_JOB}-cache-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ .Revision }}
Expand Down Expand Up @@ -127,8 +127,8 @@ jobs:
executor:
name: elixir-builder
env: dev
erlang_version: "24.3"
elixir_version: "1.13"
erlang_version: "26.2"
elixir_version: "1.16"
steps:
- checkout
- restore_cache:
Expand All @@ -145,39 +145,39 @@ jobs:
paths:
- priv

test-erlang-24_elixir-1-13:
test-erlang-26_elixir-1-16:
executor:
name: elixir-builder
env: test
erlang_version: "24.3.4.5"
elixir_version: "1.13.4"
erlang_version: "26.2.2"
elixir_version: "1.16.1"
steps:
- test

test-erlang-24_elixir-1-12:
test-erlang-26_elixir-1-15:
executor:
name: elixir-builder
env: test
erlang_version: "24.3.4.5"
elixir_version: "1.13.4"
erlang_version: "26.2.2"
elixir_version: "1.15.7"
steps:
- test

test-erlang-23_elixir-1-13:
test-erlang-25_elixir-1-16:
executor:
name: elixir-builder
env: test
erlang_version: "23.3.4.17"
elixir_version: "1.12.3"
erlang_version: "25.3.2.9"
elixir_version: "1.16.1"
steps:
- test

test-erlang-23_elixir-1-12:
test-erlang-25_elixir-1-15:
executor:
name: elixir-builder
env: test
erlang_version: "23.3.4.17"
elixir_version: "1.12.3"
erlang_version: "25.3.2.9"
elixir_version: "1.15.7"
steps:
- test

Expand Down Expand Up @@ -341,19 +341,19 @@ workflows:
requires:
- pre-build
filters: *all_tags
- test-erlang-24_elixir-1-13:
- test-erlang-26_elixir-1-16:
requires:
- pre-build
filters: *all_tags
- test-erlang-24_elixir-1-12:
- test-erlang-26_elixir-1-15:
requires:
- pre-build
filters: *all_tags
- test-erlang-23_elixir-1-13:
- test-erlang-25_elixir-1-16:
requires:
- pre-build
filters: *all_tags
- test-erlang-23_elixir-1-12:
- test-erlang-25_elixir-1-15:
requires:
- pre-build
filters: *all_tags
Expand All @@ -371,7 +371,7 @@ workflows:
requires:
- integration-tests
- build-docker-image
- test-erlang-23_elixir-1-13
- test-erlang-26_elixir-1-16
filters: *all_tags

- gh-pages-deploy:
Expand Down
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG ELIXIR_VERSION=1.13.4
ARG OTP_VERSION=24.3.4.5
ARG ELIXIR_VERSION=1.16.1
ARG OTP_VERSION=26.2.2

FROM hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-ubuntu-focal-20211006 as builder
FROM hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-ubuntu-jammy-20240125 as builder

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
git \
Expand Down Expand Up @@ -49,8 +49,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install --no-install-recomme
bash-completion \
curl \
dnsutils \
libtinfo5 \
libssl1.1 \
libssl3 \
vim && \
apt-get clean

Expand Down
16 changes: 8 additions & 8 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ config :plug, :statuses, %{

lager_formater_config = [
:date,
'T',
~c"T",
:time,
:color,
' [',
~c" [",
:severity,
'] ',
'pid=',
~c"] ",
~c"pid=",
:pid,
' ',
~c" ",
:message,
'\e[0m\r\n'
~c"\e[0m\r\n"
]

config :lager,
Expand All @@ -44,13 +44,13 @@ config :lager,
formatter_config: lager_formater_config
],
lager_file_backend: [
file: 'log/error.log',
file: ~c"log/error.log",
level: :error,
formatter: :lager_default_formatter,
formatter_config: lager_formater_config
],
lager_file_backend: [
file: 'log/console.log',
file: ~c"log/console.log",
level: :info,
formatter: :lager_default_formatter,
formatter_config: lager_formater_config
Expand Down
8 changes: 4 additions & 4 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ config :mongoose_push, :logging,
level: :error,
format: :logfmt

config :goth, endpoint: "http://fcm-mock:4001"
config :sparrow, google_auth_url: "http://localhost:4001/oauth2/v4/token"

config :mongoose_push,
fcm: [
Expand All @@ -20,7 +20,7 @@ config :mongoose_push,
appfile: "priv/fcm/token.json",
pool_size: 5,
mode: :prod,
tls_opts: []
tls_opts: [verify: :verify_none]
]
]

Expand All @@ -36,7 +36,7 @@ config :mongoose_push,
mode: :dev,
use_2197: true,
pool_size: 5,
tls_opts: []
tls_opts: [verify: :verify_none]
],
prod: [
auth: %{
Expand All @@ -48,7 +48,7 @@ config :mongoose_push,
mode: :prod,
use_2197: true,
pool_size: 5,
tls_opts: []
tls_opts: [verify: :verify_none]
]
]

Expand Down
4 changes: 3 additions & 1 deletion config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Config

config :goth, endpoint: {:system, :string, "FCM_AUTH_ENDPOINT", "https://www.googleapis.com"}
config :sparrow,
google_auth_url:
{:system, :string, "FCM_AUTH_ENDPOINT", "https://www.googleapis.com/oauth2/v4/token"}

config :mongoose_push, MongoosePushWeb.Endpoint,
https: [
Expand Down
20 changes: 11 additions & 9 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Config

config :sparrow, google_auth_url: "http://localhost:4001/oauth2/v4/token"

config :mongoose_push, :logging,
level: :error,
format: :logfmt
Expand Down Expand Up @@ -31,16 +33,16 @@ config :mongoose_push,
mode: :prod,
port: 4000,
tags: [:I, :am, :your, :father],
tls_opts: []
tls_opts: [verify: :verify_none]
],
pool2: [
appfile: "priv/fcm/token.json",
appfile: "priv/fcm/token2.json",
endpoint: "localhost",
pool_size: 3,
mode: :dev,
port: 4000,
tags: [:these, :are, :not],
tls_opts: []
tls_opts: [verify: :verify_none]
]
]

Expand All @@ -57,7 +59,7 @@ config :mongoose_push,
use_2197: true,
pool_size: 1,
default_topic: "dev_topic",
tls_opts: []
tls_opts: [verify: :verify_none]
],
prod1: [
auth: %{
Expand All @@ -69,7 +71,7 @@ config :mongoose_push,
use_2197: true,
pool_size: 2,
default_topic: "prod1_override_topic",
tls_opts: []
tls_opts: [verify: :verify_none]
],
dev2: [
auth: %{
Expand All @@ -81,7 +83,7 @@ config :mongoose_push,
mode: :dev,
use_2197: true,
pool_size: 3,
tls_opts: []
tls_opts: [verify: :verify_none]
],
prod2: [
auth: %{
Expand All @@ -93,7 +95,7 @@ config :mongoose_push,
mode: :prod,
use_2197: true,
pool_size: 4,
tls_opts: []
tls_opts: [verify: :verify_none]
],
dev3: [
auth: %{
Expand All @@ -107,7 +109,7 @@ config :mongoose_push,
use_2197: true,
pool_size: 3,
default_topic: "dev_token_topic",
tls_opts: []
tls_opts: [verify: :verify_none]
],
prod3: [
auth: %{
Expand All @@ -121,6 +123,6 @@ config :mongoose_push,
use_2197: true,
pool_size: 3,
default_topic: "prod_token_topic",
tls_opts: []
tls_opts: [verify: :verify_none]
]
]
4 changes: 2 additions & 2 deletions lib/mongoose_push.ex
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ defmodule MongoosePush do
mode = Map.get(request, :mode, :prod)
tags = Map.get(request, :tags, [])

Logger.warn("Unable to send the push notification",
Logger.warning("Unable to send the push notification",
what: :sending_notification,
result: :error,
category: category,
Expand All @@ -127,7 +127,7 @@ defmodule MongoosePush do
mode = Map.get(request, :mode, :prod)
tags = Map.get(request, :tags, [])

Logger.warn("Unable to send the push notification",
Logger.warning("Unable to send the push notification",
what: :sending_notification,
result: :error,
category: :unknown,
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoose_push/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ defmodule MongoosePush.Application do
defp ensure_tls_opts(config) do
case Application.get_env(:mongoose_push, :tls_server_cert_validation, nil) do
false ->
Keyword.put(config, :tls_opts, [])
Keyword.put(config, :tls_opts, verify: :verify_none)

_ ->
config
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoose_push/service/apns/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ defmodule MongoosePush.Service.APNS.State do
end
catch
_, reason ->
Logger.warn("Unable to find default APNS topic",
Logger.warning("Unable to find default APNS topic",
what: :default_apns_topic,
result: :error,
mode: config[:mode],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule MongoosePushWeb.HealthcheckController do
Enum.map_reduce(workers, %{connected: 0, disconnected: 0}, fn worker_info, acc ->
{_, worker_pid, _, _} = worker_info

if Sparrow.H2Worker.is_alive_connection(worker_pid) do
if Sparrow.H2Worker.alive_connection?(worker_pid) do
{worker_info, Map.update!(acc, :connected, &(&1 + 1))}
else
{worker_info, Map.update!(acc, :disconnected, &(&1 + 1))}
Expand Down
5 changes: 5 additions & 0 deletions lib/mongoose_push_web/plugs/cast_and_validate/stub_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ defmodule MongoosePushWeb.Plug.CastAndValidate.StubAdapter do
def send_resp(payload, _status, _headers, _body) do
{:ok, nil, payload}
end

@impl true
def upgrade(_payload, _protocol, _opts) do
{:error, :not_supported}
end
end
Loading