1 defmodule Pleroma.Web.Endpoint do
2 use Phoenix.Endpoint, otp_app: :pleroma
4 socket "/socket", Pleroma.Web.UserSocket
5 socket "/api/v1", Pleroma.Web.MastodonAPI.MastodonSocket
7 # Serve at "/" the static files from "priv/static" directory.
9 # You should set gzip to true if you are running phoenix.digest
10 # when deploying your static files in production.
12 at: "/media", from: "uploads", gzip: false
14 at: "/", from: :pleroma,
15 only: ~w(index.html static finmoji emoji packs sounds sw.js)
17 # Code reloading can be explicitly enabled under the
18 # :code_reloader configuration of your endpoint.
20 plug Phoenix.CodeReloader
23 plug TrailingFormatPlug
28 parsers: [:urlencoded, :multipart, :json],
32 plug Plug.MethodOverride
35 # The session will be stored in the cookie and signed,
36 # this means its contents can be read but not tampered with.
37 # Set :encryption_salt if you would also like to encrypt it.
41 signing_salt: "CqaoopA2"
43 plug Pleroma.Web.Router
46 Dynamically loads configuration from the system environment
49 It receives the endpoint configuration from the config files
50 and must return the updated configuration.
52 def load_from_system_env(config) do
53 port = System.get_env("PORT") || raise "expected the PORT environment variable to be set"
54 {:ok, Keyword.put(config, :http, [:inet6, port: port])}