Merge branch 'feature/2118-web-push-encryption-http' into 'develop'
[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 http: [
1891 follow_redirect: true,
1892 pool: :media
1893 ]
1894 ],
1895 children: [
1896 %{
1897 key: :redirect_on_failure,
1898 type: :boolean,
1899 description:
1900 "Redirects the client to the real remote URL if there's any HTTP errors. " <>
1901 "Any error during body processing will not be redirected as the response is chunked."
1902 },
1903 %{
1904 key: :max_body_length,
1905 type: :integer,
1906 description:
1907 "Limits the content length to be approximately the " <>
1908 "specified length. It is validated with the `content-length` header and also verified when proxying."
1909 },
1910 %{
1911 key: :http,
1912 label: "HTTP",
1913 type: :keyword,
1914 description: "HTTP options",
1915 children: [
1916 %{
1917 key: :adapter,
1918 type: :keyword,
1919 description: "Adapter specific options",
1920 children: [
1921 %{
1922 key: :ssl_options,
1923 type: :keyword,
1924 label: "SSL Options",
1925 description: "SSL options for HTTP adapter",
1926 children: [
1927 %{
1928 key: :versions,
1929 type: {:list, :atom},
1930 description: "List of TLS version to use",
1931 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
1932 }
1933 ]
1934 }
1935 ]
1936 },
1937 %{
1938 key: :proxy_url,
1939 label: "Proxy URL",
1940 type: [:string, :tuple],
1941 description: "Proxy URL",
1942 suggestions: ["127.0.0.1:8123", {:socks5, :localhost, 9050}]
1943 }
1944 ]
1945 }
1946 ]
1947 },
1948 %{
1949 key: :whitelist,
1950 type: {:list, :string},
1951 description: "List of hosts with scheme to bypass the mediaproxy",
1952 suggestions: ["http://example.com"]
1953 }
1954 ]
1955 },
1956 %{
1957 group: :pleroma,
1958 key: Pleroma.Web.MediaProxy.Invalidation.Http,
1959 type: :group,
1960 description: "HTTP invalidate settings",
1961 children: [
1962 %{
1963 key: :method,
1964 type: :atom,
1965 description: "HTTP method of request. Default: :purge"
1966 },
1967 %{
1968 key: :headers,
1969 type: {:keyword, :string},
1970 description: "HTTP headers of request",
1971 suggestions: [{"x-refresh", 1}]
1972 },
1973 %{
1974 key: :options,
1975 type: :keyword,
1976 description: "Request options",
1977 children: [
1978 %{
1979 key: :params,
1980 type: {:map, :string}
1981 }
1982 ]
1983 }
1984 ]
1985 },
1986 %{
1987 group: :pleroma,
1988 key: Pleroma.Web.MediaProxy.Invalidation.Script,
1989 type: :group,
1990 description: "Script invalidate settings",
1991 children: [
1992 %{
1993 key: :script_path,
1994 type: :string,
1995 description: "Path to shell script. Which will run purge cache.",
1996 suggestions: ["./installation/nginx-cache-purge.sh.example"]
1997 }
1998 ]
1999 },
2000 %{
2001 group: :pleroma,
2002 key: :gopher,
2003 type: :group,
2004 description: "Gopher settings",
2005 children: [
2006 %{
2007 key: :enabled,
2008 type: :boolean,
2009 description: "Enables the gopher interface"
2010 },
2011 %{
2012 key: :ip,
2013 label: "IP",
2014 type: :tuple,
2015 description: "IP address to bind to",
2016 suggestions: [{0, 0, 0, 0}]
2017 },
2018 %{
2019 key: :port,
2020 type: :integer,
2021 description: "Port to bind to",
2022 suggestions: [9999]
2023 },
2024 %{
2025 key: :dstport,
2026 type: :integer,
2027 description: "Port advertised in URLs (optional, defaults to port)",
2028 suggestions: [9999]
2029 }
2030 ]
2031 },
2032 %{
2033 group: :pleroma,
2034 key: :activitypub,
2035 label: "ActivityPub",
2036 type: :group,
2037 description: "ActivityPub-related settings",
2038 children: [
2039 %{
2040 key: :unfollow_blocked,
2041 type: :boolean,
2042 description: "Whether blocks result in people getting unfollowed"
2043 },
2044 %{
2045 key: :outgoing_blocks,
2046 type: :boolean,
2047 description: "Whether to federate blocks to other instances"
2048 },
2049 %{
2050 key: :sign_object_fetches,
2051 type: :boolean,
2052 description: "Sign object fetches with HTTP signatures"
2053 },
2054 %{
2055 key: :note_replies_output_limit,
2056 type: :integer,
2057 description:
2058 "The number of Note replies' URIs to be included with outgoing federation (`5` to match Mastodon hardcoded value, `0` to disable the output)"
2059 },
2060 %{
2061 key: :follow_handshake_timeout,
2062 type: :integer,
2063 description: "Following handshake timeout",
2064 suggestions: [500]
2065 }
2066 ]
2067 },
2068 %{
2069 group: :pleroma,
2070 key: :http_security,
2071 label: "HTTP security",
2072 type: :group,
2073 description: "HTTP security settings",
2074 children: [
2075 %{
2076 key: :enabled,
2077 type: :boolean,
2078 description: "Whether the managed content security policy is enabled"
2079 },
2080 %{
2081 key: :sts,
2082 label: "STS",
2083 type: :boolean,
2084 description: "Whether to additionally send a Strict-Transport-Security header"
2085 },
2086 %{
2087 key: :sts_max_age,
2088 label: "STS max age",
2089 type: :integer,
2090 description: "The maximum age for the Strict-Transport-Security header if sent",
2091 suggestions: [31_536_000]
2092 },
2093 %{
2094 key: :ct_max_age,
2095 label: "CT max age",
2096 type: :integer,
2097 description: "The maximum age for the Expect-CT header if sent",
2098 suggestions: [2_592_000]
2099 },
2100 %{
2101 key: :referrer_policy,
2102 type: :string,
2103 description: "The referrer policy to use, either \"same-origin\" or \"no-referrer\"",
2104 suggestions: ["same-origin", "no-referrer"]
2105 },
2106 %{
2107 key: :report_uri,
2108 label: "Report URI",
2109 type: :string,
2110 description: "Adds the specified URL to report-uri and report-to group in CSP header",
2111 suggestions: ["https://example.com/report-uri"]
2112 }
2113 ]
2114 },
2115 %{
2116 group: :web_push_encryption,
2117 key: :vapid_details,
2118 label: "Vapid Details",
2119 type: :group,
2120 description:
2121 "Web Push Notifications configuration. You can use the mix task mix web_push.gen.keypair to generate it.",
2122 children: [
2123 %{
2124 key: :subject,
2125 type: :string,
2126 description:
2127 "A mailto link for the administrative contact." <>
2128 " It's best if this email is not a personal email address, but rather a group email to the instance moderation team.",
2129 suggestions: ["mailto:moderators@pleroma.com"]
2130 },
2131 %{
2132 key: :public_key,
2133 type: :string,
2134 description: "VAPID public key",
2135 suggestions: ["Public key"]
2136 },
2137 %{
2138 key: :private_key,
2139 type: :string,
2140 description: "VAPID private key",
2141 suggestions: ["Private key"]
2142 }
2143 ]
2144 },
2145 %{
2146 group: :pleroma,
2147 key: Pleroma.Captcha,
2148 type: :group,
2149 description: "Captcha-related settings",
2150 children: [
2151 %{
2152 key: :enabled,
2153 type: :boolean,
2154 description: "Whether the captcha should be shown on registration"
2155 },
2156 %{
2157 key: :method,
2158 type: :module,
2159 description: "The method/service to use for captcha",
2160 suggestions: [Pleroma.Captcha.Kocaptcha, Pleroma.Captcha.Native]
2161 },
2162 %{
2163 key: :seconds_valid,
2164 type: :integer,
2165 description: "The time in seconds for which the captcha is valid",
2166 suggestions: [60]
2167 }
2168 ]
2169 },
2170 %{
2171 group: :pleroma,
2172 key: Pleroma.Captcha.Kocaptcha,
2173 type: :group,
2174 description:
2175 "Kocaptcha is a very simple captcha service with a single API endpoint, the source code is" <>
2176 " here: https://github.com/koto-bank/kocaptcha. The default endpoint (https://captcha.kotobank.ch) is hosted by the developer.",
2177 children: [
2178 %{
2179 key: :endpoint,
2180 type: :string,
2181 description: "The kocaptcha endpoint to use",
2182 suggestions: ["https://captcha.kotobank.ch"]
2183 }
2184 ]
2185 },
2186 %{
2187 group: :pleroma,
2188 label: "Pleroma Admin Token",
2189 type: :group,
2190 description:
2191 "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)",
2192 children: [
2193 %{
2194 key: :admin_token,
2195 type: :string,
2196 description: "Admin token",
2197 suggestions: [
2198 "Please use a high entropy string or UUID"
2199 ]
2200 }
2201 ]
2202 },
2203 %{
2204 group: :pleroma,
2205 key: Oban,
2206 type: :group,
2207 description: """
2208 [Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
2209
2210 Note: if you are running PostgreSQL in [`silent_mode`](https://postgresqlco.nf/en/doc/param/silent_mode?version=9.1),
2211 it's advised to set [`log_destination`](https://postgresqlco.nf/en/doc/param/log_destination?version=9.1) to `syslog`,
2212 otherwise `postmaster.log` file may grow because of "you don't own a lock of type ShareLock" warnings
2213 (see https://github.com/sorentwo/oban/issues/52).
2214 """,
2215 children: [
2216 %{
2217 key: :log,
2218 type: {:dropdown, :atom},
2219 description: "Logs verbose mode",
2220 suggestions: [false, :error, :warn, :info, :debug]
2221 },
2222 %{
2223 key: :queues,
2224 type: {:keyword, :integer},
2225 description:
2226 "Background jobs queues (keys: queues, values: max numbers of concurrent jobs)",
2227 suggestions: [
2228 activity_expiration: 10,
2229 attachments_cleanup: 5,
2230 background: 5,
2231 federator_incoming: 50,
2232 federator_outgoing: 50,
2233 mailer: 10,
2234 scheduled_activities: 10,
2235 transmogrifier: 20,
2236 web_push: 50
2237 ],
2238 children: [
2239 %{
2240 key: :activity_expiration,
2241 type: :integer,
2242 description: "Activity expiration queue",
2243 suggestions: [10]
2244 },
2245 %{
2246 key: :attachments_cleanup,
2247 type: :integer,
2248 description: "Attachment deletion queue",
2249 suggestions: [5]
2250 },
2251 %{
2252 key: :background,
2253 type: :integer,
2254 description: "Background queue",
2255 suggestions: [5]
2256 },
2257 %{
2258 key: :federator_incoming,
2259 type: :integer,
2260 description: "Incoming federation queue",
2261 suggestions: [50]
2262 },
2263 %{
2264 key: :federator_outgoing,
2265 type: :integer,
2266 description: "Outgoing federation queue",
2267 suggestions: [50]
2268 },
2269 %{
2270 key: :mailer,
2271 type: :integer,
2272 description: "Email sender queue, see Pleroma.Emails.Mailer",
2273 suggestions: [10]
2274 },
2275 %{
2276 key: :scheduled_activities,
2277 type: :integer,
2278 description: "Scheduled activities queue, see Pleroma.ScheduledActivities",
2279 suggestions: [10]
2280 },
2281 %{
2282 key: :transmogrifier,
2283 type: :integer,
2284 description: "Transmogrifier queue",
2285 suggestions: [20]
2286 },
2287 %{
2288 key: :web_push,
2289 type: :integer,
2290 description: "Web push notifications queue",
2291 suggestions: [50]
2292 }
2293 ]
2294 },
2295 %{
2296 key: :crontab,
2297 type: {:list, :tuple},
2298 description: "Settings for cron background jobs",
2299 suggestions: [
2300 {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
2301 {"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
2302 ]
2303 }
2304 ]
2305 },
2306 %{
2307 group: :pleroma,
2308 key: :workers,
2309 type: :group,
2310 description: "Includes custom worker options not interpretable directly by `Oban`",
2311 children: [
2312 %{
2313 key: :retries,
2314 type: {:keyword, :integer},
2315 description: "Max retry attempts for failed jobs, per `Oban` queue",
2316 suggestions: [
2317 federator_incoming: 5,
2318 federator_outgoing: 5
2319 ]
2320 }
2321 ]
2322 },
2323 %{
2324 group: :pleroma,
2325 key: Pleroma.Web.Metadata,
2326 type: :group,
2327 description: "Metadata-related settings",
2328 children: [
2329 %{
2330 key: :providers,
2331 type: {:list, :module},
2332 description: "List of metadata providers to enable",
2333 suggestions: [
2334 Pleroma.Web.Metadata.Providers.OpenGraph,
2335 Pleroma.Web.Metadata.Providers.TwitterCard,
2336 Pleroma.Web.Metadata.Providers.RelMe,
2337 Pleroma.Web.Metadata.Providers.Feed
2338 ]
2339 },
2340 %{
2341 key: :unfurl_nsfw,
2342 label: "Unfurl NSFW",
2343 type: :boolean,
2344 description: "When enabled NSFW attachments will be shown in previews"
2345 }
2346 ]
2347 },
2348 %{
2349 group: :pleroma,
2350 key: :rich_media,
2351 type: :group,
2352 description:
2353 "If enabled the instance will parse metadata from attached links to generate link previews",
2354 children: [
2355 %{
2356 key: :enabled,
2357 type: :boolean,
2358 description: "Enables RichMedia parsing of URLs"
2359 },
2360 %{
2361 key: :ignore_hosts,
2362 type: {:list, :string},
2363 description: "List of hosts which will be ignored by the metadata parser",
2364 suggestions: ["accounts.google.com", "xss.website"]
2365 },
2366 %{
2367 key: :ignore_tld,
2368 label: "Ignore TLD",
2369 type: {:list, :string},
2370 description: "List TLDs (top-level domains) which will ignore for parse metadata",
2371 suggestions: ["local", "localdomain", "lan"]
2372 },
2373 %{
2374 key: :parsers,
2375 type: {:list, :module},
2376 description:
2377 "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.",
2378 suggestions: [
2379 Pleroma.Web.RichMedia.Parsers.OEmbed,
2380 Pleroma.Web.RichMedia.Parsers.TwitterCard
2381 ]
2382 },
2383 %{
2384 key: :ttl_setters,
2385 label: "TTL setters",
2386 type: {:list, :module},
2387 description:
2388 "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.",
2389 suggestions: [
2390 Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl
2391 ]
2392 },
2393 %{
2394 key: :failure_backoff,
2395 type: :integer,
2396 description:
2397 "Amount of milliseconds after request failure, during which the request will not be retried.",
2398 suggestions: [60_000]
2399 }
2400 ]
2401 },
2402 %{
2403 group: :pleroma,
2404 key: Pleroma.Formatter,
2405 label: "Auto Linker",
2406 type: :group,
2407 description:
2408 "Configuration for Pleroma's link formatter which parses mentions, hashtags, and URLs.",
2409 children: [
2410 %{
2411 key: :class,
2412 type: [:string, :boolean],
2413 description: "Specify the class to be added to the generated link. Disable to clear.",
2414 suggestions: ["auto-linker", false]
2415 },
2416 %{
2417 key: :rel,
2418 type: [:string, :boolean],
2419 description: "Override the rel attribute. Disable to clear.",
2420 suggestions: ["ugc", "noopener noreferrer", false]
2421 },
2422 %{
2423 key: :new_window,
2424 type: :boolean,
2425 description: "Link URLs will open in a new window/tab."
2426 },
2427 %{
2428 key: :truncate,
2429 type: [:integer, :boolean],
2430 description:
2431 "Set to a number to truncate URLs longer than the number. Truncated URLs will end in `...`",
2432 suggestions: [15, false]
2433 },
2434 %{
2435 key: :strip_prefix,
2436 type: :boolean,
2437 description: "Strip the scheme prefix."
2438 },
2439 %{
2440 key: :extra,
2441 type: :boolean,
2442 description: "Link URLs with rarely used schemes (magnet, ipfs, irc, etc.)"
2443 },
2444 %{
2445 key: :validate_tld,
2446 type: [:atom, :boolean],
2447 description:
2448 "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)",
2449 suggestions: [:no_scheme, true]
2450 }
2451 ]
2452 },
2453 %{
2454 group: :pleroma,
2455 key: Pleroma.ScheduledActivity,
2456 type: :group,
2457 description: "Scheduled activities settings",
2458 children: [
2459 %{
2460 key: :daily_user_limit,
2461 type: :integer,
2462 description:
2463 "The number of scheduled activities a user is allowed to create in a single day. Default: 25.",
2464 suggestions: [25]
2465 },
2466 %{
2467 key: :total_user_limit,
2468 type: :integer,
2469 description:
2470 "The number of scheduled activities a user is allowed to create in total. Default: 300.",
2471 suggestions: [300]
2472 },
2473 %{
2474 key: :enabled,
2475 type: :boolean,
2476 description: "Whether scheduled activities are sent to the job queue to be executed"
2477 }
2478 ]
2479 },
2480 %{
2481 group: :pleroma,
2482 key: Pleroma.Workers.PurgeExpiredActivity,
2483 type: :group,
2484 description: "Expired activities settings",
2485 children: [
2486 %{
2487 key: :enabled,
2488 type: :boolean,
2489 description: "Enables expired activities addition & deletion"
2490 },
2491 %{
2492 key: :min_lifetime,
2493 type: :integer,
2494 description: "Minimum lifetime for ephemeral activity (in seconds)",
2495 suggestions: [600]
2496 }
2497 ]
2498 },
2499 %{
2500 group: :pleroma,
2501 label: "Pleroma Authenticator",
2502 type: :group,
2503 description: "Authenticator",
2504 children: [
2505 %{
2506 key: Pleroma.Web.Auth.Authenticator,
2507 type: :module,
2508 suggestions: [Pleroma.Web.Auth.PleromaAuthenticator, Pleroma.Web.Auth.LDAPAuthenticator]
2509 }
2510 ]
2511 },
2512 %{
2513 group: :pleroma,
2514 key: :ldap,
2515 label: "LDAP",
2516 type: :group,
2517 description:
2518 "Use LDAP for user authentication. When a user logs in to the Pleroma instance, the name and password" <>
2519 " will be verified by trying to authenticate (bind) to a LDAP server." <>
2520 " If a user exists in the LDAP directory but there is no account with the same name yet on the" <>
2521 " Pleroma instance then a new Pleroma account will be created with the same name as the LDAP user name.",
2522 children: [
2523 %{
2524 key: :enabled,
2525 type: :boolean,
2526 description: "Enables LDAP authentication"
2527 },
2528 %{
2529 key: :host,
2530 type: :string,
2531 description: "LDAP server hostname",
2532 suggestions: ["localhosts"]
2533 },
2534 %{
2535 key: :port,
2536 type: :integer,
2537 description: "LDAP port, e.g. 389 or 636",
2538 suggestions: [389, 636]
2539 },
2540 %{
2541 key: :ssl,
2542 label: "SSL",
2543 type: :boolean,
2544 description: "Enable to use SSL, usually implies the port 636"
2545 },
2546 %{
2547 key: :sslopts,
2548 label: "SSL options",
2549 type: :keyword,
2550 description: "Additional SSL options",
2551 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2552 children: [
2553 %{
2554 key: :cacertfile,
2555 type: :string,
2556 description: "Path to file with PEM encoded cacerts",
2557 suggestions: ["path/to/file/with/PEM/cacerts"]
2558 },
2559 %{
2560 key: :verify,
2561 type: :atom,
2562 description: "Type of cert verification",
2563 suggestions: [:verify_peer]
2564 }
2565 ]
2566 },
2567 %{
2568 key: :tls,
2569 label: "TLS",
2570 type: :boolean,
2571 description: "Enable to use STARTTLS, usually implies the port 389"
2572 },
2573 %{
2574 key: :tlsopts,
2575 label: "TLS options",
2576 type: :keyword,
2577 description: "Additional TLS options",
2578 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2579 children: [
2580 %{
2581 key: :cacertfile,
2582 type: :string,
2583 description: "Path to file with PEM encoded cacerts",
2584 suggestions: ["path/to/file/with/PEM/cacerts"]
2585 },
2586 %{
2587 key: :verify,
2588 type: :atom,
2589 description: "Type of cert verification",
2590 suggestions: [:verify_peer]
2591 }
2592 ]
2593 },
2594 %{
2595 key: :base,
2596 type: :string,
2597 description: "LDAP base, e.g. \"dc=example,dc=com\"",
2598 suggestions: ["dc=example,dc=com"]
2599 },
2600 %{
2601 key: :uid,
2602 label: "UID",
2603 type: :string,
2604 description:
2605 "LDAP attribute name to authenticate the user, e.g. when \"cn\", the filter will be \"cn=username,base\"",
2606 suggestions: ["cn"]
2607 }
2608 ]
2609 },
2610 %{
2611 group: :pleroma,
2612 key: :auth,
2613 type: :group,
2614 description: "Authentication / authorization settings",
2615 children: [
2616 %{
2617 key: :enforce_oauth_admin_scope_usage,
2618 label: "Enforce OAuth admin scope usage",
2619 type: :boolean,
2620 description:
2621 "OAuth admin scope requirement toggle. " <>
2622 "If enabled, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token " <>
2623 "(client app must support admin scopes). If disabled and token doesn't have admin scope(s), " <>
2624 "`is_admin` user flag grants access to admin-specific actions."
2625 },
2626 %{
2627 key: :auth_template,
2628 type: :string,
2629 description:
2630 "Authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.ee`.",
2631 suggestions: ["show.html"]
2632 },
2633 %{
2634 key: :oauth_consumer_template,
2635 label: "OAuth consumer template",
2636 type: :string,
2637 description:
2638 "OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to" <>
2639 " `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`.",
2640 suggestions: ["consumer.html"]
2641 },
2642 %{
2643 key: :oauth_consumer_strategies,
2644 label: "OAuth consumer strategies",
2645 type: {:list, :string},
2646 description:
2647 "The list of enabled OAuth consumer strategies. By default it's set by OAUTH_CONSUMER_STRATEGIES environment variable." <>
2648 " Each entry in this space-delimited string should be of format \"strategy\" or \"strategy:dependency\"" <>
2649 " (e.g. twitter or keycloak:ueberauth_keycloak_strategy in case dependency is named differently than ueberauth_<strategy>).",
2650 suggestions: ["twitter", "keycloak:ueberauth_keycloak_strategy"]
2651 }
2652 ]
2653 },
2654 %{
2655 group: :pleroma,
2656 key: :email_notifications,
2657 type: :group,
2658 description: "Email notifications settings",
2659 children: [
2660 %{
2661 key: :digest,
2662 type: :map,
2663 description:
2664 "emails of \"what you've missed\" for users who have been inactive for a while",
2665 suggestions: [
2666 %{
2667 active: false,
2668 schedule: "0 0 * * 0",
2669 interval: 7,
2670 inactivity_threshold: 7
2671 }
2672 ],
2673 children: [
2674 %{
2675 key: :active,
2676 label: "Enabled",
2677 type: :boolean,
2678 description: "Globally enable or disable digest emails"
2679 },
2680 %{
2681 key: :schedule,
2682 type: :string,
2683 description:
2684 "When to send digest email, in crontab format. \"0 0 0\" is the default, meaning \"once a week at midnight on Sunday morning\".",
2685 suggestions: ["0 0 * * 0"]
2686 },
2687 %{
2688 key: :interval,
2689 type: :integer,
2690 description: "Minimum interval between digest emails to one user",
2691 suggestions: [7]
2692 },
2693 %{
2694 key: :inactivity_threshold,
2695 type: :integer,
2696 description: "Minimum user inactivity threshold",
2697 suggestions: [7]
2698 }
2699 ]
2700 }
2701 ]
2702 },
2703 %{
2704 group: :pleroma,
2705 key: Pleroma.Emails.UserEmail,
2706 type: :group,
2707 description: "Email template settings",
2708 children: [
2709 %{
2710 key: :logo,
2711 type: {:string, :image},
2712 description: "A path to a custom logo. Set it to `nil` to use the default Pleroma logo.",
2713 suggestions: ["some/path/logo.png"]
2714 },
2715 %{
2716 key: :styling,
2717 type: :map,
2718 description: "A map with color settings for email templates.",
2719 suggestions: [
2720 %{
2721 link_color: "#d8a070",
2722 background_color: "#2C3645",
2723 content_background_color: "#1B2635",
2724 header_color: "#d8a070",
2725 text_color: "#b9b9ba",
2726 text_muted_color: "#b9b9ba"
2727 }
2728 ],
2729 children: [
2730 %{
2731 key: :link_color,
2732 type: :string,
2733 suggestions: ["#d8a070"]
2734 },
2735 %{
2736 key: :background_color,
2737 type: :string,
2738 suggestions: ["#2C3645"]
2739 },
2740 %{
2741 key: :content_background_color,
2742 type: :string,
2743 suggestions: ["#1B2635"]
2744 },
2745 %{
2746 key: :header_color,
2747 type: :string,
2748 suggestions: ["#d8a070"]
2749 },
2750 %{
2751 key: :text_color,
2752 type: :string,
2753 suggestions: ["#b9b9ba"]
2754 },
2755 %{
2756 key: :text_muted_color,
2757 type: :string,
2758 suggestions: ["#b9b9ba"]
2759 }
2760 ]
2761 }
2762 ]
2763 },
2764 %{
2765 group: :pleroma,
2766 key: Pleroma.Emails.NewUsersDigestEmail,
2767 type: :group,
2768 description: "New users admin email digest",
2769 children: [
2770 %{
2771 key: :enabled,
2772 type: :boolean,
2773 description: "Enables new users admin digest email when `true`"
2774 }
2775 ]
2776 },
2777 %{
2778 group: :pleroma,
2779 key: :oauth2,
2780 label: "OAuth2",
2781 type: :group,
2782 description: "Configure OAuth 2 provider capabilities",
2783 children: [
2784 %{
2785 key: :token_expires_in,
2786 type: :integer,
2787 description: "The lifetime in seconds of the access token",
2788 suggestions: [600]
2789 },
2790 %{
2791 key: :issue_new_refresh_token,
2792 type: :boolean,
2793 description:
2794 "Keeps old refresh token or generate new refresh token when to obtain an access token"
2795 },
2796 %{
2797 key: :clean_expired_tokens,
2798 type: :boolean,
2799 description: "Enable a background job to clean expired OAuth tokens. Default: disabled."
2800 }
2801 ]
2802 },
2803 %{
2804 group: :pleroma,
2805 key: :emoji,
2806 type: :group,
2807 children: [
2808 %{
2809 key: :shortcode_globs,
2810 type: {:list, :string},
2811 description: "Location of custom emoji files. * can be used as a wildcard.",
2812 suggestions: ["/emoji/custom/**/*.png"]
2813 },
2814 %{
2815 key: :pack_extensions,
2816 type: {:list, :string},
2817 description:
2818 "A list of file extensions for emojis, when no emoji.txt for a pack is present",
2819 suggestions: [".png", ".gif"]
2820 },
2821 %{
2822 key: :groups,
2823 type: {:keyword, {:list, :string}},
2824 description:
2825 "Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the group name" <>
2826 " and the value is the location or array of locations. * can be used as a wildcard.",
2827 suggestions: [
2828 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
2829 ]
2830 },
2831 %{
2832 key: :default_manifest,
2833 type: :string,
2834 description:
2835 "Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download." <>
2836 " Currently only one manifest can be added (no arrays).",
2837 suggestions: ["https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"]
2838 },
2839 %{
2840 key: :shared_pack_cache_seconds_per_file,
2841 label: "Shared pack cache s/file",
2842 type: :integer,
2843 descpiption:
2844 "When an emoji pack is shared, the archive is created and cached in memory" <>
2845 " for this amount of seconds multiplied by the number of files.",
2846 suggestions: [60]
2847 }
2848 ]
2849 },
2850 %{
2851 group: :pleroma,
2852 key: :rate_limit,
2853 type: :group,
2854 description:
2855 "Rate limit settings. This is an advanced feature enabled only for :authentication by default.",
2856 children: [
2857 %{
2858 key: :search,
2859 type: [:tuple, {:list, :tuple}],
2860 description: "For the search requests (account & status search etc.)",
2861 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2862 },
2863 %{
2864 key: :timeline,
2865 type: [:tuple, {:list, :tuple}],
2866 description: "For requests to timelines (each timeline has it's own limiter)",
2867 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2868 },
2869 %{
2870 key: :app_account_creation,
2871 type: [:tuple, {:list, :tuple}],
2872 description: "For registering user accounts from the same IP address",
2873 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2874 },
2875 %{
2876 key: :relations_actions,
2877 type: [:tuple, {:list, :tuple}],
2878 description: "For actions on relationships with all users (follow, unfollow)",
2879 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2880 },
2881 %{
2882 key: :relation_id_action,
2883 label: "Relation ID action",
2884 type: [:tuple, {:list, :tuple}],
2885 description: "For actions on relation with a specific user (follow, unfollow)",
2886 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2887 },
2888 %{
2889 key: :statuses_actions,
2890 type: [:tuple, {:list, :tuple}],
2891 description:
2892 "For create / delete / fav / unfav / reblog / unreblog actions on any statuses",
2893 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2894 },
2895 %{
2896 key: :status_id_action,
2897 label: "Status ID action",
2898 type: [:tuple, {:list, :tuple}],
2899 description:
2900 "For fav / unfav or reblog / unreblog actions on the same status by the same user",
2901 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2902 },
2903 %{
2904 key: :authentication,
2905 type: [:tuple, {:list, :tuple}],
2906 description: "For authentication create / password check / user existence check requests",
2907 suggestions: [{60_000, 15}]
2908 }
2909 ]
2910 },
2911 %{
2912 group: :esshd,
2913 label: "ESSHD",
2914 type: :group,
2915 description:
2916 "Before enabling this you must add :esshd to mix.exs as one of the extra_applications " <>
2917 "and generate host keys in your priv dir with ssh-keygen -m PEM -N \"\" -b 2048 -t rsa -f ssh_host_rsa_key",
2918 children: [
2919 %{
2920 key: :enabled,
2921 type: :boolean,
2922 description: "Enables SSH"
2923 },
2924 %{
2925 key: :priv_dir,
2926 type: :string,
2927 description: "Dir with SSH keys",
2928 suggestions: ["/some/path/ssh_keys"]
2929 },
2930 %{
2931 key: :handler,
2932 type: :string,
2933 description: "Handler module",
2934 suggestions: ["Pleroma.BBS.Handler"]
2935 },
2936 %{
2937 key: :port,
2938 type: :integer,
2939 description: "Port to connect",
2940 suggestions: [10_022]
2941 },
2942 %{
2943 key: :password_authenticator,
2944 type: :string,
2945 description: "Authenticator module",
2946 suggestions: ["Pleroma.BBS.Authenticator"]
2947 }
2948 ]
2949 },
2950 %{
2951 group: :mime,
2952 label: "Mime Types",
2953 type: :group,
2954 description: "Mime Types settings",
2955 children: [
2956 %{
2957 key: :types,
2958 type: :map,
2959 suggestions: [
2960 %{
2961 "application/xml" => ["xml"],
2962 "application/xrd+xml" => ["xrd+xml"],
2963 "application/jrd+json" => ["jrd+json"],
2964 "application/activity+json" => ["activity+json"],
2965 "application/ld+json" => ["activity+json"]
2966 }
2967 ],
2968 children: [
2969 %{
2970 key: "application/xml",
2971 type: {:list, :string},
2972 suggestions: ["xml"]
2973 },
2974 %{
2975 key: "application/xrd+xml",
2976 type: {:list, :string},
2977 suggestions: ["xrd+xml"]
2978 },
2979 %{
2980 key: "application/jrd+json",
2981 type: {:list, :string},
2982 suggestions: ["jrd+json"]
2983 },
2984 %{
2985 key: "application/activity+json",
2986 type: {:list, :string},
2987 suggestions: ["activity+json"]
2988 },
2989 %{
2990 key: "application/ld+json",
2991 type: {:list, :string},
2992 suggestions: ["activity+json"]
2993 }
2994 ]
2995 }
2996 ]
2997 },
2998 %{
2999 group: :pleroma,
3000 key: :chat,
3001 type: :group,
3002 description: "Pleroma chat settings",
3003 children: [
3004 %{
3005 key: :enabled,
3006 type: :boolean
3007 }
3008 ]
3009 },
3010 %{
3011 group: :pleroma,
3012 key: :http,
3013 label: "HTTP",
3014 type: :group,
3015 description: "HTTP settings",
3016 children: [
3017 %{
3018 key: :proxy_url,
3019 label: "Proxy URL",
3020 type: [:string, :tuple],
3021 description: "Proxy URL",
3022 suggestions: ["localhost:9020", {:socks5, :localhost, 3090}]
3023 },
3024 %{
3025 key: :send_user_agent,
3026 type: :boolean
3027 },
3028 %{
3029 key: :user_agent,
3030 type: [:string, :atom],
3031 description:
3032 "What user agent to use. Must be a string or an atom `:default`. Default value is `:default`.",
3033 suggestions: ["Pleroma", :default]
3034 },
3035 %{
3036 key: :adapter,
3037 type: :keyword,
3038 description: "Adapter specific options",
3039 suggestions: [],
3040 children: [
3041 %{
3042 key: :ssl_options,
3043 type: :keyword,
3044 label: "SSL Options",
3045 description: "SSL options for HTTP adapter",
3046 children: [
3047 %{
3048 key: :versions,
3049 type: {:list, :atom},
3050 description: "List of TLS version to use",
3051 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
3052 }
3053 ]
3054 }
3055 ]
3056 }
3057 ]
3058 },
3059 %{
3060 group: :pleroma,
3061 key: :markup,
3062 label: "Markup Settings",
3063 type: :group,
3064 children: [
3065 %{
3066 key: :allow_inline_images,
3067 type: :boolean
3068 },
3069 %{
3070 key: :allow_headings,
3071 type: :boolean
3072 },
3073 %{
3074 key: :allow_tables,
3075 type: :boolean
3076 },
3077 %{
3078 key: :allow_fonts,
3079 type: :boolean
3080 },
3081 %{
3082 key: :scrub_policy,
3083 type: {:list, :module},
3084 description:
3085 "Module names are shortened (removed leading `Pleroma.HTML.` part), but on adding custom module you need to use full name.",
3086 suggestions: [Pleroma.HTML.Transform.MediaProxy, Pleroma.HTML.Scrubber.Default]
3087 }
3088 ]
3089 },
3090 %{
3091 group: :pleroma,
3092 key: :user,
3093 type: :group,
3094 children: [
3095 %{
3096 key: :deny_follow_blocked,
3097 type: :boolean
3098 }
3099 ]
3100 },
3101 %{
3102 group: :pleroma,
3103 key: :mrf_normalize_markup,
3104 tab: :mrf,
3105 related_policy: "Pleroma.Web.ActivityPub.MRF.NormalizeMarkup",
3106 label: "MRF Normalize Markup",
3107 description: "MRF NormalizeMarkup settings. Scrub configured hypertext markup.",
3108 type: :group,
3109 children: [
3110 %{
3111 key: :scrub_policy,
3112 type: :module,
3113 suggestions: [Pleroma.HTML.Scrubber.Default]
3114 }
3115 ]
3116 },
3117 %{
3118 group: :pleroma,
3119 key: Pleroma.User,
3120 type: :group,
3121 children: [
3122 %{
3123 key: :restricted_nicknames,
3124 type: {:list, :string},
3125 description: "List of nicknames users may not register with.",
3126 suggestions: [
3127 ".well-known",
3128 "~",
3129 "about",
3130 "activities",
3131 "api",
3132 "auth",
3133 "check_password",
3134 "dev",
3135 "friend-requests",
3136 "inbox",
3137 "internal",
3138 "main",
3139 "media",
3140 "nodeinfo",
3141 "notice",
3142 "oauth",
3143 "objects",
3144 "ostatus_subscribe",
3145 "pleroma",
3146 "proxy",
3147 "push",
3148 "registration",
3149 "relay",
3150 "settings",
3151 "status",
3152 "tag",
3153 "user-search",
3154 "user_exists",
3155 "users",
3156 "web"
3157 ]
3158 },
3159 %{
3160 key: :email_blacklist,
3161 type: {:list, :string},
3162 description: "List of email domains users may not register with.",
3163 suggestions: ["mailinator.com", "maildrop.cc"]
3164 }
3165 ]
3166 },
3167 %{
3168 group: :cors_plug,
3169 label: "CORS plug config",
3170 type: :group,
3171 children: [
3172 %{
3173 key: :max_age,
3174 type: :integer,
3175 suggestions: [86_400]
3176 },
3177 %{
3178 key: :methods,
3179 type: {:list, :string},
3180 suggestions: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"]
3181 },
3182 %{
3183 key: :expose,
3184 type: {:list, :string},
3185 suggestions: [
3186 "Link",
3187 "X-RateLimit-Reset",
3188 "X-RateLimit-Limit",
3189 "X-RateLimit-Remaining",
3190 "X-Request-Id",
3191 "Idempotency-Key"
3192 ]
3193 },
3194 %{
3195 key: :credentials,
3196 type: :boolean
3197 },
3198 %{
3199 key: :headers,
3200 type: {:list, :string},
3201 suggestions: ["Authorization", "Content-Type", "Idempotency-Key"]
3202 }
3203 ]
3204 },
3205 %{
3206 group: :pleroma,
3207 key: Pleroma.Plugs.RemoteIp,
3208 type: :group,
3209 description: """
3210 `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
3211 **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
3212 """,
3213 children: [
3214 %{
3215 key: :enabled,
3216 type: :boolean,
3217 description: "Enable/disable the plug. Default: disabled."
3218 },
3219 %{
3220 key: :headers,
3221 type: {:list, :string},
3222 description:
3223 "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]`."
3224 },
3225 %{
3226 key: :proxies,
3227 type: {:list, :string},
3228 description:
3229 "A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Default: `[]`."
3230 },
3231 %{
3232 key: :reserved,
3233 type: {:list, :string},
3234 description:
3235 "Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network)."
3236 }
3237 ]
3238 },
3239 %{
3240 group: :pleroma,
3241 key: :web_cache_ttl,
3242 label: "Web cache TTL",
3243 type: :group,
3244 description:
3245 "The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.",
3246 children: [
3247 %{
3248 key: :activity_pub,
3249 type: :integer,
3250 description:
3251 "Activity pub routes (except question activities). Default: `nil` (no expiration).",
3252 suggestions: [30_000, nil]
3253 },
3254 %{
3255 key: :activity_pub_question,
3256 type: :integer,
3257 description: "Activity pub routes (question activities). Default: `30_000` (30 seconds).",
3258 suggestions: [30_000]
3259 }
3260 ]
3261 },
3262 %{
3263 group: :pleroma,
3264 key: :static_fe,
3265 label: "Static FE",
3266 type: :group,
3267 description:
3268 "Render profiles and posts using server-generated HTML that is viewable without using JavaScript",
3269 children: [
3270 %{
3271 key: :enabled,
3272 type: :boolean,
3273 description: "Enables the rendering of static HTML. Default: disabled."
3274 }
3275 ]
3276 },
3277 %{
3278 group: :pleroma,
3279 key: :feed,
3280 type: :group,
3281 description: "Configure feed rendering",
3282 children: [
3283 %{
3284 key: :post_title,
3285 type: :map,
3286 description: "Configure title rendering",
3287 children: [
3288 %{
3289 key: :max_length,
3290 type: :integer,
3291 description: "Maximum number of characters before truncating title",
3292 suggestions: [100]
3293 },
3294 %{
3295 key: :omission,
3296 type: :string,
3297 description: "Replacement which will be used after truncating string",
3298 suggestions: ["..."]
3299 }
3300 ]
3301 }
3302 ]
3303 },
3304 %{
3305 group: :pleroma,
3306 key: :mrf_object_age,
3307 tab: :mrf,
3308 related_policy: "Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy",
3309 label: "MRF Object Age",
3310 type: :group,
3311 description:
3312 "Rejects or delists posts based on their timestamp deviance from your server's clock.",
3313 children: [
3314 %{
3315 key: :threshold,
3316 type: :integer,
3317 description: "Required age (in seconds) of a post before actions are taken.",
3318 suggestions: [172_800]
3319 },
3320 %{
3321 key: :actions,
3322 type: {:list, :atom},
3323 description:
3324 "A list of actions to apply to the post. `:delist` removes the post from public timelines; " <>
3325 "`:strip_followers` removes followers from the ActivityPub recipient list ensuring they won't be delivered to home timelines; " <>
3326 "`:reject` rejects the message entirely",
3327 suggestions: [:delist, :strip_followers, :reject]
3328 }
3329 ]
3330 },
3331 %{
3332 group: :pleroma,
3333 key: :modules,
3334 type: :group,
3335 description: "Custom Runtime Modules",
3336 children: [
3337 %{
3338 key: :runtime_dir,
3339 type: :string,
3340 description: "A path to custom Elixir modules (such as MRF policies)."
3341 }
3342 ]
3343 },
3344 %{
3345 group: :pleroma,
3346 key: :streamer,
3347 type: :group,
3348 description: "Settings for notifications streamer",
3349 children: [
3350 %{
3351 key: :workers,
3352 type: :integer,
3353 description: "Number of workers to send notifications",
3354 suggestions: [3]
3355 },
3356 %{
3357 key: :overflow_workers,
3358 type: :integer,
3359 description: "Maximum number of workers created if pool is empty",
3360 suggestions: [2]
3361 }
3362 ]
3363 },
3364 %{
3365 group: :pleroma,
3366 key: :connections_pool,
3367 type: :group,
3368 description: "Advanced settings for `Gun` connections pool",
3369 children: [
3370 %{
3371 key: :connection_acquisition_wait,
3372 type: :integer,
3373 description:
3374 "Timeout to acquire a connection from pool. The total max time is this value multiplied by the number of retries. Default: 250ms.",
3375 suggestions: [250]
3376 },
3377 %{
3378 key: :connection_acquisition_retries,
3379 type: :integer,
3380 description:
3381 "Number of attempts to acquire the connection from the pool if it is overloaded. Default: 5",
3382 suggestions: [5]
3383 },
3384 %{
3385 key: :max_connections,
3386 type: :integer,
3387 description: "Maximum number of connections in the pool. Default: 250 connections.",
3388 suggestions: [250]
3389 },
3390 %{
3391 key: :connect_timeout,
3392 type: :integer,
3393 description: "Timeout while `gun` will wait until connection is up. Default: 5000ms.",
3394 suggestions: [5000]
3395 },
3396 %{
3397 key: :reclaim_multiplier,
3398 type: :integer,
3399 description:
3400 "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",
3401 suggestions: [0.1]
3402 }
3403 ]
3404 },
3405 %{
3406 group: :pleroma,
3407 key: :pools,
3408 type: :group,
3409 description: "Advanced settings for `Gun` workers pools",
3410 children:
3411 Enum.map([:federation, :media, :upload, :default], fn pool_name ->
3412 %{
3413 key: pool_name,
3414 type: :keyword,
3415 description: "Settings for #{pool_name} pool.",
3416 children: [
3417 %{
3418 key: :size,
3419 type: :integer,
3420 description: "Maximum number of concurrent requests in the pool.",
3421 suggestions: [50]
3422 },
3423 %{
3424 key: :max_waiting,
3425 type: :integer,
3426 description:
3427 "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",
3428 suggestions: [10]
3429 },
3430 %{
3431 key: :recv_timeout,
3432 type: :integer,
3433 description: "Timeout for the pool while gun will wait for response",
3434 suggestions: [10_000]
3435 }
3436 ]
3437 }
3438 end)
3439 },
3440 %{
3441 group: :pleroma,
3442 key: :hackney_pools,
3443 type: :group,
3444 description: "Advanced settings for `Hackney` connections pools",
3445 children: [
3446 %{
3447 key: :federation,
3448 type: :keyword,
3449 description: "Settings for federation pool.",
3450 children: [
3451 %{
3452 key: :max_connections,
3453 type: :integer,
3454 description: "Number workers in the pool.",
3455 suggestions: [50]
3456 },
3457 %{
3458 key: :timeout,
3459 type: :integer,
3460 description: "Timeout while `hackney` will wait for response.",
3461 suggestions: [150_000]
3462 }
3463 ]
3464 },
3465 %{
3466 key: :media,
3467 type: :keyword,
3468 description: "Settings for media pool.",
3469 children: [
3470 %{
3471 key: :max_connections,
3472 type: :integer,
3473 description: "Number workers in the pool.",
3474 suggestions: [50]
3475 },
3476 %{
3477 key: :timeout,
3478 type: :integer,
3479 description: "Timeout while `hackney` will wait for response.",
3480 suggestions: [150_000]
3481 }
3482 ]
3483 },
3484 %{
3485 key: :upload,
3486 type: :keyword,
3487 description: "Settings for upload pool.",
3488 children: [
3489 %{
3490 key: :max_connections,
3491 type: :integer,
3492 description: "Number workers in the pool.",
3493 suggestions: [25]
3494 },
3495 %{
3496 key: :timeout,
3497 type: :integer,
3498 description: "Timeout while `hackney` will wait for response.",
3499 suggestions: [300_000]
3500 }
3501 ]
3502 }
3503 ]
3504 },
3505 %{
3506 group: :pleroma,
3507 key: :restrict_unauthenticated,
3508 label: "Restrict Unauthenticated",
3509 type: :group,
3510 description:
3511 "Disallow viewing timelines, user profiles and statuses for unauthenticated users.",
3512 children: [
3513 %{
3514 key: :timelines,
3515 type: :map,
3516 description: "Settings for public and federated timelines.",
3517 children: [
3518 %{
3519 key: :local,
3520 type: :boolean,
3521 description: "Disallow view public timeline."
3522 },
3523 %{
3524 key: :federated,
3525 type: :boolean,
3526 description: "Disallow view federated timeline."
3527 }
3528 ]
3529 },
3530 %{
3531 key: :profiles,
3532 type: :map,
3533 description: "Settings for user profiles.",
3534 children: [
3535 %{
3536 key: :local,
3537 type: :boolean,
3538 description: "Disallow view local user profiles."
3539 },
3540 %{
3541 key: :remote,
3542 type: :boolean,
3543 description: "Disallow view remote user profiles."
3544 }
3545 ]
3546 },
3547 %{
3548 key: :activities,
3549 type: :map,
3550 description: "Settings for statuses.",
3551 children: [
3552 %{
3553 key: :local,
3554 type: :boolean,
3555 description: "Disallow view local statuses."
3556 },
3557 %{
3558 key: :remote,
3559 type: :boolean,
3560 description: "Disallow view remote statuses."
3561 }
3562 ]
3563 }
3564 ]
3565 },
3566 %{
3567 group: :pleroma,
3568 key: Pleroma.Web.ApiSpec.CastAndValidate,
3569 type: :group,
3570 children: [
3571 %{
3572 key: :strict,
3573 type: :boolean,
3574 description:
3575 "Enables strict input validation (useful in development, not recommended in production)"
3576 }
3577 ]
3578 },
3579 %{
3580 group: :pleroma,
3581 key: :instances_favicons,
3582 type: :group,
3583 description: "Control favicons for instances",
3584 children: [
3585 %{
3586 key: :enabled,
3587 type: :boolean,
3588 description: "Allow/disallow displaying and getting instances favicons"
3589 }
3590 ]
3591 },
3592 %{
3593 group: :ex_aws,
3594 key: :s3,
3595 type: :group,
3596 descriptions: "S3 service related settings",
3597 children: [
3598 %{
3599 key: :access_key_id,
3600 type: :string,
3601 description: "S3 access key ID",
3602 suggestions: ["AKIAQ8UKHTGIYN7DMWWJ"]
3603 },
3604 %{
3605 key: :secret_access_key,
3606 type: :string,
3607 description: "Secret access key",
3608 suggestions: ["JFGt+fgH1UQ7vLUQjpW+WvjTdV/UNzVxcwn7DkaeFKtBS5LvoXvIiME4NQBsT6ZZ"]
3609 },
3610 %{
3611 key: :host,
3612 type: :string,
3613 description: "S3 host",
3614 suggestions: ["s3.eu-central-1.amazonaws.com"]
3615 }
3616 ]
3617 },
3618 %{
3619 group: :pleroma,
3620 key: :frontends,
3621 type: :group,
3622 description: "Installed frontends management",
3623 children: [
3624 %{
3625 key: :primary,
3626 type: :map,
3627 description: "Primary frontend, the one that is served for all pages by default",
3628 children: installed_frontend_options
3629 },
3630 %{
3631 key: :admin,
3632 type: :map,
3633 description: "Admin frontend",
3634 children: installed_frontend_options
3635 },
3636 %{
3637 key: :available,
3638 type: :map,
3639 description:
3640 "A map containing available frontends and parameters for their installation.",
3641 children: [
3642 frontend_options
3643 ]
3644 }
3645 ]
3646 },
3647 %{
3648 group: :pleroma,
3649 key: Pleroma.Web.Preload,
3650 type: :group,
3651 description: "Preload-related settings",
3652 children: [
3653 %{
3654 key: :providers,
3655 type: {:list, :module},
3656 description: "List of preload providers to enable",
3657 suggestions: [
3658 Pleroma.Web.Preload.Providers.Instance,
3659 Pleroma.Web.Preload.Providers.User,
3660 Pleroma.Web.Preload.Providers.Timelines,
3661 Pleroma.Web.Preload.Providers.StatusNet
3662 ]
3663 }
3664 ]
3665 }
3666 ]