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