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