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