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