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