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