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