Formatting
[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: :attachment_links,
800 type: :boolean,
801 description: "Enable to automatically add attachment link text to statuses"
802 },
803 %{
804 key: :welcome_message,
805 type: :string,
806 description:
807 "A message that will be sent to a newly registered users as a direct message",
808 suggestions: [
809 "Hi, @username! Welcome on board!"
810 ]
811 },
812 %{
813 key: :welcome_user_nickname,
814 type: :string,
815 description: "The nickname of the local user that sends the welcome message",
816 suggestions: [
817 "lain"
818 ]
819 },
820 %{
821 key: :max_report_comment_size,
822 type: :integer,
823 description: "The maximum size of the report comment. Default: 1000.",
824 suggestions: [
825 1_000
826 ]
827 },
828 %{
829 key: :safe_dm_mentions,
830 type: :boolean,
831 description:
832 "If set to `true`, only mentions at the beginning of a post will be used to address people in direct messages." <>
833 " This is to prevent accidental mentioning of people when talking about them (e.g. \"@admin please keep an eye on @bad_actor\")." <>
834 " Default: `false`"
835 },
836 %{
837 key: :healthcheck,
838 type: :boolean,
839 description: "If set to `true`, system data will be shown on /api/pleroma/healthcheck"
840 },
841 %{
842 key: :remote_post_retention_days,
843 type: :integer,
844 description:
845 "The default amount of days to retain remote posts when pruning the database",
846 suggestions: [
847 90
848 ]
849 },
850 %{
851 key: :user_bio_length,
852 type: :integer,
853 description: "A user bio maximum length. Default: 5000.",
854 suggestions: [
855 5_000
856 ]
857 },
858 %{
859 key: :user_name_length,
860 type: :integer,
861 description: "A user name maximum length. Default: 100.",
862 suggestions: [
863 100
864 ]
865 },
866 %{
867 key: :skip_thread_containment,
868 type: :boolean,
869 description: "Skip filter out broken threads. Default: `true`"
870 },
871 %{
872 key: :limit_to_local_content,
873 type: {:dropdown, :atom},
874 description:
875 "Limit unauthenticated users to search for local statutes and users only. Default: `:unauthenticated`.",
876 suggestions: [
877 :unauthenticated,
878 :all,
879 false
880 ]
881 },
882 %{
883 key: :max_account_fields,
884 type: :integer,
885 description: "The maximum number of custom fields in the user profile. Default: 10.",
886 suggestions: [
887 10
888 ]
889 },
890 %{
891 key: :max_remote_account_fields,
892 type: :integer,
893 description:
894 "The maximum number of custom fields in the remote user profile. Default: 20.",
895 suggestions: [
896 20
897 ]
898 },
899 %{
900 key: :account_field_name_length,
901 type: :integer,
902 description: "An account field name maximum length. Default: 512.",
903 suggestions: [
904 512
905 ]
906 },
907 %{
908 key: :account_field_value_length,
909 type: :integer,
910 description: "An account field value maximum length. Default: 2048.",
911 suggestions: [
912 2048
913 ]
914 },
915 %{
916 key: :external_user_synchronization,
917 type: :boolean,
918 description: "Enabling following/followers counters synchronization for external users"
919 }
920 ]
921 },
922 %{
923 group: :logger,
924 type: :group,
925 description: "Logger-related settings",
926 children: [
927 %{
928 key: :backends,
929 type: [:atom, :tuple, :module],
930 description:
931 "Where logs will be sent, :console - send logs to stdout, { ExSyslogger, :ex_syslogger } - to syslog, Quack.Logger - to Slack.",
932 suggestions: [:console, {ExSyslogger, :ex_syslogger}, Quack.Logger]
933 }
934 ]
935 },
936 %{
937 group: :logger,
938 type: :group,
939 key: :ex_syslogger,
940 description: "ExSyslogger-related settings",
941 children: [
942 %{
943 key: :level,
944 type: {:dropdown, :atom},
945 description: "Log level",
946 suggestions: [:debug, :info, :warn, :error]
947 },
948 %{
949 key: :ident,
950 type: :string,
951 description:
952 "A string that's prepended to every message, and is typically set to the app name",
953 suggestions: ["pleroma"]
954 },
955 %{
956 key: :format,
957 type: :string,
958 description: "Default: \"$date $time [$level] $levelpad$node $metadata $message\".",
959 suggestions: ["$metadata[$level] $message"]
960 },
961 %{
962 key: :metadata,
963 type: {:list, :atom},
964 suggestions: [:request_id]
965 }
966 ]
967 },
968 %{
969 group: :logger,
970 type: :group,
971 key: :console,
972 description: "Console logger settings",
973 children: [
974 %{
975 key: :level,
976 type: {:dropdown, :atom},
977 description: "Log level",
978 suggestions: [:debug, :info, :warn, :error]
979 },
980 %{
981 key: :format,
982 type: :string,
983 description: "Default: \"$date $time [$level] $levelpad$node $metadata $message\".",
984 suggestions: ["$metadata[$level] $message"]
985 },
986 %{
987 key: :metadata,
988 type: {:list, :atom},
989 suggestions: [:request_id]
990 }
991 ]
992 },
993 %{
994 group: :quack,
995 type: :group,
996 description: "Quack-related settings",
997 children: [
998 %{
999 key: :level,
1000 type: {:dropdown, :atom},
1001 description: "Log level",
1002 suggestions: [:debug, :info, :warn, :error]
1003 },
1004 %{
1005 key: :meta,
1006 type: {:list, :atom},
1007 description: "Configure which metadata you want to report on",
1008 suggestions: [
1009 :application,
1010 :module,
1011 :file,
1012 :function,
1013 :line,
1014 :pid,
1015 :crash_reason,
1016 :initial_call,
1017 :registered_name,
1018 :all,
1019 :none
1020 ]
1021 },
1022 %{
1023 key: :webhook_url,
1024 type: :string,
1025 description: "Configure the Slack incoming webhook",
1026 suggestions: ["https://hooks.slack.com/services/YOUR-KEY-HERE"]
1027 }
1028 ]
1029 },
1030 %{
1031 group: :pleroma,
1032 key: :frontend_configurations,
1033 type: :group,
1034 description:
1035 "This form can be used to configure a keyword list that keeps the configuration data for any " <>
1036 "kind of frontend. By default, settings for pleroma_fe and masto_fe are configured. If you want to " <>
1037 "add your own configuration your settings all fields must be complete.",
1038 children: [
1039 %{
1040 key: :pleroma_fe,
1041 label: "Pleroma FE",
1042 type: :map,
1043 description: "Settings for Pleroma FE",
1044 suggestions: [
1045 %{
1046 theme: "pleroma-dark",
1047 logo: "/static/logo.png",
1048 background: "/images/city.jpg",
1049 redirectRootNoLogin: "/main/all",
1050 redirectRootLogin: "/main/friends",
1051 showInstanceSpecificPanel: true,
1052 scopeOptionsEnabled: false,
1053 formattingOptionsEnabled: false,
1054 collapseMessageWithSubject: false,
1055 hidePostStats: false,
1056 hideUserStats: false,
1057 scopeCopy: true,
1058 subjectLineBehavior: "email",
1059 alwaysShowSubjectInput: true,
1060 logoMask: false,
1061 logoMargin: ".1em",
1062 stickers: false,
1063 enableEmojiPicker: false
1064 }
1065 ],
1066 children: [
1067 %{
1068 key: :theme,
1069 type: :string,
1070 description: "Which theme to use, they are defined in styles.json",
1071 suggestions: ["pleroma-dark"]
1072 },
1073 %{
1074 key: :logo,
1075 type: :string,
1076 description: "URL of the logo, defaults to Pleroma's logo",
1077 suggestions: ["/static/logo.png"]
1078 },
1079 %{
1080 key: :background,
1081 type: :string,
1082 description:
1083 "URL of the background, unless viewing a user profile with a background that is set",
1084 suggestions: ["/images/city.jpg"]
1085 },
1086 %{
1087 key: :redirectRootNoLogin,
1088 label: "Redirect root no login",
1089 type: :string,
1090 description:
1091 "Relative URL which indicates where to redirect when a user isn't logged in",
1092 suggestions: ["/main/all"]
1093 },
1094 %{
1095 key: :redirectRootLogin,
1096 label: "Redirect root login",
1097 type: :string,
1098 description:
1099 "Relative URL which indicates where to redirect when a user is logged in",
1100 suggestions: ["/main/friends"]
1101 },
1102 %{
1103 key: :showInstanceSpecificPanel,
1104 label: "Show instance specific panel",
1105 type: :boolean,
1106 description: "Whenether to show the instance's specific panel"
1107 },
1108 %{
1109 key: :scopeOptionsEnabled,
1110 label: "Scope options enabled",
1111 type: :boolean,
1112 description: "Enable setting a notice visibility and subject/CW when posting"
1113 },
1114 %{
1115 key: :formattingOptionsEnabled,
1116 label: "Formatting options enabled",
1117 type: :boolean,
1118 description:
1119 "Enable setting a formatting different than plain-text (ie. HTML, Markdown) when posting, relates to `:instance`, `allowed_post_formats`"
1120 },
1121 %{
1122 key: :collapseMessageWithSubject,
1123 label: "Collapse message with subject",
1124 type: :boolean,
1125 description:
1126 "When a message has a subject (aka Content Warning), collapse it by default"
1127 },
1128 %{
1129 key: :hidePostStats,
1130 label: "Hide post stats",
1131 type: :boolean,
1132 description: "Hide notices statistics (repeats, favorites, ...)"
1133 },
1134 %{
1135 key: :hideUserStats,
1136 label: "Hide user stats",
1137 type: :boolean,
1138 description:
1139 "Hide profile statistics (posts, posts per day, followers, followings, ...)"
1140 },
1141 %{
1142 key: :scopeCopy,
1143 label: "Scope copy",
1144 type: :boolean,
1145 description: "Copy the scope (private/unlisted/public) in replies to posts by default"
1146 },
1147 %{
1148 key: :subjectLineBehavior,
1149 label: "Subject line behavior",
1150 type: :string,
1151 description: "Allows changing the default behaviour of subject lines in replies.
1152 `email`: copy and preprend re:, as in email,
1153 `masto`: copy verbatim, as in Mastodon,
1154 `noop`: don't copy the subject.",
1155 suggestions: ["email", "masto", "noop"]
1156 },
1157 %{
1158 key: :alwaysShowSubjectInput,
1159 label: "Always show subject input",
1160 type: :boolean,
1161 description: "When set to `false`, auto-hide the subject field when it's empty"
1162 },
1163 %{
1164 key: :logoMask,
1165 label: "Logo mask",
1166 type: :boolean,
1167 description:
1168 "By default it assumes logo used will be monochrome-with-alpha one, this is done to be compatible with both light and dark themes, " <>
1169 "so that white logo designed with dark theme in mind won't be invisible over light theme, this is done via CSS3 Masking. " <>
1170 "Basically - it will take alpha channel of the image and fill non-transparent areas of it with solid color. " <>
1171 "If you really want colorful logo - it can be done by setting logoMask to false."
1172 },
1173 %{
1174 key: :logoMargin,
1175 label: "Logo margin",
1176 type: :string,
1177 description:
1178 "Allows you to adjust vertical margins between logo boundary and navbar borders. " <>
1179 "The idea is that to have logo's image without any extra margins and instead adjust them to your need in layout.",
1180 suggestions: [".1em"]
1181 },
1182 %{
1183 key: :stickers,
1184 type: :boolean,
1185 description: "Enables/disables stickers."
1186 },
1187 %{
1188 key: :enableEmojiPicker,
1189 label: "Emoji picker",
1190 type: :boolean,
1191 description: "Enables/disables emoji picker."
1192 }
1193 ]
1194 },
1195 %{
1196 key: :masto_fe,
1197 label: "Masto FE",
1198 type: :map,
1199 description: "Settings for Masto FE",
1200 suggestions: [
1201 %{
1202 showInstanceSpecificPanel: true
1203 }
1204 ],
1205 children: [
1206 %{
1207 key: :showInstanceSpecificPanel,
1208 label: "Show instance specific panel",
1209 type: :boolean,
1210 description: "Whenether to show the instance's specific panel"
1211 }
1212 ]
1213 }
1214 ]
1215 },
1216 %{
1217 group: :pleroma,
1218 key: :assets,
1219 type: :group,
1220 description:
1221 "This section configures assets to be used with various frontends. Currently the only option relates to mascots on the mastodon frontend",
1222 children: [
1223 %{
1224 key: :mascots,
1225 type: {:keyword, :map},
1226 description:
1227 "Keyword of mascots, each element must contain both an url and a mime_type key",
1228 suggestions: [
1229 pleroma_fox_tan: %{
1230 url: "/images/pleroma-fox-tan-smol.png",
1231 mime_type: "image/png"
1232 },
1233 pleroma_fox_tan_shy: %{
1234 url: "/images/pleroma-fox-tan-shy.png",
1235 mime_type: "image/png"
1236 }
1237 ]
1238 },
1239 %{
1240 key: :default_mascot,
1241 type: :atom,
1242 description:
1243 "This will be used as the default mascot on MastoFE. Default: `:pleroma_fox_tan`",
1244 suggestions: [
1245 :pleroma_fox_tan
1246 ]
1247 }
1248 ]
1249 },
1250 %{
1251 group: :pleroma,
1252 key: :manifest,
1253 type: :group,
1254 description:
1255 "This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE",
1256 children: [
1257 %{
1258 key: :icons,
1259 type: {:list, :map},
1260 description: "Describe the icons of the app",
1261 suggestion: [
1262 %{
1263 src: "/static/logo.png"
1264 },
1265 %{
1266 src: "/static/icon.png",
1267 type: "image/png"
1268 },
1269 %{
1270 src: "/static/icon.ico",
1271 sizes: "72x72 96x96 128x128 256x256"
1272 }
1273 ]
1274 },
1275 %{
1276 key: :theme_color,
1277 type: :string,
1278 description: "Describe the theme color of the app",
1279 suggestions: ["#282c37", "mediumpurple"]
1280 },
1281 %{
1282 key: :background_color,
1283 type: :string,
1284 description: "Describe the background color of the app",
1285 suggestions: ["#191b22", "aliceblue"]
1286 }
1287 ]
1288 },
1289 %{
1290 group: :pleroma,
1291 key: :mrf_simple,
1292 label: "MRF simple",
1293 type: :group,
1294 description: "Message Rewrite Facility",
1295 children: [
1296 %{
1297 key: :media_removal,
1298 type: {:list, :string},
1299 description: "List of instances to remove medias from",
1300 suggestions: ["example.com", "*.example.com"]
1301 },
1302 %{
1303 key: :media_nsfw,
1304 label: "Media NSFW",
1305 type: {:list, :string},
1306 description: "List of instances to put medias as NSFW (sensitive) from",
1307 suggestions: ["example.com", "*.example.com"]
1308 },
1309 %{
1310 key: :federated_timeline_removal,
1311 type: {:list, :string},
1312 description:
1313 "List of instances to remove from Federated (aka The Whole Known Network) Timeline",
1314 suggestions: ["example.com", "*.example.com"]
1315 },
1316 %{
1317 key: :reject,
1318 type: {:list, :string},
1319 description: "List of instances to reject any activities from",
1320 suggestions: ["example.com", "*.example.com"]
1321 },
1322 %{
1323 key: :accept,
1324 type: {:list, :string},
1325 description: "List of instances to accept any activities from",
1326 suggestions: ["example.com", "*.example.com"]
1327 },
1328 %{
1329 key: :report_removal,
1330 type: {:list, :string},
1331 description: "List of instances to reject reports from",
1332 suggestions: ["example.com", "*.example.com"]
1333 },
1334 %{
1335 key: :avatar_removal,
1336 type: {:list, :string},
1337 description: "List of instances to strip avatars from",
1338 suggestions: ["example.com", "*.example.com"]
1339 },
1340 %{
1341 key: :banner_removal,
1342 type: {:list, :string},
1343 description: "List of instances to strip banners from",
1344 suggestions: ["example.com", "*.example.com"]
1345 }
1346 ]
1347 },
1348 %{
1349 group: :pleroma,
1350 key: :mrf_subchain,
1351 label: "MRF subchain",
1352 type: :group,
1353 description:
1354 "This policy processes messages through an alternate pipeline when a given message matches certain criteria." <>
1355 " All criteria are configured as a map of regular expressions to lists of policy modules.",
1356 children: [
1357 %{
1358 key: :match_actor,
1359 type: :map,
1360 description: "Matches a series of regular expressions against the actor field",
1361 suggestions: [
1362 %{
1363 ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy]
1364 }
1365 ]
1366 }
1367 ]
1368 },
1369 %{
1370 group: :pleroma,
1371 key: :mrf_rejectnonpublic,
1372 description:
1373 "MRF RejectNonPublic settings. RejectNonPublic drops posts with non-public visibility settings.",
1374 label: "MRF reject non public",
1375 type: :group,
1376 children: [
1377 %{
1378 key: :allow_followersonly,
1379 label: "Allow followers-only",
1380 type: :boolean,
1381 description: "Whether to allow followers-only posts"
1382 },
1383 %{
1384 key: :allow_direct,
1385 type: :boolean,
1386 description: "Whether to allow direct messages"
1387 }
1388 ]
1389 },
1390 %{
1391 group: :pleroma,
1392 key: :mrf_hellthread,
1393 label: "MRF hellthread",
1394 type: :group,
1395 description: "Block messages with too much mentions",
1396 children: [
1397 %{
1398 key: :delist_threshold,
1399 type: :integer,
1400 description:
1401 "Number of mentioned users after which the message gets delisted (the message can still be seen, " <>
1402 " but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable.",
1403 suggestions: [10]
1404 },
1405 %{
1406 key: :reject_threshold,
1407 type: :integer,
1408 description:
1409 "Number of mentioned users after which the messaged gets rejected. Set to 0 to disable.",
1410 suggestions: [20]
1411 }
1412 ]
1413 },
1414 %{
1415 group: :pleroma,
1416 key: :mrf_keyword,
1417 label: "MRF keyword",
1418 type: :group,
1419 description: "Reject or Word-Replace messages with a keyword or regex",
1420 children: [
1421 %{
1422 key: :reject,
1423 type: [:string, :regex],
1424 description:
1425 "A list of patterns which result in message being rejected, each pattern can be a string or a regular expression.",
1426 suggestions: ["foo", ~r/foo/iu]
1427 },
1428 %{
1429 key: :federated_timeline_removal,
1430 type: [:string, :regex],
1431 description:
1432 "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.",
1433 suggestions: ["foo", ~r/foo/iu]
1434 },
1435 %{
1436 key: :replace,
1437 type: [{:tuple, :string, :string}, {:tuple, :regex, :string}],
1438 description:
1439 "A list of tuples containing {pattern, replacement}, pattern can be a string or a regular expression.",
1440 suggestions: [{"foo", "bar"}, {~r/foo/iu, "bar"}]
1441 }
1442 ]
1443 },
1444 %{
1445 group: :pleroma,
1446 key: :mrf_mention,
1447 label: "MRF mention",
1448 type: :group,
1449 description: "Block messages which mention a user",
1450 children: [
1451 %{
1452 key: :actors,
1453 type: {:list, :string},
1454 description: "A list of actors, for which to drop any posts mentioning",
1455 suggestions: ["actor1", "actor2"]
1456 }
1457 ]
1458 },
1459 %{
1460 group: :pleroma,
1461 key: :mrf_vocabulary,
1462 label: "MRF vocabulary",
1463 type: :group,
1464 description: "Filter messages which belong to certain activity vocabularies",
1465 children: [
1466 %{
1467 key: :accept,
1468 type: {:list, :string},
1469 description:
1470 "A list of ActivityStreams terms to accept. If empty, all supported messages are accepted",
1471 suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]
1472 },
1473 %{
1474 key: :reject,
1475 type: {:list, :string},
1476 description:
1477 "A list of ActivityStreams terms to reject. If empty, no messages are rejected",
1478 suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]
1479 }
1480 ]
1481 },
1482 # %{
1483 # group: :pleroma,
1484 # key: :mrf_user_allowlist,
1485 # type: :group,
1486 # description:
1487 # "The keys in this section are the domain names that the policy should apply to." <>
1488 # " Each key should be assigned a list of users that should be allowed through by their ActivityPub ID",
1489 # children: [
1490 # ["example.org": ["https://example.org/users/admin"]],
1491 # suggestions: [
1492 # ["example.org": ["https://example.org/users/admin"]]
1493 # ]
1494 # ]
1495 # },
1496 %{
1497 group: :pleroma,
1498 key: :media_proxy,
1499 type: :group,
1500 description: "Media proxy",
1501 children: [
1502 %{
1503 key: :enabled,
1504 type: :boolean,
1505 description: "Enables proxying of remote media to the instance's proxy"
1506 },
1507 %{
1508 key: :base_url,
1509 type: :string,
1510 description:
1511 "The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.",
1512 suggestions: ["https://example.com"]
1513 },
1514 %{
1515 key: :proxy_opts,
1516 type: :keyword,
1517 description: "Options for Pleroma.ReverseProxy",
1518 suggestions: [
1519 redirect_on_failure: false,
1520 max_body_length: 25 * 1_048_576,
1521 http: [
1522 follow_redirect: true,
1523 pool: :media
1524 ]
1525 ],
1526 children: [
1527 %{
1528 key: :redirect_on_failure,
1529 type: :boolean,
1530 description:
1531 "Redirects the client to the real remote URL if there's any HTTP errors. " <>
1532 "Any error during body processing will not be redirected as the response is chunked."
1533 },
1534 %{
1535 key: :max_body_length,
1536 type: :integer,
1537 description:
1538 "Limits the content length to be approximately the " <>
1539 "specified length. It is validated with the `content-length` header and also verified when proxying."
1540 },
1541 %{
1542 key: :http,
1543 type: :keyword,
1544 description: "HTTP options",
1545 children: [
1546 %{
1547 key: :adapter,
1548 type: :keyword,
1549 description: "Adapter specific options",
1550 children: [
1551 %{
1552 key: :ssl_options,
1553 type: :keyword,
1554 label: "SSL Options",
1555 description: "SSL options for HTTP adapter",
1556 children: [
1557 %{
1558 key: :versions,
1559 type: {:list, :atom},
1560 description: "List of TLS version to use",
1561 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
1562 }
1563 ]
1564 }
1565 ]
1566 },
1567 %{
1568 key: :proxy_url,
1569 label: "Proxy URL",
1570 type: [:string, :tuple],
1571 description: "Proxy URL",
1572 suggestions: ["127.0.0.1:8123", {:socks5, :localhost, 9050}]
1573 }
1574 ]
1575 }
1576 ]
1577 },
1578 %{
1579 key: :whitelist,
1580 type: {:list, :string},
1581 description: "List of domains to bypass the mediaproxy",
1582 suggestions: ["example.com"]
1583 }
1584 ]
1585 },
1586 %{
1587 group: :pleroma,
1588 key: :gopher,
1589 type: :group,
1590 description: "Gopher settings",
1591 children: [
1592 %{
1593 key: :enabled,
1594 type: :boolean,
1595 description: "Enables the gopher interface"
1596 },
1597 %{
1598 key: :ip,
1599 type: :tuple,
1600 description: "IP address to bind to",
1601 suggestions: [{0, 0, 0, 0}]
1602 },
1603 %{
1604 key: :port,
1605 type: :integer,
1606 description: "Port to bind to",
1607 suggestions: [9999]
1608 },
1609 %{
1610 key: :dstport,
1611 type: :integer,
1612 description: "Port advertised in urls (optional, defaults to port)",
1613 suggestions: [9999]
1614 }
1615 ]
1616 },
1617 %{
1618 group: :pleroma,
1619 key: Pleroma.Web.Endpoint,
1620 type: :group,
1621 description: "Phoenix endpoint configuration",
1622 children: [
1623 %{
1624 key: :http,
1625 label: "HTTP",
1626 type: {:keyword, :integer, :tuple},
1627 description: "http protocol configuration",
1628 suggestions: [
1629 port: 8080,
1630 ip: {127, 0, 0, 1}
1631 ],
1632 children: [
1633 %{
1634 key: :dispatch,
1635 type: {:list, :tuple},
1636 description: "dispatch settings",
1637 suggestions: [
1638 {:_,
1639 [
1640 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
1641 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
1642 {Phoenix.Transports.WebSocket,
1643 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
1644 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
1645 ]}
1646 # end copied from config.exs
1647 ]
1648 },
1649 %{
1650 key: :ip,
1651 label: "IP",
1652 type: :tuple,
1653 description: "ip",
1654 suggestions: [
1655 {0, 0, 0, 0}
1656 ]
1657 },
1658 %{
1659 key: :port,
1660 type: :integer,
1661 description: "port",
1662 suggestions: [
1663 2020
1664 ]
1665 }
1666 ]
1667 },
1668 %{
1669 key: :url,
1670 label: "URL",
1671 type: {:keyword, :string, :integer},
1672 description: "configuration for generating urls",
1673 suggestions: [
1674 host: "example.com",
1675 port: 2020,
1676 scheme: "https"
1677 ],
1678 children: [
1679 %{
1680 key: :host,
1681 type: :string,
1682 description: "Host",
1683 suggestions: [
1684 "example.com"
1685 ]
1686 },
1687 %{
1688 key: :port,
1689 type: :integer,
1690 description: "port",
1691 suggestions: [
1692 2020
1693 ]
1694 },
1695 %{
1696 key: :scheme,
1697 type: :string,
1698 description: "Scheme",
1699 suggestions: [
1700 "https",
1701 "https"
1702 ]
1703 }
1704 ]
1705 },
1706 %{
1707 key: :instrumenters,
1708 type: {:list, :module},
1709 suggestions: [Pleroma.Web.Endpoint.Instrumenter]
1710 },
1711 %{
1712 key: :protocol,
1713 type: :string,
1714 suggestions: ["https"]
1715 },
1716 %{
1717 key: :secret_key_base,
1718 type: :string,
1719 suggestions: ["aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl"]
1720 },
1721 %{
1722 key: :signing_salt,
1723 type: :string,
1724 suggestions: ["CqaoopA2"]
1725 },
1726 %{
1727 key: :render_errors,
1728 type: :keyword,
1729 suggestions: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
1730 children: [
1731 %{
1732 key: :view,
1733 type: :module,
1734 suggestions: [Pleroma.Web.ErrorView]
1735 },
1736 %{
1737 key: :accepts,
1738 type: {:list, :string},
1739 suggestions: ["json"]
1740 }
1741 ]
1742 },
1743 %{
1744 key: :pubsub,
1745 type: :keyword,
1746 suggestions: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
1747 children: [
1748 %{
1749 key: :name,
1750 type: :module,
1751 suggestions: [Pleroma.PubSub]
1752 },
1753 %{
1754 key: :adapter,
1755 type: :module,
1756 suggestions: [Phoenix.PubSub.PG2]
1757 }
1758 ]
1759 },
1760 %{
1761 key: :secure_cookie_flag,
1762 type: :boolean
1763 },
1764 %{
1765 key: :extra_cookie_attrs,
1766 type: {:list, :string},
1767 suggestions: ["SameSite=Lax"]
1768 }
1769 ]
1770 },
1771 %{
1772 group: :pleroma,
1773 key: :activitypub,
1774 type: :group,
1775 description: "ActivityPub-related settings",
1776 children: [
1777 %{
1778 key: :unfollow_blocked,
1779 type: :boolean,
1780 description: "Whether blocks result in people getting unfollowed"
1781 },
1782 %{
1783 key: :outgoing_blocks,
1784 type: :boolean,
1785 description: "Whether to federate blocks to other instances"
1786 },
1787 %{
1788 key: :sign_object_fetches,
1789 type: :boolean,
1790 description: "Sign object fetches with HTTP signatures"
1791 },
1792 %{
1793 key: :follow_handshake_timeout,
1794 type: :integer,
1795 description: "Following handshake timeout",
1796 suggestions: [500]
1797 }
1798 ]
1799 },
1800 %{
1801 group: :pleroma,
1802 key: :http_security,
1803 type: :group,
1804 description: "HTTP security settings",
1805 children: [
1806 %{
1807 key: :enabled,
1808 type: :boolean,
1809 description: "Whether the managed content security policy is enabled"
1810 },
1811 %{
1812 key: :sts,
1813 label: "STS",
1814 type: :boolean,
1815 description: "Whether to additionally send a Strict-Transport-Security header"
1816 },
1817 %{
1818 key: :sts_max_age,
1819 label: "STS max age",
1820 type: :integer,
1821 description: "The maximum age for the Strict-Transport-Security header if sent",
1822 suggestions: [31_536_000]
1823 },
1824 %{
1825 key: :ct_max_age,
1826 label: "CT max age",
1827 type: :integer,
1828 description: "The maximum age for the Expect-CT header if sent",
1829 suggestions: [2_592_000]
1830 },
1831 %{
1832 key: :referrer_policy,
1833 type: :string,
1834 description: "The referrer policy to use, either \"same-origin\" or \"no-referrer\"",
1835 suggestions: ["same-origin", "no-referrer"]
1836 },
1837 %{
1838 key: :report_uri,
1839 label: "Report URI",
1840 type: :string,
1841 description: "Adds the specified url to report-uri and report-to group in CSP header",
1842 suggestions: ["https://example.com/report-uri"]
1843 }
1844 ]
1845 },
1846 %{
1847 group: :web_push_encryption,
1848 key: :vapid_details,
1849 type: :group,
1850 description:
1851 "Web Push Notifications configuration. You can use the mix task mix web_push.gen.keypair to generate it",
1852 children: [
1853 %{
1854 key: :subject,
1855 type: :string,
1856 description:
1857 "A mailto link for the administrative contact." <>
1858 " 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," <>
1859 " is unavailable for an extended period, or otherwise can't respond, someone else on the list can.",
1860 suggestions: ["Subject"]
1861 },
1862 %{
1863 key: :public_key,
1864 type: :string,
1865 description: "VAPID public key",
1866 suggestions: ["Public key"]
1867 },
1868 %{
1869 key: :private_key,
1870 type: :string,
1871 description: "VAPID private key",
1872 suggestions: ["Private key"]
1873 }
1874 ]
1875 },
1876 %{
1877 group: :pleroma,
1878 key: Pleroma.Captcha,
1879 type: :group,
1880 description: "Captcha-related settings",
1881 children: [
1882 %{
1883 key: :enabled,
1884 type: :boolean,
1885 description: "Whether the captcha should be shown on registration"
1886 },
1887 %{
1888 key: :method,
1889 type: :module,
1890 description: "The method/service to use for captcha",
1891 suggestions: [Pleroma.Captcha.Kocaptcha, Pleroma.Captcha.Native]
1892 },
1893 %{
1894 key: :seconds_valid,
1895 type: :integer,
1896 description: "The time in seconds for which the captcha is valid",
1897 suggestions: [60]
1898 }
1899 ]
1900 },
1901 %{
1902 group: :pleroma,
1903 key: Pleroma.Captcha.Kocaptcha,
1904 type: :group,
1905 description:
1906 "Kocaptcha is a very simple captcha service with a single API endpoint, the source code is" <>
1907 " here: https://github.com/koto-bank/kocaptcha. The default endpoint (https://captcha.kotobank.ch) is hosted by the developer.",
1908 children: [
1909 %{
1910 key: :endpoint,
1911 type: :string,
1912 description: "The kocaptcha endpoint to use",
1913 suggestions: ["https://captcha.kotobank.ch"]
1914 }
1915 ]
1916 },
1917 %{
1918 group: :pleroma,
1919 type: :group,
1920 description:
1921 "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",
1922 children: [
1923 %{
1924 key: :admin_token,
1925 type: :string,
1926 description: "Token",
1927 suggestions: ["some_random_token"]
1928 }
1929 ]
1930 },
1931 %{
1932 group: :pleroma_job_queue,
1933 key: :queues,
1934 type: :group,
1935 description: "[Deprecated] Replaced with `Oban`/`:queues` (keeping the same format)"
1936 },
1937 %{
1938 group: :pleroma,
1939 key: Pleroma.Web.Federator.RetryQueue,
1940 type: :group,
1941 description: "[Deprecated] See `Oban` and `:workers` sections for configuration notes",
1942 children: [
1943 %{
1944 key: :max_retries,
1945 type: :integer,
1946 description: "[Deprecated] Replaced as `Oban`/`:queues`/`:outgoing_federation` value"
1947 }
1948 ]
1949 },
1950 %{
1951 group: :pleroma,
1952 key: Oban,
1953 type: :group,
1954 description: """
1955 [Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
1956
1957 Note: if you are running PostgreSQL in [`silent_mode`](https://postgresqlco.nf/en/doc/param/silent_mode?version=9.1),
1958 it's advised to set [`log_destination`](https://postgresqlco.nf/en/doc/param/log_destination?version=9.1) to `syslog`,
1959 otherwise `postmaster.log` file may grow because of "you don't own a lock of type ShareLock" warnings
1960 (see https://github.com/sorentwo/oban/issues/52).
1961 """,
1962 children: [
1963 %{
1964 key: :repo,
1965 type: :module,
1966 description: "Application's Ecto repo",
1967 suggestions: [Pleroma.Repo]
1968 },
1969 %{
1970 key: :verbose,
1971 type: {:dropdown, :atom},
1972 description: "Logs verbose mode",
1973 suggestions: [false, :error, :warn, :info, :debug]
1974 },
1975 %{
1976 key: :prune,
1977 type: [:atom, :tuple],
1978 description:
1979 "Non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning)",
1980 suggestions: [:disabled, {:maxlen, 1500}, {:maxage, 60 * 60}]
1981 },
1982 %{
1983 key: :queues,
1984 type: {:keyword, :integer},
1985 description:
1986 "Background jobs queues (keys: queues, values: max numbers of concurrent jobs)",
1987 suggestions: [
1988 activity_expiration: 10,
1989 background: 5,
1990 federator_incoming: 50,
1991 federator_outgoing: 50,
1992 mailer: 10,
1993 scheduled_activities: 10,
1994 transmogrifier: 20,
1995 web_push: 50
1996 ],
1997 children: [
1998 %{
1999 key: :activity_expiration,
2000 type: :integer,
2001 description: "Activity expiration queue",
2002 suggestions: [10]
2003 },
2004 %{
2005 key: :background,
2006 type: :integer,
2007 description: "Background queue",
2008 suggestions: [5]
2009 },
2010 %{
2011 key: :federator_incoming,
2012 type: :integer,
2013 description: "Incoming federation queue",
2014 suggestions: [50]
2015 },
2016 %{
2017 key: :federator_outgoing,
2018 type: :integer,
2019 description: "Outgoing federation queue",
2020 suggestions: [50]
2021 },
2022 %{
2023 key: :mailer,
2024 type: :integer,
2025 description: "Email sender queue, see Pleroma.Emails.Mailer",
2026 suggestions: [10]
2027 },
2028 %{
2029 key: :scheduled_activities,
2030 type: :integer,
2031 description: "Scheduled activities queue, see Pleroma.ScheduledActivities",
2032 suggestions: [10]
2033 },
2034 %{
2035 key: :transmogrifier,
2036 type: :integer,
2037 description: "Transmogrifier queue",
2038 suggestions: [20]
2039 },
2040 %{
2041 key: :web_push,
2042 type: :integer,
2043 description: "Web push notifications queue",
2044 suggestions: [50]
2045 }
2046 ]
2047 }
2048 ]
2049 },
2050 %{
2051 group: :pleroma,
2052 key: :workers,
2053 type: :group,
2054 description: "Includes custom worker options not interpretable directly by `Oban`",
2055 children: [
2056 %{
2057 key: :retries,
2058 type: {:keyword, :integer},
2059 description: "Max retry attempts for failed jobs, per `Oban` queue",
2060 suggestions: [
2061 federator_incoming: 5,
2062 federator_outgoing: 5
2063 ]
2064 }
2065 ]
2066 },
2067 %{
2068 group: :pleroma,
2069 key: Pleroma.Web.Metadata,
2070 type: :group,
2071 description: "Metadata-related settings",
2072 children: [
2073 %{
2074 key: :providers,
2075 type: {:list, :module},
2076 description: "List of metadata providers to enable",
2077 suggestions: [
2078 Pleroma.Web.Metadata.Providers.OpenGraph,
2079 Pleroma.Web.Metadata.Providers.TwitterCard,
2080 Pleroma.Web.Metadata.Providers.RelMe,
2081 Pleroma.Web.Metadata.Providers.Feed
2082 ]
2083 },
2084 %{
2085 key: :unfurl_nsfw,
2086 label: "Unfurl NSFW",
2087 type: :boolean,
2088 description: "If set to `true` NSFW attachments will be shown in previews"
2089 }
2090 ]
2091 },
2092 %{
2093 group: :pleroma,
2094 key: :rich_media,
2095 type: :group,
2096 description:
2097 "If enabled the instance will parse metadata from attached links to generate link previews.",
2098 children: [
2099 %{
2100 key: :enabled,
2101 type: :boolean,
2102 description: "Enables/disables RichMedia."
2103 },
2104 %{
2105 key: :ignore_hosts,
2106 type: {:list, :string},
2107 description: "List of hosts which will be ignored by the metadata parser.",
2108 suggestions: ["accounts.google.com", "xss.website"]
2109 },
2110 %{
2111 key: :ignore_tld,
2112 label: "Ignore TLD",
2113 type: {:list, :string},
2114 description: "List TLDs (top-level domains) which will ignore for parse metadata.",
2115 suggestions: ["local", "localdomain", "lan"]
2116 },
2117 %{
2118 key: :parsers,
2119 type: {:list, :module},
2120 description: "List of Rich Media parsers.",
2121 suggestions: [
2122 Pleroma.Web.RichMedia.Parsers.MetaTagsParser,
2123 Pleroma.Web.RichMedia.Parsers.OEmbed,
2124 Pleroma.Web.RichMedia.Parsers.OGP,
2125 Pleroma.Web.RichMedia.Parsers.TwitterCard
2126 ]
2127 },
2128 %{
2129 key: :ttl_setters,
2130 label: "TTL setters",
2131 type: {:list, :module},
2132 description: "List of rich media TTL setters.",
2133 suggestions: [
2134 Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl
2135 ]
2136 }
2137 ]
2138 },
2139 %{
2140 group: :pleroma,
2141 key: :fetch_initial_posts,
2142 type: :group,
2143 description: "Fetching initial posts settings",
2144 children: [
2145 %{
2146 key: :enabled,
2147 type: :boolean,
2148 description:
2149 "If enabled, when a new user is federated with, fetch some of their latest posts"
2150 },
2151 %{
2152 key: :pages,
2153 type: :integer,
2154 description: "The amount of pages to fetch",
2155 suggestions: [5]
2156 }
2157 ]
2158 },
2159 %{
2160 group: :auto_linker,
2161 key: :opts,
2162 type: :group,
2163 description: "Configuration for the auto_linker library",
2164 children: [
2165 %{
2166 key: :class,
2167 type: [:string, false],
2168 description: "Specify the class to be added to the generated link. `False` to clear",
2169 suggestions: ["auto-linker", false]
2170 },
2171 %{
2172 key: :rel,
2173 type: [:string, false],
2174 description: "Override the rel attribute. `False` to clear",
2175 suggestions: ["ugc", "noopener noreferrer", false]
2176 },
2177 %{
2178 key: :new_window,
2179 type: :boolean,
2180 description: "Link urls will open in new window/tab"
2181 },
2182 %{
2183 key: :truncate,
2184 type: [:integer, false],
2185 description:
2186 "Set to a number to truncate urls longer then the number. Truncated urls will end in `..`",
2187 suggestions: [15, false]
2188 },
2189 %{
2190 key: :strip_prefix,
2191 type: :boolean,
2192 description: "Strip the scheme prefix"
2193 },
2194 %{
2195 key: :extra,
2196 type: :boolean,
2197 description: "Link urls with rarely used schemes (magnet, ipfs, irc, etc.)"
2198 }
2199 ]
2200 },
2201 %{
2202 group: :pleroma,
2203 key: Pleroma.ScheduledActivity,
2204 type: :group,
2205 description: "Scheduled activities settings",
2206 children: [
2207 %{
2208 key: :daily_user_limit,
2209 type: :integer,
2210 description:
2211 "The number of scheduled activities a user is allowed to create in a single day. Default: 25.",
2212 suggestions: [25]
2213 },
2214 %{
2215 key: :total_user_limit,
2216 type: :integer,
2217 description:
2218 "The number of scheduled activities a user is allowed to create in total. Default: 300.",
2219 suggestions: [300]
2220 },
2221 %{
2222 key: :enabled,
2223 type: :boolean,
2224 description: "Whether scheduled activities are sent to the job queue to be executed"
2225 }
2226 ]
2227 },
2228 %{
2229 group: :pleroma,
2230 key: Pleroma.ActivityExpiration,
2231 type: :group,
2232 description: "Expired activity settings",
2233 children: [
2234 %{
2235 key: :enabled,
2236 type: :boolean,
2237 description: "Whether expired activities will be sent to the job queue to be deleted"
2238 }
2239 ]
2240 },
2241 %{
2242 group: :pleroma,
2243 type: :group,
2244 description: "Authenticator",
2245 children: [
2246 %{
2247 key: Pleroma.Web.Auth.Authenticator,
2248 type: :module,
2249 suggestions: [Pleroma.Web.Auth.PleromaAuthenticator, Pleroma.Web.Auth.LDAPAuthenticator]
2250 }
2251 ]
2252 },
2253 %{
2254 group: :pleroma,
2255 key: :ldap,
2256 type: :group,
2257 description:
2258 "Use LDAP for user authentication. When a user logs in to the Pleroma instance, the name and password" <>
2259 " will be verified by trying to authenticate (bind) to a LDAP server." <>
2260 " If a user exists in the LDAP directory but there is no account with the same name yet on the" <>
2261 " Pleroma instance then a new Pleroma account will be created with the same name as the LDAP user name.",
2262 children: [
2263 %{
2264 key: :enabled,
2265 type: :boolean,
2266 description: "Enables LDAP authentication"
2267 },
2268 %{
2269 key: :host,
2270 type: :string,
2271 description: "LDAP server hostname",
2272 suggestions: ["localhosts"]
2273 },
2274 %{
2275 key: :port,
2276 type: :integer,
2277 description: "LDAP port, e.g. 389 or 636",
2278 suggestions: [389, 636]
2279 },
2280 %{
2281 key: :ssl,
2282 label: "SSL",
2283 type: :boolean,
2284 description: "`True` to use SSL, usually implies the port 636"
2285 },
2286 %{
2287 key: :sslopts,
2288 label: "SSL options",
2289 type: :keyword,
2290 description: "Additional SSL options",
2291 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2292 children: [
2293 %{
2294 key: :cacertfile,
2295 type: :string,
2296 description: "Path to file with PEM encoded cacerts",
2297 suggestions: ["path/to/file/with/PEM/cacerts"]
2298 },
2299 %{
2300 key: :verify,
2301 type: :atom,
2302 description: "Type of cert verification",
2303 suggestions: [:verify_peer]
2304 }
2305 ]
2306 },
2307 %{
2308 key: :tls,
2309 label: "TLS",
2310 type: :boolean,
2311 description: "`True` to start TLS, usually implies the port 389"
2312 },
2313 %{
2314 key: :tlsopts,
2315 label: "TLS options",
2316 type: :keyword,
2317 description: "Additional TLS options",
2318 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2319 children: [
2320 %{
2321 key: :cacertfile,
2322 type: :string,
2323 description: "Path to file with PEM encoded cacerts",
2324 suggestions: ["path/to/file/with/PEM/cacerts"]
2325 },
2326 %{
2327 key: :verify,
2328 type: :atom,
2329 description: "Type of cert verification",
2330 suggestions: [:verify_peer]
2331 }
2332 ]
2333 },
2334 %{
2335 key: :base,
2336 type: :string,
2337 description: "LDAP base, e.g. \"dc=example,dc=com\"",
2338 suggestions: ["dc=example,dc=com"]
2339 },
2340 %{
2341 key: :uid,
2342 type: :string,
2343 description:
2344 "LDAP attribute name to authenticate the user, e.g. when \"cn\", the filter will be \"cn=username,base\"",
2345 suggestions: ["cn"]
2346 }
2347 ]
2348 },
2349 %{
2350 group: :pleroma,
2351 key: :auth,
2352 type: :group,
2353 description: "Authentication / authorization settings",
2354 children: [
2355 %{
2356 key: :enforce_oauth_admin_scope_usage,
2357 type: :boolean,
2358 description:
2359 "OAuth admin scope requirement toggle. " <>
2360 "If `true`, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token " <>
2361 "(client app must support admin scopes). If `false` and token doesn't have admin scope(s)," <>
2362 "`is_admin` user flag grants access to admin-specific actions."
2363 },
2364 %{
2365 key: :auth_template,
2366 type: :string,
2367 description:
2368 "Authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.ee`.",
2369 suggestions: ["show.html"]
2370 },
2371 %{
2372 key: :oauth_consumer_template,
2373 type: :string,
2374 description:
2375 "OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to" <>
2376 " `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`.",
2377 suggestions: ["consumer.html"]
2378 },
2379 %{
2380 key: :oauth_consumer_strategies,
2381 type: {:list, :string},
2382 description:
2383 "The list of enabled OAuth consumer strategies; by default it's set by OAUTH_CONSUMER_STRATEGIES environment variable." <>
2384 " Each entry in this space-delimited string should be of format \"strategy\" or \"strategy:dependency\"" <>
2385 " (e.g. twitter or keycloak:ueberauth_keycloak_strategy in case dependency is named differently than ueberauth_<strategy>).",
2386 suggestions: ["twitter", "keycloak:ueberauth_keycloak_strategy"]
2387 }
2388 ]
2389 },
2390 %{
2391 group: :pleroma,
2392 key: :email_notifications,
2393 type: :group,
2394 description: "Email notifications settings",
2395 children: [
2396 %{
2397 key: :digest,
2398 type: :map,
2399 description:
2400 "emails of \"what you've missed\" for users who have been inactive for a while",
2401 suggestions: [
2402 %{
2403 active: false,
2404 schedule: "0 0 * * 0",
2405 interval: 7,
2406 inactivity_threshold: 7
2407 }
2408 ],
2409 children: [
2410 %{
2411 key: :active,
2412 type: :boolean,
2413 description: "Globally enable or disable digest emails"
2414 },
2415 %{
2416 key: :schedule,
2417 type: :string,
2418 description:
2419 "When to send digest email, in crontab format. \"0 0 0\" is the default, meaning \"once a week at midnight on Sunday morning\".",
2420 suggestions: ["0 0 * * 0"]
2421 },
2422 %{
2423 key: :interval,
2424 type: :integer,
2425 description: "Minimum interval between digest emails to one user",
2426 suggestions: [7]
2427 },
2428 %{
2429 key: :inactivity_threshold,
2430 type: :integer,
2431 description: "Minimum user inactivity threshold",
2432 suggestions: [7]
2433 }
2434 ]
2435 }
2436 ]
2437 },
2438 %{
2439 group: :pleroma,
2440 key: Pleroma.Emails.UserEmail,
2441 type: :group,
2442 description: "Email template settings",
2443 children: [
2444 %{
2445 key: :logo,
2446 type: :string,
2447 description: "A path to a custom logo. Set it to `nil` to use the default Pleroma logo.",
2448 suggestions: ["some/path/logo.png"]
2449 },
2450 %{
2451 key: :styling,
2452 type: :map,
2453 description: "a map with color settings for email templates.",
2454 suggestions: [
2455 %{
2456 link_color: "#d8a070",
2457 background_color: "#2C3645",
2458 content_background_color: "#1B2635",
2459 header_color: "#d8a070",
2460 text_color: "#b9b9ba",
2461 text_muted_color: "#b9b9ba"
2462 }
2463 ],
2464 children: [
2465 %{
2466 key: :link_color,
2467 type: :string,
2468 suggestions: ["#d8a070"]
2469 },
2470 %{
2471 key: :background_color,
2472 type: :string,
2473 suggestions: ["#2C3645"]
2474 },
2475 %{
2476 key: :content_background_color,
2477 type: :string,
2478 suggestions: ["#1B2635"]
2479 },
2480 %{
2481 key: :header_color,
2482 type: :string,
2483 suggestions: ["#d8a070"]
2484 },
2485 %{
2486 key: :text_color,
2487 type: :string,
2488 suggestions: ["#b9b9ba"]
2489 },
2490 %{
2491 key: :text_muted_color,
2492 type: :string,
2493 suggestions: ["#b9b9ba"]
2494 }
2495 ]
2496 }
2497 ]
2498 },
2499 %{
2500 group: :pleroma,
2501 key: :oauth2,
2502 type: :group,
2503 description: "Configure OAuth 2 provider capabilities",
2504 children: [
2505 %{
2506 key: :token_expires_in,
2507 type: :integer,
2508 description: "The lifetime in seconds of the access token",
2509 suggestions: [600]
2510 },
2511 %{
2512 key: :issue_new_refresh_token,
2513 type: :boolean,
2514 description:
2515 "Keeps old refresh token or generate new refresh token when to obtain an access token"
2516 },
2517 %{
2518 key: :clean_expired_tokens,
2519 type: :boolean,
2520 description: "Enable a background job to clean expired oauth tokens. Default: `false`."
2521 }
2522 ]
2523 },
2524 %{
2525 group: :pleroma,
2526 key: :emoji,
2527 type: :group,
2528 children: [
2529 %{
2530 key: :shortcode_globs,
2531 type: {:list, :string},
2532 description: "Location of custom emoji files. * can be used as a wildcard.",
2533 suggestions: ["/emoji/custom/**/*.png"]
2534 },
2535 %{
2536 key: :pack_extensions,
2537 type: {:list, :string},
2538 description:
2539 "A list of file extensions for emojis, when no emoji.txt for a pack is present",
2540 suggestions: [".png", ".gif"]
2541 },
2542 %{
2543 key: :groups,
2544 type: {:keyword, :string, {:list, :string}},
2545 description:
2546 "Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the group name" <>
2547 " and the value is the location or array of locations. * can be used as a wildcard.",
2548 suggestions: [
2549 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
2550 ]
2551 },
2552 %{
2553 key: :default_manifest,
2554 type: :string,
2555 description:
2556 "Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download." <>
2557 " Currently only one manifest can be added (no arrays).",
2558 suggestions: ["https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"]
2559 },
2560 %{
2561 key: :shared_pack_cache_seconds_per_file,
2562 label: "Shared pack cache s/file",
2563 type: :integer,
2564 descpiption:
2565 "When an emoji pack is shared, the archive is created and cached in memory" <>
2566 " for this amount of seconds multiplied by the number of files.",
2567 suggestions: [60]
2568 }
2569 ]
2570 },
2571 %{
2572 group: :pleroma,
2573 key: :database,
2574 type: :group,
2575 description: "Database related settings",
2576 children: [
2577 %{
2578 key: :rum_enabled,
2579 type: :boolean,
2580 description: "If RUM indexes should be used. Default: `false`"
2581 }
2582 ]
2583 },
2584 %{
2585 group: :pleroma,
2586 key: :rate_limit,
2587 type: :group,
2588 description:
2589 "Rate limit settings. This is an advanced feature enabled only for :authentication by default.",
2590 children: [
2591 %{
2592 key: :search,
2593 type: [:tuple, {:list, :tuple}],
2594 description: "For the search requests (account & status search etc.)",
2595 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2596 },
2597 %{
2598 key: :app_account_creation,
2599 type: [:tuple, {:list, :tuple}],
2600 description: "For registering user accounts from the same IP address",
2601 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2602 },
2603 %{
2604 key: :relations_actions,
2605 type: [:tuple, {:list, :tuple}],
2606 description: "For actions on relations with all users (follow, unfollow)",
2607 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2608 },
2609 %{
2610 key: :relation_id_action,
2611 type: [:tuple, {:list, :tuple}],
2612 description: "For actions on relation with a specific user (follow, unfollow)",
2613 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2614 },
2615 %{
2616 key: :statuses_actions,
2617 type: [:tuple, {:list, :tuple}],
2618 description:
2619 "For create / delete / fav / unfav / reblog / unreblog actions on any statuses",
2620 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2621 },
2622 %{
2623 key: :status_id_action,
2624 type: [:tuple, {:list, :tuple}],
2625 description:
2626 "For fav / unfav or reblog / unreblog actions on the same status by the same user",
2627 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2628 },
2629 %{
2630 key: :authentication,
2631 type: [:tuple, {:list, :tuple}],
2632 description: "For authentication create / password check / user existence check requests",
2633 suggestions: [{60_000, 15}]
2634 }
2635 ]
2636 },
2637 %{
2638 group: :esshd,
2639 type: :group,
2640 description:
2641 "Before enabling this you must add :esshd to mix.exs as one of the extra_applications " <>
2642 "and generate host keys in your priv dir with ssh-keygen -m PEM -N \"\" -b 2048 -t rsa -f ssh_host_rsa_key",
2643 children: [
2644 %{
2645 key: :enabled,
2646 type: :boolean,
2647 description: "Enables SSH"
2648 },
2649 %{
2650 key: :priv_dir,
2651 type: :string,
2652 description: "Dir with SSH keys",
2653 suggestions: ["/some/path/ssh_keys"]
2654 },
2655 %{
2656 key: :handler,
2657 type: :string,
2658 description: "Handler module",
2659 suggestions: ["Pleroma.BBS.Handler"]
2660 },
2661 %{
2662 key: :port,
2663 type: :integer,
2664 description: "Port to connect",
2665 suggestions: [10_022]
2666 },
2667 %{
2668 key: :password_authenticator,
2669 type: :string,
2670 description: "Authenticator module",
2671 suggestions: ["Pleroma.BBS.Authenticator"]
2672 }
2673 ]
2674 },
2675 %{
2676 group: :mime,
2677 type: :group,
2678 description: "Mime types",
2679 children: [
2680 %{
2681 key: :types,
2682 type: :map,
2683 suggestions: [
2684 %{
2685 "application/xml" => ["xml"],
2686 "application/xrd+xml" => ["xrd+xml"],
2687 "application/jrd+json" => ["jrd+json"],
2688 "application/activity+json" => ["activity+json"],
2689 "application/ld+json" => ["activity+json"]
2690 }
2691 ],
2692 children: [
2693 %{
2694 key: "application/xml",
2695 type: {:list, :string},
2696 suggestions: ["xml"]
2697 },
2698 %{
2699 key: "application/xrd+xml",
2700 type: {:list, :string},
2701 suggestions: ["xrd+xml"]
2702 },
2703 %{
2704 key: "application/jrd+json",
2705 type: {:list, :string},
2706 suggestions: ["jrd+json"]
2707 },
2708 %{
2709 key: "application/activity+json",
2710 type: {:list, :string},
2711 suggestions: ["activity+json"]
2712 },
2713 %{
2714 key: "application/ld+json",
2715 type: {:list, :string},
2716 suggestions: ["activity+json"]
2717 }
2718 ]
2719 }
2720 ]
2721 },
2722 %{
2723 group: :tesla,
2724 type: :group,
2725 description: "Tesla settings",
2726 children: [
2727 %{
2728 key: :adapter,
2729 type: :module,
2730 description: "Tesla adapter",
2731 suggestions: [Tesla.Adapter.Hackney]
2732 }
2733 ]
2734 },
2735 %{
2736 group: :pleroma,
2737 key: :chat,
2738 type: :group,
2739 description: "Pleroma chat settings",
2740 children: [
2741 %{
2742 key: :enabled,
2743 type: :boolean
2744 }
2745 ]
2746 },
2747 %{
2748 group: :prometheus,
2749 key: Pleroma.Web.Endpoint.MetricsExporter,
2750 type: :group,
2751 description: "Prometheus settings",
2752 children: [
2753 %{
2754 key: :path,
2755 type: :string,
2756 description: "API endpoint with metrics",
2757 suggestions: ["/api/pleroma/app_metrics"]
2758 }
2759 ]
2760 },
2761 %{
2762 group: :http_signatures,
2763 type: :group,
2764 description: "HTTP Signatures settings",
2765 children: [
2766 %{
2767 key: :adapter,
2768 type: :module,
2769 suggestions: [Pleroma.Signature]
2770 }
2771 ]
2772 },
2773 %{
2774 group: :pleroma,
2775 key: :http,
2776 type: :group,
2777 description: "HTTP settings",
2778 children: [
2779 %{
2780 key: :proxy_url,
2781 label: "Proxy URL",
2782 type: [:string, :tuple],
2783 description: "Proxy URL",
2784 suggestions: ["localhost:9020", {:socks5, :localhost, 3090}]
2785 },
2786 %{
2787 key: :send_user_agent,
2788 type: :boolean
2789 },
2790 %{
2791 key: :user_agent,
2792 type: [:string, :atom],
2793 description:
2794 "What user agent to use. Must be a string or an atom `:default`. Default value is `:default`.",
2795 suggestions: ["Pleroma", :default]
2796 },
2797 %{
2798 key: :adapter,
2799 type: :keyword,
2800 description: "Adapter specific options",
2801 suggestions: [],
2802 children: [
2803 %{
2804 key: :ssl_options,
2805 type: :keyword,
2806 label: "SSL Options",
2807 description: "SSL options for HTTP adapter",
2808 children: [
2809 %{
2810 key: :versions,
2811 type: {:list, :atom},
2812 description: "List of TLS version to use",
2813 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
2814 }
2815 ]
2816 }
2817 ]
2818 }
2819 ]
2820 },
2821 %{
2822 group: :pleroma,
2823 key: :markup,
2824 type: :group,
2825 children: [
2826 %{
2827 key: :allow_inline_images,
2828 type: :boolean
2829 },
2830 %{
2831 key: :allow_headings,
2832 type: :boolean
2833 },
2834 %{
2835 key: :allow_tables,
2836 type: :boolean
2837 },
2838 %{
2839 key: :allow_fonts,
2840 type: :boolean
2841 },
2842 %{
2843 key: :scrub_policy,
2844 type: {:list, :module},
2845 suggestions: [Pleroma.HTML.Transform.MediaProxy, Pleroma.HTML.Scrubber.Default]
2846 }
2847 ]
2848 },
2849 %{
2850 group: :pleroma,
2851 key: :user,
2852 type: :group,
2853 children: [
2854 %{
2855 key: :deny_follow_blocked,
2856 type: :boolean
2857 }
2858 ]
2859 },
2860 %{
2861 group: :pleroma,
2862 key: :mrf_normalize_markup,
2863 label: "MRF normalize markup",
2864 description: "MRF NormalizeMarkup settings. Scrub configured hypertext markup.",
2865 type: :group,
2866 children: [
2867 %{
2868 key: :scrub_policy,
2869 type: :module,
2870 suggestions: [Pleroma.HTML.Scrubber.Default]
2871 }
2872 ]
2873 },
2874 %{
2875 group: :pleroma,
2876 key: Pleroma.User,
2877 type: :group,
2878 children: [
2879 %{
2880 key: :restricted_nicknames,
2881 type: {:list, :string},
2882 suggestions: [
2883 ".well-known",
2884 "~",
2885 "about",
2886 "activities",
2887 "api",
2888 "auth",
2889 "check_password",
2890 "dev",
2891 "friend-requests",
2892 "inbox",
2893 "internal",
2894 "main",
2895 "media",
2896 "nodeinfo",
2897 "notice",
2898 "oauth",
2899 "objects",
2900 "ostatus_subscribe",
2901 "pleroma",
2902 "proxy",
2903 "push",
2904 "registration",
2905 "relay",
2906 "settings",
2907 "status",
2908 "tag",
2909 "user-search",
2910 "user_exists",
2911 "users",
2912 "web"
2913 ]
2914 }
2915 ]
2916 },
2917 %{
2918 group: :cors_plug,
2919 type: :group,
2920 children: [
2921 %{
2922 key: :max_age,
2923 type: :integer,
2924 suggestions: [86_400]
2925 },
2926 %{
2927 key: :methods,
2928 type: {:list, :string},
2929 suggestions: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"]
2930 },
2931 %{
2932 key: :expose,
2933 type: {:list, :string},
2934 suggestions: [
2935 "Link",
2936 "X-RateLimit-Reset",
2937 "X-RateLimit-Limit",
2938 "X-RateLimit-Remaining",
2939 "X-Request-Id",
2940 "Idempotency-Key"
2941 ]
2942 },
2943 %{
2944 key: :credentials,
2945 type: :boolean
2946 },
2947 %{
2948 key: :headers,
2949 type: {:list, :string},
2950 suggestions: ["Authorization", "Content-Type", "Idempotency-Key"]
2951 }
2952 ]
2953 },
2954 %{
2955 group: :pleroma,
2956 key: Pleroma.Plugs.RemoteIp,
2957 type: :group,
2958 description: """
2959 `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
2960 **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
2961 """,
2962 children: [
2963 %{
2964 key: :enabled,
2965 type: :boolean,
2966 description: "Enable/disable the plug. Default: `false`."
2967 },
2968 %{
2969 key: :headers,
2970 type: {:list, :string},
2971 description:
2972 "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]`."
2973 },
2974 %{
2975 key: :proxies,
2976 type: {:list, :string},
2977 description:
2978 "A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Default: `[]`."
2979 },
2980 %{
2981 key: :reserved,
2982 type: {:list, :string},
2983 description:
2984 "Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network)."
2985 }
2986 ]
2987 },
2988 %{
2989 group: :pleroma,
2990 key: :web_cache_ttl,
2991 type: :group,
2992 description:
2993 "The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.",
2994 children: [
2995 %{
2996 key: :activity_pub,
2997 type: :integer,
2998 description:
2999 "Activity pub routes (except question activities). Default: `nil` (no expiration).",
3000 suggestions: [30_000, nil]
3001 },
3002 %{
3003 key: :activity_pub_question,
3004 type: :integer,
3005 description: "Activity pub routes (question activities). Default: `30_000` (30 seconds).",
3006 suggestions: [30_000]
3007 }
3008 ]
3009 },
3010 %{
3011 group: :pleroma,
3012 key: :static_fe,
3013 type: :group,
3014 description:
3015 "Render profiles and posts using server-generated HTML that is viewable without using JavaScript.",
3016 children: [
3017 %{
3018 key: :enabled,
3019 type: :boolean,
3020 description: "Enables the rendering of static HTML. Defaults to `false`."
3021 }
3022 ]
3023 },
3024 %{
3025 group: :pleroma,
3026 key: :feed,
3027 type: :group,
3028 description: "Configure feed rendering.",
3029 children: [
3030 %{
3031 key: :post_title,
3032 type: :map,
3033 description: "Configure title rendering.",
3034 children: [
3035 %{
3036 key: :max_length,
3037 type: :integer,
3038 description: "Maximum number of characters before truncating title.",
3039 suggestions: [100]
3040 },
3041 %{
3042 key: :omission,
3043 type: :string,
3044 description: "Replacement which will be used after truncating string.",
3045 suggestions: ["..."]
3046 }
3047 ]
3048 }
3049 ]
3050 },
3051 %{
3052 group: :pleroma,
3053 key: :mrf_object_age,
3054 type: :group,
3055 description: "Rejects or delists posts based on their age when received.",
3056 children: [
3057 %{
3058 key: :threshold,
3059 type: :integer,
3060 description: "Required age (in seconds) of a post before actions are taken.",
3061 suggestions: [172_800]
3062 },
3063 %{
3064 key: :actions,
3065 type: {:list, :atom},
3066 description:
3067 "A list of actions to apply to the post. `:delist` removes the post from public timelines; " <>
3068 "`:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines; " <>
3069 "`:reject` rejects the message entirely",
3070 suggestions: [:delist, :strip_followers, :reject]
3071 }
3072 ]
3073 },
3074 %{
3075 group: :pleroma,
3076 key: :modules,
3077 type: :group,
3078 description: "Custom Runtime Modules.",
3079 children: [
3080 %{
3081 key: :runtime_dir,
3082 type: :string,
3083 description: "A path to custom Elixir modules (such as MRF policies)."
3084 }
3085 ]
3086 },
3087 %{
3088 group: :pleroma,
3089 type: :group,
3090 description: "Allow instance configuration from database.",
3091 children: [
3092 %{
3093 key: :configurable_from_database,
3094 type: :boolean,
3095 description:
3096 "Allow transferring configuration to DB with the subsequent customization from Admin api. Defaults to `false`"
3097 }
3098 ]
3099 }
3100 ]