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