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