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