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