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