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