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