Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma 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: :manifest,
1104 type: :group,
1105 description:
1106 "This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE",
1107 children: [
1108 %{
1109 key: :icons,
1110 type: {:list, :map},
1111 description: "Describe the icons of the app",
1112 suggestion: [
1113 %{
1114 src: "/static/logo.png"
1115 },
1116 %{
1117 src: "/static/icon.png",
1118 type: "image/png"
1119 },
1120 %{
1121 src: "/static/icon.ico",
1122 sizes: "72x72 96x96 128x128 256x256"
1123 }
1124 ]
1125 },
1126 %{
1127 key: :theme_color,
1128 type: :string,
1129 description: "Describe the theme color of the app",
1130 suggestions: ["#282c37", "mediumpurple"]
1131 },
1132 %{
1133 key: :background_color,
1134 type: :string,
1135 description: "Describe the background color of the app",
1136 suggestions: ["#191b22", "aliceblue"]
1137 }
1138 ]
1139 },
1140 %{
1141 group: :pleroma,
1142 key: :mrf_simple,
1143 type: :group,
1144 description: "Message Rewrite Facility",
1145 children: [
1146 %{
1147 key: :media_removal,
1148 type: {:list, :string},
1149 description: "List of instances to remove medias from",
1150 suggestions: ["example.com", "*.example.com"]
1151 },
1152 %{
1153 key: :media_nsfw,
1154 type: {:list, :string},
1155 description: "List of instances to put medias as NSFW(sensitive) from",
1156 suggestions: ["example.com", "*.example.com"]
1157 },
1158 %{
1159 key: :federated_timeline_removal,
1160 type: {:list, :string},
1161 description:
1162 "List of instances to remove from Federated (aka The Whole Known Network) Timeline",
1163 suggestions: ["example.com", "*.example.com"]
1164 },
1165 %{
1166 key: :reject,
1167 type: {:list, :string},
1168 description: "List of instances to reject any activities from",
1169 suggestions: ["example.com", "*.example.com"]
1170 },
1171 %{
1172 key: :accept,
1173 type: {:list, :string},
1174 description: "List of instances to accept any activities from",
1175 suggestions: ["example.com", "*.example.com"]
1176 },
1177 %{
1178 key: :report_removal,
1179 type: {:list, :string},
1180 description: "List of instances to reject reports from",
1181 suggestions: ["example.com", "*.example.com"]
1182 },
1183 %{
1184 key: :avatar_removal,
1185 type: {:list, :string},
1186 description: "List of instances to strip avatars from",
1187 suggestions: ["example.com", "*.example.com"]
1188 },
1189 %{
1190 key: :banner_removal,
1191 type: {:list, :string},
1192 description: "List of instances to strip banners from",
1193 suggestions: ["example.com", "*.example.com"]
1194 }
1195 ]
1196 },
1197 %{
1198 group: :pleroma,
1199 key: :mrf_subchain,
1200 type: :group,
1201 description:
1202 "This policy processes messages through an alternate pipeline when a given message matches certain criteria." <>
1203 " All criteria are configured as a map of regular expressions to lists of policy modules.",
1204 children: [
1205 %{
1206 key: :match_actor,
1207 type: :map,
1208 description: "Matches a series of regular expressions against the actor field",
1209 suggestions: [
1210 %{
1211 ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy]
1212 }
1213 ]
1214 }
1215 ]
1216 },
1217 %{
1218 group: :pleroma,
1219 key: :mrf_rejectnonpublic,
1220 type: :group,
1221 children: [
1222 %{
1223 key: :allow_followersonly,
1224 type: :boolean,
1225 description: "whether to allow followers-only posts"
1226 },
1227 %{
1228 key: :allow_direct,
1229 type: :boolean,
1230 description: "whether to allow direct messages"
1231 }
1232 ]
1233 },
1234 %{
1235 group: :pleroma,
1236 key: :mrf_hellthread,
1237 type: :group,
1238 description: "Block messages with too much mentions",
1239 children: [
1240 %{
1241 key: :delist_threshold,
1242 type: :integer,
1243 description:
1244 "Number of mentioned users after which the message gets delisted (the message can still be seen, " <>
1245 " but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable",
1246 suggestions: [10]
1247 },
1248 %{
1249 key: :reject_threshold,
1250 type: :integer,
1251 description:
1252 "Number of mentioned users after which the messaged gets rejected. Set to 0 to disable",
1253 suggestions: [20]
1254 }
1255 ]
1256 },
1257 %{
1258 group: :pleroma,
1259 key: :mrf_keyword,
1260 type: :group,
1261 description: "Reject or Word-Replace messages with a keyword or regex",
1262 children: [
1263 %{
1264 key: :reject,
1265 type: [:string, :regex],
1266 description:
1267 "A list of patterns which result in message being rejected, each pattern can be a string or a regular expression",
1268 suggestions: ["foo", ~r/foo/iu]
1269 },
1270 %{
1271 key: :federated_timeline_removal,
1272 type: [:string, :regex],
1273 description:
1274 "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",
1275 suggestions: ["foo", ~r/foo/iu]
1276 },
1277 %{
1278 key: :replace,
1279 type: [{:string, :string}, {:regex, :string}],
1280 description:
1281 "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",
1282 suggestions: [{"foo", "bar"}, {~r/foo/iu, "bar"}]
1283 }
1284 ]
1285 },
1286 %{
1287 group: :pleroma,
1288 key: :mrf_mention,
1289 type: :group,
1290 description: "Block messages which mention a user",
1291 children: [
1292 %{
1293 key: :actors,
1294 type: {:list, :string},
1295 description: "A list of actors, for which to drop any posts mentioning",
1296 suggestions: [["actor1", "actor2"]]
1297 }
1298 ]
1299 },
1300 %{
1301 group: :pleroma,
1302 key: :mrf_vocabulary,
1303 type: :group,
1304 description: "Filter messages which belong to certain activity vocabularies",
1305 children: [
1306 %{
1307 key: :accept,
1308 type: {:list, :string},
1309 description:
1310 "A list of ActivityStreams terms to accept. If empty, all supported messages are accepted",
1311 suggestions: [["Create", "Follow", "Mention", "Announce", "Like"]]
1312 },
1313 %{
1314 key: :reject,
1315 type: {:list, :string},
1316 description:
1317 "A list of ActivityStreams terms to reject. If empty, no messages are rejected",
1318 suggestions: [["Create", "Follow", "Mention", "Announce", "Like"]]
1319 }
1320 ]
1321 },
1322 # %{
1323 # group: :pleroma,
1324 # key: :mrf_user_allowlist,
1325 # type: :group,
1326 # description:
1327 # "The keys in this section are the domain names that the policy should apply to." <>
1328 # " Each key should be assigned a list of users that should be allowed through by their ActivityPub ID",
1329 # children: [
1330 # ["example.org": ["https://example.org/users/admin"]],
1331 # suggestions: [
1332 # ["example.org": ["https://example.org/users/admin"]]
1333 # ]
1334 # ]
1335 # },
1336 %{
1337 group: :pleroma,
1338 key: :media_proxy,
1339 type: :group,
1340 description: "Media proxy",
1341 children: [
1342 %{
1343 key: :enabled,
1344 type: :boolean,
1345 description: "Enables proxying of remote media to the instance's proxy"
1346 },
1347 %{
1348 key: :base_url,
1349 type: :string,
1350 description:
1351 "The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts",
1352 suggestions: ["https://example.com"]
1353 },
1354 %{
1355 key: :proxy_opts,
1356 type: :keyword,
1357 description: "Options for Pleroma.ReverseProxy",
1358 suggestions: [[max_body_length: 25 * 1_048_576, redirect_on_failure: false]]
1359 },
1360 %{
1361 key: :whitelist,
1362 type: {:list, :string},
1363 description: "List of domains to bypass the mediaproxy",
1364 suggestions: ["example.com"]
1365 }
1366 ]
1367 },
1368 %{
1369 group: :pleroma,
1370 key: :gopher,
1371 type: :group,
1372 description: "Gopher settings",
1373 children: [
1374 %{
1375 key: :enabled,
1376 type: :boolean,
1377 description: "Enables the gopher interface"
1378 },
1379 %{
1380 key: :ip,
1381 type: :tuple,
1382 description: "IP address to bind to",
1383 suggestions: [{0, 0, 0, 0}]
1384 },
1385 %{
1386 key: :port,
1387 type: :integer,
1388 description: "Port to bind to",
1389 suggestions: [9999]
1390 },
1391 %{
1392 key: :dstport,
1393 type: :integer,
1394 description: "Port advertised in urls (optional, defaults to port)",
1395 suggestions: [9999]
1396 }
1397 ]
1398 },
1399 %{
1400 group: :pleroma,
1401 key: Pleroma.Web.Endpoint,
1402 type: :group,
1403 description: "Phoenix endpoint configuration",
1404 children: [
1405 %{
1406 key: :http,
1407 type: :keyword,
1408 description: "http protocol configuration",
1409 suggestions: [
1410 [port: 8080, ip: {127, 0, 0, 1}]
1411 ],
1412 children: [
1413 %{
1414 key: :dispatch,
1415 type: {:list, :tuple},
1416 description: "dispatch settings",
1417 suggestions: [
1418 [
1419 {:_,
1420 [
1421 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
1422 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
1423 {Phoenix.Transports.WebSocket,
1424 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
1425 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
1426 ]}
1427 # end copied from config.exs
1428 ]
1429 ]
1430 },
1431 %{
1432 key: :ip,
1433 type: :tuple,
1434 description: "ip",
1435 suggestions: [
1436 {0, 0, 0, 0}
1437 ]
1438 },
1439 %{
1440 key: :port,
1441 type: :integer,
1442 description: "port",
1443 suggestions: [
1444 2020
1445 ]
1446 }
1447 ]
1448 },
1449 %{
1450 key: :url,
1451 type: :keyword,
1452 description: "configuration for generating urls",
1453 suggestions: [
1454 [host: "example.com", port: 2020, scheme: "https"]
1455 ],
1456 children: [
1457 %{
1458 key: :host,
1459 type: :string,
1460 description: "Host",
1461 suggestions: [
1462 "example.com"
1463 ]
1464 },
1465 %{
1466 key: :port,
1467 type: :integer,
1468 description: "port",
1469 suggestions: [
1470 2020
1471 ]
1472 },
1473 %{
1474 key: :scheme,
1475 type: :string,
1476 description: "Scheme",
1477 suggestions: [
1478 "https",
1479 "https"
1480 ]
1481 }
1482 ]
1483 },
1484 %{
1485 key: :instrumenters,
1486 type: {:list, :module},
1487 suggestions: [Pleroma.Web.Endpoint.Instrumenter]
1488 },
1489 %{
1490 key: :protocol,
1491 type: :string,
1492 suggestions: ["https"]
1493 },
1494 %{
1495 key: :secret_key_base,
1496 type: :string,
1497 suggestions: ["aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl"]
1498 },
1499 %{
1500 key: :signing_salt,
1501 type: :string,
1502 suggestions: ["CqaoopA2"]
1503 },
1504 %{
1505 key: :render_errors,
1506 type: :keyword,
1507 suggestions: [[view: Pleroma.Web.ErrorView, accepts: ~w(json)]],
1508 children: [
1509 %{
1510 key: :view,
1511 type: :module,
1512 suggestions: [Pleroma.Web.ErrorView]
1513 },
1514 %{
1515 key: :accepts,
1516 type: {:list, :string},
1517 suggestions: ["json"]
1518 }
1519 ]
1520 },
1521 %{
1522 key: :pubsub,
1523 type: :keyword,
1524 suggestions: [[name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2]],
1525 children: [
1526 %{
1527 key: :name,
1528 type: :module,
1529 suggestions: [Pleroma.PubSub]
1530 },
1531 %{
1532 key: :adapter,
1533 type: :module,
1534 suggestions: [Phoenix.PubSub.PG2]
1535 }
1536 ]
1537 },
1538 %{
1539 key: :secure_cookie_flag,
1540 type: :boolean
1541 },
1542 %{
1543 key: :extra_cookie_attrs,
1544 type: {:list, :string},
1545 suggestions: ["SameSite=Lax"]
1546 }
1547 ]
1548 },
1549 %{
1550 group: :pleroma,
1551 key: :activitypub,
1552 type: :group,
1553 description: "ActivityPub-related settings",
1554 children: [
1555 %{
1556 key: :unfollow_blocked,
1557 type: :boolean,
1558 description: "Whether blocks result in people getting unfollowed"
1559 },
1560 %{
1561 key: :outgoing_blocks,
1562 type: :boolean,
1563 description: "Whether to federate blocks to other instances"
1564 },
1565 %{
1566 key: :sign_object_fetches,
1567 type: :boolean,
1568 description: "Sign object fetches with HTTP signatures"
1569 },
1570 %{
1571 key: :follow_handshake_timeout,
1572 type: :integer,
1573 description: "Following handshake timeout",
1574 suggestions: [500]
1575 }
1576 ]
1577 },
1578 %{
1579 group: :pleroma,
1580 key: :http_security,
1581 type: :group,
1582 description: "HTTP security settings",
1583 children: [
1584 %{
1585 key: :enabled,
1586 type: :boolean,
1587 description: "Whether the managed content security policy is enabled"
1588 },
1589 %{
1590 key: :sts,
1591 type: :boolean,
1592 description: "Whether to additionally send a Strict-Transport-Security header"
1593 },
1594 %{
1595 key: :sts_max_age,
1596 type: :integer,
1597 description: "The maximum age for the Strict-Transport-Security header if sent",
1598 suggestions: [31_536_000]
1599 },
1600 %{
1601 key: :ct_max_age,
1602 type: :integer,
1603 description: "The maximum age for the Expect-CT header if sent",
1604 suggestions: [2_592_000]
1605 },
1606 %{
1607 key: :referrer_policy,
1608 type: :string,
1609 description: "The referrer policy to use, either \"same-origin\" or \"no-referrer\"",
1610 suggestions: ["same-origin", "no-referrer"]
1611 },
1612 %{
1613 key: :report_uri,
1614 type: :string,
1615 description: "Adds the specified url to report-uri and report-to group in CSP header",
1616 suggestions: ["https://example.com/report-uri"]
1617 }
1618 ]
1619 },
1620 %{
1621 group: :web_push_encryption,
1622 key: :vapid_details,
1623 type: :group,
1624 description:
1625 "Web Push Notifications configuration. You can use the mix task mix web_push.gen.keypair to generate it",
1626 children: [
1627 %{
1628 key: :subject,
1629 type: :string,
1630 description:
1631 "a mailto link for the administrative contact." <>
1632 " 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," <>
1633 " is unavailable for an extended period, or otherwise can't respond, someone else on the list can",
1634 suggestions: ["Subject"]
1635 },
1636 %{
1637 key: :public_key,
1638 type: :string,
1639 description: "VAPID public key",
1640 suggestions: ["Public key"]
1641 },
1642 %{
1643 key: :private_key,
1644 type: :string,
1645 description: "VAPID private keyn",
1646 suggestions: ["Private key"]
1647 }
1648 ]
1649 },
1650 %{
1651 group: :pleroma,
1652 key: Pleroma.Captcha,
1653 type: :group,
1654 description: "Captcha-related settings",
1655 children: [
1656 %{
1657 key: :enabled,
1658 type: :boolean,
1659 description: "Whether the captcha should be shown on registration"
1660 },
1661 %{
1662 key: :method,
1663 type: :module,
1664 description: "The method/service to use for captcha",
1665 suggestions: [Pleroma.Captcha.Kocaptcha]
1666 },
1667 %{
1668 key: :seconds_valid,
1669 type: :integer,
1670 description: "The time in seconds for which the captcha is valid",
1671 suggestions: [60]
1672 }
1673 ]
1674 },
1675 %{
1676 group: :pleroma,
1677 key: Pleroma.Captcha.Kocaptcha,
1678 type: :group,
1679 description:
1680 "Kocaptcha is a very simple captcha service with a single API endpoint, the source code is" <>
1681 " here: https://github.com/koto-bank/kocaptcha. The default endpoint https://captcha.kotobank.ch is hosted by the developer",
1682 children: [
1683 %{
1684 key: :endpoint,
1685 type: :string,
1686 description: "the kocaptcha endpoint to use",
1687 suggestions: ["https://captcha.kotobank.ch"]
1688 }
1689 ]
1690 },
1691 %{
1692 group: :pleroma,
1693 type: :group,
1694 description:
1695 "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",
1696 children: [
1697 %{
1698 key: :admin_token,
1699 type: :string,
1700 description: "Token",
1701 suggestions: ["some_random_token"]
1702 }
1703 ]
1704 },
1705 %{
1706 group: :pleroma_job_queue,
1707 key: :queues,
1708 type: :group,
1709 description: "[Deprecated] Replaced with `Oban`/`:queues` (keeping the same format)"
1710 },
1711 %{
1712 group: :pleroma,
1713 key: Pleroma.Web.Federator.RetryQueue,
1714 type: :group,
1715 description: "[Deprecated] See `Oban` and `:workers` sections for configuration notes",
1716 children: [
1717 %{
1718 key: :max_retries,
1719 type: :integer,
1720 description: "[Deprecated] Replaced as `Oban`/`:queues`/`:outgoing_federation` value"
1721 }
1722 ]
1723 },
1724 %{
1725 group: :pleroma,
1726 key: Oban,
1727 type: :group,
1728 description: """
1729 [Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
1730
1731 Note: if you are running PostgreSQL in [`silent_mode`](https://postgresqlco.nf/en/doc/param/silent_mode?version=9.1),
1732 it's advised to set [`log_destination`](https://postgresqlco.nf/en/doc/param/log_destination?version=9.1) to `syslog`,
1733 otherwise `postmaster.log` file may grow because of "you don't own a lock of type ShareLock" warnings
1734 (see https://github.com/sorentwo/oban/issues/52).
1735 """,
1736 children: [
1737 %{
1738 key: :repo,
1739 type: :module,
1740 description: "Application's Ecto repo",
1741 suggestions: [Pleroma.Repo]
1742 },
1743 %{
1744 key: :verbose,
1745 type: :boolean,
1746 description: "Logs verbose mode"
1747 },
1748 %{
1749 key: :prune,
1750 type: [:atom, :tuple],
1751 description:
1752 "Non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning)",
1753 suggestions: [:disabled, {:maxlen, 1500}, {:maxage, 60 * 60}]
1754 },
1755 %{
1756 key: :queues,
1757 type: :keyword,
1758 description:
1759 "Background jobs queues (keys: queues, values: max numbers of concurrent jobs)",
1760 suggestions: [
1761 [
1762 activity_expiration: 10,
1763 background: 5,
1764 federator_incoming: 50,
1765 federator_outgoing: 50,
1766 mailer: 10,
1767 scheduled_activities: 10,
1768 transmogrifier: 20,
1769 web_push: 50
1770 ]
1771 ],
1772 children: [
1773 %{
1774 key: :activity_expiration,
1775 type: :integer,
1776 description: "Activity expiration queue",
1777 suggestions: [10]
1778 },
1779 %{
1780 key: :background,
1781 type: :integer,
1782 description: "Background queue",
1783 suggestions: [5]
1784 },
1785 %{
1786 key: :federator_incoming,
1787 type: :integer,
1788 description: "Incoming federation queue",
1789 suggestions: [50]
1790 },
1791 %{
1792 key: :federator_outgoing,
1793 type: :integer,
1794 description: "Outgoing federation queue",
1795 suggestions: [50]
1796 },
1797 %{
1798 key: :mailer,
1799 type: :integer,
1800 description: "Email sender queue, see Pleroma.Emails.Mailer",
1801 suggestions: [10]
1802 },
1803 %{
1804 key: :scheduled_activities,
1805 type: :integer,
1806 description: "Scheduled activities queue, see Pleroma.ScheduledActivities",
1807 suggestions: [10]
1808 },
1809 %{
1810 key: :transmogrifier,
1811 type: :integer,
1812 description: "Transmogrifier queue",
1813 suggestions: [20]
1814 },
1815 %{
1816 key: :web_push,
1817 type: :integer,
1818 description: "Web push notifications queue",
1819 suggestions: [50]
1820 }
1821 ]
1822 }
1823 ]
1824 },
1825 %{
1826 group: :pleroma,
1827 key: :workers,
1828 type: :group,
1829 description: "Includes custom worker options not interpretable directly by `Oban`",
1830 children: [
1831 %{
1832 key: :retries,
1833 type: :keyword,
1834 description: "Max retry attempts for failed jobs, per `Oban` queue",
1835 suggestions: [
1836 [
1837 federator_incoming: 5,
1838 federator_outgoing: 5
1839 ]
1840 ]
1841 }
1842 ]
1843 },
1844 %{
1845 group: :pleroma,
1846 key: Pleroma.Web.Metadata,
1847 type: :group,
1848 decsription: "Metadata-related settings",
1849 children: [
1850 %{
1851 key: :providers,
1852 type: {:list, :module},
1853 description: "List of metadata providers to enable",
1854 suggestions: [
1855 [
1856 Pleroma.Web.Metadata.Providers.OpenGraph,
1857 Pleroma.Web.Metadata.Providers.TwitterCard,
1858 Pleroma.Web.Metadata.Providers.RelMe
1859 ]
1860 ]
1861 },
1862 %{
1863 key: :unfurl_nsfw,
1864 type: :boolean,
1865 description: "If set to true nsfw attachments will be shown in previews"
1866 }
1867 ]
1868 },
1869 %{
1870 group: :pleroma,
1871 key: :rich_media,
1872 type: :group,
1873 children: [
1874 %{
1875 key: :enabled,
1876 type: :boolean,
1877 description:
1878 "if enabled the instance will parse metadata from attached links to generate link previews"
1879 },
1880 %{
1881 key: :ignore_hosts,
1882 type: {:list, :string},
1883 description: "list of hosts which will be ignored by the metadata parser",
1884 suggestions: [["accounts.google.com", "xss.website"]]
1885 },
1886 %{
1887 key: :ignore_tld,
1888 type: {:list, :string},
1889 description: "list TLDs (top-level domains) which will ignore for parse metadata",
1890 suggestions: [["local", "localdomain", "lan"]]
1891 },
1892 %{
1893 key: :parsers,
1894 type: {:list, :module},
1895 description: "list of Rich Media parsers",
1896 suggestions: [
1897 Generator.richmedia_parsers()
1898 ]
1899 },
1900 %{
1901 key: :ttl_setters,
1902 type: {:list, :module},
1903 description: "list of rich media ttl setters",
1904 suggestions: [
1905 [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
1906 ]
1907 }
1908 ]
1909 },
1910 %{
1911 group: :pleroma,
1912 key: :fetch_initial_posts,
1913 type: :group,
1914 description: "Fetching initial posts settings",
1915 children: [
1916 %{
1917 key: :enabled,
1918 type: :boolean,
1919 description:
1920 "if enabled, when a new user is federated with, fetch some of their latest posts"
1921 },
1922 %{
1923 key: :pages,
1924 type: :integer,
1925 description: "the amount of pages to fetch",
1926 suggestions: [5]
1927 }
1928 ]
1929 },
1930 %{
1931 group: :auto_linker,
1932 key: :opts,
1933 type: :group,
1934 description: "Configuration for the auto_linker library",
1935 children: [
1936 %{
1937 key: :class,
1938 type: [:string, false],
1939 description: "specify the class to be added to the generated link. false to clear",
1940 suggestions: ["auto-linker", false]
1941 },
1942 %{
1943 key: :rel,
1944 type: [:string, false],
1945 description: "override the rel attribute. false to clear",
1946 suggestions: ["ugc", "noopener noreferrer", false]
1947 },
1948 %{
1949 key: :new_window,
1950 type: :boolean,
1951 description: "set to false to remove target='_blank' attribute"
1952 },
1953 %{
1954 key: :scheme,
1955 type: :boolean,
1956 description: "Set to true to link urls with schema http://google.com"
1957 },
1958 %{
1959 key: :truncate,
1960 type: [:integer, false],
1961 description:
1962 "Set to a number to truncate urls longer then the number. Truncated urls will end in `..`",
1963 suggestions: [15, false]
1964 },
1965 %{
1966 key: :strip_prefix,
1967 type: :boolean,
1968 description: "Strip the scheme prefix"
1969 },
1970 %{
1971 key: :extra,
1972 type: :boolean,
1973 description: "link urls with rarely used schemes (magnet, ipfs, irc, etc.)"
1974 }
1975 ]
1976 },
1977 %{
1978 group: :pleroma,
1979 key: Pleroma.ScheduledActivity,
1980 type: :group,
1981 description: "Scheduled activities settings",
1982 children: [
1983 %{
1984 key: :daily_user_limit,
1985 type: :integer,
1986 description:
1987 "the number of scheduled activities a user is allowed to create in a single day (Default: 25)",
1988 suggestions: [25]
1989 },
1990 %{
1991 key: :total_user_limit,
1992 type: :integer,
1993 description:
1994 "the number of scheduled activities a user is allowed to create in total (Default: 300)",
1995 suggestions: [300]
1996 },
1997 %{
1998 key: :enabled,
1999 type: :boolean,
2000 description: "whether scheduled activities are sent to the job queue to be executed"
2001 }
2002 ]
2003 },
2004 %{
2005 group: :pleroma,
2006 key: Pleroma.ActivityExpiration,
2007 type: :group,
2008 description: "Expired activity settings",
2009 children: [
2010 %{
2011 key: :enabled,
2012 type: :boolean,
2013 description: "whether expired activities will be sent to the job queue to be deleted"
2014 }
2015 ]
2016 },
2017 %{
2018 group: :pleroma,
2019 type: :group,
2020 description: "Authenticator",
2021 children: [
2022 %{
2023 key: Pleroma.Web.Auth.Authenticator,
2024 type: :module,
2025 suggestions: [Pleroma.Web.Auth.PleromaAuthenticator, Pleroma.Web.Auth.LDAPAuthenticator]
2026 }
2027 ]
2028 },
2029 %{
2030 group: :pleroma,
2031 key: :ldap,
2032 type: :group,
2033 description:
2034 "Use LDAP for user authentication. When a user logs in to the Pleroma instance, the name and password" <>
2035 " will be verified by trying to authenticate (bind) to an LDAP server." <>
2036 " If a user exists in the LDAP directory but there is no account with the same name yet on the" <>
2037 " Pleroma instance then a new Pleroma account will be created with the same name as the LDAP user name.",
2038 children: [
2039 %{
2040 key: :enabled,
2041 type: :boolean,
2042 description: "enables LDAP authentication"
2043 },
2044 %{
2045 key: :host,
2046 type: :string,
2047 description: "LDAP server hostname",
2048 suggestions: ["localhosts"]
2049 },
2050 %{
2051 key: :port,
2052 type: :integer,
2053 description: "LDAP port, e.g. 389 or 636",
2054 suggestions: [389, 636]
2055 },
2056 %{
2057 key: :ssl,
2058 type: :boolean,
2059 description: "true to use SSL, usually implies the port 636"
2060 },
2061 %{
2062 key: :sslopts,
2063 type: :keyword,
2064 description: "additional SSL options"
2065 },
2066 %{
2067 key: :tls,
2068 type: :boolean,
2069 description: "true to start TLS, usually implies the port 389"
2070 },
2071 %{
2072 key: :tlsopts,
2073 type: :keyword,
2074 description: "additional TLS options"
2075 },
2076 %{
2077 key: :base,
2078 type: :string,
2079 description: "LDAP base, e.g. \"dc=example,dc=com\"",
2080 suggestions: ["dc=example,dc=com"]
2081 },
2082 %{
2083 key: :uid,
2084 type: :string,
2085 description:
2086 "LDAP attribute name to authenticate the user, e.g. when \"cn\", the filter will be \"cn=username,base\"",
2087 suggestions: ["cn"]
2088 }
2089 ]
2090 },
2091 %{
2092 group: :pleroma,
2093 key: :auth,
2094 type: :group,
2095 description: "Authentication / authorization settings",
2096 children: [
2097 %{
2098 key: :auth_template,
2099 type: :string,
2100 description:
2101 "authentication form template. By default it's show.html which corresponds to lib/pleroma/web/templates/o_auth/o_auth/show.html.ee",
2102 suggestions: ["show.html"]
2103 },
2104 %{
2105 key: :oauth_consumer_template,
2106 type: :string,
2107 description:
2108 "OAuth consumer mode authentication form template. By default it's consumer.html which corresponds to" <>
2109 " lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex",
2110 suggestions: ["consumer.html"]
2111 },
2112 %{
2113 key: :oauth_consumer_strategies,
2114 type: :string,
2115 description:
2116 "the list of enabled OAuth consumer strategies; by default it's set by OAUTH_CONSUMER_STRATEGIES environment variable." <>
2117 " Each entry in this space-delimited string should be of format <strategy> or <strategy>:<dependency>" <>
2118 " (e.g. twitter or keycloak:ueberauth_keycloak_strategy in case dependency is named differently than ueberauth_<strategy>).",
2119 suggestions: ["twitter", "keycloak:ueberauth_keycloak_strategy"]
2120 }
2121 ]
2122 },
2123 %{
2124 group: :pleroma,
2125 key: :email_notifications,
2126 type: :group,
2127 description: "Email notifications settings",
2128 children: [
2129 %{
2130 key: :digest,
2131 type: :map,
2132 description:
2133 "emails of \"what you've missed\" for users who have been inactive for a while",
2134 suggestions: [
2135 %{
2136 active: false,
2137 schedule: "0 0 * * 0",
2138 interval: 7,
2139 inactivity_threshold: 7
2140 }
2141 ],
2142 children: [
2143 %{
2144 key: :active,
2145 type: :boolean,
2146 description: "globally enable or disable digest emails"
2147 },
2148 %{
2149 key: :schedule,
2150 type: :string,
2151 description:
2152 "When to send digest email, in crontab format. \"0 0 0\" is the default, meaning \"once a week at midnight on Sunday morning\"",
2153 suggestions: ["0 0 * * 0"]
2154 },
2155 %{
2156 key: :interval,
2157 type: :ininteger,
2158 description: "Minimum interval between digest emails to one user",
2159 suggestions: [7]
2160 },
2161 %{
2162 key: :inactivity_threshold,
2163 type: :integer,
2164 description: "Minimum user inactivity threshold",
2165 suggestions: [7]
2166 }
2167 ]
2168 }
2169 ]
2170 },
2171 %{
2172 group: :pleroma,
2173 key: Pleroma.Emails.UserEmail,
2174 type: :group,
2175 description: "Email template settings",
2176 children: [
2177 %{
2178 key: :logo,
2179 type: [:string, nil],
2180 description: "a path to a custom logo. Set it to nil to use the default Pleroma logo",
2181 suggestions: ["some/path/logo.png", nil]
2182 },
2183 %{
2184 key: :styling,
2185 type: :map,
2186 description: "a map with color settings for email templates.",
2187 suggestions: [
2188 %{
2189 link_color: "#d8a070",
2190 background_color: "#2C3645",
2191 content_background_color: "#1B2635",
2192 header_color: "#d8a070",
2193 text_color: "#b9b9ba",
2194 text_muted_color: "#b9b9ba"
2195 }
2196 ],
2197 children: [
2198 %{
2199 key: :link_color,
2200 type: :string,
2201 suggestions: ["#d8a070"]
2202 },
2203 %{
2204 key: :background_color,
2205 type: :string,
2206 suggestions: ["#2C3645"]
2207 },
2208 %{
2209 key: :content_background_color,
2210 type: :string,
2211 suggestions: ["#1B2635"]
2212 },
2213 %{
2214 key: :header_color,
2215 type: :string,
2216 suggestions: ["#d8a070"]
2217 },
2218 %{
2219 key: :text_color,
2220 type: :string,
2221 suggestions: ["#b9b9ba"]
2222 },
2223 %{
2224 key: :text_muted_color,
2225 type: :string,
2226 suggestions: ["#b9b9ba"]
2227 }
2228 ]
2229 }
2230 ]
2231 },
2232 %{
2233 group: :pleroma,
2234 key: :oauth2,
2235 type: :group,
2236 description: "Configure OAuth 2 provider capabilities",
2237 children: [
2238 %{
2239 key: :token_expires_in,
2240 type: :integer,
2241 description: "The lifetime in seconds of the access token",
2242 suggestions: [600]
2243 },
2244 %{
2245 key: :issue_new_refresh_token,
2246 type: :boolean,
2247 description:
2248 "Keeps old refresh token or generate new refresh token when to obtain an access token"
2249 },
2250 %{
2251 key: :clean_expired_tokens,
2252 type: :boolean,
2253 description: "Enable a background job to clean expired oauth tokens. Defaults to false"
2254 },
2255 %{
2256 key: :clean_expired_tokens_interval,
2257 type: :integer,
2258 description:
2259 "Interval to run the job to clean expired tokens. Defaults to 86_400_000 (24 hours).",
2260 suggestions: [86_400_000]
2261 }
2262 ]
2263 },
2264 %{
2265 group: :pleroma,
2266 key: :emoji,
2267 type: :group,
2268 children: [
2269 %{
2270 key: :shortcode_globs,
2271 type: {:list, :string},
2272 description: "Location of custom emoji files. * can be used as a wildcard",
2273 suggestions: [["/emoji/custom/**/*.png"]]
2274 },
2275 %{
2276 key: :pack_extensions,
2277 type: {:list, :string},
2278 description:
2279 "A list of file extensions for emojis, when no emoji.txt for a pack is present",
2280 suggestions: [[".png", ".gif"]]
2281 },
2282 %{
2283 key: :groups,
2284 type: :keyword,
2285 description:
2286 "Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the groupname" <>
2287 " and the value the location or array of locations. * can be used as a wildcard",
2288 suggestions: [
2289 [
2290 # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
2291 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
2292 ]
2293 ]
2294 },
2295 %{
2296 key: :default_manifest,
2297 type: :string,
2298 description:
2299 "Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download." <>
2300 " Currently only one manifest can be added (no arrays)",
2301 suggestions: ["https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"]
2302 },
2303 %{
2304 key: :shared_pack_cache_seconds_per_file,
2305 type: :integer,
2306 descpiption:
2307 "When an emoji pack is shared, the archive is created and cached in memory" <>
2308 " for this amount of seconds multiplied by the number of files.",
2309 suggestions: [60]
2310 }
2311 ]
2312 },
2313 %{
2314 group: :pleroma,
2315 key: :database,
2316 type: :group,
2317 description: "Database related settings",
2318 children: [
2319 %{
2320 key: :rum_enabled,
2321 type: :boolean,
2322 description: "If RUM indexes should be used. Defaults to false"
2323 }
2324 ]
2325 },
2326 %{
2327 group: :pleroma,
2328 key: :rate_limit,
2329 type: :group,
2330 description:
2331 "Rate limit settings. This is an advanced feature enabled only for :authentication by default.",
2332 children: [
2333 %{
2334 key: :search,
2335 type: [:tuple, {:list, :tuple}],
2336 description: "for the search requests (account & status search etc.)",
2337 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2338 },
2339 %{
2340 key: :app_account_creation,
2341 type: [:tuple, {:list, :tuple}],
2342 description: "for registering user accounts from the same IP address",
2343 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2344 },
2345 %{
2346 key: :relations_actions,
2347 type: [:tuple, {:list, :tuple}],
2348 description: "for actions on relations with all users (follow, unfollow)",
2349 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2350 },
2351 %{
2352 key: :relation_id_action,
2353 type: [:tuple, {:list, :tuple}],
2354 description: "for actions on relation with a specific user (follow, unfollow)",
2355 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2356 },
2357 %{
2358 key: :statuses_actions,
2359 type: [:tuple, {:list, :tuple}],
2360 description:
2361 "for create / delete / fav / unfav / reblog / unreblog actions on any statuses",
2362 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2363 },
2364 %{
2365 key: :status_id_action,
2366 type: [:tuple, {:list, :tuple}],
2367 description:
2368 "for fav / unfav or reblog / unreblog actions on the same status by the same user",
2369 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2370 },
2371 %{
2372 key: :authentication,
2373 type: [:tuple, {:list, :tuple}],
2374 description: "for authentication create / password check / user existence check requests",
2375 suggestions: [{60_000, 15}]
2376 }
2377 ]
2378 },
2379 %{
2380 group: :esshd,
2381 type: :group,
2382 description:
2383 "To enable simple command line interface accessible over ssh, add a setting like this to your configuration file",
2384 children: [
2385 %{
2386 key: :enabled,
2387 type: :boolean,
2388 description: "Enables ssh"
2389 },
2390 %{
2391 key: :priv_dir,
2392 type: :string,
2393 description: "Dir with ssh keys",
2394 suggestions: ["/some/path/ssh_keys"]
2395 },
2396 %{
2397 key: :handler,
2398 type: :string,
2399 description: "Handler module",
2400 suggestions: ["Pleroma.BBS.Handler"]
2401 },
2402 %{
2403 key: :port,
2404 type: :integer,
2405 description: "Port to connect",
2406 suggestions: [10_022]
2407 },
2408 %{
2409 key: :password_authenticator,
2410 type: :string,
2411 description: "Authenticator module",
2412 suggestions: ["Pleroma.BBS.Authenticator"]
2413 }
2414 ]
2415 },
2416 %{
2417 group: :mime,
2418 type: :group,
2419 description: "Mime types",
2420 children: [
2421 %{
2422 key: :types,
2423 type: :map,
2424 suggestions: [
2425 %{
2426 "application/xml" => ["xml"],
2427 "application/xrd+xml" => ["xrd+xml"],
2428 "application/jrd+json" => ["jrd+json"],
2429 "application/activity+json" => ["activity+json"],
2430 "application/ld+json" => ["activity+json"]
2431 }
2432 ],
2433 children: [
2434 %{
2435 key: "application/xml",
2436 type: {:list, :string},
2437 suggestions: [["xml"]]
2438 },
2439 %{
2440 key: "application/xrd+xml",
2441 type: {:list, :string},
2442 suggestions: [["xrd+xml"]]
2443 },
2444 %{
2445 key: "application/jrd+json",
2446 type: {:list, :string},
2447 suggestions: [["jrd+json"]]
2448 },
2449 %{
2450 key: "application/activity+json",
2451 type: {:list, :string},
2452 suggestions: [["activity+json"]]
2453 },
2454 %{
2455 key: "application/ld+json",
2456 type: {:list, :string},
2457 suggestions: [["activity+json"]]
2458 }
2459 ]
2460 }
2461 ]
2462 },
2463 %{
2464 group: :tesla,
2465 type: :group,
2466 description: "Tesla settings",
2467 children: [
2468 %{
2469 key: :adapter,
2470 type: :module,
2471 description: "Tesla adapter",
2472 suggestions: [Tesla.Adapter.Hackney]
2473 }
2474 ]
2475 },
2476 %{
2477 group: :pleroma,
2478 key: :chat,
2479 type: :group,
2480 description: "Pleroma chat settings",
2481 children: [
2482 %{
2483 key: :enabled,
2484 type: :boolean
2485 }
2486 ]
2487 },
2488 %{
2489 group: :pleroma,
2490 key: :suggestions,
2491 type: :group,
2492 children: [
2493 %{
2494 key: :enabled,
2495 type: :boolean,
2496 description: "Enables suggestions"
2497 },
2498 %{
2499 key: :third_party_engine,
2500 type: :string,
2501 description: "URL for third party engine",
2502 suggestions: [
2503 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}"
2504 ]
2505 },
2506 %{
2507 key: :timeout,
2508 type: :integer,
2509 description: "Request timeout to third party engine",
2510 suggestions: [300_000]
2511 },
2512 %{
2513 key: :limit,
2514 type: :integer,
2515 description: "Limit for suggestions",
2516 suggestions: [40]
2517 },
2518 %{
2519 key: :web,
2520 type: :string,
2521 suggestions: ["https://vinayaka.distsn.org"]
2522 }
2523 ]
2524 },
2525 %{
2526 group: :prometheus,
2527 key: Pleroma.Web.Endpoint.MetricsExporter,
2528 type: :group,
2529 description: "Prometheus settings",
2530 children: [
2531 %{
2532 key: :path,
2533 type: :string,
2534 description: "API endpoint with metrics",
2535 suggestions: ["/api/pleroma/app_metrics"]
2536 }
2537 ]
2538 },
2539 %{
2540 group: :http_signatures,
2541 type: :group,
2542 description: "HTTP Signatures settings",
2543 children: [
2544 %{
2545 key: :adapter,
2546 type: :module,
2547 suggestions: [Pleroma.Signature]
2548 }
2549 ]
2550 },
2551 %{
2552 group: :pleroma,
2553 key: Pleroma.Uploaders.MDII,
2554 type: :group,
2555 children: [
2556 %{
2557 key: :cgi,
2558 type: :string,
2559 suggestions: ["https://mdii.sakura.ne.jp/mdii-post.cgi"]
2560 },
2561 %{
2562 key: :files,
2563 type: :string,
2564 suggestions: ["https://mdii.sakura.ne.jp"]
2565 }
2566 ]
2567 },
2568 %{
2569 group: :pleroma,
2570 key: :http,
2571 type: :group,
2572 description: "HTTP settings",
2573 children: [
2574 %{
2575 key: :proxy_url,
2576 type: [:string, :atom, nil],
2577 suggestions: ["localhost:9020", {:socks5, :localhost, 3090}, nil]
2578 },
2579 %{
2580 key: :send_user_agent,
2581 type: :boolean
2582 },
2583 %{
2584 key: :adapter,
2585 type: :keyword,
2586 suggestions: [
2587 [
2588 ssl_options: [
2589 # Workaround for remote server certificate chain issues
2590 partial_chain: &:hackney_connect.partial_chain/1,
2591 # We don't support TLS v1.3 yet
2592 versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
2593 ]
2594 ]
2595 ]
2596 }
2597 ]
2598 },
2599 %{
2600 group: :pleroma,
2601 key: :markup,
2602 type: :group,
2603 children: [
2604 %{
2605 key: :allow_inline_images,
2606 type: :boolean
2607 },
2608 %{
2609 key: :allow_headings,
2610 type: :boolean
2611 },
2612 %{
2613 key: :allow_tables,
2614 type: :boolean
2615 },
2616 %{
2617 key: :allow_fonts,
2618 type: :boolean
2619 },
2620 %{
2621 key: :scrub_policy,
2622 type: {:list, :module},
2623 suggestions: [[Pleroma.HTML.Transform.MediaProxy, Pleroma.HTML.Scrubber.Default]]
2624 }
2625 ]
2626 },
2627 %{
2628 group: :pleroma,
2629 key: :user,
2630 type: :group,
2631 children: [
2632 %{
2633 key: :deny_follow_blocked,
2634 type: :boolean
2635 }
2636 ]
2637 },
2638 %{
2639 group: :pleroma,
2640 key: :mrf_normalize_markup,
2641 type: :group,
2642 children: [
2643 %{
2644 key: :scrub_policy,
2645 type: :module,
2646 suggestions: [Pleroma.HTML.Scrubber.Default]
2647 }
2648 ]
2649 },
2650 %{
2651 group: :pleroma,
2652 key: Pleroma.User,
2653 type: :group,
2654 children: [
2655 %{
2656 key: :restricted_nicknames,
2657 type: {:list, :string},
2658 suggestions: [
2659 [
2660 ".well-known",
2661 "~",
2662 "about",
2663 "activities",
2664 "api",
2665 "auth",
2666 "check_password",
2667 "dev",
2668 "friend-requests",
2669 "inbox",
2670 "internal",
2671 "main",
2672 "media",
2673 "nodeinfo",
2674 "notice",
2675 "oauth",
2676 "objects",
2677 "ostatus_subscribe",
2678 "pleroma",
2679 "proxy",
2680 "push",
2681 "registration",
2682 "relay",
2683 "settings",
2684 "status",
2685 "tag",
2686 "user-search",
2687 "user_exists",
2688 "users",
2689 "web"
2690 ]
2691 ]
2692 }
2693 ]
2694 },
2695 %{
2696 group: :cors_plug,
2697 type: :group,
2698 children: [
2699 %{
2700 key: :max_age,
2701 type: :integer,
2702 suggestions: [86_400]
2703 },
2704 %{
2705 key: :methods,
2706 type: {:list, :string},
2707 suggestions: [["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"]]
2708 },
2709 %{
2710 key: :expose,
2711 type: :string,
2712 suggestions: [
2713 [
2714 "Link",
2715 "X-RateLimit-Reset",
2716 "X-RateLimit-Limit",
2717 "X-RateLimit-Remaining",
2718 "X-Request-Id",
2719 "Idempotency-Key"
2720 ]
2721 ]
2722 },
2723 %{
2724 key: :credentials,
2725 type: :boolean
2726 },
2727 %{
2728 key: :headers,
2729 type: {:list, :string},
2730 suggestions: [["Authorization", "Content-Type", "Idempotency-Key"]]
2731 }
2732 ]
2733 },
2734 %{
2735 group: :pleroma,
2736 key: Pleroma.Plugs.RemoteIp,
2737 type: :group,
2738 description: """
2739 **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
2740
2741 `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
2742 """,
2743 children: [
2744 %{
2745 key: :enabled,
2746 type: :boolean,
2747 description: "Enable/disable the plug. Defaults to `false`.",
2748 suggestions: [true, false]
2749 },
2750 %{
2751 key: :headers,
2752 type: {:list, :string},
2753 description:
2754 "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]`."
2755 },
2756 %{
2757 key: :proxies,
2758 type: {:list, :string},
2759 description:
2760 "A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Defaults to `[]`."
2761 },
2762 %{
2763 key: :reserved,
2764 type: {:list, :string},
2765 description:
2766 "Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network)."
2767 }
2768 ]
2769 },
2770 %{
2771 group: :pleroma,
2772 key: :web_cache_ttl,
2773 type: :group,
2774 description:
2775 "The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.",
2776 children: [
2777 %{
2778 key: :activity_pub,
2779 type: :integer,
2780 description:
2781 "activity pub routes (except question activities). Defaults to `nil` (no expiration).",
2782 suggestions: [30_000, nil]
2783 },
2784 %{
2785 key: :activity_pub_question,
2786 type: :integer,
2787 description:
2788 "activity pub routes (question activities). Defaults to `30_000` (30 seconds).",
2789 suggestions: [30_000]
2790 }
2791 ]
2792 }
2793 ]