Files
firezone/elixir/apps/web/mix.exs
Brian Manifold 716623a993 feat(portal): Add IDP sync error email notifications (#6483)
This adds a feature that will email all admins in a Firezone Account
when sync errors occur with their Identity Provider.

In order to avoid spamming admins with sync error emails, the error
emails are only sent once every 24 hours. One exception to that is when
there is a successful sync the `sync_error_emailed_at` field is reset,
which means in theory if an identity provider was flip flopping between
successful and unsuccessful syncs the admins would be emailed more than
once in a 24 hours period.

### Sample Email Message
<img width="589" alt="idp-sync-error-message"
src="https://github.com/user-attachments/assets/d7128c7c-c10d-4d02-8283-059e2f1f5db5">
2024-09-18 15:29:50 +00:00

113 lines
3.2 KiB
Elixir

defmodule Web.MixProject do
use Mix.Project
def project do
{sha, _} = Code.eval_file(Path.join([__DIR__, "..", "..", "sha.exs"]))
[
app: :web,
version: "0.1.0+#{sha}",
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
]
end
def application do
[
mod: {Web.Application, []},
extra_applications: [
:logger,
:runtime_tools,
:dialyzer
]
]
end
defp elixirc_paths(:test), do: ["test/support", "lib"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
# Umbrella deps
{:domain, in_umbrella: true},
# Phoenix/Plug deps
{:phoenix, "~> 1.7.0"},
{:phoenix_html, "~> 4.0"},
{:phoenix_ecto, "~> 4.4"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 1.0.0-rc.0"},
{:plug_cowboy, "~> 2.7"},
{:gettext, "~> 0.20"},
{:remote_ip, "~> 1.0"},
# Unit conversions
{:tzdata, "~> 1.1"},
{:sizeable, "~> 1.0"},
# Asset pipeline deps
{:esbuild, "~> 0.7", runtime: Mix.env() == :dev},
{:tailwind, "~> 0.2.0", runtime: Mix.env() == :dev},
# Observability and debugging deps
{:telemetry_metrics, "~> 1.0"},
{:telemetry_poller, "~> 1.0"},
{:recon, "~> 2.5"},
{:observer_cli, "~> 1.7"},
# Observability
{:opentelemetry_telemetry, "~> 1.1.1", override: true},
{:opentelemetry_cowboy, "~> 0.3"},
{:opentelemetry_liveview, "~> 1.0.0-rc.4"},
{:opentelemetry_phoenix, "~> 1.1"},
{:nimble_options, "~> 1.0", override: true},
# Other deps
{:jason, "~> 1.2"},
{:file_size, "~> 3.0.1"},
{:nimble_csv, "~> 1.2"},
# Test deps
# TODO: use Hex after a new version of Floki is released
{:floki,
only: :test,
override: true,
github: "philss/floki",
ref: "3d5adab58a41b020a775baca82fe15c0c364daab"},
{:bypass, "~> 2.1", only: :test},
{:bureaucrat, "~> 0.2.9", only: :test},
{:wallaby, "~> 0.30.0", only: :test},
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.1", only: [:dev], runtime: false},
{:junit_formatter, "~> 3.3", only: [:test]},
{:mix_audit, "~> 2.1", only: [:dev, :test]},
{:sobelow, "~> 0.12", only: [:dev, :test]}
]
end
defp aliases do
[
setup: ["deps.get", "assets.setup", "assets.build"],
"assets.setup": [
"cmd cd assets && CI=true pnpm i",
"tailwind.install --if-missing",
"esbuild.install --if-missing"
],
"assets.build": ["tailwind web", "esbuild web"],
"assets.deploy": ["tailwind web --minify", "esbuild web --minify", "phx.digest"],
"ecto.seed": ["ecto.create", "ecto.migrate", "run ../domain/priv/repo/seeds.exs"],
"ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
"phx.server": ["ecto.create --quiet", "ecto.migrate", "phx.server"],
test: ["ecto.create --quiet", "ecto.migrate", "test"]
]
end
end