Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
[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 MRF 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 MRF 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 MRF 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 theme: "pleroma-dark",
1109 logo: "/static/logo.png",
1110 background: "/images/city.jpg",
1111 redirectRootNoLogin: "/main/all",
1112 redirectRootLogin: "/main/friends",
1113 showInstanceSpecificPanel: true,
1114 scopeOptionsEnabled: false,
1115 formattingOptionsEnabled: false,
1116 collapseMessageWithSubject: false,
1117 hidePostStats: false,
1118 hideUserStats: false,
1119 scopeCopy: true,
1120 subjectLineBehavior: "email",
1121 alwaysShowSubjectInput: true,
1122 logoMask: false,
1123 logoMargin: ".1em",
1124 stickers: false,
1125 enableEmojiPicker: false
1126 }
1127 ],
1128 children: [
1129 %{
1130 key: :theme,
1131 type: :string,
1132 description: "Which theme to use, they are defined in styles.json",
1133 suggestions: ["pleroma-dark"]
1134 },
1135 %{
1136 key: :logo,
1137 type: :string,
1138 description: "URL of the logo, defaults to Pleroma's logo",
1139 suggestions: ["/static/logo.png"]
1140 },
1141 %{
1142 key: :background,
1143 type: :string,
1144 description:
1145 "URL of the background, unless viewing a user profile with a background that is set",
1146 suggestions: ["/images/city.jpg"]
1147 },
1148 %{
1149 key: :redirectRootNoLogin,
1150 label: "Redirect root no login",
1151 type: :string,
1152 description:
1153 "Relative URL which indicates where to redirect when a user isn't logged in",
1154 suggestions: ["/main/all"]
1155 },
1156 %{
1157 key: :redirectRootLogin,
1158 label: "Redirect root login",
1159 type: :string,
1160 description:
1161 "Relative URL which indicates where to redirect when a user is logged in",
1162 suggestions: ["/main/friends"]
1163 },
1164 %{
1165 key: :showInstanceSpecificPanel,
1166 label: "Show instance specific panel",
1167 type: :boolean,
1168 description: "Whenether to show the instance's specific panel"
1169 },
1170 %{
1171 key: :scopeOptionsEnabled,
1172 label: "Scope options enabled",
1173 type: :boolean,
1174 description: "Enable setting a notice visibility and subject/CW when posting"
1175 },
1176 %{
1177 key: :formattingOptionsEnabled,
1178 label: "Formatting options enabled",
1179 type: :boolean,
1180 description:
1181 "Enable setting a formatting different than plain-text (ie. HTML, Markdown) when posting, relates to `:instance`, `allowed_post_formats`"
1182 },
1183 %{
1184 key: :collapseMessageWithSubject,
1185 label: "Collapse message with subject",
1186 type: :boolean,
1187 description:
1188 "When a message has a subject (aka Content Warning), collapse it by default"
1189 },
1190 %{
1191 key: :hidePostStats,
1192 label: "Hide post stats",
1193 type: :boolean,
1194 description: "Hide notices statistics (repeats, favorites, ...)"
1195 },
1196 %{
1197 key: :hideUserStats,
1198 label: "Hide user stats",
1199 type: :boolean,
1200 description:
1201 "Hide profile statistics (posts, posts per day, followers, followings, ...)"
1202 },
1203 %{
1204 key: :scopeCopy,
1205 label: "Scope copy",
1206 type: :boolean,
1207 description: "Copy the scope (private/unlisted/public) in replies to posts by default"
1208 },
1209 %{
1210 key: :subjectLineBehavior,
1211 label: "Subject line behavior",
1212 type: :string,
1213 description: "Allows changing the default behaviour of subject lines in replies.
1214 `email`: copy and preprend re:, as in email,
1215 `masto`: copy verbatim, as in Mastodon,
1216 `noop`: don't copy the subject.",
1217 suggestions: ["email", "masto", "noop"]
1218 },
1219 %{
1220 key: :alwaysShowSubjectInput,
1221 label: "Always show subject input",
1222 type: :boolean,
1223 description: "When disabled, auto-hide the subject field if it's empty"
1224 },
1225 %{
1226 key: :logoMask,
1227 label: "Logo mask",
1228 type: :boolean,
1229 description:
1230 "By default it assumes logo used will be monochrome with alpha channel to be compatible with both light and dark themes. " <>
1231 "If you want a colorful logo you must disable logoMask."
1232 },
1233 %{
1234 key: :logoMargin,
1235 label: "Logo margin",
1236 type: :string,
1237 description:
1238 "Allows you to adjust vertical margins between logo boundary and navbar borders. " <>
1239 "The idea is that to have logo's image without any extra margins and instead adjust them to your need in layout.",
1240 suggestions: [".1em"]
1241 },
1242 %{
1243 key: :stickers,
1244 type: :boolean,
1245 description: "Enables stickers."
1246 },
1247 %{
1248 key: :enableEmojiPicker,
1249 label: "Emoji picker",
1250 type: :boolean,
1251 description: "Enables emoji picker."
1252 }
1253 ]
1254 },
1255 %{
1256 key: :masto_fe,
1257 label: "Masto FE",
1258 type: :map,
1259 description: "Settings for Masto FE",
1260 suggestions: [
1261 %{
1262 showInstanceSpecificPanel: true
1263 }
1264 ],
1265 children: [
1266 %{
1267 key: :showInstanceSpecificPanel,
1268 label: "Show instance specific panel",
1269 type: :boolean,
1270 description: "Whenether to show the instance's specific panel"
1271 }
1272 ]
1273 }
1274 ]
1275 },
1276 %{
1277 group: :pleroma,
1278 key: :assets,
1279 type: :group,
1280 description:
1281 "This section configures assets to be used with various frontends. Currently the only option relates to mascots on the mastodon frontend",
1282 children: [
1283 %{
1284 key: :mascots,
1285 type: {:keyword, :map},
1286 description:
1287 "Keyword of mascots, each element must contain both an url and a mime_type key",
1288 suggestions: [
1289 pleroma_fox_tan: %{
1290 url: "/images/pleroma-fox-tan-smol.png",
1291 mime_type: "image/png"
1292 },
1293 pleroma_fox_tan_shy: %{
1294 url: "/images/pleroma-fox-tan-shy.png",
1295 mime_type: "image/png"
1296 }
1297 ]
1298 },
1299 %{
1300 key: :default_mascot,
1301 type: :atom,
1302 description:
1303 "This will be used as the default mascot on MastoFE. Default: `:pleroma_fox_tan`",
1304 suggestions: [
1305 :pleroma_fox_tan
1306 ]
1307 }
1308 ]
1309 },
1310 %{
1311 group: :pleroma,
1312 key: :manifest,
1313 type: :group,
1314 description:
1315 "This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE",
1316 children: [
1317 %{
1318 key: :icons,
1319 type: {:list, :map},
1320 description: "Describe the icons of the app",
1321 suggestion: [
1322 %{
1323 src: "/static/logo.png"
1324 },
1325 %{
1326 src: "/static/icon.png",
1327 type: "image/png"
1328 },
1329 %{
1330 src: "/static/icon.ico",
1331 sizes: "72x72 96x96 128x128 256x256"
1332 }
1333 ]
1334 },
1335 %{
1336 key: :theme_color,
1337 type: :string,
1338 description: "Describe the theme color of the app",
1339 suggestions: ["#282c37", "mediumpurple"]
1340 },
1341 %{
1342 key: :background_color,
1343 type: :string,
1344 description: "Describe the background color of the app",
1345 suggestions: ["#191b22", "aliceblue"]
1346 }
1347 ]
1348 },
1349 %{
1350 group: :pleroma,
1351 key: :mrf_simple,
1352 label: "MRF simple",
1353 type: :group,
1354 description: "Message Rewrite Facility",
1355 children: [
1356 %{
1357 key: :media_removal,
1358 type: {:list, :string},
1359 description: "List of instances to strip media attachments from",
1360 suggestions: ["example.com", "*.example.com"]
1361 },
1362 %{
1363 key: :media_nsfw,
1364 label: "Media NSFW",
1365 type: {:list, :string},
1366 description: "List of instances to tag all media as NSFW (sensitive) from",
1367 suggestions: ["example.com", "*.example.com"]
1368 },
1369 %{
1370 key: :federated_timeline_removal,
1371 type: {:list, :string},
1372 description:
1373 "List of instances to remove from Federated (aka The Whole Known Network) Timeline",
1374 suggestions: ["example.com", "*.example.com"]
1375 },
1376 %{
1377 key: :reject,
1378 type: {:list, :string},
1379 description: "List of instances to reject activities from (except deletes)",
1380 suggestions: ["example.com", "*.example.com"]
1381 },
1382 %{
1383 key: :accept,
1384 type: {:list, :string},
1385 description: "List of instances to only accept activities from (except deletes)",
1386 suggestions: ["example.com", "*.example.com"]
1387 },
1388 %{
1389 key: :report_removal,
1390 type: {:list, :string},
1391 description: "List of instances to reject reports from",
1392 suggestions: ["example.com", "*.example.com"]
1393 },
1394 %{
1395 key: :avatar_removal,
1396 type: {:list, :string},
1397 description: "List of instances to strip avatars from",
1398 suggestions: ["example.com", "*.example.com"]
1399 },
1400 %{
1401 key: :banner_removal,
1402 type: {:list, :string},
1403 description: "List of instances to strip banners from",
1404 suggestions: ["example.com", "*.example.com"]
1405 },
1406 %{
1407 key: :reject_deletes,
1408 type: {:list, :string},
1409 description: "List of instances to reject deletions from",
1410 suggestions: ["example.com", "*.example.com"]
1411 }
1412 ]
1413 },
1414 %{
1415 group: :pleroma,
1416 key: :mrf_subchain,
1417 label: "MRF subchain",
1418 type: :group,
1419 description:
1420 "This policy processes messages through an alternate pipeline when a given message matches certain criteria." <>
1421 " All criteria are configured as a map of regular expressions to lists of policy modules.",
1422 children: [
1423 %{
1424 key: :match_actor,
1425 type: :map,
1426 description: "Matches a series of regular expressions against the actor field",
1427 suggestions: [
1428 %{
1429 ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy]
1430 }
1431 ]
1432 }
1433 ]
1434 },
1435 %{
1436 group: :pleroma,
1437 key: :mrf_rejectnonpublic,
1438 description:
1439 "MRF RejectNonPublic settings. RejectNonPublic drops posts with non-public visibility settings.",
1440 label: "MRF reject non public",
1441 type: :group,
1442 children: [
1443 %{
1444 key: :allow_followersonly,
1445 label: "Allow followers-only",
1446 type: :boolean,
1447 description: "Whether to allow followers-only posts"
1448 },
1449 %{
1450 key: :allow_direct,
1451 type: :boolean,
1452 description: "Whether to allow direct messages"
1453 }
1454 ]
1455 },
1456 %{
1457 group: :pleroma,
1458 key: :mrf_hellthread,
1459 label: "MRF hellthread",
1460 type: :group,
1461 description: "Block messages with too much mentions",
1462 children: [
1463 %{
1464 key: :delist_threshold,
1465 type: :integer,
1466 description:
1467 "Number of mentioned users after which the message gets delisted (the message can still be seen, " <>
1468 " but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable.",
1469 suggestions: [10]
1470 },
1471 %{
1472 key: :reject_threshold,
1473 type: :integer,
1474 description:
1475 "Number of mentioned users after which the messaged gets rejected. Set to 0 to disable.",
1476 suggestions: [20]
1477 }
1478 ]
1479 },
1480 %{
1481 group: :pleroma,
1482 key: :mrf_keyword,
1483 label: "MRF keyword",
1484 type: :group,
1485 description: "Reject or Word-Replace messages with a keyword or regex",
1486 children: [
1487 %{
1488 key: :reject,
1489 type: [:string, :regex],
1490 description:
1491 "A list of patterns which result in message being rejected. Each pattern can be a string or a regular expression.",
1492 suggestions: ["foo", ~r/foo/iu]
1493 },
1494 %{
1495 key: :federated_timeline_removal,
1496 type: [:string, :regex],
1497 description:
1498 "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.",
1499 suggestions: ["foo", ~r/foo/iu]
1500 },
1501 %{
1502 key: :replace,
1503 type: [{:tuple, :string, :string}, {:tuple, :regex, :string}],
1504 description:
1505 "A list of tuples containing {pattern, replacement}. Each pattern can be a string or a regular expression.",
1506 suggestions: [{"foo", "bar"}, {~r/foo/iu, "bar"}]
1507 }
1508 ]
1509 },
1510 %{
1511 group: :pleroma,
1512 key: :mrf_mention,
1513 label: "MRF mention",
1514 type: :group,
1515 description: "Block messages which mention a user",
1516 children: [
1517 %{
1518 key: :actors,
1519 type: {:list, :string},
1520 description: "A list of actors for which any post mentioning them will be dropped.",
1521 suggestions: ["actor1", "actor2"]
1522 }
1523 ]
1524 },
1525 %{
1526 group: :pleroma,
1527 key: :mrf_vocabulary,
1528 label: "MRF vocabulary",
1529 type: :group,
1530 description: "Filter messages which belong to certain activity vocabularies",
1531 children: [
1532 %{
1533 key: :accept,
1534 type: {:list, :string},
1535 description:
1536 "A list of ActivityStreams terms to accept. If empty, all supported messages are accepted",
1537 suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]
1538 },
1539 %{
1540 key: :reject,
1541 type: {:list, :string},
1542 description:
1543 "A list of ActivityStreams terms to reject. If empty, no messages are rejected",
1544 suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]
1545 }
1546 ]
1547 },
1548 # %{
1549 # group: :pleroma,
1550 # key: :mrf_user_allowlist,
1551 # type: :group,
1552 # description:
1553 # "The keys in this section are the domain names that the policy should apply to." <>
1554 # " Each key should be assigned a list of users that should be allowed through by their ActivityPub ID",
1555 # children: [
1556 # ["example.org": ["https://example.org/users/admin"]],
1557 # suggestions: [
1558 # ["example.org": ["https://example.org/users/admin"]]
1559 # ]
1560 # ]
1561 # },
1562 %{
1563 group: :pleroma,
1564 key: :media_proxy,
1565 type: :group,
1566 description: "Media proxy",
1567 children: [
1568 %{
1569 key: :enabled,
1570 type: :boolean,
1571 description: "Enables proxying of remote media to the instance's proxy"
1572 },
1573 %{
1574 key: :base_url,
1575 type: :string,
1576 description:
1577 "The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.",
1578 suggestions: ["https://example.com"]
1579 },
1580 %{
1581 key: :proxy_opts,
1582 type: :keyword,
1583 description: "Options for Pleroma.ReverseProxy",
1584 suggestions: [
1585 redirect_on_failure: false,
1586 max_body_length: 25 * 1_048_576,
1587 http: [
1588 follow_redirect: true,
1589 pool: :media
1590 ]
1591 ],
1592 children: [
1593 %{
1594 key: :redirect_on_failure,
1595 type: :boolean,
1596 description:
1597 "Redirects the client to the real remote URL if there's any HTTP errors. " <>
1598 "Any error during body processing will not be redirected as the response is chunked."
1599 },
1600 %{
1601 key: :max_body_length,
1602 type: :integer,
1603 description:
1604 "Limits the content length to be approximately the " <>
1605 "specified length. It is validated with the `content-length` header and also verified when proxying."
1606 },
1607 %{
1608 key: :http,
1609 type: :keyword,
1610 description: "HTTP options",
1611 children: [
1612 %{
1613 key: :adapter,
1614 type: :keyword,
1615 description: "Adapter specific options",
1616 children: [
1617 %{
1618 key: :ssl_options,
1619 type: :keyword,
1620 label: "SSL Options",
1621 description: "SSL options for HTTP adapter",
1622 children: [
1623 %{
1624 key: :versions,
1625 type: {:list, :atom},
1626 description: "List of TLS version to use",
1627 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
1628 }
1629 ]
1630 }
1631 ]
1632 },
1633 %{
1634 key: :proxy_url,
1635 label: "Proxy URL",
1636 type: [:string, :tuple],
1637 description: "Proxy URL",
1638 suggestions: ["127.0.0.1:8123", {:socks5, :localhost, 9050}]
1639 }
1640 ]
1641 }
1642 ]
1643 },
1644 %{
1645 key: :whitelist,
1646 type: {:list, :string},
1647 description: "List of domains to bypass the mediaproxy",
1648 suggestions: ["example.com"]
1649 }
1650 ]
1651 },
1652 %{
1653 group: :pleroma,
1654 key: :gopher,
1655 type: :group,
1656 description: "Gopher settings",
1657 children: [
1658 %{
1659 key: :enabled,
1660 type: :boolean,
1661 description: "Enables the gopher interface"
1662 },
1663 %{
1664 key: :ip,
1665 type: :tuple,
1666 description: "IP address to bind to",
1667 suggestions: [{0, 0, 0, 0}]
1668 },
1669 %{
1670 key: :port,
1671 type: :integer,
1672 description: "Port to bind to",
1673 suggestions: [9999]
1674 },
1675 %{
1676 key: :dstport,
1677 type: :integer,
1678 description: "Port advertised in urls (optional, defaults to port)",
1679 suggestions: [9999]
1680 }
1681 ]
1682 },
1683 %{
1684 group: :pleroma,
1685 key: :activitypub,
1686 type: :group,
1687 description: "ActivityPub-related settings",
1688 children: [
1689 %{
1690 key: :unfollow_blocked,
1691 type: :boolean,
1692 description: "Whether blocks result in people getting unfollowed"
1693 },
1694 %{
1695 key: :outgoing_blocks,
1696 type: :boolean,
1697 description: "Whether to federate blocks to other instances"
1698 },
1699 %{
1700 key: :sign_object_fetches,
1701 type: :boolean,
1702 description: "Sign object fetches with HTTP signatures"
1703 },
1704 %{
1705 key: :note_replies_output_limit,
1706 type: :integer,
1707 description:
1708 "The number of Note replies' URIs to be included with outgoing federation (`5` to match Mastodon hardcoded value, `0` to disable the output)."
1709 },
1710 %{
1711 key: :follow_handshake_timeout,
1712 type: :integer,
1713 description: "Following handshake timeout",
1714 suggestions: [500]
1715 }
1716 ]
1717 },
1718 %{
1719 group: :pleroma,
1720 key: :http_security,
1721 type: :group,
1722 description: "HTTP security settings",
1723 children: [
1724 %{
1725 key: :enabled,
1726 type: :boolean,
1727 description: "Whether the managed content security policy is enabled"
1728 },
1729 %{
1730 key: :sts,
1731 label: "STS",
1732 type: :boolean,
1733 description: "Whether to additionally send a Strict-Transport-Security header"
1734 },
1735 %{
1736 key: :sts_max_age,
1737 label: "STS max age",
1738 type: :integer,
1739 description: "The maximum age for the Strict-Transport-Security header if sent",
1740 suggestions: [31_536_000]
1741 },
1742 %{
1743 key: :ct_max_age,
1744 label: "CT max age",
1745 type: :integer,
1746 description: "The maximum age for the Expect-CT header if sent",
1747 suggestions: [2_592_000]
1748 },
1749 %{
1750 key: :referrer_policy,
1751 type: :string,
1752 description: "The referrer policy to use, either \"same-origin\" or \"no-referrer\"",
1753 suggestions: ["same-origin", "no-referrer"]
1754 },
1755 %{
1756 key: :report_uri,
1757 label: "Report URI",
1758 type: :string,
1759 description: "Adds the specified url to report-uri and report-to group in CSP header",
1760 suggestions: ["https://example.com/report-uri"]
1761 }
1762 ]
1763 },
1764 %{
1765 group: :web_push_encryption,
1766 key: :vapid_details,
1767 type: :group,
1768 description:
1769 "Web Push Notifications configuration. You can use the mix task mix web_push.gen.keypair to generate it",
1770 children: [
1771 %{
1772 key: :subject,
1773 type: :string,
1774 description:
1775 "A mailto link for the administrative contact." <>
1776 " It's best if this email is not a personal email address, but rather a group email to the instance moderation team.",
1777 suggestions: ["mailto:moderators@pleroma.com"]
1778 },
1779 %{
1780 key: :public_key,
1781 type: :string,
1782 description: "VAPID public key",
1783 suggestions: ["Public key"]
1784 },
1785 %{
1786 key: :private_key,
1787 type: :string,
1788 description: "VAPID private key",
1789 suggestions: ["Private key"]
1790 }
1791 ]
1792 },
1793 %{
1794 group: :pleroma,
1795 key: Pleroma.Captcha,
1796 type: :group,
1797 description: "Captcha-related settings",
1798 children: [
1799 %{
1800 key: :enabled,
1801 type: :boolean,
1802 description: "Whether the captcha should be shown on registration"
1803 },
1804 %{
1805 key: :method,
1806 type: :module,
1807 description: "The method/service to use for captcha",
1808 suggestions: [Pleroma.Captcha.Kocaptcha, Pleroma.Captcha.Native]
1809 },
1810 %{
1811 key: :seconds_valid,
1812 type: :integer,
1813 description: "The time in seconds for which the captcha is valid",
1814 suggestions: [60]
1815 }
1816 ]
1817 },
1818 %{
1819 group: :pleroma,
1820 key: Pleroma.Captcha.Kocaptcha,
1821 type: :group,
1822 description:
1823 "Kocaptcha is a very simple captcha service with a single API endpoint, the source code is" <>
1824 " here: https://github.com/koto-bank/kocaptcha. The default endpoint (https://captcha.kotobank.ch) is hosted by the developer.",
1825 children: [
1826 %{
1827 key: :endpoint,
1828 type: :string,
1829 description: "The kocaptcha endpoint to use",
1830 suggestions: ["https://captcha.kotobank.ch"]
1831 }
1832 ]
1833 },
1834 %{
1835 group: :pleroma,
1836 type: :group,
1837 description:
1838 "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",
1839 children: [
1840 %{
1841 key: :admin_token,
1842 type: :string,
1843 description: "Token",
1844 suggestions: ["We recommend a secure random string or UUID"]
1845 }
1846 ]
1847 },
1848 %{
1849 group: :pleroma,
1850 key: Oban,
1851 type: :group,
1852 description: """
1853 [Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
1854
1855 Note: if you are running PostgreSQL in [`silent_mode`](https://postgresqlco.nf/en/doc/param/silent_mode?version=9.1),
1856 it's advised to set [`log_destination`](https://postgresqlco.nf/en/doc/param/log_destination?version=9.1) to `syslog`,
1857 otherwise `postmaster.log` file may grow because of "you don't own a lock of type ShareLock" warnings
1858 (see https://github.com/sorentwo/oban/issues/52).
1859 """,
1860 children: [
1861 %{
1862 key: :repo,
1863 type: :module,
1864 description: "Application's Ecto repo",
1865 suggestions: [Pleroma.Repo]
1866 },
1867 %{
1868 key: :verbose,
1869 type: {:dropdown, :atom},
1870 description: "Logs verbose mode",
1871 suggestions: [false, :error, :warn, :info, :debug]
1872 },
1873 %{
1874 key: :prune,
1875 type: [:atom, :tuple],
1876 description:
1877 "Non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning)",
1878 suggestions: [:disabled, {:maxlen, 1500}, {:maxage, 60 * 60}]
1879 },
1880 %{
1881 key: :queues,
1882 type: {:keyword, :integer},
1883 description:
1884 "Background jobs queues (keys: queues, values: max numbers of concurrent jobs)",
1885 suggestions: [
1886 activity_expiration: 10,
1887 attachments_cleanup: 5,
1888 background: 5,
1889 federator_incoming: 50,
1890 federator_outgoing: 50,
1891 mailer: 10,
1892 scheduled_activities: 10,
1893 transmogrifier: 20,
1894 web_push: 50
1895 ],
1896 children: [
1897 %{
1898 key: :activity_expiration,
1899 type: :integer,
1900 description: "Activity expiration queue",
1901 suggestions: [10]
1902 },
1903 %{
1904 key: :attachments_cleanup,
1905 type: :integer,
1906 description: "Attachment deletion queue",
1907 suggestions: [5]
1908 },
1909 %{
1910 key: :background,
1911 type: :integer,
1912 description: "Background queue",
1913 suggestions: [5]
1914 },
1915 %{
1916 key: :federator_incoming,
1917 type: :integer,
1918 description: "Incoming federation queue",
1919 suggestions: [50]
1920 },
1921 %{
1922 key: :federator_outgoing,
1923 type: :integer,
1924 description: "Outgoing federation queue",
1925 suggestions: [50]
1926 },
1927 %{
1928 key: :mailer,
1929 type: :integer,
1930 description: "Email sender queue, see Pleroma.Emails.Mailer",
1931 suggestions: [10]
1932 },
1933 %{
1934 key: :scheduled_activities,
1935 type: :integer,
1936 description: "Scheduled activities queue, see Pleroma.ScheduledActivities",
1937 suggestions: [10]
1938 },
1939 %{
1940 key: :transmogrifier,
1941 type: :integer,
1942 description: "Transmogrifier queue",
1943 suggestions: [20]
1944 },
1945 %{
1946 key: :web_push,
1947 type: :integer,
1948 description: "Web push notifications queue",
1949 suggestions: [50]
1950 }
1951 ]
1952 },
1953 %{
1954 key: :crontab,
1955 type: {:list, :tuple},
1956 description: "Settings for cron background jobs",
1957 suggestions: [
1958 {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
1959 {"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
1960 {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
1961 {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
1962 {"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
1963 ]
1964 }
1965 ]
1966 },
1967 %{
1968 group: :pleroma,
1969 key: :workers,
1970 type: :group,
1971 description: "Includes custom worker options not interpretable directly by `Oban`",
1972 children: [
1973 %{
1974 key: :retries,
1975 type: {:keyword, :integer},
1976 description: "Max retry attempts for failed jobs, per `Oban` queue",
1977 suggestions: [
1978 federator_incoming: 5,
1979 federator_outgoing: 5
1980 ]
1981 }
1982 ]
1983 },
1984 %{
1985 group: :pleroma,
1986 key: Pleroma.Web.Metadata,
1987 type: :group,
1988 description: "Metadata-related settings",
1989 children: [
1990 %{
1991 key: :providers,
1992 type: {:list, :module},
1993 description: "List of metadata providers to enable",
1994 suggestions: [
1995 Pleroma.Web.Metadata.Providers.OpenGraph,
1996 Pleroma.Web.Metadata.Providers.TwitterCard,
1997 Pleroma.Web.Metadata.Providers.RelMe,
1998 Pleroma.Web.Metadata.Providers.Feed
1999 ]
2000 },
2001 %{
2002 key: :unfurl_nsfw,
2003 label: "Unfurl NSFW",
2004 type: :boolean,
2005 description: "When enabled NSFW attachments will be shown in previews"
2006 }
2007 ]
2008 },
2009 %{
2010 group: :pleroma,
2011 key: :rich_media,
2012 type: :group,
2013 description:
2014 "If enabled the instance will parse metadata from attached links to generate link previews.",
2015 children: [
2016 %{
2017 key: :enabled,
2018 type: :boolean,
2019 description: "Enables RichMedia parsing of URLs."
2020 },
2021 %{
2022 key: :ignore_hosts,
2023 type: {:list, :string},
2024 description: "List of hosts which will be ignored by the metadata parser.",
2025 suggestions: ["accounts.google.com", "xss.website"]
2026 },
2027 %{
2028 key: :ignore_tld,
2029 label: "Ignore TLD",
2030 type: {:list, :string},
2031 description: "List TLDs (top-level domains) which will ignore for parse metadata.",
2032 suggestions: ["local", "localdomain", "lan"]
2033 },
2034 %{
2035 key: :parsers,
2036 type: {:list, :module},
2037 description:
2038 "List of Rich Media parsers. Module names are shortened (removed leading `Pleroma.Web.RichMedia.Parsers.` part), but on adding custom MRF module you need to use full name.",
2039 suggestions: [
2040 Pleroma.Web.RichMedia.Parsers.MetaTagsParser,
2041 Pleroma.Web.RichMedia.Parsers.OEmbed,
2042 Pleroma.Web.RichMedia.Parsers.OGP,
2043 Pleroma.Web.RichMedia.Parsers.TwitterCard
2044 ]
2045 },
2046 %{
2047 key: :ttl_setters,
2048 label: "TTL setters",
2049 type: {:list, :module},
2050 description:
2051 "List of rich media TTL setters. Module names are shortened (removed leading `Pleroma.Web.RichMedia.Parser.` part), but on adding custom MRF module you need to use full name.",
2052 suggestions: [
2053 Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl
2054 ]
2055 }
2056 ]
2057 },
2058 %{
2059 group: :auto_linker,
2060 key: :opts,
2061 type: :group,
2062 description: "Configuration for the auto_linker library",
2063 children: [
2064 %{
2065 key: :class,
2066 type: [:string, false],
2067 description: "Specify the class to be added to the generated link. Disable to clear",
2068 suggestions: ["auto-linker", false]
2069 },
2070 %{
2071 key: :rel,
2072 type: [:string, false],
2073 description: "Override the rel attribute. Disable to clear",
2074 suggestions: ["ugc", "noopener noreferrer", false]
2075 },
2076 %{
2077 key: :new_window,
2078 type: :boolean,
2079 description: "Link urls will open in new window/tab"
2080 },
2081 %{
2082 key: :truncate,
2083 type: [:integer, false],
2084 description:
2085 "Set to a number to truncate urls longer then the number. Truncated urls will end in `..`",
2086 suggestions: [15, false]
2087 },
2088 %{
2089 key: :strip_prefix,
2090 type: :boolean,
2091 description: "Strip the scheme prefix"
2092 },
2093 %{
2094 key: :extra,
2095 type: :boolean,
2096 description: "Link urls with rarely used schemes (magnet, ipfs, irc, etc.)"
2097 }
2098 ]
2099 },
2100 %{
2101 group: :pleroma,
2102 key: Pleroma.ScheduledActivity,
2103 type: :group,
2104 description: "Scheduled activities settings",
2105 children: [
2106 %{
2107 key: :daily_user_limit,
2108 type: :integer,
2109 description:
2110 "The number of scheduled activities a user is allowed to create in a single day. Default: 25.",
2111 suggestions: [25]
2112 },
2113 %{
2114 key: :total_user_limit,
2115 type: :integer,
2116 description:
2117 "The number of scheduled activities a user is allowed to create in total. Default: 300.",
2118 suggestions: [300]
2119 },
2120 %{
2121 key: :enabled,
2122 type: :boolean,
2123 description: "Whether scheduled activities are sent to the job queue to be executed"
2124 }
2125 ]
2126 },
2127 %{
2128 group: :pleroma,
2129 key: Pleroma.ActivityExpiration,
2130 type: :group,
2131 description: "Expired activity settings",
2132 children: [
2133 %{
2134 key: :enabled,
2135 type: :boolean,
2136 description: "Whether expired activities will be sent to the job queue to be deleted"
2137 }
2138 ]
2139 },
2140 %{
2141 group: :pleroma,
2142 type: :group,
2143 description: "Authenticator",
2144 children: [
2145 %{
2146 key: Pleroma.Web.Auth.Authenticator,
2147 type: :module,
2148 suggestions: [Pleroma.Web.Auth.PleromaAuthenticator, Pleroma.Web.Auth.LDAPAuthenticator]
2149 }
2150 ]
2151 },
2152 %{
2153 group: :pleroma,
2154 key: :ldap,
2155 type: :group,
2156 description:
2157 "Use LDAP for user authentication. When a user logs in to the Pleroma instance, the name and password" <>
2158 " will be verified by trying to authenticate (bind) to a LDAP server." <>
2159 " If a user exists in the LDAP directory but there is no account with the same name yet on the" <>
2160 " Pleroma instance then a new Pleroma account will be created with the same name as the LDAP user name.",
2161 children: [
2162 %{
2163 key: :enabled,
2164 type: :boolean,
2165 description: "Enables LDAP authentication"
2166 },
2167 %{
2168 key: :host,
2169 type: :string,
2170 description: "LDAP server hostname",
2171 suggestions: ["localhosts"]
2172 },
2173 %{
2174 key: :port,
2175 type: :integer,
2176 description: "LDAP port, e.g. 389 or 636",
2177 suggestions: [389, 636]
2178 },
2179 %{
2180 key: :ssl,
2181 label: "SSL",
2182 type: :boolean,
2183 description: "Enable to use SSL, usually implies the port 636"
2184 },
2185 %{
2186 key: :sslopts,
2187 label: "SSL options",
2188 type: :keyword,
2189 description: "Additional SSL options",
2190 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2191 children: [
2192 %{
2193 key: :cacertfile,
2194 type: :string,
2195 description: "Path to file with PEM encoded cacerts",
2196 suggestions: ["path/to/file/with/PEM/cacerts"]
2197 },
2198 %{
2199 key: :verify,
2200 type: :atom,
2201 description: "Type of cert verification",
2202 suggestions: [:verify_peer]
2203 }
2204 ]
2205 },
2206 %{
2207 key: :tls,
2208 label: "TLS",
2209 type: :boolean,
2210 description: "Enable to use STARTTLS, usually implies the port 389"
2211 },
2212 %{
2213 key: :tlsopts,
2214 label: "TLS options",
2215 type: :keyword,
2216 description: "Additional TLS options",
2217 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2218 children: [
2219 %{
2220 key: :cacertfile,
2221 type: :string,
2222 description: "Path to file with PEM encoded cacerts",
2223 suggestions: ["path/to/file/with/PEM/cacerts"]
2224 },
2225 %{
2226 key: :verify,
2227 type: :atom,
2228 description: "Type of cert verification",
2229 suggestions: [:verify_peer]
2230 }
2231 ]
2232 },
2233 %{
2234 key: :base,
2235 type: :string,
2236 description: "LDAP base, e.g. \"dc=example,dc=com\"",
2237 suggestions: ["dc=example,dc=com"]
2238 },
2239 %{
2240 key: :uid,
2241 type: :string,
2242 description:
2243 "LDAP attribute name to authenticate the user, e.g. when \"cn\", the filter will be \"cn=username,base\"",
2244 suggestions: ["cn"]
2245 }
2246 ]
2247 },
2248 %{
2249 group: :pleroma,
2250 key: :auth,
2251 type: :group,
2252 description: "Authentication / authorization settings",
2253 children: [
2254 %{
2255 key: :enforce_oauth_admin_scope_usage,
2256 type: :boolean,
2257 description:
2258 "OAuth admin scope requirement toggle. " <>
2259 "If enabled, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token " <>
2260 "(client app must support admin scopes). If disabled and token doesn't have admin scope(s)," <>
2261 "`is_admin` user flag grants access to admin-specific actions."
2262 },
2263 %{
2264 key: :auth_template,
2265 type: :string,
2266 description:
2267 "Authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.ee`.",
2268 suggestions: ["show.html"]
2269 },
2270 %{
2271 key: :oauth_consumer_template,
2272 type: :string,
2273 description:
2274 "OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to" <>
2275 " `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`.",
2276 suggestions: ["consumer.html"]
2277 },
2278 %{
2279 key: :oauth_consumer_strategies,
2280 type: {:list, :string},
2281 description:
2282 "The list of enabled OAuth consumer strategies. By default it's set by OAUTH_CONSUMER_STRATEGIES environment variable." <>
2283 " Each entry in this space-delimited string should be of format \"strategy\" or \"strategy:dependency\"" <>
2284 " (e.g. twitter or keycloak:ueberauth_keycloak_strategy in case dependency is named differently than ueberauth_<strategy>).",
2285 suggestions: ["twitter", "keycloak:ueberauth_keycloak_strategy"]
2286 }
2287 ]
2288 },
2289 %{
2290 group: :pleroma,
2291 key: :email_notifications,
2292 type: :group,
2293 description: "Email notifications settings",
2294 children: [
2295 %{
2296 key: :digest,
2297 type: :map,
2298 description:
2299 "emails of \"what you've missed\" for users who have been inactive for a while",
2300 suggestions: [
2301 %{
2302 active: false,
2303 schedule: "0 0 * * 0",
2304 interval: 7,
2305 inactivity_threshold: 7
2306 }
2307 ],
2308 children: [
2309 %{
2310 key: :active,
2311 label: "Enabled",
2312 type: :boolean,
2313 description: "Globally enable or disable digest emails"
2314 },
2315 %{
2316 key: :schedule,
2317 type: :string,
2318 description:
2319 "When to send digest email, in crontab format. \"0 0 0\" is the default, meaning \"once a week at midnight on Sunday morning\".",
2320 suggestions: ["0 0 * * 0"]
2321 },
2322 %{
2323 key: :interval,
2324 type: :integer,
2325 description: "Minimum interval between digest emails to one user",
2326 suggestions: [7]
2327 },
2328 %{
2329 key: :inactivity_threshold,
2330 type: :integer,
2331 description: "Minimum user inactivity threshold",
2332 suggestions: [7]
2333 }
2334 ]
2335 }
2336 ]
2337 },
2338 %{
2339 group: :pleroma,
2340 key: Pleroma.Emails.UserEmail,
2341 type: :group,
2342 description: "Email template settings",
2343 children: [
2344 %{
2345 key: :logo,
2346 type: :string,
2347 description: "A path to a custom logo. Set it to `nil` to use the default Pleroma logo.",
2348 suggestions: ["some/path/logo.png"]
2349 },
2350 %{
2351 key: :styling,
2352 type: :map,
2353 description: "a map with color settings for email templates.",
2354 suggestions: [
2355 %{
2356 link_color: "#d8a070",
2357 background_color: "#2C3645",
2358 content_background_color: "#1B2635",
2359 header_color: "#d8a070",
2360 text_color: "#b9b9ba",
2361 text_muted_color: "#b9b9ba"
2362 }
2363 ],
2364 children: [
2365 %{
2366 key: :link_color,
2367 type: :string,
2368 suggestions: ["#d8a070"]
2369 },
2370 %{
2371 key: :background_color,
2372 type: :string,
2373 suggestions: ["#2C3645"]
2374 },
2375 %{
2376 key: :content_background_color,
2377 type: :string,
2378 suggestions: ["#1B2635"]
2379 },
2380 %{
2381 key: :header_color,
2382 type: :string,
2383 suggestions: ["#d8a070"]
2384 },
2385 %{
2386 key: :text_color,
2387 type: :string,
2388 suggestions: ["#b9b9ba"]
2389 },
2390 %{
2391 key: :text_muted_color,
2392 type: :string,
2393 suggestions: ["#b9b9ba"]
2394 }
2395 ]
2396 }
2397 ]
2398 },
2399 %{
2400 group: :pleroma,
2401 key: Pleroma.Emails.NewUsersDigestEmail,
2402 type: :group,
2403 description: "New users admin email digest",
2404 children: [
2405 %{
2406 key: :enabled,
2407 type: :boolean,
2408 description: "enables new users admin digest email when `true`",
2409 suggestions: [false]
2410 }
2411 ]
2412 },
2413 %{
2414 group: :pleroma,
2415 key: :oauth2,
2416 type: :group,
2417 description: "Configure OAuth 2 provider capabilities",
2418 children: [
2419 %{
2420 key: :token_expires_in,
2421 type: :integer,
2422 description: "The lifetime in seconds of the access token",
2423 suggestions: [600]
2424 },
2425 %{
2426 key: :issue_new_refresh_token,
2427 type: :boolean,
2428 description:
2429 "Keeps old refresh token or generate new refresh token when to obtain an access token"
2430 },
2431 %{
2432 key: :clean_expired_tokens,
2433 type: :boolean,
2434 description: "Enable a background job to clean expired oauth tokens. Default: disabled."
2435 }
2436 ]
2437 },
2438 %{
2439 group: :pleroma,
2440 key: :emoji,
2441 type: :group,
2442 children: [
2443 %{
2444 key: :shortcode_globs,
2445 type: {:list, :string},
2446 description: "Location of custom emoji files. * can be used as a wildcard.",
2447 suggestions: ["/emoji/custom/**/*.png"]
2448 },
2449 %{
2450 key: :pack_extensions,
2451 type: {:list, :string},
2452 description:
2453 "A list of file extensions for emojis, when no emoji.txt for a pack is present",
2454 suggestions: [".png", ".gif"]
2455 },
2456 %{
2457 key: :groups,
2458 type: {:keyword, :string, {:list, :string}},
2459 description:
2460 "Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the group name" <>
2461 " and the value is the location or array of locations. * can be used as a wildcard.",
2462 suggestions: [
2463 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
2464 ]
2465 },
2466 %{
2467 key: :default_manifest,
2468 type: :string,
2469 description:
2470 "Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download." <>
2471 " Currently only one manifest can be added (no arrays).",
2472 suggestions: ["https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"]
2473 },
2474 %{
2475 key: :shared_pack_cache_seconds_per_file,
2476 label: "Shared pack cache s/file",
2477 type: :integer,
2478 descpiption:
2479 "When an emoji pack is shared, the archive is created and cached in memory" <>
2480 " for this amount of seconds multiplied by the number of files.",
2481 suggestions: [60]
2482 }
2483 ]
2484 },
2485 %{
2486 group: :pleroma,
2487 key: :rate_limit,
2488 type: :group,
2489 description:
2490 "Rate limit settings. This is an advanced feature enabled only for :authentication by default.",
2491 children: [
2492 %{
2493 key: :search,
2494 type: [:tuple, {:list, :tuple}],
2495 description: "For the search requests (account & status search etc.)",
2496 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2497 },
2498 %{
2499 key: :timeline,
2500 type: [:tuple, {:list, :tuple}],
2501 description: "For requests to timelines (each timeline has it's own limiter)",
2502 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2503 },
2504 %{
2505 key: :app_account_creation,
2506 type: [:tuple, {:list, :tuple}],
2507 description: "For registering user accounts from the same IP address",
2508 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2509 },
2510 %{
2511 key: :relations_actions,
2512 type: [:tuple, {:list, :tuple}],
2513 description: "For actions on relationships with all users (follow, unfollow)",
2514 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2515 },
2516 %{
2517 key: :relation_id_action,
2518 type: [:tuple, {:list, :tuple}],
2519 description: "For actions on relation with a specific user (follow, unfollow)",
2520 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2521 },
2522 %{
2523 key: :statuses_actions,
2524 type: [:tuple, {:list, :tuple}],
2525 description:
2526 "For create / delete / fav / unfav / reblog / unreblog actions on any statuses",
2527 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2528 },
2529 %{
2530 key: :status_id_action,
2531 type: [:tuple, {:list, :tuple}],
2532 description:
2533 "For fav / unfav or reblog / unreblog actions on the same status by the same user",
2534 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2535 },
2536 %{
2537 key: :authentication,
2538 type: [:tuple, {:list, :tuple}],
2539 description: "For authentication create / password check / user existence check requests",
2540 suggestions: [{60_000, 15}]
2541 }
2542 ]
2543 },
2544 %{
2545 group: :esshd,
2546 type: :group,
2547 description:
2548 "Before enabling this you must add :esshd to mix.exs as one of the extra_applications " <>
2549 "and generate host keys in your priv dir with ssh-keygen -m PEM -N \"\" -b 2048 -t rsa -f ssh_host_rsa_key",
2550 children: [
2551 %{
2552 key: :enabled,
2553 type: :boolean,
2554 description: "Enables SSH"
2555 },
2556 %{
2557 key: :priv_dir,
2558 type: :string,
2559 description: "Dir with SSH keys",
2560 suggestions: ["/some/path/ssh_keys"]
2561 },
2562 %{
2563 key: :handler,
2564 type: :string,
2565 description: "Handler module",
2566 suggestions: ["Pleroma.BBS.Handler"]
2567 },
2568 %{
2569 key: :port,
2570 type: :integer,
2571 description: "Port to connect",
2572 suggestions: [10_022]
2573 },
2574 %{
2575 key: :password_authenticator,
2576 type: :string,
2577 description: "Authenticator module",
2578 suggestions: ["Pleroma.BBS.Authenticator"]
2579 }
2580 ]
2581 },
2582 %{
2583 group: :mime,
2584 type: :group,
2585 description: "Mime types",
2586 children: [
2587 %{
2588 key: :types,
2589 type: :map,
2590 suggestions: [
2591 %{
2592 "application/xml" => ["xml"],
2593 "application/xrd+xml" => ["xrd+xml"],
2594 "application/jrd+json" => ["jrd+json"],
2595 "application/activity+json" => ["activity+json"],
2596 "application/ld+json" => ["activity+json"]
2597 }
2598 ],
2599 children: [
2600 %{
2601 key: "application/xml",
2602 type: {:list, :string},
2603 suggestions: ["xml"]
2604 },
2605 %{
2606 key: "application/xrd+xml",
2607 type: {:list, :string},
2608 suggestions: ["xrd+xml"]
2609 },
2610 %{
2611 key: "application/jrd+json",
2612 type: {:list, :string},
2613 suggestions: ["jrd+json"]
2614 },
2615 %{
2616 key: "application/activity+json",
2617 type: {:list, :string},
2618 suggestions: ["activity+json"]
2619 },
2620 %{
2621 key: "application/ld+json",
2622 type: {:list, :string},
2623 suggestions: ["activity+json"]
2624 }
2625 ]
2626 }
2627 ]
2628 },
2629 %{
2630 group: :pleroma,
2631 key: :chat,
2632 type: :group,
2633 description: "Pleroma chat settings",
2634 children: [
2635 %{
2636 key: :enabled,
2637 type: :boolean
2638 }
2639 ]
2640 },
2641 %{
2642 group: :http_signatures,
2643 type: :group,
2644 description: "HTTP Signatures settings",
2645 children: [
2646 %{
2647 key: :adapter,
2648 type: :module,
2649 suggestions: [Pleroma.Signature]
2650 }
2651 ]
2652 },
2653 %{
2654 group: :pleroma,
2655 key: :http,
2656 type: :group,
2657 description: "HTTP settings",
2658 children: [
2659 %{
2660 key: :proxy_url,
2661 label: "Proxy URL",
2662 type: [:string, :tuple],
2663 description: "Proxy URL",
2664 suggestions: ["localhost:9020", {:socks5, :localhost, 3090}]
2665 },
2666 %{
2667 key: :send_user_agent,
2668 type: :boolean
2669 },
2670 %{
2671 key: :user_agent,
2672 type: [:string, :atom],
2673 description:
2674 "What user agent to use. Must be a string or an atom `:default`. Default value is `:default`.",
2675 suggestions: ["Pleroma", :default]
2676 },
2677 %{
2678 key: :adapter,
2679 type: :keyword,
2680 description: "Adapter specific options",
2681 suggestions: [],
2682 children: [
2683 %{
2684 key: :ssl_options,
2685 type: :keyword,
2686 label: "SSL Options",
2687 description: "SSL options for HTTP adapter",
2688 children: [
2689 %{
2690 key: :versions,
2691 type: {:list, :atom},
2692 description: "List of TLS version to use",
2693 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
2694 }
2695 ]
2696 }
2697 ]
2698 }
2699 ]
2700 },
2701 %{
2702 group: :pleroma,
2703 key: :markup,
2704 type: :group,
2705 children: [
2706 %{
2707 key: :allow_inline_images,
2708 type: :boolean
2709 },
2710 %{
2711 key: :allow_headings,
2712 type: :boolean
2713 },
2714 %{
2715 key: :allow_tables,
2716 type: :boolean
2717 },
2718 %{
2719 key: :allow_fonts,
2720 type: :boolean
2721 },
2722 %{
2723 key: :scrub_policy,
2724 type: {:list, :module},
2725 description:
2726 "Module names are shortened (removed leading `Pleroma.HTML.` part), but on adding custom MRF module you need to use full name.",
2727 suggestions: [Pleroma.HTML.Transform.MediaProxy, Pleroma.HTML.Scrubber.Default]
2728 }
2729 ]
2730 },
2731 %{
2732 group: :pleroma,
2733 key: :user,
2734 type: :group,
2735 children: [
2736 %{
2737 key: :deny_follow_blocked,
2738 type: :boolean
2739 }
2740 ]
2741 },
2742 %{
2743 group: :pleroma,
2744 key: :mrf_normalize_markup,
2745 label: "MRF normalize markup",
2746 description: "MRF NormalizeMarkup settings. Scrub configured hypertext markup.",
2747 type: :group,
2748 children: [
2749 %{
2750 key: :scrub_policy,
2751 type: :module,
2752 suggestions: [Pleroma.HTML.Scrubber.Default]
2753 }
2754 ]
2755 },
2756 %{
2757 group: :pleroma,
2758 key: Pleroma.User,
2759 type: :group,
2760 children: [
2761 %{
2762 key: :restricted_nicknames,
2763 type: {:list, :string},
2764 suggestions: [
2765 ".well-known",
2766 "~",
2767 "about",
2768 "activities",
2769 "api",
2770 "auth",
2771 "check_password",
2772 "dev",
2773 "friend-requests",
2774 "inbox",
2775 "internal",
2776 "main",
2777 "media",
2778 "nodeinfo",
2779 "notice",
2780 "oauth",
2781 "objects",
2782 "ostatus_subscribe",
2783 "pleroma",
2784 "proxy",
2785 "push",
2786 "registration",
2787 "relay",
2788 "settings",
2789 "status",
2790 "tag",
2791 "user-search",
2792 "user_exists",
2793 "users",
2794 "web"
2795 ]
2796 }
2797 ]
2798 },
2799 %{
2800 group: :cors_plug,
2801 type: :group,
2802 children: [
2803 %{
2804 key: :max_age,
2805 type: :integer,
2806 suggestions: [86_400]
2807 },
2808 %{
2809 key: :methods,
2810 type: {:list, :string},
2811 suggestions: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"]
2812 },
2813 %{
2814 key: :expose,
2815 type: {:list, :string},
2816 suggestions: [
2817 "Link",
2818 "X-RateLimit-Reset",
2819 "X-RateLimit-Limit",
2820 "X-RateLimit-Remaining",
2821 "X-Request-Id",
2822 "Idempotency-Key"
2823 ]
2824 },
2825 %{
2826 key: :credentials,
2827 type: :boolean
2828 },
2829 %{
2830 key: :headers,
2831 type: {:list, :string},
2832 suggestions: ["Authorization", "Content-Type", "Idempotency-Key"]
2833 }
2834 ]
2835 },
2836 %{
2837 group: :pleroma,
2838 key: Pleroma.Plugs.RemoteIp,
2839 type: :group,
2840 description: """
2841 `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
2842 **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
2843 """,
2844 children: [
2845 %{
2846 key: :enabled,
2847 type: :boolean,
2848 description: "Enable/disable the plug. Default: disabled."
2849 },
2850 %{
2851 key: :headers,
2852 type: {:list, :string},
2853 description:
2854 "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]`."
2855 },
2856 %{
2857 key: :proxies,
2858 type: {:list, :string},
2859 description:
2860 "A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Default: `[]`."
2861 },
2862 %{
2863 key: :reserved,
2864 type: {:list, :string},
2865 description:
2866 "Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network)."
2867 }
2868 ]
2869 },
2870 %{
2871 group: :pleroma,
2872 key: :web_cache_ttl,
2873 type: :group,
2874 description:
2875 "The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.",
2876 children: [
2877 %{
2878 key: :activity_pub,
2879 type: :integer,
2880 description:
2881 "Activity pub routes (except question activities). Default: `nil` (no expiration).",
2882 suggestions: [30_000, nil]
2883 },
2884 %{
2885 key: :activity_pub_question,
2886 type: :integer,
2887 description: "Activity pub routes (question activities). Default: `30_000` (30 seconds).",
2888 suggestions: [30_000]
2889 }
2890 ]
2891 },
2892 %{
2893 group: :pleroma,
2894 key: :static_fe,
2895 type: :group,
2896 description:
2897 "Render profiles and posts using server-generated HTML that is viewable without using JavaScript.",
2898 children: [
2899 %{
2900 key: :enabled,
2901 type: :boolean,
2902 description: "Enables the rendering of static HTML. Default: disabled."
2903 }
2904 ]
2905 },
2906 %{
2907 group: :pleroma,
2908 key: :feed,
2909 type: :group,
2910 description: "Configure feed rendering",
2911 children: [
2912 %{
2913 key: :post_title,
2914 type: :map,
2915 description: "Configure title rendering.",
2916 children: [
2917 %{
2918 key: :max_length,
2919 type: :integer,
2920 description: "Maximum number of characters before truncating title.",
2921 suggestions: [100]
2922 },
2923 %{
2924 key: :omission,
2925 type: :string,
2926 description: "Replacement which will be used after truncating string.",
2927 suggestions: ["..."]
2928 }
2929 ]
2930 }
2931 ]
2932 },
2933 %{
2934 group: :pleroma,
2935 key: :mrf_object_age,
2936 type: :group,
2937 description: "Rejects or delists posts based on their age when received.",
2938 children: [
2939 %{
2940 key: :threshold,
2941 type: :integer,
2942 description: "Required age (in seconds) of a post before actions are taken.",
2943 suggestions: [172_800]
2944 },
2945 %{
2946 key: :actions,
2947 type: {:list, :atom},
2948 description:
2949 "A list of actions to apply to the post. `:delist` removes the post from public timelines; " <>
2950 "`:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines; " <>
2951 "`:reject` rejects the message entirely",
2952 suggestions: [:delist, :strip_followers, :reject]
2953 }
2954 ]
2955 },
2956 %{
2957 group: :pleroma,
2958 key: :modules,
2959 type: :group,
2960 description: "Custom Runtime Modules",
2961 children: [
2962 %{
2963 key: :runtime_dir,
2964 type: :string,
2965 description: "A path to custom Elixir modules (such as MRF policies)."
2966 }
2967 ]
2968 },
2969 %{
2970 group: :pleroma,
2971 key: :streamer,
2972 type: :group,
2973 description: "Settings for notifications streamer",
2974 children: [
2975 %{
2976 key: :workers,
2977 type: :integer,
2978 description: "Number of workers to send notifications.",
2979 suggestions: [3]
2980 },
2981 %{
2982 key: :overflow_workers,
2983 type: :integer,
2984 description: "Maximum number of workers created if pool is empty.",
2985 suggestions: [2]
2986 }
2987 ]
2988 },
2989 %{
2990 group: :pleroma,
2991 key: :connections_pool,
2992 type: :group,
2993 description: "Advanced settings for `gun` connections pool",
2994 children: [
2995 %{
2996 key: :checkin_timeout,
2997 type: :integer,
2998 description: "Timeout to checkin connection from pool. Default: 250ms.",
2999 suggestions: [250]
3000 },
3001 %{
3002 key: :max_connections,
3003 type: :integer,
3004 description: "Maximum number of connections in the pool. Default: 250 connections.",
3005 suggestions: [250]
3006 },
3007 %{
3008 key: :retry,
3009 type: :integer,
3010 description:
3011 "Number of retries, while `gun` will try to reconnect if connection goes down. Default: 1.",
3012 suggestions: [1]
3013 },
3014 %{
3015 key: :retry_timeout,
3016 type: :integer,
3017 description:
3018 "Time between retries when `gun` will try to reconnect in milliseconds. Default: 1000ms.",
3019 suggestions: [1000]
3020 },
3021 %{
3022 key: :await_up_timeout,
3023 type: :integer,
3024 description: "Timeout while `gun` will wait until connection is up. Default: 5000ms.",
3025 suggestions: [5000]
3026 }
3027 ]
3028 },
3029 %{
3030 group: :pleroma,
3031 key: :pools,
3032 type: :group,
3033 description: "Advanced settings for `gun` workers pools",
3034 children: [
3035 %{
3036 key: :federation,
3037 type: :keyword,
3038 description: "Settings for federation pool.",
3039 children: [
3040 %{
3041 key: :size,
3042 type: :integer,
3043 description: "Number workers in the pool.",
3044 suggestions: [50]
3045 },
3046 %{
3047 key: :max_overflow,
3048 type: :integer,
3049 description: "Number of additional workers if pool is under load.",
3050 suggestions: [10]
3051 },
3052 %{
3053 key: :timeout,
3054 type: :integer,
3055 description: "Timeout while `gun` will wait for response.",
3056 suggestions: [150_000]
3057 }
3058 ]
3059 },
3060 %{
3061 key: :media,
3062 type: :keyword,
3063 description: "Settings for media pool.",
3064 children: [
3065 %{
3066 key: :size,
3067 type: :integer,
3068 description: "Number workers in the pool.",
3069 suggestions: [50]
3070 },
3071 %{
3072 key: :max_overflow,
3073 type: :integer,
3074 description: "Number of additional workers if pool is under load.",
3075 suggestions: [10]
3076 },
3077 %{
3078 key: :timeout,
3079 type: :integer,
3080 description: "Timeout while `gun` will wait for response.",
3081 suggestions: [150_000]
3082 }
3083 ]
3084 },
3085 %{
3086 key: :upload,
3087 type: :keyword,
3088 description: "Settings for upload pool.",
3089 children: [
3090 %{
3091 key: :size,
3092 type: :integer,
3093 description: "Number workers in the pool.",
3094 suggestions: [25]
3095 },
3096 %{
3097 key: :max_overflow,
3098 type: :integer,
3099 description: "Number of additional workers if pool is under load.",
3100 suggestions: [5]
3101 },
3102 %{
3103 key: :timeout,
3104 type: :integer,
3105 description: "Timeout while `gun` will wait for response.",
3106 suggestions: [300_000]
3107 }
3108 ]
3109 },
3110 %{
3111 key: :default,
3112 type: :keyword,
3113 description: "Settings for default pool.",
3114 children: [
3115 %{
3116 key: :size,
3117 type: :integer,
3118 description: "Number workers in the pool.",
3119 suggestions: [10]
3120 },
3121 %{
3122 key: :max_overflow,
3123 type: :integer,
3124 description: "Number of additional workers if pool is under load.",
3125 suggestions: [2]
3126 },
3127 %{
3128 key: :timeout,
3129 type: :integer,
3130 description: "Timeout while `gun` will wait for response.",
3131 suggestions: [10_000]
3132 }
3133 ]
3134 }
3135 ]
3136 },
3137 %{
3138 group: :pleroma,
3139 key: :hackney_pools,
3140 type: :group,
3141 description: "Advanced settings for `hackney` connections pools",
3142 children: [
3143 %{
3144 key: :federation,
3145 type: :keyword,
3146 description: "Settings for federation pool.",
3147 children: [
3148 %{
3149 key: :max_connections,
3150 type: :integer,
3151 description: "Number workers in the pool.",
3152 suggestions: [50]
3153 },
3154 %{
3155 key: :timeout,
3156 type: :integer,
3157 description: "Timeout while `hackney` will wait for response.",
3158 suggestions: [150_000]
3159 }
3160 ]
3161 },
3162 %{
3163 key: :media,
3164 type: :keyword,
3165 description: "Settings for media pool.",
3166 children: [
3167 %{
3168 key: :max_connections,
3169 type: :integer,
3170 description: "Number workers in the pool.",
3171 suggestions: [50]
3172 },
3173 %{
3174 key: :timeout,
3175 type: :integer,
3176 description: "Timeout while `hackney` will wait for response.",
3177 suggestions: [150_000]
3178 }
3179 ]
3180 },
3181 %{
3182 key: :upload,
3183 type: :keyword,
3184 description: "Settings for upload pool.",
3185 children: [
3186 %{
3187 key: :max_connections,
3188 type: :integer,
3189 description: "Number workers in the pool.",
3190 suggestions: [25]
3191 },
3192 %{
3193 key: :timeout,
3194 type: :integer,
3195 description: "Timeout while `hackney` will wait for response.",
3196 suggestions: [300_000]
3197 }
3198 ]
3199 }
3200 ]
3201 },
3202 %{
3203 group: :pleroma,
3204 key: :restrict_unauthenticated,
3205 type: :group,
3206 description:
3207 "Disallow viewing timelines, user profiles and statuses for unauthenticated users.",
3208 children: [
3209 %{
3210 key: :timelines,
3211 type: :map,
3212 description: "Settings for public and federated timelines.",
3213 children: [
3214 %{
3215 key: :local,
3216 type: :boolean,
3217 description: "Disallow view public timeline."
3218 },
3219 %{
3220 key: :federated,
3221 type: :boolean,
3222 description: "Disallow view federated timeline."
3223 }
3224 ]
3225 },
3226 %{
3227 key: :profiles,
3228 type: :map,
3229 description: "Settings for user profiles.",
3230 children: [
3231 %{
3232 key: :local,
3233 type: :boolean,
3234 description: "Disallow view local user profiles."
3235 },
3236 %{
3237 key: :remote,
3238 type: :boolean,
3239 description: "Disallow view remote user profiles."
3240 }
3241 ]
3242 },
3243 %{
3244 key: :activities,
3245 type: :map,
3246 description: "Settings for statuses.",
3247 children: [
3248 %{
3249 key: :local,
3250 type: :boolean,
3251 description: "Disallow view local statuses."
3252 },
3253 %{
3254 key: :remote,
3255 type: :boolean,
3256 description: "Disallow view remote statuses."
3257 }
3258 ]
3259 }
3260 ]
3261 },
3262 %{
3263 group: :pleroma,
3264 key: Pleroma.Web.ApiSpec.CastAndValidate,
3265 type: :group,
3266 children: [
3267 %{
3268 key: :strict,
3269 type: :boolean,
3270 description:
3271 "Enables strict input validation (useful in development, not recommended in production)",
3272 suggestions: [false]
3273 }
3274 ]
3275 }
3276 ]