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