2022-07-23 01:44:03 +02:00
|
|
|
defmodule Claper.Application do
|
|
|
|
|
# See https://hexdocs.pm/elixir/Application.html
|
|
|
|
|
# for more information on OTP Applications
|
|
|
|
|
@moduledoc false
|
|
|
|
|
|
|
|
|
|
use Application
|
|
|
|
|
|
|
|
|
|
@impl true
|
|
|
|
|
def start(_type, _args) do
|
|
|
|
|
topologies = Application.get_env(:libcluster, :topologies) || []
|
2024-08-11 11:16:34 +02:00
|
|
|
oidc_config = Application.get_env(:claper, :oidc) || []
|
2024-12-21 10:09:29 -05:00
|
|
|
Oban.Telemetry.attach_default_logger()
|
2022-07-23 01:44:03 +02:00
|
|
|
|
|
|
|
|
children = [
|
|
|
|
|
{Cluster.Supervisor, [topologies, [name: Claper.ClusterSupervisor]]},
|
|
|
|
|
# Start the Ecto repository
|
|
|
|
|
Claper.Repo,
|
|
|
|
|
# Start the Telemetry supervisor
|
|
|
|
|
ClaperWeb.Telemetry,
|
|
|
|
|
# Start the PubSub system
|
|
|
|
|
{Phoenix.PubSub, name: Claper.PubSub},
|
|
|
|
|
# Start the Endpoint (http/https)
|
|
|
|
|
ClaperWeb.Presence,
|
|
|
|
|
ClaperWeb.Endpoint,
|
|
|
|
|
# Start a worker by calling: Claper.Worker.start_link(arg)
|
|
|
|
|
# {Claper.Worker, arg}
|
|
|
|
|
{Finch, name: Swoosh.Finch},
|
2024-08-11 11:16:34 +02:00
|
|
|
{Task.Supervisor, name: Claper.TaskSupervisor},
|
|
|
|
|
{Oidcc.ProviderConfiguration.Worker,
|
2024-12-21 10:09:29 -05:00
|
|
|
%{issuer: oidc_config[:issuer], name: Claper.OidcProviderConfig}},
|
|
|
|
|
{Oban, Application.fetch_env!(:claper, Oban)}
|
2022-07-23 01:44:03 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# See https://hexdocs.pm/elixir/Supervisor.html
|
|
|
|
|
# for other strategies and supported options
|
|
|
|
|
opts = [strategy: :one_for_one, name: Claper.Supervisor]
|
|
|
|
|
|
|
|
|
|
Supervisor.start_link(children, opts)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Tell Phoenix to update the endpoint configuration
|
|
|
|
|
# whenever the application is updated.
|
|
|
|
|
@impl true
|
|
|
|
|
def config_change(changed, _new, removed) do
|
|
|
|
|
ClaperWeb.Endpoint.config_change(changed, removed)
|
|
|
|
|
:ok
|
|
|
|
|
end
|
|
|
|
|
end
|