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