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 # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
102 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
103 ],
104 default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json",
105 shared_pack_cache_seconds_per_file: 60
106
107 config :pleroma, :uri_schemes,
108 valid_schemes: [
109 "https",
110 "http",
111 "dat",
112 "dweb",
113 "gopher",
114 "ipfs",
115 "ipns",
116 "irc",
117 "ircs",
118 "magnet",
119 "mailto",
120 "mumble",
121 "ssb",
122 "xmpp"
123 ]
124
125 websocket_config = [
126 path: "/websocket",
127 serializer: [
128 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
129 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
130 ],
131 timeout: 60_000,
132 transport_log: false,
133 compress: false
134 ]
135
136 # Configures the endpoint
137 config :pleroma, Pleroma.Web.Endpoint,
138 instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
139 url: [host: "localhost"],
140 http: [
141 ip: {127, 0, 0, 1},
142 dispatch: [
143 {:_,
144 [
145 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
146 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
147 {Phoenix.Transports.WebSocket,
148 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
149 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
150 ]}
151 ]
152 ],
153 protocol: "https",
154 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
155 signing_salt: "CqaoopA2",
156 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
157 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
158 secure_cookie_flag: true,
159 extra_cookie_attrs: [
160 "SameSite=Lax"
161 ]
162
163 # Configures Elixir's Logger
164 config :logger, :console,
165 level: :debug,
166 format: "\n$time $metadata[$level] $message\n",
167 metadata: [:request_id]
168
169 config :logger, :ex_syslogger,
170 level: :debug,
171 ident: "pleroma",
172 format: "$metadata[$level] $message",
173 metadata: [:request_id]
174
175 config :quack,
176 level: :warn,
177 meta: [:all],
178 webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
179
180 config :mime, :types, %{
181 "application/xml" => ["xml"],
182 "application/xrd+xml" => ["xrd+xml"],
183 "application/jrd+json" => ["jrd+json"],
184 "application/activity+json" => ["activity+json"],
185 "application/ld+json" => ["activity+json"]
186 }
187
188 config :tesla, adapter: Tesla.Adapter.Hackney
189
190 # Configures http settings, upstream proxy etc.
191 config :pleroma, :http,
192 proxy_url: nil,
193 send_user_agent: true,
194 user_agent: :default,
195 adapter: [
196 ssl_options: [
197 # Workaround for remote server certificate chain issues
198 partial_chain: &:hackney_connect.partial_chain/1,
199 # We don't support TLS v1.3 yet
200 versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
201 ]
202 ]
203
204 config :pleroma, :instance,
205 name: "Pleroma",
206 email: "example@example.com",
207 notify_email: "noreply@example.com",
208 description: "A Pleroma instance, an alternative fediverse server",
209 limit: 5_000,
210 chat_limit: 5_000,
211 remote_limit: 100_000,
212 upload_limit: 16_000_000,
213 avatar_upload_limit: 2_000_000,
214 background_upload_limit: 4_000_000,
215 banner_upload_limit: 4_000_000,
216 poll_limits: %{
217 max_options: 20,
218 max_option_chars: 200,
219 min_expiration: 0,
220 max_expiration: 365 * 24 * 60 * 60
221 },
222 registrations_open: true,
223 federating: true,
224 federation_incoming_replies_max_depth: 100,
225 federation_reachability_timeout_days: 7,
226 federation_publisher_modules: [
227 Pleroma.Web.ActivityPub.Publisher
228 ],
229 allow_relay: true,
230 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
231 public: true,
232 quarantined_instances: [],
233 managed_config: true,
234 static_dir: "instance/static/",
235 allowed_post_formats: [
236 "text/plain",
237 "text/html",
238 "text/markdown",
239 "text/bbcode"
240 ],
241 mrf_transparency: true,
242 mrf_transparency_exclusions: [],
243 autofollowed_nicknames: [],
244 max_pinned_statuses: 1,
245 no_attachment_links: true,
246 welcome_user_nickname: nil,
247 welcome_message: nil,
248 max_report_comment_size: 1000,
249 safe_dm_mentions: false,
250 healthcheck: false,
251 remote_post_retention_days: 90,
252 skip_thread_containment: true,
253 limit_to_local_content: :unauthenticated,
254 dynamic_configuration: false,
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
264 config :pleroma, :feed,
265 post_title: %{
266 max_length: 100,
267 omission: "..."
268 }
269
270 config :pleroma, :markup,
271 # XXX - unfortunately, inline images must be enabled by default right now, because
272 # of custom emoji. Issue #275 discusses defanging that somehow.
273 allow_inline_images: true,
274 allow_headings: false,
275 allow_tables: false,
276 allow_fonts: false,
277 scrub_policy: [
278 Pleroma.HTML.Scrubber.Default,
279 Pleroma.HTML.Transform.MediaProxy
280 ]
281
282 config :pleroma, :frontend_configurations,
283 pleroma_fe: %{
284 theme: "pleroma-dark",
285 logo: "/static/logo.png",
286 background: "/images/city.jpg",
287 redirectRootNoLogin: "/main/all",
288 redirectRootLogin: "/main/friends",
289 showInstanceSpecificPanel: true,
290 scopeOptionsEnabled: false,
291 formattingOptionsEnabled: false,
292 collapseMessageWithSubject: false,
293 hidePostStats: false,
294 hideUserStats: false,
295 scopeCopy: true,
296 subjectLineBehavior: "email",
297 alwaysShowSubjectInput: true
298 },
299 masto_fe: %{
300 showInstanceSpecificPanel: true
301 }
302
303 config :pleroma, :assets,
304 mascots: [
305 pleroma_fox_tan: %{
306 url: "/images/pleroma-fox-tan-smol.png",
307 mime_type: "image/png"
308 },
309 pleroma_fox_tan_shy: %{
310 url: "/images/pleroma-fox-tan-shy.png",
311 mime_type: "image/png"
312 }
313 ],
314 default_mascot: :pleroma_fox_tan
315
316 config :pleroma, :manifest,
317 icons: [
318 %{
319 src: "/static/logo.png",
320 type: "image/png"
321 }
322 ],
323 theme_color: "#282c37",
324 background_color: "#191b22"
325
326 config :pleroma, :activitypub,
327 unfollow_blocked: true,
328 outgoing_blocks: true,
329 follow_handshake_timeout: 500,
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, :suggestions,
417 enabled: false,
418 third_party_engine:
419 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
420 timeout: 300_000,
421 limit: 40,
422 web: "https://vinayaka.distsn.org"
423
424 config :pleroma, :http_security,
425 enabled: true,
426 sts: false,
427 sts_max_age: 31_536_000,
428 ct_max_age: 2_592_000,
429 referrer_policy: "same-origin"
430
431 config :cors_plug,
432 max_age: 86_400,
433 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
434 expose: [
435 "Link",
436 "X-RateLimit-Reset",
437 "X-RateLimit-Limit",
438 "X-RateLimit-Remaining",
439 "X-Request-Id",
440 "Idempotency-Key"
441 ],
442 credentials: true,
443 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
444
445 config :pleroma, Pleroma.User,
446 restricted_nicknames: [
447 ".well-known",
448 "~",
449 "about",
450 "activities",
451 "api",
452 "auth",
453 "check_password",
454 "dev",
455 "friend-requests",
456 "inbox",
457 "internal",
458 "main",
459 "media",
460 "nodeinfo",
461 "notice",
462 "oauth",
463 "objects",
464 "ostatus_subscribe",
465 "pleroma",
466 "proxy",
467 "push",
468 "registration",
469 "relay",
470 "settings",
471 "status",
472 "tag",
473 "user-search",
474 "user_exists",
475 "users",
476 "web"
477 ]
478
479 config :pleroma, Oban,
480 repo: Pleroma.Repo,
481 verbose: false,
482 prune: {:maxlen, 1500},
483 queues: [
484 activity_expiration: 10,
485 federator_incoming: 50,
486 federator_outgoing: 50,
487 web_push: 50,
488 mailer: 10,
489 transmogrifier: 20,
490 scheduled_activities: 10,
491 background: 5,
492 attachments_cleanup: 5
493 ],
494 crontab: [
495 {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
496 {"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
497 {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
498 {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker}
499 ]
500
501 config :pleroma, :workers,
502 retries: [
503 federator_incoming: 5,
504 federator_outgoing: 5
505 ]
506
507 config :pleroma, :fetch_initial_posts,
508 enabled: false,
509 pages: 5
510
511 config :auto_linker,
512 opts: [
513 scheme: true,
514 extra: true,
515 # TODO: Set to :no_scheme when it works properly
516 validate_tld: true,
517 class: false,
518 strip_prefix: false,
519 new_window: false,
520 rel: "ugc"
521 ]
522
523 config :pleroma, :ldap,
524 enabled: System.get_env("LDAP_ENABLED") == "true",
525 host: System.get_env("LDAP_HOST") || "localhost",
526 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
527 ssl: System.get_env("LDAP_SSL") == "true",
528 sslopts: [],
529 tls: System.get_env("LDAP_TLS") == "true",
530 tlsopts: [],
531 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
532 uid: System.get_env("LDAP_UID") || "cn"
533
534 config :esshd,
535 enabled: false
536
537 oauth_consumer_strategies =
538 System.get_env("OAUTH_CONSUMER_STRATEGIES")
539 |> to_string()
540 |> String.split()
541 |> Enum.map(&hd(String.split(&1, ":")))
542
543 ueberauth_providers =
544 for strategy <- oauth_consumer_strategies do
545 strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
546 strategy_module = String.to_atom(strategy_module_name)
547 {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
548 end
549
550 config :ueberauth,
551 Ueberauth,
552 base_path: "/oauth",
553 providers: ueberauth_providers
554
555 config :pleroma,
556 :auth,
557 enforce_oauth_admin_scope_usage: true,
558 oauth_consumer_strategies: oauth_consumer_strategies
559
560 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
561
562 config :pleroma, Pleroma.Emails.UserEmail,
563 logo: nil,
564 styling: %{
565 link_color: "#d8a070",
566 background_color: "#2C3645",
567 content_background_color: "#1B2635",
568 header_color: "#d8a070",
569 text_color: "#b9b9ba",
570 text_muted_color: "#b9b9ba"
571 }
572
573 config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
574
575 config :pleroma, Pleroma.ScheduledActivity,
576 daily_user_limit: 25,
577 total_user_limit: 300,
578 enabled: true
579
580 config :pleroma, :email_notifications,
581 digest: %{
582 active: false,
583 interval: 7,
584 inactivity_threshold: 7
585 }
586
587 config :pleroma, :oauth2,
588 token_expires_in: 600,
589 issue_new_refresh_token: true,
590 clean_expired_tokens: false
591
592 config :pleroma, :database, rum_enabled: false
593
594 config :pleroma, :env, Mix.env()
595
596 config :http_signatures,
597 adapter: Pleroma.Signature
598
599 config :pleroma, :rate_limit, authentication: {60_000, 15}
600
601 config :pleroma, Pleroma.ActivityExpiration, enabled: true
602
603 config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
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 # Import environment specific config. This must remain at the bottom
614 # of this file so it overrides the configuration defined above.
615 import_config "#{Mix.env()}.exs"