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