Skip to content

Commit

Permalink
bump use otp 27 add disco_log
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdotb committed Aug 27, 2024
1 parent 80874ca commit 2280d82
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 231 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
elixir 1.17.2-otp-26
erlang 26.2.5.2
elixir 1.17
erlang 27.0
nodejs 17.9.1
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
#

# dependabot: dependency-name=hexpm/elixir versioning-strategy=increase
ARG ELIXIR_VERSION=1.16.0
ARG ELIXIR_VERSION=1.17.2
# dependabot: dependency-name=erlang/otp versioning-strategy=increase
ARG OTP_VERSION=26.2.1
ARG OTP_VERSION=27.0.1
# dependabot: dependency-name=debian versioning-strategy=increase
ARG DEBIAN_VERSION=bullseye-20231009-slim
ARG DEBIAN_VERSION=bullseye-20240812-slim

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"

# separate base from build stage to test base image existence
FROM ${BUILDER_IMAGE} as base
FROM base as builder
FROM ${BUILDER_IMAGE} AS base
FROM base AS builder

# install build dependencies
RUN apt-get update -y && apt-get install -y build-essential git \
Expand Down Expand Up @@ -80,9 +80,9 @@ RUN apt-get update -y && \
# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

WORKDIR "/app"
RUN chown nobody /app
Expand All @@ -95,7 +95,7 @@ COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/lor ./

USER nobody

ENV RLIMIT_NOFILE 100000
ENV RLIMIT_NOFILE=100000
COPY limits.sh /app/limits.sh
ENTRYPOINT ["/usr/bin/tini", "-s", "-g", "--", "/app/limits.sh"]

Expand Down
48 changes: 17 additions & 31 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -258,39 +258,25 @@ if config_env() == :prod do
environment variable DISCORD_TOKEN is missing.
"""

discord_info_channel_id =
System.get_env("DISCORD_INFO_CHANNEL_ID") ||
discord_guild_id =
System.get_env("DISCORD_GUILD_ID") ||
raise """
environment variable DISCORD_INFO_CHANNEL_ID is missing.
environment variable DISCORD_GUILD_ID
"""

discord_error_channel_id =
System.get_env("DISCORD_ERROR_CHANNEL_ID") ||
raise """
environment variable DISCORD_ERROR_CHANNEL_ID is missing.
"""

config :logger,
level: :info,
backends: [
:console,
{
Lor.Discord.Logger,
:discord_logger
}
]

config :lor, Lor.Discord.Client, token: discord_token

config :logger, :discord_logger,
channel_info: discord_info_channel_id,
channel_error: discord_error_channel_id,
level: :info,
info_format: "`$time $message`",
error_format: """
`$time $metadata[module] $metadata[function] $metadata[file]:$metadata[line]`
$message
""",
metadata: [:application, :module, :function, :file, :line]
config :disco_log,
otp_app: :lor,
token: discord_token,
guild_id: discord_guild_id,
category_id: "1278017079970238465",
occurrences_channel_id: "1278017081471668295",
occurrences_channel_tags: %{
"plug" => "1278017081471668296",
"live_view" => "1278017081471668297",
"oban" => "1278017081471668298"
},
info_channel_id: "1278017082377900094",
error_channel_id: "1278017083757822036",
metatada: [:extra]
end
end
2 changes: 0 additions & 2 deletions lib/lor/discord.ex

This file was deleted.

41 changes: 0 additions & 41 deletions lib/lor/discord/client.ex

This file was deleted.

145 changes: 0 additions & 145 deletions lib/lor/discord/logger.ex

This file was deleted.

2 changes: 1 addition & 1 deletion lib/lor/lol/api/ddragon/warmer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule Lor.Lol.Ddragon.Warmer do

@impl true
def init(_opts) do
Logger.info("Start Ddragon Warmer")
Logger.debug("Start Ddragon Warmer")

send(self(), :cache)
{:ok, [], {:continue, :start}}
Expand Down
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ defmodule Lor.MixProject do
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.1"},
{:tesla, "~> 1.11"},
{:disco_log, github: "mrdotb/disco-log"},
{:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
{:exvcr, "~> 0.11", only: :test},
{:phoenix_live_reload, "~> 1.5.3", only: :dev},
Expand Down
2 changes: 2 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"},
"db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"},
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
"disco_log": {:git, "https://github.com/mrdotb/disco-log.git", "bd45b36d037ce9d0a060015746472192ab2020b6", []},
"dns_cluster": {:hex, :dns_cluster, "0.1.1", "73b4b2c3ec692f8a64276c43f8c929733a9ab9ac48c34e4c0b3d9d1b5cd69155", [:mix], [], "hexpm", "03a3f6ff16dcbb53e219b99c7af6aab29eb6b88acf80164b4bd76ac18dc890b3"},
"earmark": {:hex, :earmark, "1.4.47", "7e7596b84fe4ebeb8751e14cbaeaf4d7a0237708f2ce43630cfd9065551f94ca", [:mix], [], "hexpm", "3e96bebea2c2d95f3b346a7ff22285bc68a99fbabdad9b655aa9c6be06c698f8"},
"ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"},
Expand Down Expand Up @@ -82,6 +83,7 @@
"postgrex": {:hex, :postgrex, "0.18.0", "f34664101eaca11ff24481ed4c378492fed2ff416cd9b06c399e90f321867d7e", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a042989ba1bc1cca7383ebb9e461398e3f89f868c92ce6671feb7ef132a252d1"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"reactor": {:hex, :reactor, "0.9.0", "f48af9f300454b979a22d5a04b18b59e16959478ffa7f88d50b5e142b5d055dc", [:mix], [{:igniter, "~> 0.2", [hex: :igniter, repo: "hexpm", optional: false]}, {:iterex, "~> 0.1", [hex: :iterex, repo: "hexpm", optional: false]}, {:libgraph, "~> 0.16", [hex: :libgraph, repo: "hexpm", optional: false]}, {:spark, "~> 2.0", [hex: :spark, repo: "hexpm", optional: false]}, {:splode, "~> 0.2", [hex: :splode, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.2", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4c5ffd700ac669d0992a9e296978abe2110670b23addc0970fca9108d506489c"},
"req": {:hex, :req, "0.5.6", "8fe1eead4a085510fe3d51ad854ca8f20a622aae46e97b302f499dfb84f726ac", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.17", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 2.0.6 or ~> 2.1", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "cfaa8e720945d46654853de39d368f40362c2641c4b2153c886418914b372185"},
"rewrite": {:hex, :rewrite, "0.10.5", "6afadeae0b9d843b27ac6225e88e165884875e0aed333ef4ad3bf36f9c101bed", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.0", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "51cc347a4269ad3a1e7a2c4122dbac9198302b082f5615964358b4635ebf3d4f"},
"simple_sat": {:hex, :simple_sat, "0.1.3", "f650fc3c184a5fe741868b5ac56dc77fdbb428468f6dbf1978e14d0334497578", [:mix], [], "hexpm", "a54305066a356b7194dc81db2a89232bacdc0b3edaef68ed9aba28dcbc34887b"},
"sleeplocks": {:hex, :sleeplocks, "1.1.2", "d45aa1c5513da48c888715e3381211c859af34bee9b8290490e10c90bb6ff0ca", [:rebar3], [], "hexpm", "9fe5d048c5b781d6305c1a3a0f40bb3dfc06f49bf40571f3d2d0c57eaa7f59a5"},
Expand Down

0 comments on commit 2280d82

Please sign in to comment.