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