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