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