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