Runtime configured router
[akkoma] / lib / pleroma / plugs / federating_plug.ex
1 defmodule Pleroma.Web.FederatingPlug do
2 import Plug.Conn
3
4 def init(options) do
5 options
6 end
7
8 def call(conn, opts) do
9 if Keyword.get(Application.get_env(:pleroma, :instance), :federating) do
10 conn
11 else
12 conn
13 |> put_status(404)
14 |> Phoenix.Controller.render(Pleroma.Web.ErrorView, "404.json")
15 |> halt()
16 end
17 end
18 end