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