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