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