Merge branch 'develop' into issue/1383
[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 no_attachment_links: true,
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 sign_object_fetches: true
330
331 config :pleroma, :streamer,
332 workers: 3,
333 overflow_workers: 2
334
335 config :pleroma, :user, deny_follow_blocked: true
336
337 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
338
339 config :pleroma, :mrf_rejectnonpublic,
340 allow_followersonly: false,
341 allow_direct: false
342
343 config :pleroma, :mrf_hellthread,
344 delist_threshold: 10,
345 reject_threshold: 20
346
347 config :pleroma, :mrf_simple,
348 media_removal: [],
349 media_nsfw: [],
350 federated_timeline_removal: [],
351 report_removal: [],
352 reject: [],
353 accept: [],
354 avatar_removal: [],
355 banner_removal: []
356
357 config :pleroma, :mrf_keyword,
358 reject: [],
359 federated_timeline_removal: [],
360 replace: []
361
362 config :pleroma, :mrf_subchain, match_actor: %{}
363
364 config :pleroma, :mrf_vocabulary,
365 accept: [],
366 reject: []
367
368 config :pleroma, :mrf_object_age,
369 threshold: 172_800,
370 actions: [:delist, :strip_followers]
371
372 config :pleroma, :rich_media,
373 enabled: true,
374 ignore_hosts: [],
375 ignore_tld: ["local", "localdomain", "lan"],
376 parsers: [
377 Pleroma.Web.RichMedia.Parsers.TwitterCard,
378 Pleroma.Web.RichMedia.Parsers.OGP,
379 Pleroma.Web.RichMedia.Parsers.OEmbed
380 ],
381 ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
382
383 config :pleroma, :media_proxy,
384 enabled: false,
385 proxy_opts: [
386 redirect_on_failure: false,
387 max_body_length: 25 * 1_048_576,
388 http: [
389 follow_redirect: true,
390 pool: :media
391 ]
392 ],
393 whitelist: []
394
395 config :pleroma, :chat, enabled: true
396
397 config :phoenix, :format_encoders, json: Jason
398
399 config :phoenix, :json_library, Jason
400
401 config :pleroma, :gopher,
402 enabled: false,
403 ip: {0, 0, 0, 0},
404 port: 9999
405
406 config :pleroma, Pleroma.Web.Metadata,
407 providers: [
408 Pleroma.Web.Metadata.Providers.OpenGraph,
409 Pleroma.Web.Metadata.Providers.TwitterCard,
410 Pleroma.Web.Metadata.Providers.RelMe,
411 Pleroma.Web.Metadata.Providers.Feed
412 ],
413 unfurl_nsfw: false
414
415 config :pleroma, :http_security,
416 enabled: true,
417 sts: false,
418 sts_max_age: 31_536_000,
419 ct_max_age: 2_592_000,
420 referrer_policy: "same-origin"
421
422 config :cors_plug,
423 max_age: 86_400,
424 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
425 expose: [
426 "Link",
427 "X-RateLimit-Reset",
428 "X-RateLimit-Limit",
429 "X-RateLimit-Remaining",
430 "X-Request-Id",
431 "Idempotency-Key"
432 ],
433 credentials: true,
434 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
435
436 config :pleroma, Pleroma.User,
437 restricted_nicknames: [
438 ".well-known",
439 "~",
440 "about",
441 "activities",
442 "api",
443 "auth",
444 "check_password",
445 "dev",
446 "friend-requests",
447 "inbox",
448 "internal",
449 "main",
450 "media",
451 "nodeinfo",
452 "notice",
453 "oauth",
454 "objects",
455 "ostatus_subscribe",
456 "pleroma",
457 "proxy",
458 "push",
459 "registration",
460 "relay",
461 "settings",
462 "status",
463 "tag",
464 "user-search",
465 "user_exists",
466 "users",
467 "web"
468 ]
469
470 config :pleroma, Oban,
471 repo: Pleroma.Repo,
472 verbose: false,
473 prune: {:maxlen, 1500},
474 queues: [
475 activity_expiration: 10,
476 federator_incoming: 50,
477 federator_outgoing: 50,
478 web_push: 50,
479 mailer: 10,
480 transmogrifier: 20,
481 scheduled_activities: 10,
482 background: 5,
483 attachments_cleanup: 5
484 ],
485 crontab: [
486 {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
487 {"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
488 {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
489 {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker}
490 ]
491
492 config :pleroma, :workers,
493 retries: [
494 federator_incoming: 5,
495 federator_outgoing: 5
496 ]
497
498 config :pleroma, :fetch_initial_posts,
499 enabled: false,
500 pages: 5
501
502 config :auto_linker,
503 opts: [
504 extra: true,
505 # TODO: Set to :no_scheme when it works properly
506 validate_tld: true,
507 class: false,
508 strip_prefix: false,
509 new_window: false,
510 rel: "ugc"
511 ]
512
513 config :pleroma, :ldap,
514 enabled: System.get_env("LDAP_ENABLED") == "true",
515 host: System.get_env("LDAP_HOST") || "localhost",
516 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
517 ssl: System.get_env("LDAP_SSL") == "true",
518 sslopts: [],
519 tls: System.get_env("LDAP_TLS") == "true",
520 tlsopts: [],
521 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
522 uid: System.get_env("LDAP_UID") || "cn"
523
524 config :esshd,
525 enabled: false
526
527 oauth_consumer_strategies =
528 System.get_env("OAUTH_CONSUMER_STRATEGIES")
529 |> to_string()
530 |> String.split()
531 |> Enum.map(&hd(String.split(&1, ":")))
532
533 ueberauth_providers =
534 for strategy <- oauth_consumer_strategies do
535 strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
536 strategy_module = String.to_atom(strategy_module_name)
537 {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
538 end
539
540 config :ueberauth,
541 Ueberauth,
542 base_path: "/oauth",
543 providers: ueberauth_providers
544
545 config :pleroma,
546 :auth,
547 enforce_oauth_admin_scope_usage: true,
548 oauth_consumer_strategies: oauth_consumer_strategies
549
550 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
551
552 config :pleroma, Pleroma.Emails.UserEmail,
553 logo: nil,
554 styling: %{
555 link_color: "#d8a070",
556 background_color: "#2C3645",
557 content_background_color: "#1B2635",
558 header_color: "#d8a070",
559 text_color: "#b9b9ba",
560 text_muted_color: "#b9b9ba"
561 }
562
563 config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
564
565 config :pleroma, Pleroma.ScheduledActivity,
566 daily_user_limit: 25,
567 total_user_limit: 300,
568 enabled: true
569
570 config :pleroma, :email_notifications,
571 digest: %{
572 active: false,
573 interval: 7,
574 inactivity_threshold: 7
575 }
576
577 config :pleroma, :oauth2,
578 token_expires_in: 600,
579 issue_new_refresh_token: true,
580 clean_expired_tokens: false
581
582 config :pleroma, :database, rum_enabled: false
583
584 config :pleroma, :env, Mix.env()
585
586 config :http_signatures,
587 adapter: Pleroma.Signature
588
589 config :pleroma, :rate_limit,
590 authentication: {60_000, 15},
591 search: [{1000, 10}, {1000, 30}],
592 app_account_creation: {1_800_000, 25},
593 relations_actions: {10_000, 10},
594 relation_id_action: {60_000, 2},
595 statuses_actions: {10_000, 15},
596 status_id_action: {60_000, 3},
597 password_reset: {1_800_000, 5},
598 account_confirmation_resend: {8_640_000, 5},
599 ap_routes: {60_000, 15}
600
601 config :pleroma, Pleroma.ActivityExpiration, enabled: true
602
603 config :pleroma, Pleroma.Plugs.RemoteIp, enabled: true
604
605 config :pleroma, :static_fe, enabled: false
606
607 config :pleroma, :web_cache_ttl,
608 activity_pub: nil,
609 activity_pub_question: 30_000
610
611 config :pleroma, :modules, runtime_dir: "instance/modules"
612
613 config :pleroma, configurable_from_database: false
614
615 # Import environment specific config. This must remain at the bottom
616 # of this file so it overrides the configuration defined above.
617 import_config "#{Mix.env()}.exs"