Merge remote-tracking branch 'remotes/origin/develop' into 1505-threads-federation
[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 federating: true,
223 federation_incoming_replies_max_depth: 100,
224 federation_reachability_timeout_days: 7,
225 federation_publisher_modules: [
226 Pleroma.Web.ActivityPub.Publisher
227 ],
228 allow_relay: true,
229 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
230 public: true,
231 quarantined_instances: [],
232 managed_config: true,
233 static_dir: "instance/static/",
234 allowed_post_formats: [
235 "text/plain",
236 "text/html",
237 "text/markdown",
238 "text/bbcode"
239 ],
240 mrf_transparency: true,
241 mrf_transparency_exclusions: [],
242 autofollowed_nicknames: [],
243 max_pinned_statuses: 1,
244 attachment_links: false,
245 welcome_user_nickname: nil,
246 welcome_message: nil,
247 max_report_comment_size: 1000,
248 safe_dm_mentions: false,
249 healthcheck: false,
250 remote_post_retention_days: 90,
251 skip_thread_containment: true,
252 limit_to_local_content: :unauthenticated,
253 user_bio_length: 5000,
254 user_name_length: 100,
255 max_account_fields: 10,
256 max_remote_account_fields: 20,
257 account_field_name_length: 512,
258 account_field_value_length: 2048,
259 external_user_synchronization: true,
260 extended_nickname_format: true,
261 cleanup_attachments: false
262
263 config :pleroma, :feed,
264 post_title: %{
265 max_length: 100,
266 omission: "..."
267 }
268
269 config :pleroma, :markup,
270 # XXX - unfortunately, inline images must be enabled by default right now, because
271 # of custom emoji. Issue #275 discusses defanging that somehow.
272 allow_inline_images: true,
273 allow_headings: false,
274 allow_tables: false,
275 allow_fonts: false,
276 scrub_policy: [
277 Pleroma.HTML.Scrubber.Default,
278 Pleroma.HTML.Transform.MediaProxy
279 ]
280
281 config :pleroma, :frontend_configurations,
282 pleroma_fe: %{
283 theme: "pleroma-dark",
284 logo: "/static/logo.png",
285 background: "/images/city.jpg",
286 redirectRootNoLogin: "/main/all",
287 redirectRootLogin: "/main/friends",
288 showInstanceSpecificPanel: true,
289 scopeOptionsEnabled: false,
290 formattingOptionsEnabled: false,
291 collapseMessageWithSubject: false,
292 hidePostStats: false,
293 hideUserStats: false,
294 scopeCopy: true,
295 subjectLineBehavior: "email",
296 alwaysShowSubjectInput: true
297 },
298 masto_fe: %{
299 showInstanceSpecificPanel: true
300 }
301
302 config :pleroma, :assets,
303 mascots: [
304 pleroma_fox_tan: %{
305 url: "/images/pleroma-fox-tan-smol.png",
306 mime_type: "image/png"
307 },
308 pleroma_fox_tan_shy: %{
309 url: "/images/pleroma-fox-tan-shy.png",
310 mime_type: "image/png"
311 }
312 ],
313 default_mascot: :pleroma_fox_tan
314
315 config :pleroma, :manifest,
316 icons: [
317 %{
318 src: "/static/logo.png",
319 type: "image/png"
320 }
321 ],
322 theme_color: "#282c37",
323 background_color: "#191b22"
324
325 config :pleroma, :activitypub,
326 unfollow_blocked: true,
327 outgoing_blocks: true,
328 follow_handshake_timeout: 500,
329 note_replies_output_limit: 5,
330 sign_object_fetches: true
331
332 config :pleroma, :streamer,
333 workers: 3,
334 overflow_workers: 2
335
336 config :pleroma, :user, deny_follow_blocked: true
337
338 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
339
340 config :pleroma, :mrf_rejectnonpublic,
341 allow_followersonly: false,
342 allow_direct: false
343
344 config :pleroma, :mrf_hellthread,
345 delist_threshold: 10,
346 reject_threshold: 20
347
348 config :pleroma, :mrf_simple,
349 media_removal: [],
350 media_nsfw: [],
351 federated_timeline_removal: [],
352 report_removal: [],
353 reject: [],
354 accept: [],
355 avatar_removal: [],
356 banner_removal: []
357
358 config :pleroma, :mrf_keyword,
359 reject: [],
360 federated_timeline_removal: [],
361 replace: []
362
363 config :pleroma, :mrf_subchain, match_actor: %{}
364
365 config :pleroma, :mrf_vocabulary,
366 accept: [],
367 reject: []
368
369 config :pleroma, :mrf_object_age,
370 threshold: 172_800,
371 actions: [:delist, :strip_followers]
372
373 config :pleroma, :rich_media,
374 enabled: true,
375 ignore_hosts: [],
376 ignore_tld: ["local", "localdomain", "lan"],
377 parsers: [
378 Pleroma.Web.RichMedia.Parsers.TwitterCard,
379 Pleroma.Web.RichMedia.Parsers.OGP,
380 Pleroma.Web.RichMedia.Parsers.OEmbed
381 ],
382 ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
383
384 config :pleroma, :media_proxy,
385 enabled: false,
386 proxy_opts: [
387 redirect_on_failure: false,
388 max_body_length: 25 * 1_048_576,
389 http: [
390 follow_redirect: true,
391 pool: :media
392 ]
393 ],
394 whitelist: []
395
396 config :pleroma, :chat, enabled: true
397
398 config :phoenix, :format_encoders, json: Jason
399
400 config :phoenix, :json_library, Jason
401
402 config :pleroma, :gopher,
403 enabled: false,
404 ip: {0, 0, 0, 0},
405 port: 9999
406
407 config :pleroma, Pleroma.Web.Metadata,
408 providers: [
409 Pleroma.Web.Metadata.Providers.OpenGraph,
410 Pleroma.Web.Metadata.Providers.TwitterCard,
411 Pleroma.Web.Metadata.Providers.RelMe,
412 Pleroma.Web.Metadata.Providers.Feed
413 ],
414 unfurl_nsfw: false
415
416 config :pleroma, :http_security,
417 enabled: true,
418 sts: false,
419 sts_max_age: 31_536_000,
420 ct_max_age: 2_592_000,
421 referrer_policy: "same-origin"
422
423 config :cors_plug,
424 max_age: 86_400,
425 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
426 expose: [
427 "Link",
428 "X-RateLimit-Reset",
429 "X-RateLimit-Limit",
430 "X-RateLimit-Remaining",
431 "X-Request-Id",
432 "Idempotency-Key"
433 ],
434 credentials: true,
435 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
436
437 config :pleroma, Pleroma.User,
438 restricted_nicknames: [
439 ".well-known",
440 "~",
441 "about",
442 "activities",
443 "api",
444 "auth",
445 "check_password",
446 "dev",
447 "friend-requests",
448 "inbox",
449 "internal",
450 "main",
451 "media",
452 "nodeinfo",
453 "notice",
454 "oauth",
455 "objects",
456 "ostatus_subscribe",
457 "pleroma",
458 "proxy",
459 "push",
460 "registration",
461 "relay",
462 "settings",
463 "status",
464 "tag",
465 "user-search",
466 "user_exists",
467 "users",
468 "web"
469 ]
470
471 config :pleroma, Oban,
472 repo: Pleroma.Repo,
473 verbose: false,
474 prune: {:maxlen, 1500},
475 queues: [
476 activity_expiration: 10,
477 federator_incoming: 50,
478 federator_outgoing: 50,
479 web_push: 50,
480 mailer: 10,
481 transmogrifier: 20,
482 scheduled_activities: 10,
483 background: 5,
484 remote_fetcher: 2,
485 attachments_cleanup: 5
486 ],
487 crontab: [
488 {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
489 {"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
490 {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
491 {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker}
492 ]
493
494 config :pleroma, :workers,
495 retries: [
496 federator_incoming: 5,
497 federator_outgoing: 5
498 ]
499
500 config :pleroma, :fetch_initial_posts,
501 enabled: false,
502 pages: 5
503
504 config :auto_linker,
505 opts: [
506 extra: true,
507 # TODO: Set to :no_scheme when it works properly
508 validate_tld: true,
509 class: false,
510 strip_prefix: false,
511 new_window: false,
512 rel: "ugc"
513 ]
514
515 config :pleroma, :ldap,
516 enabled: System.get_env("LDAP_ENABLED") == "true",
517 host: System.get_env("LDAP_HOST") || "localhost",
518 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
519 ssl: System.get_env("LDAP_SSL") == "true",
520 sslopts: [],
521 tls: System.get_env("LDAP_TLS") == "true",
522 tlsopts: [],
523 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
524 uid: System.get_env("LDAP_UID") || "cn"
525
526 config :esshd,
527 enabled: false
528
529 oauth_consumer_strategies =
530 System.get_env("OAUTH_CONSUMER_STRATEGIES")
531 |> to_string()
532 |> String.split()
533 |> Enum.map(&hd(String.split(&1, ":")))
534
535 ueberauth_providers =
536 for strategy <- oauth_consumer_strategies do
537 strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
538 strategy_module = String.to_atom(strategy_module_name)
539 {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
540 end
541
542 config :ueberauth,
543 Ueberauth,
544 base_path: "/oauth",
545 providers: ueberauth_providers
546
547 config :pleroma,
548 :auth,
549 enforce_oauth_admin_scope_usage: true,
550 oauth_consumer_strategies: oauth_consumer_strategies
551
552 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
553
554 config :pleroma, Pleroma.Emails.UserEmail,
555 logo: nil,
556 styling: %{
557 link_color: "#d8a070",
558 background_color: "#2C3645",
559 content_background_color: "#1B2635",
560 header_color: "#d8a070",
561 text_color: "#b9b9ba",
562 text_muted_color: "#b9b9ba"
563 }
564
565 config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
566
567 config :pleroma, Pleroma.ScheduledActivity,
568 daily_user_limit: 25,
569 total_user_limit: 300,
570 enabled: true
571
572 config :pleroma, :email_notifications,
573 digest: %{
574 active: false,
575 interval: 7,
576 inactivity_threshold: 7
577 }
578
579 config :pleroma, :oauth2,
580 token_expires_in: 600,
581 issue_new_refresh_token: true,
582 clean_expired_tokens: false
583
584 config :pleroma, :database, rum_enabled: false
585
586 config :pleroma, :env, Mix.env()
587
588 config :http_signatures,
589 adapter: Pleroma.Signature
590
591 config :pleroma, :rate_limit,
592 authentication: {60_000, 15},
593 search: [{1000, 10}, {1000, 30}],
594 app_account_creation: {1_800_000, 25},
595 relations_actions: {10_000, 10},
596 relation_id_action: {60_000, 2},
597 statuses_actions: {10_000, 15},
598 status_id_action: {60_000, 3},
599 password_reset: {1_800_000, 5},
600 account_confirmation_resend: {8_640_000, 5},
601 ap_routes: {60_000, 15}
602
603 config :pleroma, Pleroma.ActivityExpiration, enabled: true
604
605 config :pleroma, Pleroma.Plugs.RemoteIp, enabled: true
606
607 config :pleroma, :static_fe, enabled: false
608
609 config :pleroma, :web_cache_ttl,
610 activity_pub: nil,
611 activity_pub_question: 30_000
612
613 config :pleroma, :modules, runtime_dir: "instance/modules"
614
615 config :pleroma, configurable_from_database: false
616
617 # Import environment specific config. This must remain at the bottom
618 # of this file so it overrides the configuration defined above.
619 import_config "#{Mix.env()}.exs"