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