Cowboy handler for Mastodon WebSocket
[akkoma] / config / config.exs
1 # This file is responsible for configuring your application
2 # and its dependencies with the aid of the Mix.Config module.
3 #
4 # This configuration file is loaded before any dependency and
5 # is restricted to this project.
6 use Mix.Config
7
8 # General application configuration
9 config :pleroma, ecto_repos: [Pleroma.Repo]
10
11 config :pleroma, Pleroma.Repo, types: Pleroma.PostgresTypes
12
13 # Upload configuration
14 config :pleroma, Pleroma.Upload,
15 uploader: Pleroma.Uploaders.Local,
16 filters: [],
17 proxy_remote: false,
18 proxy_opts: []
19
20 config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
21
22 config :pleroma, Pleroma.Uploaders.S3,
23 bucket: nil,
24 public_endpoint: "https://s3.amazonaws.com"
25
26 config :pleroma, Pleroma.Uploaders.MDII,
27 cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
28 files: "https://mdii.sakura.ne.jp"
29
30 config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]
31
32 config :pleroma, :uri_schemes,
33 valid_schemes: [
34 "https",
35 "http",
36 "dat",
37 "dweb",
38 "gopher",
39 "ipfs",
40 "ipns",
41 "irc",
42 "ircs",
43 "magnet",
44 "mailto",
45 "mumble",
46 "ssb",
47 "xmpp"
48 ]
49
50 # Configures the endpoint
51 config :pleroma, Pleroma.Web.Endpoint,
52 url: [host: "localhost"],
53 http: [
54 dispatch: [
55 {:_,
56 [
57 {"/api/v1/streaming", Elixir.Pleroma.Web.MastodonAPI.WebsocketHandler, []},
58 {:_, Plug.Adapters.Cowboy.Handler, {Pleroma.Web.Endpoint, []}}
59 ]}
60 ]
61 ],
62 protocol: "https",
63 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
64 signing_salt: "CqaoopA2",
65 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
66 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
67 secure_cookie_flag: true
68
69 # Configures Elixir's Logger
70 config :logger, :console,
71 format: "$time $metadata[$level] $message\n",
72 metadata: [:request_id]
73
74 config :mime, :types, %{
75 "application/xml" => ["xml"],
76 "application/xrd+xml" => ["xrd+xml"],
77 "application/jrd+json" => ["jrd+json"],
78 "application/activity+json" => ["activity+json"],
79 "application/ld+json" => ["activity+json"]
80 }
81
82 config :pleroma, :websub, Pleroma.Web.Websub
83 config :pleroma, :ostatus, Pleroma.Web.OStatus
84 config :pleroma, :httpoison, Pleroma.HTTP
85 config :tesla, adapter: Tesla.Adapter.Hackney
86
87 # Configures http settings, upstream proxy etc.
88 config :pleroma, :http, proxy_url: nil
89
90 config :pleroma, :instance,
91 name: "Pleroma",
92 email: "example@example.com",
93 description: "A Pleroma instance, an alternative fediverse server",
94 limit: 5000,
95 upload_limit: 16_000_000,
96 avatar_upload_limit: 2_000_000,
97 background_upload_limit: 4_000_000,
98 banner_upload_limit: 4_000_000,
99 registrations_open: true,
100 federating: true,
101 allow_relay: true,
102 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
103 public: true,
104 quarantined_instances: [],
105 managed_config: true,
106 allowed_post_formats: [
107 "text/plain",
108 "text/html",
109 "text/markdown"
110 ],
111 finmoji_enabled: true,
112 mrf_transparency: true
113
114 config :pleroma, :markup,
115 # XXX - unfortunately, inline images must be enabled by default right now, because
116 # of custom emoji. Issue #275 discusses defanging that somehow.
117 allow_inline_images: true,
118 allow_headings: false,
119 allow_tables: false,
120 allow_fonts: false,
121 scrub_policy: [
122 Pleroma.HTML.Transform.MediaProxy,
123 Pleroma.HTML.Scrubber.Default
124 ]
125
126 config :pleroma, :fe,
127 theme: "pleroma-dark",
128 logo: "/static/logo.png",
129 logo_mask: true,
130 logo_margin: "0.1em",
131 background: "/static/aurora_borealis.jpg",
132 redirect_root_no_login: "/main/all",
133 redirect_root_login: "/main/friends",
134 show_instance_panel: true,
135 scope_options_enabled: false,
136 formatting_options_enabled: false,
137 collapse_message_with_subject: false,
138 hide_post_stats: false,
139 hide_user_stats: false,
140 scope_copy: true,
141 subject_line_behavior: "email",
142 always_show_subject_input: true
143
144 config :pleroma, :activitypub,
145 accept_blocks: true,
146 unfollow_blocked: true,
147 outgoing_blocks: true,
148 follow_handshake_timeout: 500
149
150 config :pleroma, :user, deny_follow_blocked: true
151
152 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
153
154 config :pleroma, :mrf_rejectnonpublic,
155 allow_followersonly: false,
156 allow_direct: false
157
158 config :pleroma, :mrf_simple,
159 media_removal: [],
160 media_nsfw: [],
161 federated_timeline_removal: [],
162 reject: [],
163 accept: []
164
165 config :pleroma, :media_proxy,
166 enabled: false,
167 # base_url: "https://cache.pleroma.social",
168 proxy_opts: [
169 # inline_content_types: [] | false | true,
170 # http: [:insecure]
171 ]
172
173 config :pleroma, :chat, enabled: true
174
175 config :ecto, json_library: Jason
176
177 config :phoenix, :format_encoders, json: Jason
178
179 config :pleroma, :gopher,
180 enabled: false,
181 ip: {0, 0, 0, 0},
182 port: 9999
183
184 config :pleroma, :suggestions,
185 enabled: false,
186 third_party_engine:
187 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
188 timeout: 300_000,
189 limit: 23,
190 web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
191
192 config :pleroma, :http_security,
193 enabled: true,
194 sts: false,
195 sts_max_age: 31_536_000,
196 ct_max_age: 2_592_000,
197 referrer_policy: "same-origin"
198
199 config :cors_plug,
200 max_age: 86_400,
201 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
202 expose: [
203 "Link",
204 "X-RateLimit-Reset",
205 "X-RateLimit-Limit",
206 "X-RateLimit-Remaining",
207 "X-Request-Id",
208 "Idempotency-Key"
209 ],
210 credentials: true,
211 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
212
213 # Import environment specific config. This must remain at the bottom
214 # of this file so it overrides the configuration defined above.
215 import_config "#{Mix.env()}.exs"