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