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