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