1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Application do
10 @version Mix.Project.config()[:version]
12 def version, do: @version
13 def named_version(), do: @name <> " " <> @version
16 info = "#{Pleroma.Web.base_url()} <#{Pleroma.Config.get([:instance, :email], "")}>"
17 named_version() <> "; " <> info
20 # See http://elixir-lang.org/docs/stable/elixir/Application.html
21 # for more information on OTP Applications
22 def start(_type, _args) do
25 # Define workers and child supervisors to be supervised
28 # Start the Ecto repository
29 supervisor(Pleroma.Repo, []),
30 worker(Pleroma.Emoji, []),
31 worker(Pleroma.Captcha, []),
63 default: :timer.seconds(6 * 60 * 60),
64 interval: :timer.seconds(60)
71 worker(Pleroma.Web.Federator.RetryQueue, []),
72 worker(Pleroma.Web.Federator, []),
73 worker(Pleroma.Stats, []),
74 worker(Pleroma.Web.Push, [])
79 # Start the endpoint when the application starts
80 supervisor(Pleroma.Web.Endpoint, []),
81 worker(Pleroma.Gopher.Server, [])
84 # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
85 # for other strategies and supported options
86 opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
87 Supervisor.start_link(children, opts)
90 if Mix.env() == :test do
91 defp streamer_child(), do: []
92 defp chat_child(), do: []
94 defp streamer_child() do
95 [worker(Pleroma.Web.Streamer, [])]
99 if Pleroma.Config.get([:chat, :enabled]) do
100 [worker(Pleroma.Web.ChatChannel.ChatChannelState, [])]