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