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