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