Pleroma.Web.TwitterAPI.TwoFactorAuthenticationController -> Pleroma.Web.PleromaAPI...
[akkoma] / config / description.exs
1 use Mix.Config
2 alias Pleroma.Docs.Generator
3
4 websocket_config = [
5 path: "/websocket",
6 serializer: [
7 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
8 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
9 ],
10 timeout: 60_000,
11 transport_log: false,
12 compress: false
13 ]
14
15 config :pleroma, :config_description, [
16 %{
17 group: :pleroma,
18 key: Pleroma.Upload,
19 type: :group,
20 description: "Upload general settings",
21 children: [
22 %{
23 key: :uploader,
24 type: :module,
25 description: "Module which will be used for uploads",
26 suggestions: [Pleroma.Uploaders.Local, Pleroma.Uploaders.S3]
27 },
28 %{
29 key: :filters,
30 type: {:list, :module},
31 description: "List of filter modules for uploads",
32 suggestions:
33 Generator.list_modules_in_dir(
34 "lib/pleroma/upload/filter",
35 "Elixir.Pleroma.Upload.Filter."
36 )
37 },
38 %{
39 key: :link_name,
40 type: :boolean,
41 description:
42 "If enabled, a name parameter will be added to the url of the upload. For example `https://instance.tld/media/imagehash.png?name=realname.png`."
43 },
44 %{
45 key: :base_url,
46 type: :string,
47 description: "Base url for the uploads, needed if you use CDN",
48 suggestions: [
49 "https://cdn-host.com"
50 ]
51 },
52 %{
53 key: :proxy_remote,
54 type: :boolean,
55 description:
56 "If enabled, requests to media stored using a remote uploader will be proxied instead of being redirected"
57 },
58 %{
59 key: :proxy_opts,
60 type: :keyword,
61 description: "Options for Pleroma.ReverseProxy",
62 suggestions: [
63 redirect_on_failure: false,
64 max_body_length: 25 * 1_048_576,
65 http: [
66 follow_redirect: true,
67 pool: :media
68 ]
69 ],
70 children: [
71 %{
72 key: :redirect_on_failure,
73 type: :boolean,
74 description:
75 "Redirects the client to the real remote URL if there's any HTTP errors. " <>
76 "Any error during body processing will not be redirected as the response is chunked."
77 },
78 %{
79 key: :max_body_length,
80 type: :integer,
81 description:
82 "Limits the content length to be approximately the " <>
83 "specified length. It is validated with the `content-length` header and also verified when proxying."
84 },
85 %{
86 key: :http,
87 type: :keyword,
88 description: "HTTP options",
89 children: [
90 %{
91 key: :adapter,
92 type: :keyword,
93 description: "Adapter specific options",
94 children: [
95 %{
96 key: :ssl_options,
97 type: :keyword,
98 label: "SSL Options",
99 description: "SSL options for HTTP adapter",
100 children: [
101 %{
102 key: :versions,
103 type: {:list, :atom},
104 description: "List of TLS versions to use",
105 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
106 }
107 ]
108 }
109 ]
110 },
111 %{
112 key: :proxy_url,
113 label: "Proxy URL",
114 type: [:string, :tuple],
115 description: "Proxy URL",
116 suggestions: ["127.0.0.1:8123", {:socks5, :localhost, 9050}]
117 }
118 ]
119 }
120 ]
121 }
122 ]
123 },
124 %{
125 group: :pleroma,
126 key: Pleroma.Uploaders.Local,
127 type: :group,
128 description: "Local uploader-related settings",
129 children: [
130 %{
131 key: :uploads,
132 type: :string,
133 description: "Path where user's uploads will be saved",
134 suggestions: [
135 "uploads"
136 ]
137 }
138 ]
139 },
140 %{
141 group: :pleroma,
142 key: Pleroma.Uploaders.S3,
143 type: :group,
144 description: "S3 uploader-related settings",
145 children: [
146 %{
147 key: :bucket,
148 type: :string,
149 description: "S3 bucket",
150 suggestions: [
151 "bucket"
152 ]
153 },
154 %{
155 key: :bucket_namespace,
156 type: :string,
157 description: "S3 bucket namespace",
158 suggestions: ["pleroma"]
159 },
160 %{
161 key: :public_endpoint,
162 type: :string,
163 description: "S3 endpoint",
164 suggestions: ["https://s3.amazonaws.com"]
165 },
166 %{
167 key: :truncated_namespace,
168 type: :string,
169 description:
170 "If you use S3 compatible service such as Digital Ocean Spaces or CDN, set folder name or \"\" etc." <>
171 " For example, when using CDN to S3 virtual host format, set \"\". At this time, write CNAME to CDN in public_endpoint."
172 },
173 %{
174 key: :streaming_enabled,
175 type: :boolean,
176 description:
177 "Enable streaming uploads, when enabled the file will be sent to the server in chunks as it's being read. This may be unsupported by some providers, try disabling this if you have upload problems."
178 }
179 ]
180 },
181 %{
182 group: :pleroma,
183 key: Pleroma.Upload.Filter.Mogrify,
184 type: :group,
185 description: "Uploads mogrify filter settings",
186 children: [
187 %{
188 key: :args,
189 type: [:string, {:list, :string}, {:list, :tuple}],
190 description: "List of actions for the mogrify command",
191 suggestions: [
192 "strip",
193 "auto-orient",
194 {"implode", "1"}
195 ]
196 }
197 ]
198 },
199 %{
200 group: :pleroma,
201 key: Pleroma.Upload.Filter.AnonymizeFilename,
202 type: :group,
203 description: "Filter replaces the filename of the upload",
204 children: [
205 %{
206 key: :text,
207 type: :string,
208 description:
209 "Text to replace filenames in links. If no setting, {random}.extension will be used. You can get the original" <>
210 " filename extension by using {extension}, for example custom-file-name.{extension}.",
211 suggestions: [
212 "custom-file-name.{extension}"
213 ]
214 }
215 ]
216 },
217 %{
218 group: :pleroma,
219 key: Pleroma.Emails.Mailer,
220 type: :group,
221 description: "Mailer-related settings",
222 children: [
223 %{
224 key: :adapter,
225 type: :module,
226 description:
227 "One of the mail adapters listed in [Swoosh readme](https://github.com/swoosh/swoosh#adapters)," <>
228 " or Swoosh.Adapters.Local for in-memory mailbox",
229 suggestions: [
230 Swoosh.Adapters.SMTP,
231 Swoosh.Adapters.Sendgrid,
232 Swoosh.Adapters.Sendmail,
233 Swoosh.Adapters.Mandrill,
234 Swoosh.Adapters.Mailgun,
235 Swoosh.Adapters.Mailjet,
236 Swoosh.Adapters.Postmark,
237 Swoosh.Adapters.SparkPost,
238 Swoosh.Adapters.AmazonSES,
239 Swoosh.Adapters.Dyn,
240 Swoosh.Adapters.SocketLabs,
241 Swoosh.Adapters.Gmail,
242 Swoosh.Adapters.Local
243 ]
244 },
245 %{
246 key: :enabled,
247 type: :boolean,
248 description: "Allow/disallow send emails"
249 },
250 %{
251 group: {:subgroup, Swoosh.Adapters.SMTP},
252 key: :relay,
253 type: :string,
254 description: "`Swoosh.Adapters.SMTP` adapter specific setting",
255 suggestions: ["smtp.gmail.com"]
256 },
257 %{
258 group: {:subgroup, Swoosh.Adapters.SMTP},
259 key: :username,
260 type: :string,
261 description: "`Swoosh.Adapters.SMTP` adapter specific setting",
262 suggestions: ["pleroma"]
263 },
264 %{
265 group: {:subgroup, Swoosh.Adapters.SMTP},
266 key: :password,
267 type: :string,
268 description: "`Swoosh.Adapters.SMTP` adapter specific setting",
269 suggestions: ["password"]
270 },
271 %{
272 group: {:subgroup, Swoosh.Adapters.SMTP},
273 key: :ssl,
274 label: "SSL",
275 type: :boolean,
276 description: "`Swoosh.Adapters.SMTP` adapter specific setting"
277 },
278 %{
279 group: {:subgroup, Swoosh.Adapters.SMTP},
280 key: :tls,
281 label: "TLS",
282 type: :atom,
283 description: "`Swoosh.Adapters.SMTP` adapter specific setting",
284 suggestions: [:always, :never, :if_available]
285 },
286 %{
287 group: {:subgroup, Swoosh.Adapters.SMTP},
288 key: :auth,
289 type: :atom,
290 description: "`Swoosh.Adapters.SMTP` adapter specific setting",
291 suggestions: [:always, :never, :if_available]
292 },
293 %{
294 group: {:subgroup, Swoosh.Adapters.SMTP},
295 key: :port,
296 type: :integer,
297 description: "`Swoosh.Adapters.SMTP` adapter specific setting",
298 suggestions: [1025]
299 },
300 %{
301 group: {:subgroup, Swoosh.Adapters.SMTP},
302 key: :retries,
303 type: :integer,
304 description: "`Swoosh.Adapters.SMTP` adapter specific setting",
305 suggestions: [5]
306 },
307 %{
308 group: {:subgroup, Swoosh.Adapters.SMTP},
309 key: :no_mx_lookups,
310 label: "No MX lookups",
311 type: :boolean,
312 description: "`Swoosh.Adapters.SMTP` adapter specific setting"
313 },
314 %{
315 group: {:subgroup, Swoosh.Adapters.Sendgrid},
316 key: :api_key,
317 label: "API key",
318 type: :string,
319 description: "`Swoosh.Adapters.Sendgrid` adapter specific setting",
320 suggestions: ["my-api-key"]
321 },
322 %{
323 group: {:subgroup, Swoosh.Adapters.Sendmail},
324 key: :cmd_path,
325 type: :string,
326 description: "`Swoosh.Adapters.Sendmail` adapter specific setting",
327 suggestions: ["/usr/bin/sendmail"]
328 },
329 %{
330 group: {:subgroup, Swoosh.Adapters.Sendmail},
331 key: :cmd_args,
332 type: :string,
333 description: "`Swoosh.Adapters.Sendmail` adapter specific setting",
334 suggestions: ["-N delay,failure,success"]
335 },
336 %{
337 group: {:subgroup, Swoosh.Adapters.Sendmail},
338 key: :qmail,
339 type: :boolean,
340 description: "`Swoosh.Adapters.Sendmail` adapter specific setting"
341 },
342 %{
343 group: {:subgroup, Swoosh.Adapters.Mandrill},
344 key: :api_key,
345 label: "API key",
346 type: :string,
347 description: "`Swoosh.Adapters.Mandrill` adapter specific setting",
348 suggestions: ["my-api-key"]
349 },
350 %{
351 group: {:subgroup, Swoosh.Adapters.Mailgun},
352 key: :api_key,
353 label: "API key",
354 type: :string,
355 description: "`Swoosh.Adapters.Mailgun` adapter specific setting",
356 suggestions: ["my-api-key"]
357 },
358 %{
359 group: {:subgroup, Swoosh.Adapters.Mailgun},
360 key: :domain,
361 type: :string,
362 description: "`Swoosh.Adapters.Mailgun` adapter specific setting",
363 suggestions: ["pleroma.com"]
364 },
365 %{
366 group: {:subgroup, Swoosh.Adapters.Mailjet},
367 key: :api_key,
368 label: "API key",
369 type: :string,
370 description: "`Swoosh.Adapters.Mailjet` adapter specific setting",
371 suggestions: ["my-api-key"]
372 },
373 %{
374 group: {:subgroup, Swoosh.Adapters.Mailjet},
375 key: :secret,
376 type: :string,
377 description: "`Swoosh.Adapters.Mailjet` adapter specific setting",
378 suggestions: ["my-secret-key"]
379 },
380 %{
381 group: {:subgroup, Swoosh.Adapters.Postmark},
382 key: :api_key,
383 label: "API key",
384 type: :string,
385 description: "`Swoosh.Adapters.Postmark` adapter specific setting",
386 suggestions: ["my-api-key"]
387 },
388 %{
389 group: {:subgroup, Swoosh.Adapters.SparkPost},
390 key: :api_key,
391 label: "API key",
392 type: :string,
393 description: "`Swoosh.Adapters.SparkPost` adapter specific setting",
394 suggestions: ["my-api-key"]
395 },
396 %{
397 group: {:subgroup, Swoosh.Adapters.SparkPost},
398 key: :endpoint,
399 type: :string,
400 description: "`Swoosh.Adapters.SparkPost` adapter specific setting",
401 suggestions: ["https://api.sparkpost.com/api/v1"]
402 },
403 %{
404 group: {:subgroup, Swoosh.Adapters.AmazonSES},
405 key: :region,
406 type: :string,
407 description: "`Swoosh.Adapters.AmazonSES` adapter specific setting",
408 suggestions: ["us-east-1", "us-east-2"]
409 },
410 %{
411 group: {:subgroup, Swoosh.Adapters.AmazonSES},
412 key: :access_key,
413 type: :string,
414 description: "`Swoosh.Adapters.AmazonSES` adapter specific setting",
415 suggestions: ["aws-access-key"]
416 },
417 %{
418 group: {:subgroup, Swoosh.Adapters.AmazonSES},
419 key: :secret,
420 type: :string,
421 description: "`Swoosh.Adapters.AmazonSES` adapter specific setting",
422 suggestions: ["aws-secret-key"]
423 },
424 %{
425 group: {:subgroup, Swoosh.Adapters.Dyn},
426 key: :api_key,
427 label: "API key",
428 type: :string,
429 description: "`Swoosh.Adapters.Dyn` adapter specific setting",
430 suggestions: ["my-api-key"]
431 },
432 %{
433 group: {:subgroup, Swoosh.Adapters.SocketLabs},
434 key: :server_id,
435 type: :string,
436 description: "`Swoosh.Adapters.SocketLabs` adapter specific setting"
437 },
438 %{
439 group: {:subgroup, Swoosh.Adapters.SocketLabs},
440 key: :api_key,
441 label: "API key",
442 type: :string,
443 description: "`Swoosh.Adapters.SocketLabs` adapter specific setting"
444 },
445 %{
446 group: {:subgroup, Swoosh.Adapters.Gmail},
447 key: :access_token,
448 type: :string,
449 description: "`Swoosh.Adapters.Gmail` adapter specific setting"
450 }
451 ]
452 },
453 %{
454 group: :swoosh,
455 type: :group,
456 description: "`Swoosh.Adapters.Local` adapter specific settings",
457 children: [
458 %{
459 group: {:subgroup, Swoosh.Adapters.Local},
460 key: :serve_mailbox,
461 type: :boolean,
462 description: "Run the preview server together as part of your app"
463 },
464 %{
465 group: {:subgroup, Swoosh.Adapters.Local},
466 key: :preview_port,
467 type: :integer,
468 description: "The preview server port",
469 suggestions: [4001]
470 }
471 ]
472 },
473 %{
474 group: :pleroma,
475 key: :uri_schemes,
476 type: :group,
477 description: "URI schemes related settings",
478 children: [
479 %{
480 key: :valid_schemes,
481 type: {:list, :string},
482 description: "List of the scheme part that is considered valid to be an URL",
483 suggestions: [
484 "https",
485 "http",
486 "dat",
487 "dweb",
488 "gopher",
489 "ipfs",
490 "ipns",
491 "irc",
492 "ircs",
493 "magnet",
494 "mailto",
495 "mumble",
496 "ssb",
497 "xmpp"
498 ]
499 }
500 ]
501 },
502 %{
503 group: :pleroma,
504 key: :instance,
505 type: :group,
506 description: "Instance-related settings",
507 children: [
508 %{
509 key: :name,
510 type: :string,
511 description: "Name of the instance",
512 suggestions: [
513 "Pleroma"
514 ]
515 },
516 %{
517 key: :email,
518 label: "Admin Email Address",
519 type: :string,
520 description: "Email used to reach an Administrator/Moderator of the instance",
521 suggestions: [
522 "email@example.com"
523 ]
524 },
525 %{
526 key: :notify_email,
527 label: "Sender Email Address",
528 type: :string,
529 description: "Envelope FROM address for mail sent via Pleroma",
530 suggestions: [
531 "notify@example.com"
532 ]
533 },
534 %{
535 key: :description,
536 type: :string,
537 description:
538 "The instance's description. It can be seen in nodeinfo and `/api/v1/instance`",
539 suggestions: [
540 "Very cool instance"
541 ]
542 },
543 %{
544 key: :limit,
545 type: :integer,
546 description: "Posts character limit (CW/Subject included in the counter)",
547 suggestions: [
548 5_000
549 ]
550 },
551 %{
552 key: :chat_limit,
553 type: :integer,
554 description: "Character limit of the instance chat messages",
555 suggestions: [
556 5_000
557 ]
558 },
559 %{
560 key: :remote_limit,
561 type: :integer,
562 description: "Hard character limit beyond which remote posts will be dropped",
563 suggestions: [
564 100_000
565 ]
566 },
567 %{
568 key: :upload_limit,
569 type: :integer,
570 description: "File size limit of uploads (except for avatar, background, banner)",
571 suggestions: [
572 16_000_000
573 ]
574 },
575 %{
576 key: :avatar_upload_limit,
577 type: :integer,
578 description: "File size limit of user's profile avatars",
579 suggestions: [
580 2_000_000
581 ]
582 },
583 %{
584 key: :background_upload_limit,
585 type: :integer,
586 description: "File size limit of user's profile backgrounds",
587 suggestions: [
588 4_000_000
589 ]
590 },
591 %{
592 key: :banner_upload_limit,
593 type: :integer,
594 description: "File size limit of user's profile banners",
595 suggestions: [
596 4_000_000
597 ]
598 },
599 %{
600 key: :poll_limits,
601 type: :map,
602 description: "A map with poll limits for local polls",
603 suggestions: [
604 %{
605 max_options: 20,
606 max_option_chars: 200,
607 min_expiration: 0,
608 max_expiration: 31_536_000
609 }
610 ],
611 children: [
612 %{
613 key: :max_options,
614 type: :integer,
615 description: "Maximum number of options",
616 suggestions: [20]
617 },
618 %{
619 key: :max_option_chars,
620 type: :integer,
621 description: "Maximum number of characters per option",
622 suggestions: [200]
623 },
624 %{
625 key: :min_expiration,
626 type: :integer,
627 description: "Minimum expiration time (in seconds)",
628 suggestions: [0]
629 },
630 %{
631 key: :max_expiration,
632 type: :integer,
633 description: "Maximum expiration time (in seconds)",
634 suggestions: [3600]
635 }
636 ]
637 },
638 %{
639 key: :registrations_open,
640 type: :boolean,
641 description:
642 "Enable registrations for anyone. Invitations require this setting to be disabled."
643 },
644 %{
645 key: :invites_enabled,
646 type: :boolean,
647 description:
648 "Enable user invitations for admins (depends on `registrations_open` being disabled)."
649 },
650 %{
651 key: :account_activation_required,
652 type: :boolean,
653 description: "Require users to confirm their emails before signing in."
654 },
655 %{
656 key: :federating,
657 type: :boolean,
658 description: "Enable federation with other instances."
659 },
660 %{
661 key: :federation_incoming_replies_max_depth,
662 label: "Fed. incoming replies max depth",
663 type: :integer,
664 description:
665 "Max. depth of reply-to and reply activities fetching on incoming federation, to prevent out-of-memory situations while" <>
666 " fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes.",
667 suggestions: [
668 100
669 ]
670 },
671 %{
672 key: :federation_reachability_timeout_days,
673 label: "Fed. reachability timeout days",
674 type: :integer,
675 description:
676 "Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.",
677 suggestions: [
678 7
679 ]
680 },
681 %{
682 key: :federation_publisher_modules,
683 type: {:list, :module},
684 description: "List of modules for federation publishing",
685 suggestions: [
686 Pleroma.Web.ActivityPub.Publisher
687 ]
688 },
689 %{
690 key: :allow_relay,
691 type: :boolean,
692 description: "Enable Pleroma's Relay, which makes it possible to follow a whole instance"
693 },
694 %{
695 key: :rewrite_policy,
696 type: [:module, {:list, :module}],
697 description: "A list of MRF policies enabled",
698 suggestions:
699 Generator.list_modules_in_dir(
700 "lib/pleroma/web/activity_pub/mrf",
701 "Elixir.Pleroma.Web.ActivityPub.MRF."
702 )
703 },
704 %{
705 key: :public,
706 type: :boolean,
707 description:
708 "Makes the client API in authentificated mode-only except for user-profiles." <>
709 " Useful for disabling the Local Timeline and The Whole Known Network."
710 },
711 %{
712 key: :quarantined_instances,
713 type: {:list, :string},
714 description:
715 "List of ActivityPub instances where private (DMs, followers-only) activities will not be send",
716 suggestions: [
717 "quarantined.com",
718 "*.quarantined.com"
719 ]
720 },
721 %{
722 key: :managed_config,
723 type: :boolean,
724 description:
725 "Whenether the config for pleroma-fe is configured in this config or in static/config.json"
726 },
727 %{
728 key: :static_dir,
729 type: :string,
730 description: "Instance static directory",
731 suggestions: [
732 "instance/static/"
733 ]
734 },
735 %{
736 key: :allowed_post_formats,
737 type: {:list, :string},
738 description: "MIME-type list of formats allowed to be posted (transformed into HTML)",
739 suggestions: [
740 "text/plain",
741 "text/html",
742 "text/markdown",
743 "text/bbcode"
744 ]
745 },
746 %{
747 key: :mrf_transparency,
748 label: "MRF transparency",
749 type: :boolean,
750 description:
751 "Make the content of your Message Rewrite Facility settings public (via nodeinfo)"
752 },
753 %{
754 key: :mrf_transparency_exclusions,
755 label: "MRF transparency exclusions",
756 type: {:list, :string},
757 description:
758 "Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.",
759 suggestions: [
760 "exclusion.com"
761 ]
762 },
763 %{
764 key: :extended_nickname_format,
765 type: :boolean,
766 description:
767 "Enable to use extended local nicknames format (allows underscores/dashes)." <>
768 " This will break federation with older software for theses nicknames."
769 },
770 %{
771 key: :cleanup_attachments,
772 type: :boolean,
773 description: """
774 Enable to remove associated attachments when status is removed.
775 This will not affect duplicates and attachments without status.
776 Enabling this will increase load to database when deleting statuses on larger instances.
777 """
778 },
779 %{
780 key: :max_pinned_statuses,
781 type: :integer,
782 description: "The maximum number of pinned statuses. 0 will disable the feature.",
783 suggestions: [
784 0,
785 1,
786 3
787 ]
788 },
789 %{
790 key: :autofollowed_nicknames,
791 type: {:list, :string},
792 description:
793 "Set to nicknames of (local) users that every new user should automatically follow",
794 suggestions: [
795 "lain",
796 "kaniini",
797 "lanodan",
798 "rinpatch"
799 ]
800 },
801 %{
802 key: :attachment_links,
803 type: :boolean,
804 description: "Enable to automatically add attachment link text to statuses"
805 },
806 %{
807 key: :welcome_message,
808 type: :string,
809 description:
810 "A message that will be sent to a newly registered users as a direct message",
811 suggestions: [
812 "Hi, @username! Welcome on board!"
813 ]
814 },
815 %{
816 key: :welcome_user_nickname,
817 type: :string,
818 description: "The nickname of the local user that sends the welcome message",
819 suggestions: [
820 "lain"
821 ]
822 },
823 %{
824 key: :max_report_comment_size,
825 type: :integer,
826 description: "The maximum size of the report comment. Default: 1000.",
827 suggestions: [
828 1_000
829 ]
830 },
831 %{
832 key: :safe_dm_mentions,
833 type: :boolean,
834 description:
835 "If enabled, only mentions at the beginning of a post will be used to address people in direct messages." <>
836 " This is to prevent accidental mentioning of people when talking about them (e.g. \"@admin please keep an eye on @bad_actor\")." <>
837 " Default: disabled"
838 },
839 %{
840 key: :healthcheck,
841 type: :boolean,
842 description: "If enabled, system data will be shown on `/api/pleroma/healthcheck`"
843 },
844 %{
845 key: :remote_post_retention_days,
846 type: :integer,
847 description:
848 "The default amount of days to retain remote posts when pruning the database",
849 suggestions: [
850 90
851 ]
852 },
853 %{
854 key: :user_bio_length,
855 type: :integer,
856 description: "A user bio maximum length. Default: 5000.",
857 suggestions: [
858 5_000
859 ]
860 },
861 %{
862 key: :user_name_length,
863 type: :integer,
864 description: "A user name maximum length. Default: 100.",
865 suggestions: [
866 100
867 ]
868 },
869 %{
870 key: :skip_thread_containment,
871 type: :boolean,
872 description: "Skip filtering out broken threads. Default: enabled"
873 },
874 %{
875 key: :limit_to_local_content,
876 type: {:dropdown, :atom},
877 description:
878 "Limit unauthenticated users to search for local statutes and users only. Default: `:unauthenticated`.",
879 suggestions: [
880 :unauthenticated,
881 :all,
882 false
883 ]
884 },
885 %{
886 key: :max_account_fields,
887 type: :integer,
888 description: "The maximum number of custom fields in the user profile. Default: 10.",
889 suggestions: [
890 10
891 ]
892 },
893 %{
894 key: :max_remote_account_fields,
895 type: :integer,
896 description:
897 "The maximum number of custom fields in the remote user profile. Default: 20.",
898 suggestions: [
899 20
900 ]
901 },
902 %{
903 key: :account_field_name_length,
904 type: :integer,
905 description: "An account field name maximum length. Default: 512.",
906 suggestions: [
907 512
908 ]
909 },
910 %{
911 key: :account_field_value_length,
912 type: :integer,
913 description: "An account field value maximum length. Default: 2048.",
914 suggestions: [
915 2048
916 ]
917 },
918 %{
919 key: :external_user_synchronization,
920 type: :boolean,
921 description: "Enabling following/followers counters synchronization for external users"
922 },
923 %{
924 key: :multi_factor_authentication,
925 type: :keyword,
926 description: "Multi-factor authentication settings",
927 suggestions: [
928 [
929 totp: [digits: 6, period: 30],
930 backup_codes: [number: 5, length: 16]
931 ]
932 ],
933 children: [
934 %{
935 key: :totp,
936 type: :keyword,
937 description: "TOTP settings",
938 suggestions: [digits: 6, period: 30],
939 children: [
940 %{
941 key: :digits,
942 type: :integer,
943 suggestions: [6],
944 description:
945 "Determines the length of a one-time pass-code, in characters. Defaults to 6 characters."
946 },
947 %{
948 key: :period,
949 type: :integer,
950 suggestions: [30],
951 description:
952 "a period for which the TOTP code will be valid, in seconds. Defaults to 30 seconds."
953 }
954 ]
955 },
956 %{
957 key: :backup_codes,
958 type: :keyword,
959 description: "MFA backup codes settings",
960 suggestions: [number: 5, length: 16],
961 children: [
962 %{
963 key: :number,
964 type: :integer,
965 suggestions: [5],
966 description: "number of backup codes to generate."
967 },
968 %{
969 key: :length,
970 type: :integer,
971 suggestions: [16],
972 description:
973 "Determines the length of backup one-time pass-codes, in characters. Defaults to 16 characters."
974 }
975 ]
976 }
977 ]
978 }
979 ]
980 },
981 %{
982 group: :logger,
983 type: :group,
984 description: "Logger-related settings",
985 children: [
986 %{
987 key: :backends,
988 type: [:atom, :tuple, :module],
989 description:
990 "Where logs will be sent, :console - send logs to stdout, { ExSyslogger, :ex_syslogger } - to syslog, Quack.Logger - to Slack.",
991 suggestions: [:console, {ExSyslogger, :ex_syslogger}, Quack.Logger]
992 }
993 ]
994 },
995 %{
996 group: :logger,
997 type: :group,
998 key: :ex_syslogger,
999 description: "ExSyslogger-related settings",
1000 children: [
1001 %{
1002 key: :level,
1003 type: {:dropdown, :atom},
1004 description: "Log level",
1005 suggestions: [:debug, :info, :warn, :error]
1006 },
1007 %{
1008 key: :ident,
1009 type: :string,
1010 description:
1011 "A string that's prepended to every message, and is typically set to the app name",
1012 suggestions: ["pleroma"]
1013 },
1014 %{
1015 key: :format,
1016 type: :string,
1017 description: "Default: \"$date $time [$level] $levelpad$node $metadata $message\".",
1018 suggestions: ["$metadata[$level] $message"]
1019 },
1020 %{
1021 key: :metadata,
1022 type: {:list, :atom},
1023 suggestions: [:request_id]
1024 }
1025 ]
1026 },
1027 %{
1028 group: :logger,
1029 type: :group,
1030 key: :console,
1031 description: "Console logger settings",
1032 children: [
1033 %{
1034 key: :level,
1035 type: {:dropdown, :atom},
1036 description: "Log level",
1037 suggestions: [:debug, :info, :warn, :error]
1038 },
1039 %{
1040 key: :format,
1041 type: :string,
1042 description: "Default: \"$date $time [$level] $levelpad$node $metadata $message\".",
1043 suggestions: ["$metadata[$level] $message"]
1044 },
1045 %{
1046 key: :metadata,
1047 type: {:list, :atom},
1048 suggestions: [:request_id]
1049 }
1050 ]
1051 },
1052 %{
1053 group: :quack,
1054 type: :group,
1055 description: "Quack-related settings",
1056 children: [
1057 %{
1058 key: :level,
1059 type: {:dropdown, :atom},
1060 description: "Log level",
1061 suggestions: [:debug, :info, :warn, :error]
1062 },
1063 %{
1064 key: :meta,
1065 type: {:list, :atom},
1066 description: "Configure which metadata you want to report on",
1067 suggestions: [
1068 :application,
1069 :module,
1070 :file,
1071 :function,
1072 :line,
1073 :pid,
1074 :crash_reason,
1075 :initial_call,
1076 :registered_name,
1077 :all,
1078 :none
1079 ]
1080 },
1081 %{
1082 key: :webhook_url,
1083 type: :string,
1084 description: "Configure the Slack incoming webhook",
1085 suggestions: ["https://hooks.slack.com/services/YOUR-KEY-HERE"]
1086 }
1087 ]
1088 },
1089 %{
1090 group: :pleroma,
1091 key: :frontend_configurations,
1092 type: :group,
1093 description:
1094 "This form can be used to configure a keyword list that keeps the configuration data for any " <>
1095 "kind of frontend. By default, settings for pleroma_fe and masto_fe are configured. If you want to " <>
1096 "add your own configuration your settings all fields must be complete.",
1097 children: [
1098 %{
1099 key: :pleroma_fe,
1100 label: "Pleroma FE",
1101 type: :map,
1102 description: "Settings for Pleroma FE",
1103 suggestions: [
1104 %{
1105 theme: "pleroma-dark",
1106 logo: "/static/logo.png",
1107 background: "/images/city.jpg",
1108 redirectRootNoLogin: "/main/all",
1109 redirectRootLogin: "/main/friends",
1110 showInstanceSpecificPanel: true,
1111 scopeOptionsEnabled: false,
1112 formattingOptionsEnabled: false,
1113 collapseMessageWithSubject: false,
1114 hidePostStats: false,
1115 hideUserStats: false,
1116 scopeCopy: true,
1117 subjectLineBehavior: "email",
1118 alwaysShowSubjectInput: true,
1119 logoMask: false,
1120 logoMargin: ".1em",
1121 stickers: false,
1122 enableEmojiPicker: false
1123 }
1124 ],
1125 children: [
1126 %{
1127 key: :theme,
1128 type: :string,
1129 description: "Which theme to use, they are defined in styles.json",
1130 suggestions: ["pleroma-dark"]
1131 },
1132 %{
1133 key: :logo,
1134 type: :string,
1135 description: "URL of the logo, defaults to Pleroma's logo",
1136 suggestions: ["/static/logo.png"]
1137 },
1138 %{
1139 key: :background,
1140 type: :string,
1141 description:
1142 "URL of the background, unless viewing a user profile with a background that is set",
1143 suggestions: ["/images/city.jpg"]
1144 },
1145 %{
1146 key: :redirectRootNoLogin,
1147 label: "Redirect root no login",
1148 type: :string,
1149 description:
1150 "Relative URL which indicates where to redirect when a user isn't logged in",
1151 suggestions: ["/main/all"]
1152 },
1153 %{
1154 key: :redirectRootLogin,
1155 label: "Redirect root login",
1156 type: :string,
1157 description:
1158 "Relative URL which indicates where to redirect when a user is logged in",
1159 suggestions: ["/main/friends"]
1160 },
1161 %{
1162 key: :showInstanceSpecificPanel,
1163 label: "Show instance specific panel",
1164 type: :boolean,
1165 description: "Whenether to show the instance's specific panel"
1166 },
1167 %{
1168 key: :scopeOptionsEnabled,
1169 label: "Scope options enabled",
1170 type: :boolean,
1171 description: "Enable setting a notice visibility and subject/CW when posting"
1172 },
1173 %{
1174 key: :formattingOptionsEnabled,
1175 label: "Formatting options enabled",
1176 type: :boolean,
1177 description:
1178 "Enable setting a formatting different than plain-text (ie. HTML, Markdown) when posting, relates to `:instance`, `allowed_post_formats`"
1179 },
1180 %{
1181 key: :collapseMessageWithSubject,
1182 label: "Collapse message with subject",
1183 type: :boolean,
1184 description:
1185 "When a message has a subject (aka Content Warning), collapse it by default"
1186 },
1187 %{
1188 key: :hidePostStats,
1189 label: "Hide post stats",
1190 type: :boolean,
1191 description: "Hide notices statistics (repeats, favorites, ...)"
1192 },
1193 %{
1194 key: :hideUserStats,
1195 label: "Hide user stats",
1196 type: :boolean,
1197 description:
1198 "Hide profile statistics (posts, posts per day, followers, followings, ...)"
1199 },
1200 %{
1201 key: :scopeCopy,
1202 label: "Scope copy",
1203 type: :boolean,
1204 description: "Copy the scope (private/unlisted/public) in replies to posts by default"
1205 },
1206 %{
1207 key: :subjectLineBehavior,
1208 label: "Subject line behavior",
1209 type: :string,
1210 description: "Allows changing the default behaviour of subject lines in replies.
1211 `email`: copy and preprend re:, as in email,
1212 `masto`: copy verbatim, as in Mastodon,
1213 `noop`: don't copy the subject.",
1214 suggestions: ["email", "masto", "noop"]
1215 },
1216 %{
1217 key: :alwaysShowSubjectInput,
1218 label: "Always show subject input",
1219 type: :boolean,
1220 description: "When disabled, auto-hide the subject field if it's empty"
1221 },
1222 %{
1223 key: :logoMask,
1224 label: "Logo mask",
1225 type: :boolean,
1226 description:
1227 "By default it assumes logo used will be monochrome with alpha channel to be compatible with both light and dark themes. " <>
1228 "If you want a colorful logo you must disable logoMask."
1229 },
1230 %{
1231 key: :logoMargin,
1232 label: "Logo margin",
1233 type: :string,
1234 description:
1235 "Allows you to adjust vertical margins between logo boundary and navbar borders. " <>
1236 "The idea is that to have logo's image without any extra margins and instead adjust them to your need in layout.",
1237 suggestions: [".1em"]
1238 },
1239 %{
1240 key: :stickers,
1241 type: :boolean,
1242 description: "Enables stickers."
1243 },
1244 %{
1245 key: :enableEmojiPicker,
1246 label: "Emoji picker",
1247 type: :boolean,
1248 description: "Enables emoji picker."
1249 }
1250 ]
1251 },
1252 %{
1253 key: :masto_fe,
1254 label: "Masto FE",
1255 type: :map,
1256 description: "Settings for Masto FE",
1257 suggestions: [
1258 %{
1259 showInstanceSpecificPanel: true
1260 }
1261 ],
1262 children: [
1263 %{
1264 key: :showInstanceSpecificPanel,
1265 label: "Show instance specific panel",
1266 type: :boolean,
1267 description: "Whenether to show the instance's specific panel"
1268 }
1269 ]
1270 }
1271 ]
1272 },
1273 %{
1274 group: :pleroma,
1275 key: :assets,
1276 type: :group,
1277 description:
1278 "This section configures assets to be used with various frontends. Currently the only option relates to mascots on the mastodon frontend",
1279 children: [
1280 %{
1281 key: :mascots,
1282 type: {:keyword, :map},
1283 description:
1284 "Keyword of mascots, each element must contain both an url and a mime_type key",
1285 suggestions: [
1286 pleroma_fox_tan: %{
1287 url: "/images/pleroma-fox-tan-smol.png",
1288 mime_type: "image/png"
1289 },
1290 pleroma_fox_tan_shy: %{
1291 url: "/images/pleroma-fox-tan-shy.png",
1292 mime_type: "image/png"
1293 }
1294 ]
1295 },
1296 %{
1297 key: :default_mascot,
1298 type: :atom,
1299 description:
1300 "This will be used as the default mascot on MastoFE. Default: `:pleroma_fox_tan`",
1301 suggestions: [
1302 :pleroma_fox_tan
1303 ]
1304 }
1305 ]
1306 },
1307 %{
1308 group: :pleroma,
1309 key: :manifest,
1310 type: :group,
1311 description:
1312 "This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE",
1313 children: [
1314 %{
1315 key: :icons,
1316 type: {:list, :map},
1317 description: "Describe the icons of the app",
1318 suggestion: [
1319 %{
1320 src: "/static/logo.png"
1321 },
1322 %{
1323 src: "/static/icon.png",
1324 type: "image/png"
1325 },
1326 %{
1327 src: "/static/icon.ico",
1328 sizes: "72x72 96x96 128x128 256x256"
1329 }
1330 ]
1331 },
1332 %{
1333 key: :theme_color,
1334 type: :string,
1335 description: "Describe the theme color of the app",
1336 suggestions: ["#282c37", "mediumpurple"]
1337 },
1338 %{
1339 key: :background_color,
1340 type: :string,
1341 description: "Describe the background color of the app",
1342 suggestions: ["#191b22", "aliceblue"]
1343 }
1344 ]
1345 },
1346 %{
1347 group: :pleroma,
1348 key: :mrf_simple,
1349 label: "MRF simple",
1350 type: :group,
1351 description: "Message Rewrite Facility",
1352 children: [
1353 %{
1354 key: :media_removal,
1355 type: {:list, :string},
1356 description: "List of instances to strip media attachments from",
1357 suggestions: ["example.com", "*.example.com"]
1358 },
1359 %{
1360 key: :media_nsfw,
1361 label: "Media NSFW",
1362 type: {:list, :string},
1363 description: "List of instances to tag all media as NSFW (sensitive) from",
1364 suggestions: ["example.com", "*.example.com"]
1365 },
1366 %{
1367 key: :federated_timeline_removal,
1368 type: {:list, :string},
1369 description:
1370 "List of instances to remove from Federated (aka The Whole Known Network) Timeline",
1371 suggestions: ["example.com", "*.example.com"]
1372 },
1373 %{
1374 key: :reject,
1375 type: {:list, :string},
1376 description: "List of instances to reject activities from (except deletes)",
1377 suggestions: ["example.com", "*.example.com"]
1378 },
1379 %{
1380 key: :accept,
1381 type: {:list, :string},
1382 description: "List of instances to only accept activities from (except deletes)",
1383 suggestions: ["example.com", "*.example.com"]
1384 },
1385 %{
1386 key: :report_removal,
1387 type: {:list, :string},
1388 description: "List of instances to reject reports from",
1389 suggestions: ["example.com", "*.example.com"]
1390 },
1391 %{
1392 key: :avatar_removal,
1393 type: {:list, :string},
1394 description: "List of instances to strip avatars from",
1395 suggestions: ["example.com", "*.example.com"]
1396 },
1397 %{
1398 key: :banner_removal,
1399 type: {:list, :string},
1400 description: "List of instances to strip banners from",
1401 suggestions: ["example.com", "*.example.com"]
1402 },
1403 %{
1404 key: :reject_deletes,
1405 type: {:list, :string},
1406 description: "List of instances to reject deletions from",
1407 suggestions: ["example.com", "*.example.com"]
1408 }
1409 ]
1410 },
1411 %{
1412 group: :pleroma,
1413 key: :mrf_subchain,
1414 label: "MRF subchain",
1415 type: :group,
1416 description:
1417 "This policy processes messages through an alternate pipeline when a given message matches certain criteria." <>
1418 " All criteria are configured as a map of regular expressions to lists of policy modules.",
1419 children: [
1420 %{
1421 key: :match_actor,
1422 type: :map,
1423 description: "Matches a series of regular expressions against the actor field",
1424 suggestions: [
1425 %{
1426 ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy]
1427 }
1428 ]
1429 }
1430 ]
1431 },
1432 %{
1433 group: :pleroma,
1434 key: :mrf_rejectnonpublic,
1435 description:
1436 "MRF RejectNonPublic settings. RejectNonPublic drops posts with non-public visibility settings.",
1437 label: "MRF reject non public",
1438 type: :group,
1439 children: [
1440 %{
1441 key: :allow_followersonly,
1442 label: "Allow followers-only",
1443 type: :boolean,
1444 description: "Whether to allow followers-only posts"
1445 },
1446 %{
1447 key: :allow_direct,
1448 type: :boolean,
1449 description: "Whether to allow direct messages"
1450 }
1451 ]
1452 },
1453 %{
1454 group: :pleroma,
1455 key: :mrf_hellthread,
1456 label: "MRF hellthread",
1457 type: :group,
1458 description: "Block messages with too much mentions",
1459 children: [
1460 %{
1461 key: :delist_threshold,
1462 type: :integer,
1463 description:
1464 "Number of mentioned users after which the message gets delisted (the message can still be seen, " <>
1465 " but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable.",
1466 suggestions: [10]
1467 },
1468 %{
1469 key: :reject_threshold,
1470 type: :integer,
1471 description:
1472 "Number of mentioned users after which the messaged gets rejected. Set to 0 to disable.",
1473 suggestions: [20]
1474 }
1475 ]
1476 },
1477 %{
1478 group: :pleroma,
1479 key: :mrf_keyword,
1480 label: "MRF keyword",
1481 type: :group,
1482 description: "Reject or Word-Replace messages with a keyword or regex",
1483 children: [
1484 %{
1485 key: :reject,
1486 type: [:string, :regex],
1487 description:
1488 "A list of patterns which result in message being rejected. Each pattern can be a string or a regular expression.",
1489 suggestions: ["foo", ~r/foo/iu]
1490 },
1491 %{
1492 key: :federated_timeline_removal,
1493 type: [:string, :regex],
1494 description:
1495 "A list of patterns which result in message being removed from federated timelines (a.k.a unlisted). Each pattern can be a string or a regular expression.",
1496 suggestions: ["foo", ~r/foo/iu]
1497 },
1498 %{
1499 key: :replace,
1500 type: [{:tuple, :string, :string}, {:tuple, :regex, :string}],
1501 description:
1502 "A list of tuples containing {pattern, replacement}. Each pattern can be a string or a regular expression.",
1503 suggestions: [{"foo", "bar"}, {~r/foo/iu, "bar"}]
1504 }
1505 ]
1506 },
1507 %{
1508 group: :pleroma,
1509 key: :mrf_mention,
1510 label: "MRF mention",
1511 type: :group,
1512 description: "Block messages which mention a user",
1513 children: [
1514 %{
1515 key: :actors,
1516 type: {:list, :string},
1517 description: "A list of actors for which any post mentioning them will be dropped.",
1518 suggestions: ["actor1", "actor2"]
1519 }
1520 ]
1521 },
1522 %{
1523 group: :pleroma,
1524 key: :mrf_vocabulary,
1525 label: "MRF vocabulary",
1526 type: :group,
1527 description: "Filter messages which belong to certain activity vocabularies",
1528 children: [
1529 %{
1530 key: :accept,
1531 type: {:list, :string},
1532 description:
1533 "A list of ActivityStreams terms to accept. If empty, all supported messages are accepted",
1534 suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]
1535 },
1536 %{
1537 key: :reject,
1538 type: {:list, :string},
1539 description:
1540 "A list of ActivityStreams terms to reject. If empty, no messages are rejected",
1541 suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]
1542 }
1543 ]
1544 },
1545 # %{
1546 # group: :pleroma,
1547 # key: :mrf_user_allowlist,
1548 # type: :group,
1549 # description:
1550 # "The keys in this section are the domain names that the policy should apply to." <>
1551 # " Each key should be assigned a list of users that should be allowed through by their ActivityPub ID",
1552 # children: [
1553 # ["example.org": ["https://example.org/users/admin"]],
1554 # suggestions: [
1555 # ["example.org": ["https://example.org/users/admin"]]
1556 # ]
1557 # ]
1558 # },
1559 %{
1560 group: :pleroma,
1561 key: :media_proxy,
1562 type: :group,
1563 description: "Media proxy",
1564 children: [
1565 %{
1566 key: :enabled,
1567 type: :boolean,
1568 description: "Enables proxying of remote media to the instance's proxy"
1569 },
1570 %{
1571 key: :base_url,
1572 type: :string,
1573 description:
1574 "The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.",
1575 suggestions: ["https://example.com"]
1576 },
1577 %{
1578 key: :proxy_opts,
1579 type: :keyword,
1580 description: "Options for Pleroma.ReverseProxy",
1581 suggestions: [
1582 redirect_on_failure: false,
1583 max_body_length: 25 * 1_048_576,
1584 http: [
1585 follow_redirect: true,
1586 pool: :media
1587 ]
1588 ],
1589 children: [
1590 %{
1591 key: :redirect_on_failure,
1592 type: :boolean,
1593 description:
1594 "Redirects the client to the real remote URL if there's any HTTP errors. " <>
1595 "Any error during body processing will not be redirected as the response is chunked."
1596 },
1597 %{
1598 key: :max_body_length,
1599 type: :integer,
1600 description:
1601 "Limits the content length to be approximately the " <>
1602 "specified length. It is validated with the `content-length` header and also verified when proxying."
1603 },
1604 %{
1605 key: :http,
1606 type: :keyword,
1607 description: "HTTP options",
1608 children: [
1609 %{
1610 key: :adapter,
1611 type: :keyword,
1612 description: "Adapter specific options",
1613 children: [
1614 %{
1615 key: :ssl_options,
1616 type: :keyword,
1617 label: "SSL Options",
1618 description: "SSL options for HTTP adapter",
1619 children: [
1620 %{
1621 key: :versions,
1622 type: {:list, :atom},
1623 description: "List of TLS version to use",
1624 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
1625 }
1626 ]
1627 }
1628 ]
1629 },
1630 %{
1631 key: :proxy_url,
1632 label: "Proxy URL",
1633 type: [:string, :tuple],
1634 description: "Proxy URL",
1635 suggestions: ["127.0.0.1:8123", {:socks5, :localhost, 9050}]
1636 }
1637 ]
1638 }
1639 ]
1640 },
1641 %{
1642 key: :whitelist,
1643 type: {:list, :string},
1644 description: "List of domains to bypass the mediaproxy",
1645 suggestions: ["example.com"]
1646 }
1647 ]
1648 },
1649 %{
1650 group: :pleroma,
1651 key: :gopher,
1652 type: :group,
1653 description: "Gopher settings",
1654 children: [
1655 %{
1656 key: :enabled,
1657 type: :boolean,
1658 description: "Enables the gopher interface"
1659 },
1660 %{
1661 key: :ip,
1662 type: :tuple,
1663 description: "IP address to bind to",
1664 suggestions: [{0, 0, 0, 0}]
1665 },
1666 %{
1667 key: :port,
1668 type: :integer,
1669 description: "Port to bind to",
1670 suggestions: [9999]
1671 },
1672 %{
1673 key: :dstport,
1674 type: :integer,
1675 description: "Port advertised in urls (optional, defaults to port)",
1676 suggestions: [9999]
1677 }
1678 ]
1679 },
1680 %{
1681 group: :pleroma,
1682 key: :activitypub,
1683 type: :group,
1684 description: "ActivityPub-related settings",
1685 children: [
1686 %{
1687 key: :unfollow_blocked,
1688 type: :boolean,
1689 description: "Whether blocks result in people getting unfollowed"
1690 },
1691 %{
1692 key: :outgoing_blocks,
1693 type: :boolean,
1694 description: "Whether to federate blocks to other instances"
1695 },
1696 %{
1697 key: :sign_object_fetches,
1698 type: :boolean,
1699 description: "Sign object fetches with HTTP signatures"
1700 },
1701 %{
1702 key: :note_replies_output_limit,
1703 type: :integer,
1704 description:
1705 "The number of Note replies' URIs to be included with outgoing federation (`5` to match Mastodon hardcoded value, `0` to disable the output)."
1706 },
1707 %{
1708 key: :follow_handshake_timeout,
1709 type: :integer,
1710 description: "Following handshake timeout",
1711 suggestions: [500]
1712 }
1713 ]
1714 },
1715 %{
1716 group: :pleroma,
1717 key: :http_security,
1718 type: :group,
1719 description: "HTTP security settings",
1720 children: [
1721 %{
1722 key: :enabled,
1723 type: :boolean,
1724 description: "Whether the managed content security policy is enabled"
1725 },
1726 %{
1727 key: :sts,
1728 label: "STS",
1729 type: :boolean,
1730 description: "Whether to additionally send a Strict-Transport-Security header"
1731 },
1732 %{
1733 key: :sts_max_age,
1734 label: "STS max age",
1735 type: :integer,
1736 description: "The maximum age for the Strict-Transport-Security header if sent",
1737 suggestions: [31_536_000]
1738 },
1739 %{
1740 key: :ct_max_age,
1741 label: "CT max age",
1742 type: :integer,
1743 description: "The maximum age for the Expect-CT header if sent",
1744 suggestions: [2_592_000]
1745 },
1746 %{
1747 key: :referrer_policy,
1748 type: :string,
1749 description: "The referrer policy to use, either \"same-origin\" or \"no-referrer\"",
1750 suggestions: ["same-origin", "no-referrer"]
1751 },
1752 %{
1753 key: :report_uri,
1754 label: "Report URI",
1755 type: :string,
1756 description: "Adds the specified url to report-uri and report-to group in CSP header",
1757 suggestions: ["https://example.com/report-uri"]
1758 }
1759 ]
1760 },
1761 %{
1762 group: :web_push_encryption,
1763 key: :vapid_details,
1764 type: :group,
1765 description:
1766 "Web Push Notifications configuration. You can use the mix task mix web_push.gen.keypair to generate it",
1767 children: [
1768 %{
1769 key: :subject,
1770 type: :string,
1771 description:
1772 "A mailto link for the administrative contact." <>
1773 " It's best if this email is not a personal email address, but rather a group email to the instance moderation team.",
1774 suggestions: ["mailto:moderators@pleroma.com"]
1775 },
1776 %{
1777 key: :public_key,
1778 type: :string,
1779 description: "VAPID public key",
1780 suggestions: ["Public key"]
1781 },
1782 %{
1783 key: :private_key,
1784 type: :string,
1785 description: "VAPID private key",
1786 suggestions: ["Private key"]
1787 }
1788 ]
1789 },
1790 %{
1791 group: :pleroma,
1792 key: Pleroma.Captcha,
1793 type: :group,
1794 description: "Captcha-related settings",
1795 children: [
1796 %{
1797 key: :enabled,
1798 type: :boolean,
1799 description: "Whether the captcha should be shown on registration"
1800 },
1801 %{
1802 key: :method,
1803 type: :module,
1804 description: "The method/service to use for captcha",
1805 suggestions: [Pleroma.Captcha.Kocaptcha, Pleroma.Captcha.Native]
1806 },
1807 %{
1808 key: :seconds_valid,
1809 type: :integer,
1810 description: "The time in seconds for which the captcha is valid",
1811 suggestions: [60]
1812 }
1813 ]
1814 },
1815 %{
1816 group: :pleroma,
1817 key: Pleroma.Captcha.Kocaptcha,
1818 type: :group,
1819 description:
1820 "Kocaptcha is a very simple captcha service with a single API endpoint, the source code is" <>
1821 " here: https://github.com/koto-bank/kocaptcha. The default endpoint (https://captcha.kotobank.ch) is hosted by the developer.",
1822 children: [
1823 %{
1824 key: :endpoint,
1825 type: :string,
1826 description: "The kocaptcha endpoint to use",
1827 suggestions: ["https://captcha.kotobank.ch"]
1828 }
1829 ]
1830 },
1831 %{
1832 group: :pleroma,
1833 type: :group,
1834 description:
1835 "Allows to set a token that can be used to authenticate with the admin api without using an actual user by giving it as the `admin_token` parameter",
1836 children: [
1837 %{
1838 key: :admin_token,
1839 type: :string,
1840 description: "Token",
1841 suggestions: ["We recommend a secure random string or UUID"]
1842 }
1843 ]
1844 },
1845 %{
1846 group: :pleroma,
1847 key: Oban,
1848 type: :group,
1849 description: """
1850 [Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
1851
1852 Note: if you are running PostgreSQL in [`silent_mode`](https://postgresqlco.nf/en/doc/param/silent_mode?version=9.1),
1853 it's advised to set [`log_destination`](https://postgresqlco.nf/en/doc/param/log_destination?version=9.1) to `syslog`,
1854 otherwise `postmaster.log` file may grow because of "you don't own a lock of type ShareLock" warnings
1855 (see https://github.com/sorentwo/oban/issues/52).
1856 """,
1857 children: [
1858 %{
1859 key: :repo,
1860 type: :module,
1861 description: "Application's Ecto repo",
1862 suggestions: [Pleroma.Repo]
1863 },
1864 %{
1865 key: :verbose,
1866 type: {:dropdown, :atom},
1867 description: "Logs verbose mode",
1868 suggestions: [false, :error, :warn, :info, :debug]
1869 },
1870 %{
1871 key: :prune,
1872 type: [:atom, :tuple],
1873 description:
1874 "Non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning)",
1875 suggestions: [:disabled, {:maxlen, 1500}, {:maxage, 60 * 60}]
1876 },
1877 %{
1878 key: :queues,
1879 type: {:keyword, :integer},
1880 description:
1881 "Background jobs queues (keys: queues, values: max numbers of concurrent jobs)",
1882 suggestions: [
1883 activity_expiration: 10,
1884 attachments_cleanup: 5,
1885 background: 5,
1886 federator_incoming: 50,
1887 federator_outgoing: 50,
1888 mailer: 10,
1889 scheduled_activities: 10,
1890 transmogrifier: 20,
1891 web_push: 50
1892 ],
1893 children: [
1894 %{
1895 key: :activity_expiration,
1896 type: :integer,
1897 description: "Activity expiration queue",
1898 suggestions: [10]
1899 },
1900 %{
1901 key: :attachments_cleanup,
1902 type: :integer,
1903 description: "Attachment deletion queue",
1904 suggestions: [5]
1905 },
1906 %{
1907 key: :background,
1908 type: :integer,
1909 description: "Background queue",
1910 suggestions: [5]
1911 },
1912 %{
1913 key: :federator_incoming,
1914 type: :integer,
1915 description: "Incoming federation queue",
1916 suggestions: [50]
1917 },
1918 %{
1919 key: :federator_outgoing,
1920 type: :integer,
1921 description: "Outgoing federation queue",
1922 suggestions: [50]
1923 },
1924 %{
1925 key: :mailer,
1926 type: :integer,
1927 description: "Email sender queue, see Pleroma.Emails.Mailer",
1928 suggestions: [10]
1929 },
1930 %{
1931 key: :scheduled_activities,
1932 type: :integer,
1933 description: "Scheduled activities queue, see Pleroma.ScheduledActivities",
1934 suggestions: [10]
1935 },
1936 %{
1937 key: :transmogrifier,
1938 type: :integer,
1939 description: "Transmogrifier queue",
1940 suggestions: [20]
1941 },
1942 %{
1943 key: :web_push,
1944 type: :integer,
1945 description: "Web push notifications queue",
1946 suggestions: [50]
1947 }
1948 ]
1949 },
1950 %{
1951 key: :crontab,
1952 type: {:list, :tuple},
1953 description: "Settings for cron background jobs",
1954 suggestions: [
1955 {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
1956 {"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
1957 {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
1958 {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
1959 {"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
1960 ]
1961 }
1962 ]
1963 },
1964 %{
1965 group: :pleroma,
1966 key: :workers,
1967 type: :group,
1968 description: "Includes custom worker options not interpretable directly by `Oban`",
1969 children: [
1970 %{
1971 key: :retries,
1972 type: {:keyword, :integer},
1973 description: "Max retry attempts for failed jobs, per `Oban` queue",
1974 suggestions: [
1975 federator_incoming: 5,
1976 federator_outgoing: 5
1977 ]
1978 }
1979 ]
1980 },
1981 %{
1982 group: :pleroma,
1983 key: Pleroma.Web.Metadata,
1984 type: :group,
1985 description: "Metadata-related settings",
1986 children: [
1987 %{
1988 key: :providers,
1989 type: {:list, :module},
1990 description: "List of metadata providers to enable",
1991 suggestions: [
1992 Pleroma.Web.Metadata.Providers.OpenGraph,
1993 Pleroma.Web.Metadata.Providers.TwitterCard,
1994 Pleroma.Web.Metadata.Providers.RelMe,
1995 Pleroma.Web.Metadata.Providers.Feed
1996 ]
1997 },
1998 %{
1999 key: :unfurl_nsfw,
2000 label: "Unfurl NSFW",
2001 type: :boolean,
2002 description: "When enabled NSFW attachments will be shown in previews"
2003 }
2004 ]
2005 },
2006 %{
2007 group: :pleroma,
2008 key: :rich_media,
2009 type: :group,
2010 description:
2011 "If enabled the instance will parse metadata from attached links to generate link previews.",
2012 children: [
2013 %{
2014 key: :enabled,
2015 type: :boolean,
2016 description: "Enables RichMedia parsing of URLs."
2017 },
2018 %{
2019 key: :ignore_hosts,
2020 type: {:list, :string},
2021 description: "List of hosts which will be ignored by the metadata parser.",
2022 suggestions: ["accounts.google.com", "xss.website"]
2023 },
2024 %{
2025 key: :ignore_tld,
2026 label: "Ignore TLD",
2027 type: {:list, :string},
2028 description: "List TLDs (top-level domains) which will ignore for parse metadata.",
2029 suggestions: ["local", "localdomain", "lan"]
2030 },
2031 %{
2032 key: :parsers,
2033 type: {:list, :module},
2034 description: "List of Rich Media parsers.",
2035 suggestions: [
2036 Pleroma.Web.RichMedia.Parsers.MetaTagsParser,
2037 Pleroma.Web.RichMedia.Parsers.OEmbed,
2038 Pleroma.Web.RichMedia.Parsers.OGP,
2039 Pleroma.Web.RichMedia.Parsers.TwitterCard
2040 ]
2041 },
2042 %{
2043 key: :ttl_setters,
2044 label: "TTL setters",
2045 type: {:list, :module},
2046 description: "List of rich media TTL setters.",
2047 suggestions: [
2048 Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl
2049 ]
2050 }
2051 ]
2052 },
2053 %{
2054 group: :auto_linker,
2055 key: :opts,
2056 type: :group,
2057 description: "Configuration for the auto_linker library",
2058 children: [
2059 %{
2060 key: :class,
2061 type: [:string, false],
2062 description: "Specify the class to be added to the generated link. Disable to clear",
2063 suggestions: ["auto-linker", false]
2064 },
2065 %{
2066 key: :rel,
2067 type: [:string, false],
2068 description: "Override the rel attribute. Disable to clear",
2069 suggestions: ["ugc", "noopener noreferrer", false]
2070 },
2071 %{
2072 key: :new_window,
2073 type: :boolean,
2074 description: "Link urls will open in new window/tab"
2075 },
2076 %{
2077 key: :truncate,
2078 type: [:integer, false],
2079 description:
2080 "Set to a number to truncate urls longer then the number. Truncated urls will end in `..`",
2081 suggestions: [15, false]
2082 },
2083 %{
2084 key: :strip_prefix,
2085 type: :boolean,
2086 description: "Strip the scheme prefix"
2087 },
2088 %{
2089 key: :extra,
2090 type: :boolean,
2091 description: "Link urls with rarely used schemes (magnet, ipfs, irc, etc.)"
2092 }
2093 ]
2094 },
2095 %{
2096 group: :pleroma,
2097 key: Pleroma.ScheduledActivity,
2098 type: :group,
2099 description: "Scheduled activities settings",
2100 children: [
2101 %{
2102 key: :daily_user_limit,
2103 type: :integer,
2104 description:
2105 "The number of scheduled activities a user is allowed to create in a single day. Default: 25.",
2106 suggestions: [25]
2107 },
2108 %{
2109 key: :total_user_limit,
2110 type: :integer,
2111 description:
2112 "The number of scheduled activities a user is allowed to create in total. Default: 300.",
2113 suggestions: [300]
2114 },
2115 %{
2116 key: :enabled,
2117 type: :boolean,
2118 description: "Whether scheduled activities are sent to the job queue to be executed"
2119 }
2120 ]
2121 },
2122 %{
2123 group: :pleroma,
2124 key: Pleroma.ActivityExpiration,
2125 type: :group,
2126 description: "Expired activity settings",
2127 children: [
2128 %{
2129 key: :enabled,
2130 type: :boolean,
2131 description: "Whether expired activities will be sent to the job queue to be deleted"
2132 }
2133 ]
2134 },
2135 %{
2136 group: :pleroma,
2137 type: :group,
2138 description: "Authenticator",
2139 children: [
2140 %{
2141 key: Pleroma.Web.Auth.Authenticator,
2142 type: :module,
2143 suggestions: [Pleroma.Web.Auth.PleromaAuthenticator, Pleroma.Web.Auth.LDAPAuthenticator]
2144 }
2145 ]
2146 },
2147 %{
2148 group: :pleroma,
2149 key: :ldap,
2150 type: :group,
2151 description:
2152 "Use LDAP for user authentication. When a user logs in to the Pleroma instance, the name and password" <>
2153 " will be verified by trying to authenticate (bind) to a LDAP server." <>
2154 " If a user exists in the LDAP directory but there is no account with the same name yet on the" <>
2155 " Pleroma instance then a new Pleroma account will be created with the same name as the LDAP user name.",
2156 children: [
2157 %{
2158 key: :enabled,
2159 type: :boolean,
2160 description: "Enables LDAP authentication"
2161 },
2162 %{
2163 key: :host,
2164 type: :string,
2165 description: "LDAP server hostname",
2166 suggestions: ["localhosts"]
2167 },
2168 %{
2169 key: :port,
2170 type: :integer,
2171 description: "LDAP port, e.g. 389 or 636",
2172 suggestions: [389, 636]
2173 },
2174 %{
2175 key: :ssl,
2176 label: "SSL",
2177 type: :boolean,
2178 description: "Enable to use SSL, usually implies the port 636"
2179 },
2180 %{
2181 key: :sslopts,
2182 label: "SSL options",
2183 type: :keyword,
2184 description: "Additional SSL options",
2185 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2186 children: [
2187 %{
2188 key: :cacertfile,
2189 type: :string,
2190 description: "Path to file with PEM encoded cacerts",
2191 suggestions: ["path/to/file/with/PEM/cacerts"]
2192 },
2193 %{
2194 key: :verify,
2195 type: :atom,
2196 description: "Type of cert verification",
2197 suggestions: [:verify_peer]
2198 }
2199 ]
2200 },
2201 %{
2202 key: :tls,
2203 label: "TLS",
2204 type: :boolean,
2205 description: "Enable to use STARTTLS, usually implies the port 389"
2206 },
2207 %{
2208 key: :tlsopts,
2209 label: "TLS options",
2210 type: :keyword,
2211 description: "Additional TLS options",
2212 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2213 children: [
2214 %{
2215 key: :cacertfile,
2216 type: :string,
2217 description: "Path to file with PEM encoded cacerts",
2218 suggestions: ["path/to/file/with/PEM/cacerts"]
2219 },
2220 %{
2221 key: :verify,
2222 type: :atom,
2223 description: "Type of cert verification",
2224 suggestions: [:verify_peer]
2225 }
2226 ]
2227 },
2228 %{
2229 key: :base,
2230 type: :string,
2231 description: "LDAP base, e.g. \"dc=example,dc=com\"",
2232 suggestions: ["dc=example,dc=com"]
2233 },
2234 %{
2235 key: :uid,
2236 type: :string,
2237 description:
2238 "LDAP attribute name to authenticate the user, e.g. when \"cn\", the filter will be \"cn=username,base\"",
2239 suggestions: ["cn"]
2240 }
2241 ]
2242 },
2243 %{
2244 group: :pleroma,
2245 key: :auth,
2246 type: :group,
2247 description: "Authentication / authorization settings",
2248 children: [
2249 %{
2250 key: :enforce_oauth_admin_scope_usage,
2251 type: :boolean,
2252 description:
2253 "OAuth admin scope requirement toggle. " <>
2254 "If enabled, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token " <>
2255 "(client app must support admin scopes). If disabled and token doesn't have admin scope(s)," <>
2256 "`is_admin` user flag grants access to admin-specific actions."
2257 },
2258 %{
2259 key: :auth_template,
2260 type: :string,
2261 description:
2262 "Authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.ee`.",
2263 suggestions: ["show.html"]
2264 },
2265 %{
2266 key: :oauth_consumer_template,
2267 type: :string,
2268 description:
2269 "OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to" <>
2270 " `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`.",
2271 suggestions: ["consumer.html"]
2272 },
2273 %{
2274 key: :oauth_consumer_strategies,
2275 type: {:list, :string},
2276 description:
2277 "The list of enabled OAuth consumer strategies. By default it's set by OAUTH_CONSUMER_STRATEGIES environment variable." <>
2278 " Each entry in this space-delimited string should be of format \"strategy\" or \"strategy:dependency\"" <>
2279 " (e.g. twitter or keycloak:ueberauth_keycloak_strategy in case dependency is named differently than ueberauth_<strategy>).",
2280 suggestions: ["twitter", "keycloak:ueberauth_keycloak_strategy"]
2281 }
2282 ]
2283 },
2284 %{
2285 group: :pleroma,
2286 key: :email_notifications,
2287 type: :group,
2288 description: "Email notifications settings",
2289 children: [
2290 %{
2291 key: :digest,
2292 type: :map,
2293 description:
2294 "emails of \"what you've missed\" for users who have been inactive for a while",
2295 suggestions: [
2296 %{
2297 active: false,
2298 schedule: "0 0 * * 0",
2299 interval: 7,
2300 inactivity_threshold: 7
2301 }
2302 ],
2303 children: [
2304 %{
2305 key: :active,
2306 label: "Enabled",
2307 type: :boolean,
2308 description: "Globally enable or disable digest emails"
2309 },
2310 %{
2311 key: :schedule,
2312 type: :string,
2313 description:
2314 "When to send digest email, in crontab format. \"0 0 0\" is the default, meaning \"once a week at midnight on Sunday morning\".",
2315 suggestions: ["0 0 * * 0"]
2316 },
2317 %{
2318 key: :interval,
2319 type: :integer,
2320 description: "Minimum interval between digest emails to one user",
2321 suggestions: [7]
2322 },
2323 %{
2324 key: :inactivity_threshold,
2325 type: :integer,
2326 description: "Minimum user inactivity threshold",
2327 suggestions: [7]
2328 }
2329 ]
2330 }
2331 ]
2332 },
2333 %{
2334 group: :pleroma,
2335 key: Pleroma.Emails.UserEmail,
2336 type: :group,
2337 description: "Email template settings",
2338 children: [
2339 %{
2340 key: :logo,
2341 type: :string,
2342 description: "A path to a custom logo. Set it to `nil` to use the default Pleroma logo.",
2343 suggestions: ["some/path/logo.png"]
2344 },
2345 %{
2346 key: :styling,
2347 type: :map,
2348 description: "a map with color settings for email templates.",
2349 suggestions: [
2350 %{
2351 link_color: "#d8a070",
2352 background_color: "#2C3645",
2353 content_background_color: "#1B2635",
2354 header_color: "#d8a070",
2355 text_color: "#b9b9ba",
2356 text_muted_color: "#b9b9ba"
2357 }
2358 ],
2359 children: [
2360 %{
2361 key: :link_color,
2362 type: :string,
2363 suggestions: ["#d8a070"]
2364 },
2365 %{
2366 key: :background_color,
2367 type: :string,
2368 suggestions: ["#2C3645"]
2369 },
2370 %{
2371 key: :content_background_color,
2372 type: :string,
2373 suggestions: ["#1B2635"]
2374 },
2375 %{
2376 key: :header_color,
2377 type: :string,
2378 suggestions: ["#d8a070"]
2379 },
2380 %{
2381 key: :text_color,
2382 type: :string,
2383 suggestions: ["#b9b9ba"]
2384 },
2385 %{
2386 key: :text_muted_color,
2387 type: :string,
2388 suggestions: ["#b9b9ba"]
2389 }
2390 ]
2391 }
2392 ]
2393 },
2394 %{
2395 group: :pleroma,
2396 key: Pleroma.Emails.NewUsersDigestEmail,
2397 type: :group,
2398 description: "New users admin email digest",
2399 children: [
2400 %{
2401 key: :enabled,
2402 type: :boolean,
2403 description: "enables new users admin digest email when `true`",
2404 suggestions: [false]
2405 }
2406 ]
2407 },
2408 %{
2409 group: :pleroma,
2410 key: :oauth2,
2411 type: :group,
2412 description: "Configure OAuth 2 provider capabilities",
2413 children: [
2414 %{
2415 key: :token_expires_in,
2416 type: :integer,
2417 description: "The lifetime in seconds of the access token",
2418 suggestions: [600]
2419 },
2420 %{
2421 key: :issue_new_refresh_token,
2422 type: :boolean,
2423 description:
2424 "Keeps old refresh token or generate new refresh token when to obtain an access token"
2425 },
2426 %{
2427 key: :clean_expired_tokens,
2428 type: :boolean,
2429 description: "Enable a background job to clean expired oauth tokens. Default: disabled."
2430 }
2431 ]
2432 },
2433 %{
2434 group: :pleroma,
2435 key: :emoji,
2436 type: :group,
2437 children: [
2438 %{
2439 key: :shortcode_globs,
2440 type: {:list, :string},
2441 description: "Location of custom emoji files. * can be used as a wildcard.",
2442 suggestions: ["/emoji/custom/**/*.png"]
2443 },
2444 %{
2445 key: :pack_extensions,
2446 type: {:list, :string},
2447 description:
2448 "A list of file extensions for emojis, when no emoji.txt for a pack is present",
2449 suggestions: [".png", ".gif"]
2450 },
2451 %{
2452 key: :groups,
2453 type: {:keyword, :string, {:list, :string}},
2454 description:
2455 "Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the group name" <>
2456 " and the value is the location or array of locations. * can be used as a wildcard.",
2457 suggestions: [
2458 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
2459 ]
2460 },
2461 %{
2462 key: :default_manifest,
2463 type: :string,
2464 description:
2465 "Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download." <>
2466 " Currently only one manifest can be added (no arrays).",
2467 suggestions: ["https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"]
2468 },
2469 %{
2470 key: :shared_pack_cache_seconds_per_file,
2471 label: "Shared pack cache s/file",
2472 type: :integer,
2473 descpiption:
2474 "When an emoji pack is shared, the archive is created and cached in memory" <>
2475 " for this amount of seconds multiplied by the number of files.",
2476 suggestions: [60]
2477 }
2478 ]
2479 },
2480 %{
2481 group: :pleroma,
2482 key: :rate_limit,
2483 type: :group,
2484 description:
2485 "Rate limit settings. This is an advanced feature enabled only for :authentication by default.",
2486 children: [
2487 %{
2488 key: :search,
2489 type: [:tuple, {:list, :tuple}],
2490 description: "For the search requests (account & status search etc.)",
2491 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2492 },
2493 %{
2494 key: :timeline,
2495 type: [:tuple, {:list, :tuple}],
2496 description: "For requests to timelines (each timeline has it's own limiter)",
2497 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2498 },
2499 %{
2500 key: :app_account_creation,
2501 type: [:tuple, {:list, :tuple}],
2502 description: "For registering user accounts from the same IP address",
2503 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2504 },
2505 %{
2506 key: :relations_actions,
2507 type: [:tuple, {:list, :tuple}],
2508 description: "For actions on relationships with all users (follow, unfollow)",
2509 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2510 },
2511 %{
2512 key: :relation_id_action,
2513 type: [:tuple, {:list, :tuple}],
2514 description: "For actions on relation with a specific user (follow, unfollow)",
2515 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2516 },
2517 %{
2518 key: :statuses_actions,
2519 type: [:tuple, {:list, :tuple}],
2520 description:
2521 "For create / delete / fav / unfav / reblog / unreblog actions on any statuses",
2522 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2523 },
2524 %{
2525 key: :status_id_action,
2526 type: [:tuple, {:list, :tuple}],
2527 description:
2528 "For fav / unfav or reblog / unreblog actions on the same status by the same user",
2529 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2530 },
2531 %{
2532 key: :authentication,
2533 type: [:tuple, {:list, :tuple}],
2534 description: "For authentication create / password check / user existence check requests",
2535 suggestions: [{60_000, 15}]
2536 }
2537 ]
2538 },
2539 %{
2540 group: :esshd,
2541 type: :group,
2542 description:
2543 "Before enabling this you must add :esshd to mix.exs as one of the extra_applications " <>
2544 "and generate host keys in your priv dir with ssh-keygen -m PEM -N \"\" -b 2048 -t rsa -f ssh_host_rsa_key",
2545 children: [
2546 %{
2547 key: :enabled,
2548 type: :boolean,
2549 description: "Enables SSH"
2550 },
2551 %{
2552 key: :priv_dir,
2553 type: :string,
2554 description: "Dir with SSH keys",
2555 suggestions: ["/some/path/ssh_keys"]
2556 },
2557 %{
2558 key: :handler,
2559 type: :string,
2560 description: "Handler module",
2561 suggestions: ["Pleroma.BBS.Handler"]
2562 },
2563 %{
2564 key: :port,
2565 type: :integer,
2566 description: "Port to connect",
2567 suggestions: [10_022]
2568 },
2569 %{
2570 key: :password_authenticator,
2571 type: :string,
2572 description: "Authenticator module",
2573 suggestions: ["Pleroma.BBS.Authenticator"]
2574 }
2575 ]
2576 },
2577 %{
2578 group: :mime,
2579 type: :group,
2580 description: "Mime types",
2581 children: [
2582 %{
2583 key: :types,
2584 type: :map,
2585 suggestions: [
2586 %{
2587 "application/xml" => ["xml"],
2588 "application/xrd+xml" => ["xrd+xml"],
2589 "application/jrd+json" => ["jrd+json"],
2590 "application/activity+json" => ["activity+json"],
2591 "application/ld+json" => ["activity+json"]
2592 }
2593 ],
2594 children: [
2595 %{
2596 key: "application/xml",
2597 type: {:list, :string},
2598 suggestions: ["xml"]
2599 },
2600 %{
2601 key: "application/xrd+xml",
2602 type: {:list, :string},
2603 suggestions: ["xrd+xml"]
2604 },
2605 %{
2606 key: "application/jrd+json",
2607 type: {:list, :string},
2608 suggestions: ["jrd+json"]
2609 },
2610 %{
2611 key: "application/activity+json",
2612 type: {:list, :string},
2613 suggestions: ["activity+json"]
2614 },
2615 %{
2616 key: "application/ld+json",
2617 type: {:list, :string},
2618 suggestions: ["activity+json"]
2619 }
2620 ]
2621 }
2622 ]
2623 },
2624 %{
2625 group: :pleroma,
2626 key: :chat,
2627 type: :group,
2628 description: "Pleroma chat settings",
2629 children: [
2630 %{
2631 key: :enabled,
2632 type: :boolean
2633 }
2634 ]
2635 },
2636 %{
2637 group: :http_signatures,
2638 type: :group,
2639 description: "HTTP Signatures settings",
2640 children: [
2641 %{
2642 key: :adapter,
2643 type: :module,
2644 suggestions: [Pleroma.Signature]
2645 }
2646 ]
2647 },
2648 %{
2649 group: :pleroma,
2650 key: :http,
2651 type: :group,
2652 description: "HTTP settings",
2653 children: [
2654 %{
2655 key: :proxy_url,
2656 label: "Proxy URL",
2657 type: [:string, :tuple],
2658 description: "Proxy URL",
2659 suggestions: ["localhost:9020", {:socks5, :localhost, 3090}]
2660 },
2661 %{
2662 key: :send_user_agent,
2663 type: :boolean
2664 },
2665 %{
2666 key: :user_agent,
2667 type: [:string, :atom],
2668 description:
2669 "What user agent to use. Must be a string or an atom `:default`. Default value is `:default`.",
2670 suggestions: ["Pleroma", :default]
2671 },
2672 %{
2673 key: :adapter,
2674 type: :keyword,
2675 description: "Adapter specific options",
2676 suggestions: [],
2677 children: [
2678 %{
2679 key: :ssl_options,
2680 type: :keyword,
2681 label: "SSL Options",
2682 description: "SSL options for HTTP adapter",
2683 children: [
2684 %{
2685 key: :versions,
2686 type: {:list, :atom},
2687 description: "List of TLS version to use",
2688 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
2689 }
2690 ]
2691 }
2692 ]
2693 }
2694 ]
2695 },
2696 %{
2697 group: :pleroma,
2698 key: :markup,
2699 type: :group,
2700 children: [
2701 %{
2702 key: :allow_inline_images,
2703 type: :boolean
2704 },
2705 %{
2706 key: :allow_headings,
2707 type: :boolean
2708 },
2709 %{
2710 key: :allow_tables,
2711 type: :boolean
2712 },
2713 %{
2714 key: :allow_fonts,
2715 type: :boolean
2716 },
2717 %{
2718 key: :scrub_policy,
2719 type: {:list, :module},
2720 suggestions: [Pleroma.HTML.Transform.MediaProxy, Pleroma.HTML.Scrubber.Default]
2721 }
2722 ]
2723 },
2724 %{
2725 group: :pleroma,
2726 key: :user,
2727 type: :group,
2728 children: [
2729 %{
2730 key: :deny_follow_blocked,
2731 type: :boolean
2732 }
2733 ]
2734 },
2735 %{
2736 group: :pleroma,
2737 key: :mrf_normalize_markup,
2738 label: "MRF normalize markup",
2739 description: "MRF NormalizeMarkup settings. Scrub configured hypertext markup.",
2740 type: :group,
2741 children: [
2742 %{
2743 key: :scrub_policy,
2744 type: :module,
2745 suggestions: [Pleroma.HTML.Scrubber.Default]
2746 }
2747 ]
2748 },
2749 %{
2750 group: :pleroma,
2751 key: Pleroma.User,
2752 type: :group,
2753 children: [
2754 %{
2755 key: :restricted_nicknames,
2756 type: {:list, :string},
2757 suggestions: [
2758 ".well-known",
2759 "~",
2760 "about",
2761 "activities",
2762 "api",
2763 "auth",
2764 "check_password",
2765 "dev",
2766 "friend-requests",
2767 "inbox",
2768 "internal",
2769 "main",
2770 "media",
2771 "nodeinfo",
2772 "notice",
2773 "oauth",
2774 "objects",
2775 "ostatus_subscribe",
2776 "pleroma",
2777 "proxy",
2778 "push",
2779 "registration",
2780 "relay",
2781 "settings",
2782 "status",
2783 "tag",
2784 "user-search",
2785 "user_exists",
2786 "users",
2787 "web"
2788 ]
2789 }
2790 ]
2791 },
2792 %{
2793 group: :cors_plug,
2794 type: :group,
2795 children: [
2796 %{
2797 key: :max_age,
2798 type: :integer,
2799 suggestions: [86_400]
2800 },
2801 %{
2802 key: :methods,
2803 type: {:list, :string},
2804 suggestions: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"]
2805 },
2806 %{
2807 key: :expose,
2808 type: {:list, :string},
2809 suggestions: [
2810 "Link",
2811 "X-RateLimit-Reset",
2812 "X-RateLimit-Limit",
2813 "X-RateLimit-Remaining",
2814 "X-Request-Id",
2815 "Idempotency-Key"
2816 ]
2817 },
2818 %{
2819 key: :credentials,
2820 type: :boolean
2821 },
2822 %{
2823 key: :headers,
2824 type: {:list, :string},
2825 suggestions: ["Authorization", "Content-Type", "Idempotency-Key"]
2826 }
2827 ]
2828 },
2829 %{
2830 group: :pleroma,
2831 key: Pleroma.Plugs.RemoteIp,
2832 type: :group,
2833 description: """
2834 `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
2835 **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
2836 """,
2837 children: [
2838 %{
2839 key: :enabled,
2840 type: :boolean,
2841 description: "Enable/disable the plug. Default: disabled."
2842 },
2843 %{
2844 key: :headers,
2845 type: {:list, :string},
2846 description:
2847 "A list of strings naming the `req_headers` to use when deriving the `remote_ip`. Order does not matter. Default: `~w[forwarded x-forwarded-for x-client-ip x-real-ip]`."
2848 },
2849 %{
2850 key: :proxies,
2851 type: {:list, :string},
2852 description:
2853 "A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Default: `[]`."
2854 },
2855 %{
2856 key: :reserved,
2857 type: {:list, :string},
2858 description:
2859 "Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network)."
2860 }
2861 ]
2862 },
2863 %{
2864 group: :pleroma,
2865 key: :web_cache_ttl,
2866 type: :group,
2867 description:
2868 "The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.",
2869 children: [
2870 %{
2871 key: :activity_pub,
2872 type: :integer,
2873 description:
2874 "Activity pub routes (except question activities). Default: `nil` (no expiration).",
2875 suggestions: [30_000, nil]
2876 },
2877 %{
2878 key: :activity_pub_question,
2879 type: :integer,
2880 description: "Activity pub routes (question activities). Default: `30_000` (30 seconds).",
2881 suggestions: [30_000]
2882 }
2883 ]
2884 },
2885 %{
2886 group: :pleroma,
2887 key: :static_fe,
2888 type: :group,
2889 description:
2890 "Render profiles and posts using server-generated HTML that is viewable without using JavaScript.",
2891 children: [
2892 %{
2893 key: :enabled,
2894 type: :boolean,
2895 description: "Enables the rendering of static HTML. Default: disabled."
2896 }
2897 ]
2898 },
2899 %{
2900 group: :pleroma,
2901 key: :feed,
2902 type: :group,
2903 description: "Configure feed rendering",
2904 children: [
2905 %{
2906 key: :post_title,
2907 type: :map,
2908 description: "Configure title rendering.",
2909 children: [
2910 %{
2911 key: :max_length,
2912 type: :integer,
2913 description: "Maximum number of characters before truncating title.",
2914 suggestions: [100]
2915 },
2916 %{
2917 key: :omission,
2918 type: :string,
2919 description: "Replacement which will be used after truncating string.",
2920 suggestions: ["..."]
2921 }
2922 ]
2923 }
2924 ]
2925 },
2926 %{
2927 group: :pleroma,
2928 key: :mrf_object_age,
2929 type: :group,
2930 description: "Rejects or delists posts based on their age when received.",
2931 children: [
2932 %{
2933 key: :threshold,
2934 type: :integer,
2935 description: "Required age (in seconds) of a post before actions are taken.",
2936 suggestions: [172_800]
2937 },
2938 %{
2939 key: :actions,
2940 type: {:list, :atom},
2941 description:
2942 "A list of actions to apply to the post. `:delist` removes the post from public timelines; " <>
2943 "`:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines; " <>
2944 "`:reject` rejects the message entirely",
2945 suggestions: [:delist, :strip_followers, :reject]
2946 }
2947 ]
2948 },
2949 %{
2950 group: :pleroma,
2951 key: :modules,
2952 type: :group,
2953 description: "Custom Runtime Modules",
2954 children: [
2955 %{
2956 key: :runtime_dir,
2957 type: :string,
2958 description: "A path to custom Elixir modules (such as MRF policies)."
2959 }
2960 ]
2961 },
2962 %{
2963 group: :pleroma,
2964 key: :streamer,
2965 type: :group,
2966 description: "Settings for notifications streamer",
2967 children: [
2968 %{
2969 key: :workers,
2970 type: :integer,
2971 description: "Number of workers to send notifications.",
2972 suggestions: [3]
2973 },
2974 %{
2975 key: :overflow_workers,
2976 type: :integer,
2977 description: "Maximum number of workers created if pool is empty.",
2978 suggestions: [2]
2979 }
2980 ]
2981 },
2982 %{
2983 group: :pleroma,
2984 key: :connections_pool,
2985 type: :group,
2986 description: "Advanced settings for `gun` connections pool",
2987 children: [
2988 %{
2989 key: :checkin_timeout,
2990 type: :integer,
2991 description: "Timeout to checkin connection from pool. Default: 250ms.",
2992 suggestions: [250]
2993 },
2994 %{
2995 key: :max_connections,
2996 type: :integer,
2997 description: "Maximum number of connections in the pool. Default: 250 connections.",
2998 suggestions: [250]
2999 },
3000 %{
3001 key: :retry,
3002 type: :integer,
3003 description:
3004 "Number of retries, while `gun` will try to reconnect if connection goes down. Default: 1.",
3005 suggestions: [1]
3006 },
3007 %{
3008 key: :retry_timeout,
3009 type: :integer,
3010 description:
3011 "Time between retries when `gun` will try to reconnect in milliseconds. Default: 1000ms.",
3012 suggestions: [1000]
3013 },
3014 %{
3015 key: :await_up_timeout,
3016 type: :integer,
3017 description: "Timeout while `gun` will wait until connection is up. Default: 5000ms.",
3018 suggestions: [5000]
3019 }
3020 ]
3021 },
3022 %{
3023 group: :pleroma,
3024 key: :pools,
3025 type: :group,
3026 description: "Advanced settings for `gun` workers pools",
3027 children: [
3028 %{
3029 key: :federation,
3030 type: :keyword,
3031 description: "Settings for federation pool.",
3032 children: [
3033 %{
3034 key: :size,
3035 type: :integer,
3036 description: "Number workers in the pool.",
3037 suggestions: [50]
3038 },
3039 %{
3040 key: :max_overflow,
3041 type: :integer,
3042 description: "Number of additional workers if pool is under load.",
3043 suggestions: [10]
3044 },
3045 %{
3046 key: :timeout,
3047 type: :integer,
3048 description: "Timeout while `gun` will wait for response.",
3049 suggestions: [150_000]
3050 }
3051 ]
3052 },
3053 %{
3054 key: :media,
3055 type: :keyword,
3056 description: "Settings for media pool.",
3057 children: [
3058 %{
3059 key: :size,
3060 type: :integer,
3061 description: "Number workers in the pool.",
3062 suggestions: [50]
3063 },
3064 %{
3065 key: :max_overflow,
3066 type: :integer,
3067 description: "Number of additional workers if pool is under load.",
3068 suggestions: [10]
3069 },
3070 %{
3071 key: :timeout,
3072 type: :integer,
3073 description: "Timeout while `gun` will wait for response.",
3074 suggestions: [150_000]
3075 }
3076 ]
3077 },
3078 %{
3079 key: :upload,
3080 type: :keyword,
3081 description: "Settings for upload pool.",
3082 children: [
3083 %{
3084 key: :size,
3085 type: :integer,
3086 description: "Number workers in the pool.",
3087 suggestions: [25]
3088 },
3089 %{
3090 key: :max_overflow,
3091 type: :integer,
3092 description: "Number of additional workers if pool is under load.",
3093 suggestions: [5]
3094 },
3095 %{
3096 key: :timeout,
3097 type: :integer,
3098 description: "Timeout while `gun` will wait for response.",
3099 suggestions: [300_000]
3100 }
3101 ]
3102 },
3103 %{
3104 key: :default,
3105 type: :keyword,
3106 description: "Settings for default pool.",
3107 children: [
3108 %{
3109 key: :size,
3110 type: :integer,
3111 description: "Number workers in the pool.",
3112 suggestions: [10]
3113 },
3114 %{
3115 key: :max_overflow,
3116 type: :integer,
3117 description: "Number of additional workers if pool is under load.",
3118 suggestions: [2]
3119 },
3120 %{
3121 key: :timeout,
3122 type: :integer,
3123 description: "Timeout while `gun` will wait for response.",
3124 suggestions: [10_000]
3125 }
3126 ]
3127 }
3128 ]
3129 },
3130 %{
3131 group: :pleroma,
3132 key: :hackney_pools,
3133 type: :group,
3134 description: "Advanced settings for `hackney` connections pools",
3135 children: [
3136 %{
3137 key: :federation,
3138 type: :keyword,
3139 description: "Settings for federation pool.",
3140 children: [
3141 %{
3142 key: :max_connections,
3143 type: :integer,
3144 description: "Number workers in the pool.",
3145 suggestions: [50]
3146 },
3147 %{
3148 key: :timeout,
3149 type: :integer,
3150 description: "Timeout while `hackney` will wait for response.",
3151 suggestions: [150_000]
3152 }
3153 ]
3154 },
3155 %{
3156 key: :media,
3157 type: :keyword,
3158 description: "Settings for media pool.",
3159 children: [
3160 %{
3161 key: :max_connections,
3162 type: :integer,
3163 description: "Number workers in the pool.",
3164 suggestions: [50]
3165 },
3166 %{
3167 key: :timeout,
3168 type: :integer,
3169 description: "Timeout while `hackney` will wait for response.",
3170 suggestions: [150_000]
3171 }
3172 ]
3173 },
3174 %{
3175 key: :upload,
3176 type: :keyword,
3177 description: "Settings for upload pool.",
3178 children: [
3179 %{
3180 key: :max_connections,
3181 type: :integer,
3182 description: "Number workers in the pool.",
3183 suggestions: [25]
3184 },
3185 %{
3186 key: :timeout,
3187 type: :integer,
3188 description: "Timeout while `hackney` will wait for response.",
3189 suggestions: [300_000]
3190 }
3191 ]
3192 }
3193 ]
3194 },
3195 %{
3196 group: :pleroma,
3197 key: :restrict_unauthenticated,
3198 type: :group,
3199 description:
3200 "Disallow viewing timelines, user profiles and statuses for unauthenticated users.",
3201 children: [
3202 %{
3203 key: :timelines,
3204 type: :map,
3205 description: "Settings for public and federated timelines.",
3206 children: [
3207 %{
3208 key: :local,
3209 type: :boolean,
3210 description: "Disallow view public timeline."
3211 },
3212 %{
3213 key: :federated,
3214 type: :boolean,
3215 description: "Disallow view federated timeline."
3216 }
3217 ]
3218 },
3219 %{
3220 key: :profiles,
3221 type: :map,
3222 description: "Settings for user profiles.",
3223 children: [
3224 %{
3225 key: :local,
3226 type: :boolean,
3227 description: "Disallow view local user profiles."
3228 },
3229 %{
3230 key: :remote,
3231 type: :boolean,
3232 description: "Disallow view remote user profiles."
3233 }
3234 ]
3235 },
3236 %{
3237 key: :activities,
3238 type: :map,
3239 description: "Settings for statuses.",
3240 children: [
3241 %{
3242 key: :local,
3243 type: :boolean,
3244 description: "Disallow view local statuses."
3245 },
3246 %{
3247 key: :remote,
3248 type: :boolean,
3249 description: "Disallow view remote statuses."
3250 }
3251 ]
3252 }
3253 ]
3254 },
3255 %{
3256 group: :pleroma,
3257 key: Pleroma.Web.ApiSpec.CastAndValidate,
3258 type: :group,
3259 children: [
3260 %{
3261 key: :strict,
3262 type: :boolean,
3263 description:
3264 "Enables strict input validation (useful in development, not recommended in production)",
3265 suggestions: [false]
3266 }
3267 ]
3268 }
3269 ]