dccf7b2637c21d6fa7e7fb6b6c221e8b6f12039b
[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.Captcha,
12 enabled: false,
13 seconds_valid: 60,
14 method: Pleroma.Captcha.Kocaptcha
15
16 config :pleroma, :hackney_pools,
17 federation: [
18 max_connections: 50,
19 timeout: 150_000
20 ],
21 media: [
22 max_connections: 50,
23 timeout: 150_000
24 ],
25 upload: [
26 max_connections: 25,
27 timeout: 300_000
28 ]
29
30 config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
31
32 # Upload configuration
33 config :pleroma, Pleroma.Upload,
34 uploader: Pleroma.Uploaders.Local,
35 filters: [Pleroma.Upload.Filter.Dedupe],
36 link_name: true,
37 proxy_remote: false,
38 proxy_opts: [
39 redirect_on_failure: false,
40 max_body_length: 25 * 1_048_576,
41 http: [
42 follow_redirect: true,
43 pool: :upload
44 ]
45 ]
46
47 config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
48
49 config :pleroma, Pleroma.Uploaders.S3,
50 bucket: nil,
51 public_endpoint: "https://s3.amazonaws.com"
52
53 config :pleroma, Pleroma.Uploaders.MDII,
54 cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
55 files: "https://mdii.sakura.ne.jp"
56
57 config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]
58
59 config :pleroma, :uri_schemes,
60 valid_schemes: [
61 "https",
62 "http",
63 "dat",
64 "dweb",
65 "gopher",
66 "ipfs",
67 "ipns",
68 "irc",
69 "ircs",
70 "magnet",
71 "mailto",
72 "mumble",
73 "ssb",
74 "xmpp"
75 ]
76
77 websocket_config = [
78 path: "/websocket",
79 serializer: [
80 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
81 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
82 ],
83 timeout: 60_000,
84 transport_log: false,
85 compress: false
86 ]
87
88 # Configures the endpoint
89 config :pleroma, Pleroma.Web.Endpoint,
90 url: [host: "localhost"],
91 http: [
92 dispatch: [
93 {:_,
94 [
95 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
96 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
97 {Phoenix.Transports.WebSocket,
98 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
99 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
100 ]}
101 ]
102 ],
103 protocol: "https",
104 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
105 signing_salt: "CqaoopA2",
106 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
107 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
108 secure_cookie_flag: true
109
110 # Configures Elixir's Logger
111 config :logger, :console,
112 format: "$time $metadata[$level] $message\n",
113 metadata: [:request_id]
114
115 config :logger, :ex_syslogger,
116 level: :debug,
117 ident: "Pleroma",
118 format: "$metadata[$level] $message",
119 metadata: [:request_id]
120
121 config :mime, :types, %{
122 "application/xml" => ["xml"],
123 "application/xrd+xml" => ["xrd+xml"],
124 "application/jrd+json" => ["jrd+json"],
125 "application/activity+json" => ["activity+json"],
126 "application/ld+json" => ["activity+json"]
127 }
128
129 config :pleroma, :websub, Pleroma.Web.Websub
130 config :pleroma, :ostatus, Pleroma.Web.OStatus
131 config :pleroma, :httpoison, Pleroma.HTTP
132 config :tesla, adapter: Tesla.Adapter.Hackney
133
134 # Configures http settings, upstream proxy etc.
135 config :pleroma, :http,
136 proxy_url: nil,
137 adapter: [
138 ssl_options: [
139 # We don't support TLS v1.3 yet
140 versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
141 ]
142 ]
143
144 config :pleroma, :instance,
145 name: "Pleroma",
146 email: "example@example.com",
147 description: "A Pleroma instance, an alternative fediverse server",
148 limit: 5_000,
149 remote_limit: 100_000,
150 upload_limit: 16_000_000,
151 avatar_upload_limit: 2_000_000,
152 background_upload_limit: 4_000_000,
153 banner_upload_limit: 4_000_000,
154 registrations_open: true,
155 federating: true,
156 federation_reachability_timeout_days: 7,
157 allow_relay: true,
158 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
159 public: true,
160 quarantined_instances: [],
161 managed_config: true,
162 static_dir: "instance/static/",
163 allowed_post_formats: [
164 "text/plain",
165 "text/html",
166 "text/markdown"
167 ],
168 finmoji_enabled: true,
169 mrf_transparency: true,
170 autofollowed_nicknames: [],
171 max_pinned_statuses: 1,
172 no_attachment_links: false,
173 welcome_user_nickname: nil,
174 welcome_message: nil,
175 max_report_comment_size: 1000,
176 safe_dm_mentions: false
177
178 config :pleroma, :markup,
179 # XXX - unfortunately, inline images must be enabled by default right now, because
180 # of custom emoji. Issue #275 discusses defanging that somehow.
181 allow_inline_images: true,
182 allow_headings: false,
183 allow_tables: false,
184 allow_fonts: false,
185 scrub_policy: [
186 Pleroma.HTML.Transform.MediaProxy,
187 Pleroma.HTML.Scrubber.Default
188 ]
189
190 # Deprecated, will be gone in 1.0
191 config :pleroma, :fe,
192 theme: "pleroma-dark",
193 logo: "/static/logo.png",
194 logo_mask: true,
195 logo_margin: "0.1em",
196 background: "/static/aurora_borealis.jpg",
197 redirect_root_no_login: "/main/all",
198 redirect_root_login: "/main/friends",
199 show_instance_panel: true,
200 scope_options_enabled: false,
201 formatting_options_enabled: false,
202 collapse_message_with_subject: false,
203 hide_post_stats: false,
204 hide_user_stats: false,
205 scope_copy: true,
206 subject_line_behavior: "email",
207 always_show_subject_input: true
208
209 config :pleroma, :frontend_configurations,
210 pleroma_fe: %{
211 theme: "pleroma-dark",
212 logo: "/static/logo.png",
213 background: "/images/city.jpg",
214 redirectRootNoLogin: "/main/all",
215 redirectRootLogin: "/main/friends",
216 showInstanceSpecificPanel: true,
217 scopeOptionsEnabled: false,
218 formattingOptionsEnabled: false,
219 collapseMessageWithSubject: false,
220 hidePostStats: false,
221 hideUserStats: false,
222 scopeCopy: true,
223 subjectLineBehavior: "email",
224 alwaysShowSubjectInput: true
225 },
226 masto_fe: %{
227 showInstanceSpecificPanel: true
228 }
229
230 config :pleroma, :activitypub,
231 accept_blocks: true,
232 unfollow_blocked: true,
233 outgoing_blocks: true,
234 follow_handshake_timeout: 500
235
236 config :pleroma, :user, deny_follow_blocked: true
237
238 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
239
240 config :pleroma, :mrf_rejectnonpublic,
241 allow_followersonly: false,
242 allow_direct: false
243
244 config :pleroma, :mrf_hellthread,
245 delist_threshold: 10,
246 reject_threshold: 20
247
248 config :pleroma, :mrf_simple,
249 media_removal: [],
250 media_nsfw: [],
251 federated_timeline_removal: [],
252 reject: [],
253 accept: []
254
255 config :pleroma, :mrf_keyword,
256 reject: [],
257 federated_timeline_removal: [],
258 replace: []
259
260 config :pleroma, :rich_media, enabled: true
261
262 config :pleroma, :media_proxy,
263 enabled: false,
264 proxy_opts: [
265 redirect_on_failure: false,
266 max_body_length: 25 * 1_048_576,
267 http: [
268 follow_redirect: true,
269 pool: :media
270 ]
271 ]
272
273 config :pleroma, :chat, enabled: true
274
275 config :phoenix, :format_encoders, json: Jason
276
277 config :pleroma, :gopher,
278 enabled: false,
279 ip: {0, 0, 0, 0},
280 port: 9999
281
282 config :pleroma, Pleroma.Web.Metadata, providers: [], unfurl_nsfw: false
283
284 config :pleroma, :suggestions,
285 enabled: false,
286 third_party_engine:
287 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
288 timeout: 300_000,
289 limit: 23,
290 web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
291
292 config :pleroma, :http_security,
293 enabled: true,
294 sts: false,
295 sts_max_age: 31_536_000,
296 ct_max_age: 2_592_000,
297 referrer_policy: "same-origin"
298
299 config :cors_plug,
300 max_age: 86_400,
301 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
302 expose: [
303 "Link",
304 "X-RateLimit-Reset",
305 "X-RateLimit-Limit",
306 "X-RateLimit-Remaining",
307 "X-Request-Id",
308 "Idempotency-Key"
309 ],
310 credentials: true,
311 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
312
313 config :pleroma, Pleroma.User,
314 restricted_nicknames: [
315 ".well-known",
316 "~",
317 "about",
318 "activities",
319 "api",
320 "auth",
321 "dev",
322 "friend-requests",
323 "inbox",
324 "internal",
325 "main",
326 "media",
327 "nodeinfo",
328 "notice",
329 "oauth",
330 "objects",
331 "ostatus_subscribe",
332 "pleroma",
333 "proxy",
334 "push",
335 "registration",
336 "relay",
337 "settings",
338 "status",
339 "tag",
340 "user-search",
341 "users",
342 "web"
343 ]
344
345 config :pleroma, Pleroma.Web.Federator.RetryQueue,
346 enabled: false,
347 max_jobs: 20,
348 initial_timeout: 30,
349 max_retries: 5
350
351 config :pleroma_job_queue, :queues,
352 federator_incoming: 50,
353 federator_outgoing: 50,
354 mailer: 10
355
356 config :pleroma, :fetch_initial_posts,
357 enabled: false,
358 pages: 5
359
360 config :auto_linker,
361 opts: [
362 scheme: true,
363 extra: true,
364 class: false,
365 strip_prefix: false,
366 new_window: false,
367 rel: false
368 ]
369
370 config :pleroma, :ldap,
371 enabled: System.get_env("LDAP_ENABLED") == "true",
372 host: System.get_env("LDAP_HOST") || "localhost",
373 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
374 ssl: System.get_env("LDAP_SSL") == "true",
375 sslopts: [],
376 tls: System.get_env("LDAP_TLS") == "true",
377 tlsopts: [],
378 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
379 uid: System.get_env("LDAP_UID") || "cn"
380
381 config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Sendmail
382
383 # Import environment specific config. This must remain at the bottom
384 # of this file so it overrides the configuration defined above.
385 import_config "#{Mix.env()}.exs"