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