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