Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma] / config / config.exs
1 # .i;;;;i.
2 # iYcviii;vXY:
3 # .YXi .i1c.
4 # .YC. . in7.
5 # .vc. ...... ;1c.
6 # i7, .. .;1;
7 # i7, .. ... .Y1i
8 # ,7v .6MMM@; .YX,
9 # .7;. ..IMMMMMM1 :t7.
10 # .;Y. ;$MMMMMM9. :tc.
11 # vY. .. .nMMM@MMU. ;1v.
12 # i7i ... .#MM@M@C. .....:71i
13 # it: .... $MMM@9;.,i;;;i,;tti
14 # :t7. ..... 0MMMWv.,iii:::,,;St.
15 # .nC. ..... IMMMQ..,::::::,.,czX.
16 # .ct: ....... .ZMMMI..,:::::::,,:76Y.
17 # c2: ......,i..Y$M@t..:::::::,,..inZY
18 # vov ......:ii..c$MBc..,,,,,,,,,,..iI9i
19 # i9Y ......iii:..7@MA,..,,,,,,,,,....;AA:
20 # iIS. ......:ii::..;@MI....,............;Ez.
21 # .I9. ......:i::::...8M1..................C0z.
22 # .z9; ......:i::::,.. .i:...................zWX.
23 # vbv ......,i::::,,. ................. :AQY
24 # c6Y. .,...,::::,,..:t0@@QY. ................ :8bi
25 # :6S. ..,,...,:::,,,..EMMMMMMI. ............... .;bZ,
26 # :6o, .,,,,..:::,,,..i#MMMMMM#v................. YW2.
27 # .n8i ..,,,,,,,::,,,,.. tMMMMM@C:.................. .1Wn
28 # 7Uc. .:::,,,,,::,,,,.. i1t;,..................... .UEi
29 # 7C...::::::::::::,,,,.. .................... vSi.
30 # ;1;...,,::::::,......... .................. Yz:
31 # v97,......... .voC.
32 # izAotX7777777777777777777777777777777777777777Y7n92:
33 # .;CoIIIIIUAA666666699999ZZZZZZZZZZZZZZZZZZZZ6ov.
34 #
35 # !!! ATTENTION !!!
36 # DO NOT EDIT THIS FILE! THIS FILE CONTAINS THE DEFAULT VALUES FOR THE CON-
37 # FIGURATION! EDIT YOUR SECRET FILE (either prod.secret.exs, dev.secret.exs).
38 #
39 # This file is responsible for configuring your application
40 # and its dependencies with the aid of the Mix.Config module.
41 #
42 # This configuration file is loaded before any dependency and
43 # is restricted to this project.
44 use Mix.Config
45
46 # General application configuration
47 config :pleroma, ecto_repos: [Pleroma.Repo]
48
49 config :pleroma, Pleroma.Repo,
50 types: Pleroma.PostgresTypes,
51 telemetry_event: [Pleroma.Repo.Instrumenter],
52 migration_lock: nil
53
54 config :pleroma, Pleroma.Captcha,
55 enabled: true,
56 seconds_valid: 300,
57 method: Pleroma.Captcha.Native
58
59 config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
60
61 config :pleroma, :hackney_pools,
62 federation: [
63 max_connections: 50,
64 timeout: 150_000
65 ],
66 media: [
67 max_connections: 50,
68 timeout: 150_000
69 ],
70 upload: [
71 max_connections: 25,
72 timeout: 300_000
73 ]
74
75 # Upload configuration
76 config :pleroma, Pleroma.Upload,
77 uploader: Pleroma.Uploaders.Local,
78 filters: [Pleroma.Upload.Filter.Dedupe],
79 link_name: false,
80 proxy_remote: false,
81 proxy_opts: [
82 redirect_on_failure: false,
83 max_body_length: 25 * 1_048_576,
84 http: [
85 follow_redirect: true,
86 pool: :upload
87 ]
88 ]
89
90 config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
91
92 config :pleroma, Pleroma.Uploaders.S3,
93 bucket: nil,
94 streaming_enabled: true,
95 public_endpoint: "https://s3.amazonaws.com"
96
97 config :pleroma, :emoji,
98 shortcode_globs: ["/emoji/custom/**/*.png"],
99 pack_extensions: [".png", ".gif"],
100 groups: [
101 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
102 ],
103 default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json",
104 shared_pack_cache_seconds_per_file: 60
105
106 config :pleroma, :uri_schemes,
107 valid_schemes: [
108 "https",
109 "http",
110 "dat",
111 "dweb",
112 "gopher",
113 "ipfs",
114 "ipns",
115 "irc",
116 "ircs",
117 "magnet",
118 "mailto",
119 "mumble",
120 "ssb",
121 "xmpp"
122 ]
123
124 websocket_config = [
125 path: "/websocket",
126 serializer: [
127 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
128 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
129 ],
130 timeout: 60_000,
131 transport_log: false,
132 compress: false
133 ]
134
135 # Configures the endpoint
136 config :pleroma, Pleroma.Web.Endpoint,
137 instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
138 url: [host: "localhost"],
139 http: [
140 ip: {127, 0, 0, 1},
141 dispatch: [
142 {:_,
143 [
144 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
145 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
146 {Phoenix.Transports.WebSocket,
147 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
148 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
149 ]}
150 ]
151 ],
152 protocol: "https",
153 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
154 signing_salt: "CqaoopA2",
155 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
156 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
157 secure_cookie_flag: true,
158 extra_cookie_attrs: [
159 "SameSite=Lax"
160 ]
161
162 # Configures Elixir's Logger
163 config :logger, :console,
164 level: :debug,
165 format: "\n$time $metadata[$level] $message\n",
166 metadata: [:request_id]
167
168 config :logger, :ex_syslogger,
169 level: :debug,
170 ident: "pleroma",
171 format: "$metadata[$level] $message",
172 metadata: [:request_id]
173
174 config :quack,
175 level: :warn,
176 meta: [:all],
177 webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
178
179 config :mime, :types, %{
180 "application/xml" => ["xml"],
181 "application/xrd+xml" => ["xrd+xml"],
182 "application/jrd+json" => ["jrd+json"],
183 "application/activity+json" => ["activity+json"],
184 "application/ld+json" => ["activity+json"]
185 }
186
187 config :tesla, adapter: Tesla.Adapter.Hackney
188
189 # Configures http settings, upstream proxy etc.
190 config :pleroma, :http,
191 proxy_url: nil,
192 send_user_agent: true,
193 user_agent: :default,
194 adapter: [
195 ssl_options: [
196 # Workaround for remote server certificate chain issues
197 partial_chain: &:hackney_connect.partial_chain/1,
198 # We don't support TLS v1.3 yet
199 versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
200 ]
201 ]
202
203 config :pleroma, :instance,
204 name: "Pleroma",
205 email: "example@example.com",
206 notify_email: "noreply@example.com",
207 description: "A Pleroma instance, an alternative fediverse server",
208 limit: 5_000,
209 chat_limit: 5_000,
210 remote_limit: 100_000,
211 upload_limit: 16_000_000,
212 avatar_upload_limit: 2_000_000,
213 background_upload_limit: 4_000_000,
214 banner_upload_limit: 4_000_000,
215 poll_limits: %{
216 max_options: 20,
217 max_option_chars: 200,
218 min_expiration: 0,
219 max_expiration: 365 * 24 * 60 * 60
220 },
221 registrations_open: true,
222 invites_enabled: false,
223 account_activation_required: false,
224 federating: true,
225 federation_incoming_replies_max_depth: 100,
226 federation_reachability_timeout_days: 7,
227 federation_publisher_modules: [
228 Pleroma.Web.ActivityPub.Publisher
229 ],
230 allow_relay: true,
231 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
232 public: true,
233 quarantined_instances: [],
234 managed_config: true,
235 static_dir: "instance/static/",
236 allowed_post_formats: [
237 "text/plain",
238 "text/html",
239 "text/markdown",
240 "text/bbcode"
241 ],
242 mrf_transparency: true,
243 mrf_transparency_exclusions: [],
244 staff_transparency: [],
245 autofollowed_nicknames: [],
246 max_pinned_statuses: 1,
247 attachment_links: false,
248 welcome_user_nickname: nil,
249 welcome_message: nil,
250 max_report_comment_size: 1000,
251 safe_dm_mentions: false,
252 healthcheck: false,
253 remote_post_retention_days: 90,
254 skip_thread_containment: true,
255 limit_to_local_content: :unauthenticated,
256 user_bio_length: 5000,
257 user_name_length: 100,
258 max_account_fields: 10,
259 max_remote_account_fields: 20,
260 account_field_name_length: 512,
261 account_field_value_length: 2048,
262 external_user_synchronization: true,
263 extended_nickname_format: true,
264 cleanup_attachments: false
265
266 config :pleroma, :feed,
267 post_title: %{
268 max_length: 100,
269 omission: "..."
270 }
271
272 config :pleroma, :markup,
273 # XXX - unfortunately, inline images must be enabled by default right now, because
274 # of custom emoji. Issue #275 discusses defanging that somehow.
275 allow_inline_images: true,
276 allow_headings: false,
277 allow_tables: false,
278 allow_fonts: false,
279 scrub_policy: [
280 Pleroma.HTML.Scrubber.Default,
281 Pleroma.HTML.Transform.MediaProxy
282 ]
283
284 config :pleroma, :frontend_configurations,
285 pleroma_fe: %{
286 theme: "pleroma-dark",
287 logo: "/static/logo.png",
288 background: "/images/city.jpg",
289 redirectRootNoLogin: "/main/all",
290 redirectRootLogin: "/main/friends",
291 showInstanceSpecificPanel: true,
292 scopeOptionsEnabled: false,
293 formattingOptionsEnabled: false,
294 collapseMessageWithSubject: false,
295 hidePostStats: false,
296 hideUserStats: false,
297 scopeCopy: true,
298 subjectLineBehavior: "email",
299 alwaysShowSubjectInput: true
300 },
301 masto_fe: %{
302 showInstanceSpecificPanel: true
303 }
304
305 config :pleroma, :assets,
306 mascots: [
307 pleroma_fox_tan: %{
308 url: "/images/pleroma-fox-tan-smol.png",
309 mime_type: "image/png"
310 },
311 pleroma_fox_tan_shy: %{
312 url: "/images/pleroma-fox-tan-shy.png",
313 mime_type: "image/png"
314 }
315 ],
316 default_mascot: :pleroma_fox_tan
317
318 config :pleroma, :manifest,
319 icons: [
320 %{
321 src: "/static/logo.png",
322 type: "image/png"
323 }
324 ],
325 theme_color: "#282c37",
326 background_color: "#191b22"
327
328 config :pleroma, :activitypub,
329 unfollow_blocked: true,
330 outgoing_blocks: true,
331 follow_handshake_timeout: 500,
332 note_replies_output_limit: 5,
333 sign_object_fetches: true,
334 authorized_fetch_mode: false
335
336 config :pleroma, :streamer,
337 workers: 3,
338 overflow_workers: 2
339
340 config :pleroma, :user, deny_follow_blocked: true
341
342 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
343
344 config :pleroma, :mrf_rejectnonpublic,
345 allow_followersonly: false,
346 allow_direct: false
347
348 config :pleroma, :mrf_hellthread,
349 delist_threshold: 10,
350 reject_threshold: 20
351
352 config :pleroma, :mrf_simple,
353 media_removal: [],
354 media_nsfw: [],
355 federated_timeline_removal: [],
356 report_removal: [],
357 reject: [],
358 accept: [],
359 avatar_removal: [],
360 banner_removal: []
361
362 config :pleroma, :mrf_keyword,
363 reject: [],
364 federated_timeline_removal: [],
365 replace: []
366
367 config :pleroma, :mrf_subchain, match_actor: %{}
368
369 config :pleroma, :mrf_vocabulary,
370 accept: [],
371 reject: []
372
373 config :pleroma, :mrf_object_age,
374 threshold: 172_800,
375 actions: [:delist, :strip_followers]
376
377 config :pleroma, :rich_media,
378 enabled: true,
379 ignore_hosts: [],
380 ignore_tld: ["local", "localdomain", "lan"],
381 parsers: [
382 Pleroma.Web.RichMedia.Parsers.TwitterCard,
383 Pleroma.Web.RichMedia.Parsers.OGP,
384 Pleroma.Web.RichMedia.Parsers.OEmbed
385 ],
386 ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
387
388 config :pleroma, :media_proxy,
389 enabled: false,
390 proxy_opts: [
391 redirect_on_failure: false,
392 max_body_length: 25 * 1_048_576,
393 http: [
394 follow_redirect: true,
395 pool: :media
396 ]
397 ],
398 whitelist: []
399
400 config :pleroma, :chat, enabled: true
401
402 config :phoenix, :format_encoders, json: Jason
403
404 config :phoenix, :json_library, Jason
405
406 config :phoenix, :filter_parameters, ["password", "confirm"]
407
408 config :pleroma, :gopher,
409 enabled: false,
410 ip: {0, 0, 0, 0},
411 port: 9999
412
413 config :pleroma, Pleroma.Web.Metadata,
414 providers: [
415 Pleroma.Web.Metadata.Providers.OpenGraph,
416 Pleroma.Web.Metadata.Providers.TwitterCard,
417 Pleroma.Web.Metadata.Providers.RelMe,
418 Pleroma.Web.Metadata.Providers.Feed
419 ],
420 unfurl_nsfw: false
421
422 config :pleroma, :http_security,
423 enabled: true,
424 sts: false,
425 sts_max_age: 31_536_000,
426 ct_max_age: 2_592_000,
427 referrer_policy: "same-origin"
428
429 config :cors_plug,
430 max_age: 86_400,
431 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
432 expose: [
433 "Link",
434 "X-RateLimit-Reset",
435 "X-RateLimit-Limit",
436 "X-RateLimit-Remaining",
437 "X-Request-Id",
438 "Idempotency-Key"
439 ],
440 credentials: true,
441 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
442
443 config :pleroma, Pleroma.User,
444 restricted_nicknames: [
445 ".well-known",
446 "~",
447 "about",
448 "activities",
449 "api",
450 "auth",
451 "check_password",
452 "dev",
453 "friend-requests",
454 "inbox",
455 "internal",
456 "main",
457 "media",
458 "nodeinfo",
459 "notice",
460 "oauth",
461 "objects",
462 "ostatus_subscribe",
463 "pleroma",
464 "proxy",
465 "push",
466 "registration",
467 "relay",
468 "settings",
469 "status",
470 "tag",
471 "user-search",
472 "user_exists",
473 "users",
474 "web"
475 ]
476
477 config :pleroma, Oban,
478 repo: Pleroma.Repo,
479 verbose: false,
480 prune: {:maxlen, 1500},
481 queues: [
482 activity_expiration: 10,
483 federator_incoming: 50,
484 federator_outgoing: 50,
485 web_push: 50,
486 mailer: 10,
487 transmogrifier: 20,
488 scheduled_activities: 10,
489 background: 5,
490 remote_fetcher: 2,
491 attachments_cleanup: 5,
492 new_users_digest: 1
493 ],
494 crontab: [
495 {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
496 {"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
497 {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
498 {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
499 {"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
500 ]
501
502 config :pleroma, :workers,
503 retries: [
504 federator_incoming: 5,
505 federator_outgoing: 5
506 ]
507
508 config :pleroma, :fetch_initial_posts,
509 enabled: false,
510 pages: 5
511
512 config :auto_linker,
513 opts: [
514 extra: true,
515 # TODO: Set to :no_scheme when it works properly
516 validate_tld: true,
517 class: false,
518 strip_prefix: false,
519 new_window: false,
520 rel: "ugc"
521 ]
522
523 config :pleroma, :ldap,
524 enabled: System.get_env("LDAP_ENABLED") == "true",
525 host: System.get_env("LDAP_HOST") || "localhost",
526 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
527 ssl: System.get_env("LDAP_SSL") == "true",
528 sslopts: [],
529 tls: System.get_env("LDAP_TLS") == "true",
530 tlsopts: [],
531 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
532 uid: System.get_env("LDAP_UID") || "cn"
533
534 config :esshd,
535 enabled: false
536
537 oauth_consumer_strategies =
538 System.get_env("OAUTH_CONSUMER_STRATEGIES")
539 |> to_string()
540 |> String.split()
541 |> Enum.map(&hd(String.split(&1, ":")))
542
543 ueberauth_providers =
544 for strategy <- oauth_consumer_strategies do
545 strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
546 strategy_module = String.to_atom(strategy_module_name)
547 {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
548 end
549
550 config :ueberauth,
551 Ueberauth,
552 base_path: "/oauth",
553 providers: ueberauth_providers
554
555 config :pleroma,
556 :auth,
557 enforce_oauth_admin_scope_usage: true,
558 oauth_consumer_strategies: oauth_consumer_strategies
559
560 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
561
562 config :pleroma, Pleroma.Emails.UserEmail,
563 logo: nil,
564 styling: %{
565 link_color: "#d8a070",
566 background_color: "#2C3645",
567 content_background_color: "#1B2635",
568 header_color: "#d8a070",
569 text_color: "#b9b9ba",
570 text_muted_color: "#b9b9ba"
571 }
572
573 config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: false
574
575 config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
576
577 config :pleroma, Pleroma.ScheduledActivity,
578 daily_user_limit: 25,
579 total_user_limit: 300,
580 enabled: true
581
582 config :pleroma, :email_notifications,
583 digest: %{
584 active: false,
585 interval: 7,
586 inactivity_threshold: 7
587 }
588
589 config :pleroma, :oauth2,
590 token_expires_in: 600,
591 issue_new_refresh_token: true,
592 clean_expired_tokens: false
593
594 config :pleroma, :database, rum_enabled: false
595
596 config :pleroma, :env, Mix.env()
597
598 config :http_signatures,
599 adapter: Pleroma.Signature
600
601 config :pleroma, :rate_limit,
602 authentication: {60_000, 15},
603 timeline: {500, 3},
604 search: [{1000, 10}, {1000, 30}],
605 app_account_creation: {1_800_000, 25},
606 relations_actions: {10_000, 10},
607 relation_id_action: {60_000, 2},
608 statuses_actions: {10_000, 15},
609 status_id_action: {60_000, 3},
610 password_reset: {1_800_000, 5},
611 account_confirmation_resend: {8_640_000, 5},
612 ap_routes: {60_000, 15}
613
614 config :pleroma, Pleroma.ActivityExpiration, enabled: true
615
616 config :pleroma, Pleroma.Plugs.RemoteIp, enabled: true
617
618 config :pleroma, :static_fe, enabled: false
619
620 config :pleroma, :web_cache_ttl,
621 activity_pub: nil,
622 activity_pub_question: 30_000
623
624 config :pleroma, :modules, runtime_dir: "instance/modules"
625
626 config :pleroma, configurable_from_database: false
627
628 config :pleroma, Pleroma.Repo,
629 parameters: [gin_fuzzy_search_limit: "500"],
630 prepare: :unnamed
631
632 # Import environment specific config. This must remain at the bottom
633 # of this file so it overrides the configuration defined above.
634 import_config "#{Mix.env()}.exs"