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