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