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 # Upload configuration
62 config :pleroma, Pleroma.Upload,
63 uploader: Pleroma.Uploaders.Local,
64 filters: [Pleroma.Upload.Filter.Dedupe],
65 link_name: false,
66 proxy_remote: false,
67 proxy_opts: [
68 redirect_on_failure: false,
69 max_body_length: 25 * 1_048_576,
70 http: [
71 follow_redirect: true,
72 pool: :upload
73 ]
74 ],
75 filename_display_max_length: 30
76
77 config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
78
79 config :pleroma, Pleroma.Uploaders.S3,
80 bucket: nil,
81 streaming_enabled: true,
82 public_endpoint: "https://s3.amazonaws.com"
83
84 config :pleroma, :emoji,
85 shortcode_globs: ["/emoji/custom/**/*.png"],
86 pack_extensions: [".png", ".gif"],
87 groups: [
88 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
89 ],
90 default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json",
91 shared_pack_cache_seconds_per_file: 60
92
93 config :pleroma, :uri_schemes,
94 valid_schemes: [
95 "https",
96 "http",
97 "dat",
98 "dweb",
99 "gopher",
100 "hyper",
101 "ipfs",
102 "ipns",
103 "irc",
104 "ircs",
105 "magnet",
106 "mailto",
107 "mumble",
108 "ssb",
109 "xmpp"
110 ]
111
112 websocket_config = [
113 path: "/websocket",
114 serializer: [
115 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
116 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
117 ],
118 timeout: 60_000,
119 transport_log: false,
120 compress: false
121 ]
122
123 # Configures the endpoint
124 config :pleroma, Pleroma.Web.Endpoint,
125 instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
126 url: [host: "localhost"],
127 http: [
128 ip: {127, 0, 0, 1},
129 dispatch: [
130 {:_,
131 [
132 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
133 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
134 {Phoenix.Transports.WebSocket,
135 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
136 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
137 ]}
138 ]
139 ],
140 protocol: "https",
141 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
142 signing_salt: "CqaoopA2",
143 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
144 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
145 secure_cookie_flag: true,
146 extra_cookie_attrs: [
147 "SameSite=Lax"
148 ]
149
150 # Configures Elixir's Logger
151 config :logger, :console,
152 level: :debug,
153 format: "\n$time $metadata[$level] $message\n",
154 metadata: [:request_id]
155
156 config :logger, :ex_syslogger,
157 level: :debug,
158 ident: "pleroma",
159 format: "$metadata[$level] $message",
160 metadata: [:request_id]
161
162 config :quack,
163 level: :warn,
164 meta: [:all],
165 webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
166
167 config :mime, :types, %{
168 "application/xml" => ["xml"],
169 "application/xrd+xml" => ["xrd+xml"],
170 "application/jrd+json" => ["jrd+json"],
171 "application/activity+json" => ["activity+json"],
172 "application/ld+json" => ["activity+json"]
173 }
174
175 config :tesla, adapter: Tesla.Adapter.Hackney
176
177 # Configures http settings, upstream proxy etc.
178 config :pleroma, :http,
179 proxy_url: nil,
180 send_user_agent: true,
181 user_agent: :default,
182 adapter: []
183
184 config :pleroma, :instance,
185 name: "Pleroma",
186 email: "example@example.com",
187 notify_email: "noreply@example.com",
188 description: "Pleroma: An efficient and flexible fediverse server",
189 background_image: "/images/city.jpg",
190 instance_thumbnail: "/instance/thumbnail.jpeg",
191 limit: 5_000,
192 description_limit: 5_000,
193 chat_limit: 5_000,
194 remote_limit: 100_000,
195 upload_limit: 16_000_000,
196 avatar_upload_limit: 2_000_000,
197 background_upload_limit: 4_000_000,
198 banner_upload_limit: 4_000_000,
199 poll_limits: %{
200 max_options: 20,
201 max_option_chars: 200,
202 min_expiration: 0,
203 max_expiration: 365 * 24 * 60 * 60
204 },
205 registrations_open: true,
206 invites_enabled: false,
207 account_activation_required: false,
208 account_approval_required: false,
209 federating: true,
210 federation_incoming_replies_max_depth: 100,
211 federation_reachability_timeout_days: 7,
212 federation_publisher_modules: [
213 Pleroma.Web.ActivityPub.Publisher
214 ],
215 allow_relay: true,
216 public: true,
217 quarantined_instances: [],
218 managed_config: true,
219 static_dir: "instance/static/",
220 allowed_post_formats: [
221 "text/plain",
222 "text/html",
223 "text/markdown",
224 "text/bbcode"
225 ],
226 mrf_transparency: true,
227 mrf_transparency_exclusions: [],
228 staff_transparency: [],
229 autofollowed_nicknames: [],
230 max_pinned_statuses: 1,
231 attachment_links: false,
232 max_report_comment_size: 1000,
233 safe_dm_mentions: false,
234 healthcheck: false,
235 remote_post_retention_days: 90,
236 skip_thread_containment: true,
237 limit_to_local_content: :unauthenticated,
238 user_bio_length: 5000,
239 user_name_length: 100,
240 max_account_fields: 10,
241 max_remote_account_fields: 20,
242 account_field_name_length: 512,
243 account_field_value_length: 2048,
244 registration_reason_length: 500,
245 external_user_synchronization: true,
246 extended_nickname_format: true,
247 cleanup_attachments: false,
248 multi_factor_authentication: [
249 totp: [
250 # digits 6 or 8
251 digits: 6,
252 period: 30
253 ],
254 backup_codes: [
255 number: 5,
256 length: 16
257 ]
258 ],
259 show_reactions: true
260
261 config :pleroma, :welcome,
262 direct_message: [
263 enabled: false,
264 sender_nickname: nil,
265 message: nil
266 ],
267 email: [
268 enabled: false,
269 sender: nil,
270 subject: "Welcome to <%= instance_name %>",
271 html: "Welcome to <%= instance_name %>",
272 text: "Welcome to <%= instance_name %>"
273 ]
274
275 config :pleroma, :feed,
276 post_title: %{
277 max_length: 100,
278 omission: "..."
279 }
280
281 config :pleroma, :markup,
282 # XXX - unfortunately, inline images must be enabled by default right now, because
283 # of custom emoji. Issue #275 discusses defanging that somehow.
284 allow_inline_images: true,
285 allow_headings: false,
286 allow_tables: false,
287 allow_fonts: false,
288 scrub_policy: [
289 Pleroma.HTML.Scrubber.Default,
290 Pleroma.HTML.Transform.MediaProxy
291 ]
292
293 config :pleroma, :frontend_configurations,
294 pleroma_fe: %{
295 alwaysShowSubjectInput: true,
296 background: "/images/city.jpg",
297 collapseMessageWithSubject: false,
298 disableChat: false,
299 greentext: false,
300 hideFilteredStatuses: false,
301 hideMutedPosts: false,
302 hidePostStats: false,
303 hideSitename: false,
304 hideUserStats: false,
305 loginMethod: "password",
306 logo: "/static/logo.png",
307 logoMargin: ".1em",
308 logoMask: true,
309 minimalScopesMode: false,
310 noAttachmentLinks: false,
311 nsfwCensorImage: "",
312 postContentType: "text/plain",
313 redirectRootLogin: "/main/friends",
314 redirectRootNoLogin: "/main/all",
315 scopeCopy: true,
316 sidebarRight: false,
317 showFeaturesPanel: true,
318 showInstanceSpecificPanel: false,
319 subjectLineBehavior: "email",
320 theme: "pleroma-dark",
321 webPushNotifications: false
322 },
323 masto_fe: %{
324 showInstanceSpecificPanel: true
325 }
326
327 config :pleroma, :assets,
328 mascots: [
329 pleroma_fox_tan: %{
330 url: "/images/pleroma-fox-tan-smol.png",
331 mime_type: "image/png"
332 },
333 pleroma_fox_tan_shy: %{
334 url: "/images/pleroma-fox-tan-shy.png",
335 mime_type: "image/png"
336 }
337 ],
338 default_mascot: :pleroma_fox_tan
339
340 config :pleroma, :manifest,
341 icons: [
342 %{
343 src: "/static/logo.png",
344 type: "image/png"
345 }
346 ],
347 theme_color: "#282c37",
348 background_color: "#191b22"
349
350 config :pleroma, :activitypub,
351 unfollow_blocked: true,
352 outgoing_blocks: true,
353 follow_handshake_timeout: 500,
354 note_replies_output_limit: 5,
355 sign_object_fetches: true,
356 authorized_fetch_mode: false
357
358 config :pleroma, :streamer,
359 workers: 3,
360 overflow_workers: 2
361
362 config :pleroma, :user, deny_follow_blocked: true
363
364 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
365
366 config :pleroma, :mrf_rejectnonpublic,
367 allow_followersonly: false,
368 allow_direct: false
369
370 config :pleroma, :mrf_hellthread,
371 delist_threshold: 10,
372 reject_threshold: 20
373
374 config :pleroma, :mrf_simple,
375 media_removal: [],
376 media_nsfw: [],
377 federated_timeline_removal: [],
378 report_removal: [],
379 reject: [],
380 accept: [],
381 avatar_removal: [],
382 banner_removal: [],
383 reject_deletes: []
384
385 config :pleroma, :mrf_keyword,
386 reject: [],
387 federated_timeline_removal: [],
388 replace: []
389
390 config :pleroma, :mrf_subchain, match_actor: %{}
391
392 config :pleroma, :mrf_activity_expiration, days: 365
393
394 config :pleroma, :mrf_vocabulary,
395 accept: [],
396 reject: []
397
398 config :pleroma, :mrf_object_age,
399 threshold: 172_800,
400 actions: [:delist, :strip_followers]
401
402 config :pleroma, :rich_media,
403 enabled: true,
404 ignore_hosts: [],
405 ignore_tld: ["local", "localdomain", "lan"],
406 parsers: [
407 Pleroma.Web.RichMedia.Parsers.TwitterCard,
408 Pleroma.Web.RichMedia.Parsers.OEmbed
409 ],
410 ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
411
412 config :pleroma, :media_proxy,
413 enabled: false,
414 invalidation: [
415 enabled: false,
416 provider: Pleroma.Web.MediaProxy.Invalidation.Script
417 ],
418 proxy_opts: [
419 redirect_on_failure: false,
420 max_body_length: 25 * 1_048_576,
421 http: [
422 follow_redirect: true,
423 pool: :media
424 ]
425 ],
426 whitelist: []
427
428 config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http,
429 method: :purge,
430 headers: [],
431 options: []
432
433 config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script, script_path: nil
434
435 config :pleroma, :chat, enabled: true
436
437 config :phoenix, :format_encoders, json: Jason
438
439 config :phoenix, :json_library, Jason
440
441 config :phoenix, :filter_parameters, ["password", "confirm"]
442
443 config :pleroma, :gopher,
444 enabled: false,
445 ip: {0, 0, 0, 0},
446 port: 9999
447
448 config :pleroma, Pleroma.Web.Metadata,
449 providers: [
450 Pleroma.Web.Metadata.Providers.OpenGraph,
451 Pleroma.Web.Metadata.Providers.TwitterCard,
452 Pleroma.Web.Metadata.Providers.RelMe,
453 Pleroma.Web.Metadata.Providers.Feed
454 ],
455 unfurl_nsfw: false
456
457 config :pleroma, Pleroma.Web.Preload,
458 providers: [
459 Pleroma.Web.Preload.Providers.Instance
460 ]
461
462 config :pleroma, :http_security,
463 enabled: true,
464 sts: false,
465 sts_max_age: 31_536_000,
466 ct_max_age: 2_592_000,
467 referrer_policy: "same-origin"
468
469 config :cors_plug,
470 max_age: 86_400,
471 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
472 expose: [
473 "Link",
474 "X-RateLimit-Reset",
475 "X-RateLimit-Limit",
476 "X-RateLimit-Remaining",
477 "X-Request-Id",
478 "Idempotency-Key"
479 ],
480 credentials: true,
481 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
482
483 config :pleroma, Pleroma.User,
484 restricted_nicknames: [
485 ".well-known",
486 "~",
487 "about",
488 "activities",
489 "api",
490 "auth",
491 "check_password",
492 "dev",
493 "friend-requests",
494 "inbox",
495 "internal",
496 "main",
497 "media",
498 "nodeinfo",
499 "notice",
500 "oauth",
501 "objects",
502 "ostatus_subscribe",
503 "pleroma",
504 "proxy",
505 "push",
506 "registration",
507 "relay",
508 "settings",
509 "status",
510 "tag",
511 "user-search",
512 "user_exists",
513 "users",
514 "web"
515 ]
516
517 config :pleroma, Oban,
518 repo: Pleroma.Repo,
519 log: false,
520 queues: [
521 activity_expiration: 10,
522 federator_incoming: 50,
523 federator_outgoing: 50,
524 web_push: 50,
525 mailer: 10,
526 transmogrifier: 20,
527 scheduled_activities: 10,
528 background: 5,
529 remote_fetcher: 2,
530 attachments_cleanup: 5,
531 new_users_digest: 1
532 ],
533 plugins: [Oban.Plugins.Pruner],
534 crontab: [
535 {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
536 {"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
537 {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
538 {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
539 {"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
540 ]
541
542 config :pleroma, :workers,
543 retries: [
544 federator_incoming: 5,
545 federator_outgoing: 5
546 ]
547
548 config :pleroma, Pleroma.Formatter,
549 class: false,
550 rel: "ugc",
551 new_window: false,
552 truncate: false,
553 strip_prefix: false,
554 extra: true,
555 validate_tld: :no_scheme
556
557 config :pleroma, :ldap,
558 enabled: System.get_env("LDAP_ENABLED") == "true",
559 host: System.get_env("LDAP_HOST") || "localhost",
560 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
561 ssl: System.get_env("LDAP_SSL") == "true",
562 sslopts: [],
563 tls: System.get_env("LDAP_TLS") == "true",
564 tlsopts: [],
565 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
566 uid: System.get_env("LDAP_UID") || "cn"
567
568 config :esshd,
569 enabled: false
570
571 oauth_consumer_strategies =
572 System.get_env("OAUTH_CONSUMER_STRATEGIES")
573 |> to_string()
574 |> String.split()
575 |> Enum.map(&hd(String.split(&1, ":")))
576
577 ueberauth_providers =
578 for strategy <- oauth_consumer_strategies do
579 strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
580 strategy_module = String.to_atom(strategy_module_name)
581 {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
582 end
583
584 config :ueberauth,
585 Ueberauth,
586 base_path: "/oauth",
587 providers: ueberauth_providers
588
589 config :pleroma,
590 :auth,
591 enforce_oauth_admin_scope_usage: true,
592 oauth_consumer_strategies: oauth_consumer_strategies
593
594 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
595
596 config :pleroma, Pleroma.Emails.UserEmail,
597 logo: nil,
598 styling: %{
599 link_color: "#d8a070",
600 background_color: "#2C3645",
601 content_background_color: "#1B2635",
602 header_color: "#d8a070",
603 text_color: "#b9b9ba",
604 text_muted_color: "#b9b9ba"
605 }
606
607 config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: false
608
609 config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
610
611 config :pleroma, Pleroma.ScheduledActivity,
612 daily_user_limit: 25,
613 total_user_limit: 300,
614 enabled: true
615
616 config :pleroma, :email_notifications,
617 digest: %{
618 active: false,
619 interval: 7,
620 inactivity_threshold: 7
621 }
622
623 config :pleroma, :oauth2,
624 token_expires_in: 600,
625 issue_new_refresh_token: true,
626 clean_expired_tokens: false
627
628 config :pleroma, :database, rum_enabled: false
629
630 config :pleroma, :env, Mix.env()
631
632 config :http_signatures,
633 adapter: Pleroma.Signature
634
635 config :pleroma, :rate_limit,
636 authentication: {60_000, 15},
637 timeline: {500, 3},
638 search: [{1000, 10}, {1000, 30}],
639 app_account_creation: {1_800_000, 25},
640 relations_actions: {10_000, 10},
641 relation_id_action: {60_000, 2},
642 statuses_actions: {10_000, 15},
643 status_id_action: {60_000, 3},
644 password_reset: {1_800_000, 5},
645 account_confirmation_resend: {8_640_000, 5},
646 ap_routes: {60_000, 15}
647
648 config :pleroma, Pleroma.ActivityExpiration, enabled: true
649
650 config :pleroma, Pleroma.Plugs.RemoteIp, enabled: true
651
652 config :pleroma, :static_fe, enabled: false
653
654 # Example of frontend configuration
655 # This example will make us serve the primary frontend from the
656 # frontends directory within your `:pleroma, :instance, static_dir`.
657 # e.g., instance/static/frontends/pleroma/develop/
658 #
659 # With no frontend configuration, the bundled files from the `static` directory will
660 # be used.
661 #
662 # config :pleroma, :frontends, primary: %{"name" => "pleroma", "ref" => "develop"}
663
664 config :pleroma, :web_cache_ttl,
665 activity_pub: nil,
666 activity_pub_question: 30_000
667
668 config :pleroma, :modules, runtime_dir: "instance/modules"
669
670 config :pleroma, configurable_from_database: false
671
672 config :pleroma, Pleroma.Repo,
673 parameters: [gin_fuzzy_search_limit: "500"],
674 prepare: :unnamed
675
676 config :pleroma, :connections_pool,
677 reclaim_multiplier: 0.1,
678 connection_acquisition_wait: 250,
679 connection_acquisition_retries: 5,
680 max_connections: 250,
681 max_idle_time: 30_000,
682 retry: 0,
683 await_up_timeout: 5_000
684
685 config :pleroma, :pools,
686 federation: [
687 size: 50,
688 max_waiting: 10
689 ],
690 media: [
691 size: 50,
692 max_waiting: 10
693 ],
694 upload: [
695 size: 25,
696 max_waiting: 5
697 ],
698 default: [
699 size: 10,
700 max_waiting: 2
701 ]
702
703 config :pleroma, :hackney_pools,
704 federation: [
705 max_connections: 50,
706 timeout: 150_000
707 ],
708 media: [
709 max_connections: 50,
710 timeout: 150_000
711 ],
712 upload: [
713 max_connections: 25,
714 timeout: 300_000
715 ]
716
717 config :pleroma, :restrict_unauthenticated,
718 timelines: %{local: false, federated: false},
719 profiles: %{local: false, remote: false},
720 activities: %{local: false, remote: false}
721
722 config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: false
723
724 config :pleroma, :mrf,
725 policies: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
726 transparency: true,
727 transparency_exclusions: []
728
729 config :tzdata, :http_client, Pleroma.HTTP.Tzdata
730
731 config :ex_aws, http_client: Pleroma.HTTP.ExAws
732
733 config :pleroma, :instances_favicons, enabled: false
734
735 # Import environment specific config. This must remain at the bottom
736 # of this file so it overrides the configuration defined above.
737 import_config "#{Mix.env()}.exs"