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