909693319484efa0aac8e0bc9011f754052cc28e
[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's 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 require this setting to be disabled."
641 },
642 %{
643 key: :invites_enabled,
644 type: :boolean,
645 description: "Enable user invitations for admins (depends on `registrations_open` being disabled)."
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 "Enable to use extended local nicknames format (allows underscores/dashes)." <>
765 " This will break federation with older software for theses nicknames."
766 },
767 %{
768 key: :cleanup_attachments,
769 type: :boolean,
770 description: """
771 "Enable to remove associated attachments when status is removed.
772 This will not affect duplicates and attachments without status.
773 Enabling this will increase load to database when deleting statuses on larger instances.
774 """
775 },
776 %{
777 key: :max_pinned_statuses,
778 type: :integer,
779 description: "The maximum number of pinned statuses. 0 will disable the feature.",
780 suggestions: [
781 0,
782 1,
783 3
784 ]
785 },
786 %{
787 key: :autofollowed_nicknames,
788 type: {:list, :string},
789 description:
790 "Set to nicknames of (local) users that every new user should automatically follow",
791 suggestions: [
792 "lain",
793 "kaniini",
794 "lanodan",
795 "rinpatch"
796 ]
797 },
798 %{
799 key: :no_attachment_links,
800 type: :boolean,
801 description:
802 "Enable to disable automatically adding attachment link text to statuses"
803 },
804 %{
805 key: :welcome_message,
806 type: :string,
807 description:
808 "A message that will be sent to a newly registered users as a direct message",
809 suggestions: [
810 "Hi, @username! Welcome on board!"
811 ]
812 },
813 %{
814 key: :welcome_user_nickname,
815 type: :string,
816 description: "The nickname of the local user that sends the welcome message",
817 suggestions: [
818 "lain"
819 ]
820 },
821 %{
822 key: :max_report_comment_size,
823 type: :integer,
824 description: "The maximum size of the report comment. Default: 1000.",
825 suggestions: [
826 1_000
827 ]
828 },
829 %{
830 key: :safe_dm_mentions,
831 type: :boolean,
832 description:
833 "If enabled, only mentions at the beginning of a post will be used to address people in direct messages." <>
834 " This is to prevent accidental mentioning of people when talking about them (e.g. \"@admin please keep an eye on @bad_actor\")." <>
835 " Default: disabled"
836 },
837 %{
838 key: :healthcheck,
839 type: :boolean,
840 description: "If enabled, system data will be shown on /api/pleroma/healthcheck"
841 },
842 %{
843 key: :remote_post_retention_days,
844 type: :integer,
845 description:
846 "The default amount of days to retain remote posts when pruning the database",
847 suggestions: [
848 90
849 ]
850 },
851 %{
852 key: :user_bio_length,
853 type: :integer,
854 description: "A user bio maximum length. Default: 5000.",
855 suggestions: [
856 5_000
857 ]
858 },
859 %{
860 key: :user_name_length,
861 type: :integer,
862 description: "A user name maximum length. Default: 100.",
863 suggestions: [
864 100
865 ]
866 },
867 %{
868 key: :skip_thread_containment,
869 type: :boolean,
870 description: "Skip filtering out broken threads. Default: enabled"
871 },
872 %{
873 key: :limit_to_local_content,
874 type: {:dropdown, :atom},
875 description:
876 "Limit unauthenticated users to search for local statutes and users only. Default: `:unauthenticated`.",
877 suggestions: [
878 :unauthenticated,
879 :all,
880 false
881 ]
882 },
883 %{
884 key: :max_account_fields,
885 type: :integer,
886 description: "The maximum number of custom fields in the user profile. Default: 10.",
887 suggestions: [
888 10
889 ]
890 },
891 %{
892 key: :max_remote_account_fields,
893 type: :integer,
894 description:
895 "The maximum number of custom fields in the remote user profile. Default: 20.",
896 suggestions: [
897 20
898 ]
899 },
900 %{
901 key: :account_field_name_length,
902 type: :integer,
903 description: "An account field name maximum length. Default: 512.",
904 suggestions: [
905 512
906 ]
907 },
908 %{
909 key: :account_field_value_length,
910 type: :integer,
911 description: "An account field value maximum length. Default: 2048.",
912 suggestions: [
913 2048
914 ]
915 },
916 %{
917 key: :external_user_synchronization,
918 type: :boolean,
919 description: "Enabling following/followers counters synchronization for external users"
920 }
921 ]
922 },
923 %{
924 group: :logger,
925 type: :group,
926 description: "Logger-related settings",
927 children: [
928 %{
929 key: :backends,
930 type: [:atom, :tuple, :module],
931 description:
932 "Where logs will be sent, :console - send logs to stdout, { ExSyslogger, :ex_syslogger } - to syslog, Quack.Logger - to Slack.",
933 suggestions: [:console, {ExSyslogger, :ex_syslogger}, Quack.Logger]
934 }
935 ]
936 },
937 %{
938 group: :logger,
939 type: :group,
940 key: :ex_syslogger,
941 description: "ExSyslogger-related settings",
942 children: [
943 %{
944 key: :level,
945 type: {:dropdown, :atom},
946 description: "Log level",
947 suggestions: [:debug, :info, :warn, :error]
948 },
949 %{
950 key: :ident,
951 type: :string,
952 description:
953 "A string that's prepended to every message, and is typically set to the app name",
954 suggestions: ["pleroma"]
955 },
956 %{
957 key: :format,
958 type: :string,
959 description: "Default: \"$date $time [$level] $levelpad$node $metadata $message\".",
960 suggestions: ["$metadata[$level] $message"]
961 },
962 %{
963 key: :metadata,
964 type: {:list, :atom},
965 suggestions: [:request_id]
966 }
967 ]
968 },
969 %{
970 group: :logger,
971 type: :group,
972 key: :console,
973 description: "Console logger settings",
974 children: [
975 %{
976 key: :level,
977 type: {:dropdown, :atom},
978 description: "Log level",
979 suggestions: [:debug, :info, :warn, :error]
980 },
981 %{
982 key: :format,
983 type: :string,
984 description: "Default: \"$date $time [$level] $levelpad$node $metadata $message\".",
985 suggestions: ["$metadata[$level] $message"]
986 },
987 %{
988 key: :metadata,
989 type: {:list, :atom},
990 suggestions: [:request_id]
991 }
992 ]
993 },
994 %{
995 group: :quack,
996 type: :group,
997 description: "Quack-related settings",
998 children: [
999 %{
1000 key: :level,
1001 type: {:dropdown, :atom},
1002 description: "Log level",
1003 suggestions: [:debug, :info, :warn, :error]
1004 },
1005 %{
1006 key: :meta,
1007 type: {:list, :atom},
1008 description: "Configure which metadata you want to report on",
1009 suggestions: [
1010 :application,
1011 :module,
1012 :file,
1013 :function,
1014 :line,
1015 :pid,
1016 :crash_reason,
1017 :initial_call,
1018 :registered_name,
1019 :all,
1020 :none
1021 ]
1022 },
1023 %{
1024 key: :webhook_url,
1025 type: :string,
1026 description: "Configure the Slack incoming webhook",
1027 suggestions: ["https://hooks.slack.com/services/YOUR-KEY-HERE"]
1028 }
1029 ]
1030 },
1031 %{
1032 group: :pleroma,
1033 key: :frontend_configurations,
1034 type: :group,
1035 description:
1036 "This form can be used to configure a keyword list that keeps the configuration data for any " <>
1037 "kind of frontend. By default, settings for pleroma_fe and masto_fe are configured. If you want to " <>
1038 "add your own configuration your settings all fields must be complete.",
1039 children: [
1040 %{
1041 key: :pleroma_fe,
1042 label: "Pleroma FE",
1043 type: :map,
1044 description: "Settings for Pleroma FE",
1045 suggestions: [
1046 %{
1047 theme: "pleroma-dark",
1048 logo: "/static/logo.png",
1049 background: "/images/city.jpg",
1050 redirectRootNoLogin: "/main/all",
1051 redirectRootLogin: "/main/friends",
1052 showInstanceSpecificPanel: true,
1053 scopeOptionsEnabled: false,
1054 formattingOptionsEnabled: false,
1055 collapseMessageWithSubject: false,
1056 hidePostStats: false,
1057 hideUserStats: false,
1058 scopeCopy: true,
1059 subjectLineBehavior: "email",
1060 alwaysShowSubjectInput: true,
1061 logoMask: false,
1062 logoMargin: ".1em",
1063 stickers: false,
1064 enableEmojiPicker: false
1065 }
1066 ],
1067 children: [
1068 %{
1069 key: :theme,
1070 type: :string,
1071 description: "Which theme to use, they are defined in styles.json",
1072 suggestions: ["pleroma-dark"]
1073 },
1074 %{
1075 key: :logo,
1076 type: :string,
1077 description: "URL of the logo, defaults to Pleroma's logo",
1078 suggestions: ["/static/logo.png"]
1079 },
1080 %{
1081 key: :background,
1082 type: :string,
1083 description:
1084 "URL of the background, unless viewing a user profile with a background that is set",
1085 suggestions: ["/images/city.jpg"]
1086 },
1087 %{
1088 key: :redirectRootNoLogin,
1089 label: "Redirect root no login",
1090 type: :string,
1091 description:
1092 "Relative URL which indicates where to redirect when a user isn't logged in",
1093 suggestions: ["/main/all"]
1094 },
1095 %{
1096 key: :redirectRootLogin,
1097 label: "Redirect root login",
1098 type: :string,
1099 description:
1100 "Relative URL which indicates where to redirect when a user is logged in",
1101 suggestions: ["/main/friends"]
1102 },
1103 %{
1104 key: :showInstanceSpecificPanel,
1105 label: "Show instance specific panel",
1106 type: :boolean,
1107 description: "Whenether to show the instance's specific panel"
1108 },
1109 %{
1110 key: :scopeOptionsEnabled,
1111 label: "Scope options enabled",
1112 type: :boolean,
1113 description: "Enable setting a notice visibility and subject/CW when posting"
1114 },
1115 %{
1116 key: :formattingOptionsEnabled,
1117 label: "Formatting options enabled",
1118 type: :boolean,
1119 description:
1120 "Enable setting a formatting different than plain-text (ie. HTML, Markdown) when posting, relates to `:instance`, `allowed_post_formats`"
1121 },
1122 %{
1123 key: :collapseMessageWithSubject,
1124 label: "Collapse message with subject",
1125 type: :boolean,
1126 description:
1127 "When a message has a subject (aka Content Warning), collapse it by default"
1128 },
1129 %{
1130 key: :hidePostStats,
1131 label: "Hide post stats",
1132 type: :boolean,
1133 description: "Hide notices statistics (repeats, favorites, ...)"
1134 },
1135 %{
1136 key: :hideUserStats,
1137 label: "Hide user stats",
1138 type: :boolean,
1139 description:
1140 "Hide profile statistics (posts, posts per day, followers, followings, ...)"
1141 },
1142 %{
1143 key: :scopeCopy,
1144 label: "Scope copy",
1145 type: :boolean,
1146 description: "Copy the scope (private/unlisted/public) in replies to posts by default"
1147 },
1148 %{
1149 key: :subjectLineBehavior,
1150 label: "Subject line behavior",
1151 type: :string,
1152 description: "Allows changing the default behaviour of subject lines in replies.
1153 `email`: copy and preprend re:, as in email,
1154 `masto`: copy verbatim, as in Mastodon,
1155 `noop`: don't copy the subject.",
1156 suggestions: ["email", "masto", "noop"]
1157 },
1158 %{
1159 key: :alwaysShowSubjectInput,
1160 label: "Always show subject input",
1161 type: :boolean,
1162 description: "When disabled, auto-hide the subject field if it's empty"
1163 },
1164 %{
1165 key: :logoMask,
1166 label: "Logo mask",
1167 type: :boolean,
1168 description:
1169 "By default it assumes logo used will be monochrome with alpha channel to be compatible with both light and dark themes. " <>
1170 "If you want a colorful logo you must disable logoMask."
1171 },
1172 %{
1173 key: :logoMargin,
1174 label: "Logo margin",
1175 type: :string,
1176 description:
1177 "Allows you to adjust vertical margins between logo boundary and navbar borders. " <>
1178 "The idea is that to have logo's image without any extra margins and instead adjust them to your need in layout.",
1179 suggestions: [".1em"]
1180 },
1181 %{
1182 key: :stickers,
1183 type: :boolean,
1184 description: "Enables stickers."
1185 },
1186 %{
1187 key: :enableEmojiPicker,
1188 label: "Emoji picker",
1189 type: :boolean,
1190 description: "Enables emoji picker."
1191 }
1192 ]
1193 },
1194 %{
1195 key: :masto_fe,
1196 label: "Masto FE",
1197 type: :map,
1198 description: "Settings for Masto FE",
1199 suggestions: [
1200 %{
1201 showInstanceSpecificPanel: true
1202 }
1203 ],
1204 children: [
1205 %{
1206 key: :showInstanceSpecificPanel,
1207 label: "Show instance specific panel",
1208 type: :boolean,
1209 description: "Whenether to show the instance's specific panel"
1210 }
1211 ]
1212 }
1213 ]
1214 },
1215 %{
1216 group: :pleroma,
1217 key: :assets,
1218 type: :group,
1219 description:
1220 "This section configures assets to be used with various frontends. Currently the only option relates to mascots on the mastodon frontend",
1221 children: [
1222 %{
1223 key: :mascots,
1224 type: {:keyword, :map},
1225 description:
1226 "Keyword of mascots, each element must contain both an url and a mime_type key",
1227 suggestions: [
1228 pleroma_fox_tan: %{
1229 url: "/images/pleroma-fox-tan-smol.png",
1230 mime_type: "image/png"
1231 },
1232 pleroma_fox_tan_shy: %{
1233 url: "/images/pleroma-fox-tan-shy.png",
1234 mime_type: "image/png"
1235 }
1236 ]
1237 },
1238 %{
1239 key: :default_mascot,
1240 type: :atom,
1241 description:
1242 "This will be used as the default mascot on MastoFE. Default: `:pleroma_fox_tan`",
1243 suggestions: [
1244 :pleroma_fox_tan
1245 ]
1246 }
1247 ]
1248 },
1249 %{
1250 group: :pleroma,
1251 key: :manifest,
1252 type: :group,
1253 description:
1254 "This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE",
1255 children: [
1256 %{
1257 key: :icons,
1258 type: {:list, :map},
1259 description: "Describe the icons of the app",
1260 suggestion: [
1261 %{
1262 src: "/static/logo.png"
1263 },
1264 %{
1265 src: "/static/icon.png",
1266 type: "image/png"
1267 },
1268 %{
1269 src: "/static/icon.ico",
1270 sizes: "72x72 96x96 128x128 256x256"
1271 }
1272 ]
1273 },
1274 %{
1275 key: :theme_color,
1276 type: :string,
1277 description: "Describe the theme color of the app",
1278 suggestions: ["#282c37", "mediumpurple"]
1279 },
1280 %{
1281 key: :background_color,
1282 type: :string,
1283 description: "Describe the background color of the app",
1284 suggestions: ["#191b22", "aliceblue"]
1285 }
1286 ]
1287 },
1288 %{
1289 group: :pleroma,
1290 key: :mrf_simple,
1291 label: "MRF simple",
1292 type: :group,
1293 description: "Message Rewrite Facility",
1294 children: [
1295 %{
1296 key: :media_removal,
1297 type: {:list, :string},
1298 description: "List of instances to remove medias from",
1299 suggestions: ["example.com", "*.example.com"]
1300 },
1301 %{
1302 key: :media_nsfw,
1303 label: "Media NSFW",
1304 type: {:list, :string},
1305 description: "List of instances to put medias as NSFW (sensitive) from",
1306 suggestions: ["example.com", "*.example.com"]
1307 },
1308 %{
1309 key: :federated_timeline_removal,
1310 type: {:list, :string},
1311 description:
1312 "List of instances to remove from Federated (aka The Whole Known Network) Timeline",
1313 suggestions: ["example.com", "*.example.com"]
1314 },
1315 %{
1316 key: :reject,
1317 type: {:list, :string},
1318 description: "List of instances to reject any activities from",
1319 suggestions: ["example.com", "*.example.com"]
1320 },
1321 %{
1322 key: :accept,
1323 type: {:list, :string},
1324 description: "List of instances to accept any activities from",
1325 suggestions: ["example.com", "*.example.com"]
1326 },
1327 %{
1328 key: :report_removal,
1329 type: {:list, :string},
1330 description: "List of instances to reject reports from",
1331 suggestions: ["example.com", "*.example.com"]
1332 },
1333 %{
1334 key: :avatar_removal,
1335 type: {:list, :string},
1336 description: "List of instances to strip avatars from",
1337 suggestions: ["example.com", "*.example.com"]
1338 },
1339 %{
1340 key: :banner_removal,
1341 type: {:list, :string},
1342 description: "List of instances to strip banners from",
1343 suggestions: ["example.com", "*.example.com"]
1344 }
1345 ]
1346 },
1347 %{
1348 group: :pleroma,
1349 key: :mrf_subchain,
1350 label: "MRF subchain",
1351 type: :group,
1352 description:
1353 "This policy processes messages through an alternate pipeline when a given message matches certain criteria." <>
1354 " All criteria are configured as a map of regular expressions to lists of policy modules.",
1355 children: [
1356 %{
1357 key: :match_actor,
1358 type: :map,
1359 description: "Matches a series of regular expressions against the actor field",
1360 suggestions: [
1361 %{
1362 ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy]
1363 }
1364 ]
1365 }
1366 ]
1367 },
1368 %{
1369 group: :pleroma,
1370 key: :mrf_rejectnonpublic,
1371 description:
1372 "MRF RejectNonPublic settings. RejectNonPublic drops posts with non-public visibility settings.",
1373 label: "MRF reject non public",
1374 type: :group,
1375 children: [
1376 %{
1377 key: :allow_followersonly,
1378 label: "Allow followers-only",
1379 type: :boolean,
1380 description: "Whether to allow followers-only posts"
1381 },
1382 %{
1383 key: :allow_direct,
1384 type: :boolean,
1385 description: "Whether to allow direct messages"
1386 }
1387 ]
1388 },
1389 %{
1390 group: :pleroma,
1391 key: :mrf_hellthread,
1392 label: "MRF hellthread",
1393 type: :group,
1394 description: "Block messages with too much mentions",
1395 children: [
1396 %{
1397 key: :delist_threshold,
1398 type: :integer,
1399 description:
1400 "Number of mentioned users after which the message gets delisted (the message can still be seen, " <>
1401 " but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable.",
1402 suggestions: [10]
1403 },
1404 %{
1405 key: :reject_threshold,
1406 type: :integer,
1407 description:
1408 "Number of mentioned users after which the messaged gets rejected. Set to 0 to disable.",
1409 suggestions: [20]
1410 }
1411 ]
1412 },
1413 %{
1414 group: :pleroma,
1415 key: :mrf_keyword,
1416 label: "MRF keyword",
1417 type: :group,
1418 description: "Reject or Word-Replace messages with a keyword or regex",
1419 children: [
1420 %{
1421 key: :reject,
1422 type: [:string, :regex],
1423 description:
1424 "A list of patterns which result in message being rejected, each pattern can be a string or a regular expression.",
1425 suggestions: ["foo", ~r/foo/iu]
1426 },
1427 %{
1428 key: :federated_timeline_removal,
1429 type: [:string, :regex],
1430 description:
1431 "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.",
1432 suggestions: ["foo", ~r/foo/iu]
1433 },
1434 %{
1435 key: :replace,
1436 type: [{:tuple, :string, :string}, {:tuple, :regex, :string}],
1437 description:
1438 "A list of tuples containing {pattern, replacement}, pattern can be a string or a regular expression.",
1439 suggestions: [{"foo", "bar"}, {~r/foo/iu, "bar"}]
1440 }
1441 ]
1442 },
1443 %{
1444 group: :pleroma,
1445 key: :mrf_mention,
1446 label: "MRF mention",
1447 type: :group,
1448 description: "Block messages which mention a user",
1449 children: [
1450 %{
1451 key: :actors,
1452 type: {:list, :string},
1453 description: "A list of actors, for which to drop any posts mentioning",
1454 suggestions: ["actor1", "actor2"]
1455 }
1456 ]
1457 },
1458 %{
1459 group: :pleroma,
1460 key: :mrf_vocabulary,
1461 label: "MRF vocabulary",
1462 type: :group,
1463 description: "Filter messages which belong to certain activity vocabularies",
1464 children: [
1465 %{
1466 key: :accept,
1467 type: {:list, :string},
1468 description:
1469 "A list of ActivityStreams terms to accept. If empty, all supported messages are accepted",
1470 suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]
1471 },
1472 %{
1473 key: :reject,
1474 type: {:list, :string},
1475 description:
1476 "A list of ActivityStreams terms to reject. If empty, no messages are rejected",
1477 suggestions: ["Create", "Follow", "Mention", "Announce", "Like"]
1478 }
1479 ]
1480 },
1481 # %{
1482 # group: :pleroma,
1483 # key: :mrf_user_allowlist,
1484 # type: :group,
1485 # description:
1486 # "The keys in this section are the domain names that the policy should apply to." <>
1487 # " Each key should be assigned a list of users that should be allowed through by their ActivityPub ID",
1488 # children: [
1489 # ["example.org": ["https://example.org/users/admin"]],
1490 # suggestions: [
1491 # ["example.org": ["https://example.org/users/admin"]]
1492 # ]
1493 # ]
1494 # },
1495 %{
1496 group: :pleroma,
1497 key: :media_proxy,
1498 type: :group,
1499 description: "Media proxy",
1500 children: [
1501 %{
1502 key: :enabled,
1503 type: :boolean,
1504 description: "Enables proxying of remote media to the instance's proxy"
1505 },
1506 %{
1507 key: :base_url,
1508 type: :string,
1509 description:
1510 "The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.",
1511 suggestions: ["https://example.com"]
1512 },
1513 %{
1514 key: :proxy_opts,
1515 type: :keyword,
1516 description: "Options for Pleroma.ReverseProxy",
1517 suggestions: [
1518 redirect_on_failure: false,
1519 max_body_length: 25 * 1_048_576,
1520 http: [
1521 follow_redirect: true,
1522 pool: :media
1523 ]
1524 ],
1525 children: [
1526 %{
1527 key: :redirect_on_failure,
1528 type: :boolean,
1529 description:
1530 "Redirects the client to the real remote URL if there's any HTTP errors. " <>
1531 "Any error during body processing will not be redirected as the response is chunked."
1532 },
1533 %{
1534 key: :max_body_length,
1535 type: :integer,
1536 description:
1537 "Limits the content length to be approximately the " <>
1538 "specified length. It is validated with the `content-length` header and also verified when proxying."
1539 },
1540 %{
1541 key: :http,
1542 type: :keyword,
1543 description: "HTTP options",
1544 children: [
1545 %{
1546 key: :adapter,
1547 type: :keyword,
1548 description: "Adapter specific options",
1549 children: [
1550 %{
1551 key: :ssl_options,
1552 type: :keyword,
1553 label: "SSL Options",
1554 description: "SSL options for HTTP adapter",
1555 children: [
1556 %{
1557 key: :versions,
1558 type: {:list, :atom},
1559 description: "List of TLS version to use",
1560 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
1561 }
1562 ]
1563 }
1564 ]
1565 },
1566 %{
1567 key: :proxy_url,
1568 label: "Proxy URL",
1569 type: [:string, :tuple],
1570 description: "Proxy URL",
1571 suggestions: ["127.0.0.1:8123", {:socks5, :localhost, 9050}]
1572 }
1573 ]
1574 }
1575 ]
1576 },
1577 %{
1578 key: :whitelist,
1579 type: {:list, :string},
1580 description: "List of domains to bypass the mediaproxy",
1581 suggestions: ["example.com"]
1582 }
1583 ]
1584 },
1585 %{
1586 group: :pleroma,
1587 key: :gopher,
1588 type: :group,
1589 description: "Gopher settings",
1590 children: [
1591 %{
1592 key: :enabled,
1593 type: :boolean,
1594 description: "Enables the gopher interface"
1595 },
1596 %{
1597 key: :ip,
1598 type: :tuple,
1599 description: "IP address to bind to",
1600 suggestions: [{0, 0, 0, 0}]
1601 },
1602 %{
1603 key: :port,
1604 type: :integer,
1605 description: "Port to bind to",
1606 suggestions: [9999]
1607 },
1608 %{
1609 key: :dstport,
1610 type: :integer,
1611 description: "Port advertised in urls (optional, defaults to port)",
1612 suggestions: [9999]
1613 }
1614 ]
1615 },
1616 %{
1617 group: :pleroma,
1618 key: Pleroma.Web.Endpoint,
1619 type: :group,
1620 description: "Phoenix endpoint configuration",
1621 children: [
1622 %{
1623 key: :http,
1624 label: "HTTP",
1625 type: {:keyword, :integer, :tuple},
1626 description: "http protocol configuration",
1627 suggestions: [
1628 port: 8080,
1629 ip: {127, 0, 0, 1}
1630 ],
1631 children: [
1632 %{
1633 key: :dispatch,
1634 type: {:list, :tuple},
1635 description: "dispatch settings",
1636 suggestions: [
1637 {:_,
1638 [
1639 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
1640 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
1641 {Phoenix.Transports.WebSocket,
1642 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
1643 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
1644 ]}
1645 # end copied from config.exs
1646 ]
1647 },
1648 %{
1649 key: :ip,
1650 label: "IP",
1651 type: :tuple,
1652 description: "ip",
1653 suggestions: [
1654 {0, 0, 0, 0}
1655 ]
1656 },
1657 %{
1658 key: :port,
1659 type: :integer,
1660 description: "port",
1661 suggestions: [
1662 2020
1663 ]
1664 }
1665 ]
1666 },
1667 %{
1668 key: :url,
1669 label: "URL",
1670 type: {:keyword, :string, :integer},
1671 description: "configuration for generating urls",
1672 suggestions: [
1673 host: "example.com",
1674 port: 2020,
1675 scheme: "https"
1676 ],
1677 children: [
1678 %{
1679 key: :host,
1680 type: :string,
1681 description: "Host",
1682 suggestions: [
1683 "example.com"
1684 ]
1685 },
1686 %{
1687 key: :port,
1688 type: :integer,
1689 description: "port",
1690 suggestions: [
1691 2020
1692 ]
1693 },
1694 %{
1695 key: :scheme,
1696 type: :string,
1697 description: "Scheme",
1698 suggestions: [
1699 "https",
1700 "https"
1701 ]
1702 }
1703 ]
1704 },
1705 %{
1706 key: :instrumenters,
1707 type: {:list, :module},
1708 suggestions: [Pleroma.Web.Endpoint.Instrumenter]
1709 },
1710 %{
1711 key: :protocol,
1712 type: :string,
1713 suggestions: ["https"]
1714 },
1715 %{
1716 key: :secret_key_base,
1717 type: :string,
1718 suggestions: ["aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl"]
1719 },
1720 %{
1721 key: :signing_salt,
1722 type: :string,
1723 suggestions: ["CqaoopA2"]
1724 },
1725 %{
1726 key: :render_errors,
1727 type: :keyword,
1728 suggestions: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
1729 children: [
1730 %{
1731 key: :view,
1732 type: :module,
1733 suggestions: [Pleroma.Web.ErrorView]
1734 },
1735 %{
1736 key: :accepts,
1737 type: {:list, :string},
1738 suggestions: ["json"]
1739 }
1740 ]
1741 },
1742 %{
1743 key: :pubsub,
1744 type: :keyword,
1745 suggestions: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
1746 children: [
1747 %{
1748 key: :name,
1749 type: :module,
1750 suggestions: [Pleroma.PubSub]
1751 },
1752 %{
1753 key: :adapter,
1754 type: :module,
1755 suggestions: [Phoenix.PubSub.PG2]
1756 }
1757 ]
1758 },
1759 %{
1760 key: :secure_cookie_flag,
1761 type: :boolean
1762 },
1763 %{
1764 key: :extra_cookie_attrs,
1765 type: {:list, :string},
1766 suggestions: ["SameSite=Lax"]
1767 }
1768 ]
1769 },
1770 %{
1771 group: :pleroma,
1772 key: :activitypub,
1773 type: :group,
1774 description: "ActivityPub-related settings",
1775 children: [
1776 %{
1777 key: :unfollow_blocked,
1778 type: :boolean,
1779 description: "Whether blocks result in people getting unfollowed"
1780 },
1781 %{
1782 key: :outgoing_blocks,
1783 type: :boolean,
1784 description: "Whether to federate blocks to other instances"
1785 },
1786 %{
1787 key: :sign_object_fetches,
1788 type: :boolean,
1789 description: "Sign object fetches with HTTP signatures"
1790 },
1791 %{
1792 key: :follow_handshake_timeout,
1793 type: :integer,
1794 description: "Following handshake timeout",
1795 suggestions: [500]
1796 }
1797 ]
1798 },
1799 %{
1800 group: :pleroma,
1801 key: :http_security,
1802 type: :group,
1803 description: "HTTP security settings",
1804 children: [
1805 %{
1806 key: :enabled,
1807 type: :boolean,
1808 description: "Whether the managed content security policy is enabled"
1809 },
1810 %{
1811 key: :sts,
1812 label: "STS",
1813 type: :boolean,
1814 description: "Whether to additionally send a Strict-Transport-Security header"
1815 },
1816 %{
1817 key: :sts_max_age,
1818 label: "STS max age",
1819 type: :integer,
1820 description: "The maximum age for the Strict-Transport-Security header if sent",
1821 suggestions: [31_536_000]
1822 },
1823 %{
1824 key: :ct_max_age,
1825 label: "CT max age",
1826 type: :integer,
1827 description: "The maximum age for the Expect-CT header if sent",
1828 suggestions: [2_592_000]
1829 },
1830 %{
1831 key: :referrer_policy,
1832 type: :string,
1833 description: "The referrer policy to use, either \"same-origin\" or \"no-referrer\"",
1834 suggestions: ["same-origin", "no-referrer"]
1835 },
1836 %{
1837 key: :report_uri,
1838 label: "Report URI",
1839 type: :string,
1840 description: "Adds the specified url to report-uri and report-to group in CSP header",
1841 suggestions: ["https://example.com/report-uri"]
1842 }
1843 ]
1844 },
1845 %{
1846 group: :web_push_encryption,
1847 key: :vapid_details,
1848 type: :group,
1849 description:
1850 "Web Push Notifications configuration. You can use the mix task mix web_push.gen.keypair to generate it",
1851 children: [
1852 %{
1853 key: :subject,
1854 type: :string,
1855 description:
1856 "A mailto link for the administrative contact." <>
1857 " 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," <>
1858 " is unavailable for an extended period, or otherwise can't respond, someone else on the list can.",
1859 suggestions: ["Subject"]
1860 },
1861 %{
1862 key: :public_key,
1863 type: :string,
1864 description: "VAPID public key",
1865 suggestions: ["Public key"]
1866 },
1867 %{
1868 key: :private_key,
1869 type: :string,
1870 description: "VAPID private key",
1871 suggestions: ["Private key"]
1872 }
1873 ]
1874 },
1875 %{
1876 group: :pleroma,
1877 key: Pleroma.Captcha,
1878 type: :group,
1879 description: "Captcha-related settings",
1880 children: [
1881 %{
1882 key: :enabled,
1883 type: :boolean,
1884 description: "Whether the captcha should be shown on registration"
1885 },
1886 %{
1887 key: :method,
1888 type: :module,
1889 description: "The method/service to use for captcha",
1890 suggestions: [Pleroma.Captcha.Kocaptcha, Pleroma.Captcha.Native]
1891 },
1892 %{
1893 key: :seconds_valid,
1894 type: :integer,
1895 description: "The time in seconds for which the captcha is valid",
1896 suggestions: [60]
1897 }
1898 ]
1899 },
1900 %{
1901 group: :pleroma,
1902 key: Pleroma.Captcha.Kocaptcha,
1903 type: :group,
1904 description:
1905 "Kocaptcha is a very simple captcha service with a single API endpoint, the source code is" <>
1906 " here: https://github.com/koto-bank/kocaptcha. The default endpoint (https://captcha.kotobank.ch) is hosted by the developer.",
1907 children: [
1908 %{
1909 key: :endpoint,
1910 type: :string,
1911 description: "The kocaptcha endpoint to use",
1912 suggestions: ["https://captcha.kotobank.ch"]
1913 }
1914 ]
1915 },
1916 %{
1917 group: :pleroma,
1918 type: :group,
1919 description:
1920 "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",
1921 children: [
1922 %{
1923 key: :admin_token,
1924 type: :string,
1925 description: "Token",
1926 suggestions: ["some_random_token"]
1927 }
1928 ]
1929 },
1930 %{
1931 group: :pleroma_job_queue,
1932 key: :queues,
1933 type: :group,
1934 description: "[Deprecated] Replaced with `Oban`/`:queues` (keeping the same format)"
1935 },
1936 %{
1937 group: :pleroma,
1938 key: Pleroma.Web.Federator.RetryQueue,
1939 type: :group,
1940 description: "[Deprecated] See `Oban` and `:workers` sections for configuration notes",
1941 children: [
1942 %{
1943 key: :max_retries,
1944 type: :integer,
1945 description: "[Deprecated] Replaced as `Oban`/`:queues`/`:outgoing_federation` value"
1946 }
1947 ]
1948 },
1949 %{
1950 group: :pleroma,
1951 key: Oban,
1952 type: :group,
1953 description: """
1954 [Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
1955
1956 Note: if you are running PostgreSQL in [`silent_mode`](https://postgresqlco.nf/en/doc/param/silent_mode?version=9.1),
1957 it's advised to set [`log_destination`](https://postgresqlco.nf/en/doc/param/log_destination?version=9.1) to `syslog`,
1958 otherwise `postmaster.log` file may grow because of "you don't own a lock of type ShareLock" warnings
1959 (see https://github.com/sorentwo/oban/issues/52).
1960 """,
1961 children: [
1962 %{
1963 key: :repo,
1964 type: :module,
1965 description: "Application's Ecto repo",
1966 suggestions: [Pleroma.Repo]
1967 },
1968 %{
1969 key: :verbose,
1970 type: {:dropdown, :atom},
1971 description: "Logs verbose mode",
1972 suggestions: [false, :error, :warn, :info, :debug]
1973 },
1974 %{
1975 key: :prune,
1976 type: [:atom, :tuple],
1977 description:
1978 "Non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning)",
1979 suggestions: [:disabled, {:maxlen, 1500}, {:maxage, 60 * 60}]
1980 },
1981 %{
1982 key: :queues,
1983 type: {:keyword, :integer},
1984 description:
1985 "Background jobs queues (keys: queues, values: max numbers of concurrent jobs)",
1986 suggestions: [
1987 activity_expiration: 10,
1988 background: 5,
1989 federator_incoming: 50,
1990 federator_outgoing: 50,
1991 mailer: 10,
1992 scheduled_activities: 10,
1993 transmogrifier: 20,
1994 web_push: 50
1995 ],
1996 children: [
1997 %{
1998 key: :activity_expiration,
1999 type: :integer,
2000 description: "Activity expiration queue",
2001 suggestions: [10]
2002 },
2003 %{
2004 key: :background,
2005 type: :integer,
2006 description: "Background queue",
2007 suggestions: [5]
2008 },
2009 %{
2010 key: :federator_incoming,
2011 type: :integer,
2012 description: "Incoming federation queue",
2013 suggestions: [50]
2014 },
2015 %{
2016 key: :federator_outgoing,
2017 type: :integer,
2018 description: "Outgoing federation queue",
2019 suggestions: [50]
2020 },
2021 %{
2022 key: :mailer,
2023 type: :integer,
2024 description: "Email sender queue, see Pleroma.Emails.Mailer",
2025 suggestions: [10]
2026 },
2027 %{
2028 key: :scheduled_activities,
2029 type: :integer,
2030 description: "Scheduled activities queue, see Pleroma.ScheduledActivities",
2031 suggestions: [10]
2032 },
2033 %{
2034 key: :transmogrifier,
2035 type: :integer,
2036 description: "Transmogrifier queue",
2037 suggestions: [20]
2038 },
2039 %{
2040 key: :web_push,
2041 type: :integer,
2042 description: "Web push notifications queue",
2043 suggestions: [50]
2044 }
2045 ]
2046 }
2047 ]
2048 },
2049 %{
2050 group: :pleroma,
2051 key: :workers,
2052 type: :group,
2053 description: "Includes custom worker options not interpretable directly by `Oban`",
2054 children: [
2055 %{
2056 key: :retries,
2057 type: {:keyword, :integer},
2058 description: "Max retry attempts for failed jobs, per `Oban` queue",
2059 suggestions: [
2060 federator_incoming: 5,
2061 federator_outgoing: 5
2062 ]
2063 }
2064 ]
2065 },
2066 %{
2067 group: :pleroma,
2068 key: Pleroma.Web.Metadata,
2069 type: :group,
2070 description: "Metadata-related settings",
2071 children: [
2072 %{
2073 key: :providers,
2074 type: {:list, :module},
2075 description: "List of metadata providers to enable",
2076 suggestions: [
2077 Pleroma.Web.Metadata.Providers.OpenGraph,
2078 Pleroma.Web.Metadata.Providers.TwitterCard,
2079 Pleroma.Web.Metadata.Providers.RelMe,
2080 Pleroma.Web.Metadata.Providers.Feed
2081 ]
2082 },
2083 %{
2084 key: :unfurl_nsfw,
2085 label: "Unfurl NSFW",
2086 type: :boolean,
2087 description: "When enabled NSFW attachments will be shown in previews"
2088 }
2089 ]
2090 },
2091 %{
2092 group: :pleroma,
2093 key: :rich_media,
2094 type: :group,
2095 description:
2096 "If enabled the instance will parse metadata from attached links to generate link previews.",
2097 children: [
2098 %{
2099 key: :enabled,
2100 type: :boolean,
2101 description: "Enables/disables RichMedia."
2102 },
2103 %{
2104 key: :ignore_hosts,
2105 type: {:list, :string},
2106 description: "List of hosts which will be ignored by the metadata parser.",
2107 suggestions: ["accounts.google.com", "xss.website"]
2108 },
2109 %{
2110 key: :ignore_tld,
2111 label: "Ignore TLD",
2112 type: {:list, :string},
2113 description: "List TLDs (top-level domains) which will ignore for parse metadata.",
2114 suggestions: ["local", "localdomain", "lan"]
2115 },
2116 %{
2117 key: :parsers,
2118 type: {:list, :module},
2119 description: "List of Rich Media parsers.",
2120 suggestions: [
2121 Pleroma.Web.RichMedia.Parsers.MetaTagsParser,
2122 Pleroma.Web.RichMedia.Parsers.OEmbed,
2123 Pleroma.Web.RichMedia.Parsers.OGP,
2124 Pleroma.Web.RichMedia.Parsers.TwitterCard
2125 ]
2126 },
2127 %{
2128 key: :ttl_setters,
2129 label: "TTL setters",
2130 type: {:list, :module},
2131 description: "List of rich media TTL setters.",
2132 suggestions: [
2133 Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl
2134 ]
2135 }
2136 ]
2137 },
2138 %{
2139 group: :pleroma,
2140 key: :fetch_initial_posts,
2141 type: :group,
2142 description: "Fetching initial posts settings",
2143 children: [
2144 %{
2145 key: :enabled,
2146 type: :boolean,
2147 description:
2148 "If enabled, when a new user is federated with, fetch some of their latest posts"
2149 },
2150 %{
2151 key: :pages,
2152 type: :integer,
2153 description: "The amount of pages to fetch",
2154 suggestions: [5]
2155 }
2156 ]
2157 },
2158 %{
2159 group: :auto_linker,
2160 key: :opts,
2161 type: :group,
2162 description: "Configuration for the auto_linker library",
2163 children: [
2164 %{
2165 key: :class,
2166 type: [:string, false],
2167 description: "Specify the class to be added to the generated link. `False` to clear",
2168 suggestions: ["auto-linker", false]
2169 },
2170 %{
2171 key: :rel,
2172 type: [:string, false],
2173 description: "Override the rel attribute. `False` to clear",
2174 suggestions: ["ugc", "noopener noreferrer", false]
2175 },
2176 %{
2177 key: :new_window,
2178 type: :boolean,
2179 description: "Link urls will open in new window/tab"
2180 },
2181 %{
2182 key: :truncate,
2183 type: [:integer, false],
2184 description:
2185 "Set to a number to truncate urls longer then the number. Truncated urls will end in `..`",
2186 suggestions: [15, false]
2187 },
2188 %{
2189 key: :strip_prefix,
2190 type: :boolean,
2191 description: "Strip the scheme prefix"
2192 },
2193 %{
2194 key: :extra,
2195 type: :boolean,
2196 description: "Link urls with rarely used schemes (magnet, ipfs, irc, etc.)"
2197 }
2198 ]
2199 },
2200 %{
2201 group: :pleroma,
2202 key: Pleroma.ScheduledActivity,
2203 type: :group,
2204 description: "Scheduled activities settings",
2205 children: [
2206 %{
2207 key: :daily_user_limit,
2208 type: :integer,
2209 description:
2210 "The number of scheduled activities a user is allowed to create in a single day. Default: 25.",
2211 suggestions: [25]
2212 },
2213 %{
2214 key: :total_user_limit,
2215 type: :integer,
2216 description:
2217 "The number of scheduled activities a user is allowed to create in total. Default: 300.",
2218 suggestions: [300]
2219 },
2220 %{
2221 key: :enabled,
2222 type: :boolean,
2223 description: "Whether scheduled activities are sent to the job queue to be executed"
2224 }
2225 ]
2226 },
2227 %{
2228 group: :pleroma,
2229 key: Pleroma.ActivityExpiration,
2230 type: :group,
2231 description: "Expired activity settings",
2232 children: [
2233 %{
2234 key: :enabled,
2235 type: :boolean,
2236 description: "Whether expired activities will be sent to the job queue to be deleted"
2237 }
2238 ]
2239 },
2240 %{
2241 group: :pleroma,
2242 type: :group,
2243 description: "Authenticator",
2244 children: [
2245 %{
2246 key: Pleroma.Web.Auth.Authenticator,
2247 type: :module,
2248 suggestions: [Pleroma.Web.Auth.PleromaAuthenticator, Pleroma.Web.Auth.LDAPAuthenticator]
2249 }
2250 ]
2251 },
2252 %{
2253 group: :pleroma,
2254 key: :ldap,
2255 type: :group,
2256 description:
2257 "Use LDAP for user authentication. When a user logs in to the Pleroma instance, the name and password" <>
2258 " will be verified by trying to authenticate (bind) to a LDAP server." <>
2259 " If a user exists in the LDAP directory but there is no account with the same name yet on the" <>
2260 " Pleroma instance then a new Pleroma account will be created with the same name as the LDAP user name.",
2261 children: [
2262 %{
2263 key: :enabled,
2264 type: :boolean,
2265 description: "Enables LDAP authentication"
2266 },
2267 %{
2268 key: :host,
2269 type: :string,
2270 description: "LDAP server hostname",
2271 suggestions: ["localhosts"]
2272 },
2273 %{
2274 key: :port,
2275 type: :integer,
2276 description: "LDAP port, e.g. 389 or 636",
2277 suggestions: [389, 636]
2278 },
2279 %{
2280 key: :ssl,
2281 label: "SSL",
2282 type: :boolean,
2283 description: "`True` to use SSL, usually implies the port 636"
2284 },
2285 %{
2286 key: :sslopts,
2287 label: "SSL options",
2288 type: :keyword,
2289 description: "Additional SSL options",
2290 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2291 children: [
2292 %{
2293 key: :cacertfile,
2294 type: :string,
2295 description: "Path to file with PEM encoded cacerts",
2296 suggestions: ["path/to/file/with/PEM/cacerts"]
2297 },
2298 %{
2299 key: :verify,
2300 type: :atom,
2301 description: "Type of cert verification",
2302 suggestions: [:verify_peer]
2303 }
2304 ]
2305 },
2306 %{
2307 key: :tls,
2308 label: "TLS",
2309 type: :boolean,
2310 description: "`True` to start TLS, usually implies the port 389"
2311 },
2312 %{
2313 key: :tlsopts,
2314 label: "TLS options",
2315 type: :keyword,
2316 description: "Additional TLS options",
2317 suggestions: [cacertfile: "path/to/file/with/PEM/cacerts", verify: :verify_peer],
2318 children: [
2319 %{
2320 key: :cacertfile,
2321 type: :string,
2322 description: "Path to file with PEM encoded cacerts",
2323 suggestions: ["path/to/file/with/PEM/cacerts"]
2324 },
2325 %{
2326 key: :verify,
2327 type: :atom,
2328 description: "Type of cert verification",
2329 suggestions: [:verify_peer]
2330 }
2331 ]
2332 },
2333 %{
2334 key: :base,
2335 type: :string,
2336 description: "LDAP base, e.g. \"dc=example,dc=com\"",
2337 suggestions: ["dc=example,dc=com"]
2338 },
2339 %{
2340 key: :uid,
2341 type: :string,
2342 description:
2343 "LDAP attribute name to authenticate the user, e.g. when \"cn\", the filter will be \"cn=username,base\"",
2344 suggestions: ["cn"]
2345 }
2346 ]
2347 },
2348 %{
2349 group: :pleroma,
2350 key: :auth,
2351 type: :group,
2352 description: "Authentication / authorization settings",
2353 children: [
2354 %{
2355 key: :enforce_oauth_admin_scope_usage,
2356 type: :boolean,
2357 description:
2358 "OAuth admin scope requirement toggle. " <>
2359 "If enabled, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token " <>
2360 "(client app must support admin scopes). If `false` and token doesn't have admin scope(s)," <>
2361 "`is_admin` user flag grants access to admin-specific actions."
2362 },
2363 %{
2364 key: :auth_template,
2365 type: :string,
2366 description:
2367 "Authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.ee`.",
2368 suggestions: ["show.html"]
2369 },
2370 %{
2371 key: :oauth_consumer_template,
2372 type: :string,
2373 description:
2374 "OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to" <>
2375 " `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`.",
2376 suggestions: ["consumer.html"]
2377 },
2378 %{
2379 key: :oauth_consumer_strategies,
2380 type: {:list, :string},
2381 description:
2382 "The list of enabled OAuth consumer strategies; by default it's set by OAUTH_CONSUMER_STRATEGIES environment variable." <>
2383 " Each entry in this space-delimited string should be of format \"strategy\" or \"strategy:dependency\"" <>
2384 " (e.g. twitter or keycloak:ueberauth_keycloak_strategy in case dependency is named differently than ueberauth_<strategy>).",
2385 suggestions: ["twitter", "keycloak:ueberauth_keycloak_strategy"]
2386 }
2387 ]
2388 },
2389 %{
2390 group: :pleroma,
2391 key: :email_notifications,
2392 type: :group,
2393 description: "Email notifications settings",
2394 children: [
2395 %{
2396 key: :digest,
2397 type: :map,
2398 description:
2399 "emails of \"what you've missed\" for users who have been inactive for a while",
2400 suggestions: [
2401 %{
2402 active: false,
2403 schedule: "0 0 * * 0",
2404 interval: 7,
2405 inactivity_threshold: 7
2406 }
2407 ],
2408 children: [
2409 %{
2410 key: :active,
2411 type: :boolean,
2412 description: "Globally enable or disable digest emails"
2413 },
2414 %{
2415 key: :schedule,
2416 type: :string,
2417 description:
2418 "When to send digest email, in crontab format. \"0 0 0\" is the default, meaning \"once a week at midnight on Sunday morning\".",
2419 suggestions: ["0 0 * * 0"]
2420 },
2421 %{
2422 key: :interval,
2423 type: :integer,
2424 description: "Minimum interval between digest emails to one user",
2425 suggestions: [7]
2426 },
2427 %{
2428 key: :inactivity_threshold,
2429 type: :integer,
2430 description: "Minimum user inactivity threshold",
2431 suggestions: [7]
2432 }
2433 ]
2434 }
2435 ]
2436 },
2437 %{
2438 group: :pleroma,
2439 key: Pleroma.Emails.UserEmail,
2440 type: :group,
2441 description: "Email template settings",
2442 children: [
2443 %{
2444 key: :logo,
2445 type: :string,
2446 description: "A path to a custom logo. Set it to `nil` to use the default Pleroma logo.",
2447 suggestions: ["some/path/logo.png"]
2448 },
2449 %{
2450 key: :styling,
2451 type: :map,
2452 description: "a map with color settings for email templates.",
2453 suggestions: [
2454 %{
2455 link_color: "#d8a070",
2456 background_color: "#2C3645",
2457 content_background_color: "#1B2635",
2458 header_color: "#d8a070",
2459 text_color: "#b9b9ba",
2460 text_muted_color: "#b9b9ba"
2461 }
2462 ],
2463 children: [
2464 %{
2465 key: :link_color,
2466 type: :string,
2467 suggestions: ["#d8a070"]
2468 },
2469 %{
2470 key: :background_color,
2471 type: :string,
2472 suggestions: ["#2C3645"]
2473 },
2474 %{
2475 key: :content_background_color,
2476 type: :string,
2477 suggestions: ["#1B2635"]
2478 },
2479 %{
2480 key: :header_color,
2481 type: :string,
2482 suggestions: ["#d8a070"]
2483 },
2484 %{
2485 key: :text_color,
2486 type: :string,
2487 suggestions: ["#b9b9ba"]
2488 },
2489 %{
2490 key: :text_muted_color,
2491 type: :string,
2492 suggestions: ["#b9b9ba"]
2493 }
2494 ]
2495 }
2496 ]
2497 },
2498 %{
2499 group: :pleroma,
2500 key: :oauth2,
2501 type: :group,
2502 description: "Configure OAuth 2 provider capabilities",
2503 children: [
2504 %{
2505 key: :token_expires_in,
2506 type: :integer,
2507 description: "The lifetime in seconds of the access token",
2508 suggestions: [600]
2509 },
2510 %{
2511 key: :issue_new_refresh_token,
2512 type: :boolean,
2513 description:
2514 "Keeps old refresh token or generate new refresh token when to obtain an access token"
2515 },
2516 %{
2517 key: :clean_expired_tokens,
2518 type: :boolean,
2519 description: "Enable a background job to clean expired oauth tokens. Default: `false`."
2520 }
2521 ]
2522 },
2523 %{
2524 group: :pleroma,
2525 key: :emoji,
2526 type: :group,
2527 children: [
2528 %{
2529 key: :shortcode_globs,
2530 type: {:list, :string},
2531 description: "Location of custom emoji files. * can be used as a wildcard.",
2532 suggestions: ["/emoji/custom/**/*.png"]
2533 },
2534 %{
2535 key: :pack_extensions,
2536 type: {:list, :string},
2537 description:
2538 "A list of file extensions for emojis, when no emoji.txt for a pack is present",
2539 suggestions: [".png", ".gif"]
2540 },
2541 %{
2542 key: :groups,
2543 type: {:keyword, :string, {:list, :string}},
2544 description:
2545 "Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the group name" <>
2546 " and the value is the location or array of locations. * can be used as a wildcard.",
2547 suggestions: [
2548 Custom: ["/emoji/*.png", "/emoji/**/*.png"]
2549 ]
2550 },
2551 %{
2552 key: :default_manifest,
2553 type: :string,
2554 description:
2555 "Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download." <>
2556 " Currently only one manifest can be added (no arrays).",
2557 suggestions: ["https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"]
2558 },
2559 %{
2560 key: :shared_pack_cache_seconds_per_file,
2561 label: "Shared pack cache s/file",
2562 type: :integer,
2563 descpiption:
2564 "When an emoji pack is shared, the archive is created and cached in memory" <>
2565 " for this amount of seconds multiplied by the number of files.",
2566 suggestions: [60]
2567 }
2568 ]
2569 },
2570 %{
2571 group: :pleroma,
2572 key: :database,
2573 type: :group,
2574 description: "Database related settings",
2575 children: [
2576 %{
2577 key: :rum_enabled,
2578 type: :boolean,
2579 description: "If RUM indexes should be used. Default: `false`"
2580 }
2581 ]
2582 },
2583 %{
2584 group: :pleroma,
2585 key: :rate_limit,
2586 type: :group,
2587 description:
2588 "Rate limit settings. This is an advanced feature enabled only for :authentication by default.",
2589 children: [
2590 %{
2591 key: :search,
2592 type: [:tuple, {:list, :tuple}],
2593 description: "For the search requests (account & status search etc.)",
2594 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2595 },
2596 %{
2597 key: :app_account_creation,
2598 type: [:tuple, {:list, :tuple}],
2599 description: "For registering user accounts from the same IP address",
2600 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2601 },
2602 %{
2603 key: :relations_actions,
2604 type: [:tuple, {:list, :tuple}],
2605 description: "For actions on relations with all users (follow, unfollow)",
2606 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2607 },
2608 %{
2609 key: :relation_id_action,
2610 type: [:tuple, {:list, :tuple}],
2611 description: "For actions on relation with a specific user (follow, unfollow)",
2612 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2613 },
2614 %{
2615 key: :statuses_actions,
2616 type: [:tuple, {:list, :tuple}],
2617 description:
2618 "For create / delete / fav / unfav / reblog / unreblog actions on any statuses",
2619 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2620 },
2621 %{
2622 key: :status_id_action,
2623 type: [:tuple, {:list, :tuple}],
2624 description:
2625 "For fav / unfav or reblog / unreblog actions on the same status by the same user",
2626 suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
2627 },
2628 %{
2629 key: :authentication,
2630 type: [:tuple, {:list, :tuple}],
2631 description: "For authentication create / password check / user existence check requests",
2632 suggestions: [{60_000, 15}]
2633 }
2634 ]
2635 },
2636 %{
2637 group: :esshd,
2638 type: :group,
2639 description:
2640 "Before enabling this you must add :esshd to mix.exs as one of the extra_applications " <>
2641 "and generate host keys in your priv dir with ssh-keygen -m PEM -N \"\" -b 2048 -t rsa -f ssh_host_rsa_key",
2642 children: [
2643 %{
2644 key: :enabled,
2645 type: :boolean,
2646 description: "Enables SSH"
2647 },
2648 %{
2649 key: :priv_dir,
2650 type: :string,
2651 description: "Dir with SSH keys",
2652 suggestions: ["/some/path/ssh_keys"]
2653 },
2654 %{
2655 key: :handler,
2656 type: :string,
2657 description: "Handler module",
2658 suggestions: ["Pleroma.BBS.Handler"]
2659 },
2660 %{
2661 key: :port,
2662 type: :integer,
2663 description: "Port to connect",
2664 suggestions: [10_022]
2665 },
2666 %{
2667 key: :password_authenticator,
2668 type: :string,
2669 description: "Authenticator module",
2670 suggestions: ["Pleroma.BBS.Authenticator"]
2671 }
2672 ]
2673 },
2674 %{
2675 group: :mime,
2676 type: :group,
2677 description: "Mime types",
2678 children: [
2679 %{
2680 key: :types,
2681 type: :map,
2682 suggestions: [
2683 %{
2684 "application/xml" => ["xml"],
2685 "application/xrd+xml" => ["xrd+xml"],
2686 "application/jrd+json" => ["jrd+json"],
2687 "application/activity+json" => ["activity+json"],
2688 "application/ld+json" => ["activity+json"]
2689 }
2690 ],
2691 children: [
2692 %{
2693 key: "application/xml",
2694 type: {:list, :string},
2695 suggestions: ["xml"]
2696 },
2697 %{
2698 key: "application/xrd+xml",
2699 type: {:list, :string},
2700 suggestions: ["xrd+xml"]
2701 },
2702 %{
2703 key: "application/jrd+json",
2704 type: {:list, :string},
2705 suggestions: ["jrd+json"]
2706 },
2707 %{
2708 key: "application/activity+json",
2709 type: {:list, :string},
2710 suggestions: ["activity+json"]
2711 },
2712 %{
2713 key: "application/ld+json",
2714 type: {:list, :string},
2715 suggestions: ["activity+json"]
2716 }
2717 ]
2718 }
2719 ]
2720 },
2721 %{
2722 group: :tesla,
2723 type: :group,
2724 description: "Tesla settings",
2725 children: [
2726 %{
2727 key: :adapter,
2728 type: :module,
2729 description: "Tesla adapter",
2730 suggestions: [Tesla.Adapter.Hackney]
2731 }
2732 ]
2733 },
2734 %{
2735 group: :pleroma,
2736 key: :chat,
2737 type: :group,
2738 description: "Pleroma chat settings",
2739 children: [
2740 %{
2741 key: :enabled,
2742 type: :boolean
2743 }
2744 ]
2745 },
2746 %{
2747 group: :prometheus,
2748 key: Pleroma.Web.Endpoint.MetricsExporter,
2749 type: :group,
2750 description: "Prometheus settings",
2751 children: [
2752 %{
2753 key: :path,
2754 type: :string,
2755 description: "API endpoint with metrics",
2756 suggestions: ["/api/pleroma/app_metrics"]
2757 }
2758 ]
2759 },
2760 %{
2761 group: :http_signatures,
2762 type: :group,
2763 description: "HTTP Signatures settings",
2764 children: [
2765 %{
2766 key: :adapter,
2767 type: :module,
2768 suggestions: [Pleroma.Signature]
2769 }
2770 ]
2771 },
2772 %{
2773 group: :pleroma,
2774 key: :http,
2775 type: :group,
2776 description: "HTTP settings",
2777 children: [
2778 %{
2779 key: :proxy_url,
2780 label: "Proxy URL",
2781 type: [:string, :tuple],
2782 description: "Proxy URL",
2783 suggestions: ["localhost:9020", {:socks5, :localhost, 3090}]
2784 },
2785 %{
2786 key: :send_user_agent,
2787 type: :boolean
2788 },
2789 %{
2790 key: :user_agent,
2791 type: [:string, :atom],
2792 description:
2793 "What user agent to use. Must be a string or an atom `:default`. Default value is `:default`.",
2794 suggestions: ["Pleroma", :default]
2795 },
2796 %{
2797 key: :adapter,
2798 type: :keyword,
2799 description: "Adapter specific options",
2800 suggestions: [],
2801 children: [
2802 %{
2803 key: :ssl_options,
2804 type: :keyword,
2805 label: "SSL Options",
2806 description: "SSL options for HTTP adapter",
2807 children: [
2808 %{
2809 key: :versions,
2810 type: {:list, :atom},
2811 description: "List of TLS version to use",
2812 suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
2813 }
2814 ]
2815 }
2816 ]
2817 }
2818 ]
2819 },
2820 %{
2821 group: :pleroma,
2822 key: :markup,
2823 type: :group,
2824 children: [
2825 %{
2826 key: :allow_inline_images,
2827 type: :boolean
2828 },
2829 %{
2830 key: :allow_headings,
2831 type: :boolean
2832 },
2833 %{
2834 key: :allow_tables,
2835 type: :boolean
2836 },
2837 %{
2838 key: :allow_fonts,
2839 type: :boolean
2840 },
2841 %{
2842 key: :scrub_policy,
2843 type: {:list, :module},
2844 suggestions: [Pleroma.HTML.Transform.MediaProxy, Pleroma.HTML.Scrubber.Default]
2845 }
2846 ]
2847 },
2848 %{
2849 group: :pleroma,
2850 key: :user,
2851 type: :group,
2852 children: [
2853 %{
2854 key: :deny_follow_blocked,
2855 type: :boolean
2856 }
2857 ]
2858 },
2859 %{
2860 group: :pleroma,
2861 key: :mrf_normalize_markup,
2862 label: "MRF normalize markup",
2863 description: "MRF NormalizeMarkup settings. Scrub configured hypertext markup.",
2864 type: :group,
2865 children: [
2866 %{
2867 key: :scrub_policy,
2868 type: :module,
2869 suggestions: [Pleroma.HTML.Scrubber.Default]
2870 }
2871 ]
2872 },
2873 %{
2874 group: :pleroma,
2875 key: Pleroma.User,
2876 type: :group,
2877 children: [
2878 %{
2879 key: :restricted_nicknames,
2880 type: {:list, :string},
2881 suggestions: [
2882 ".well-known",
2883 "~",
2884 "about",
2885 "activities",
2886 "api",
2887 "auth",
2888 "check_password",
2889 "dev",
2890 "friend-requests",
2891 "inbox",
2892 "internal",
2893 "main",
2894 "media",
2895 "nodeinfo",
2896 "notice",
2897 "oauth",
2898 "objects",
2899 "ostatus_subscribe",
2900 "pleroma",
2901 "proxy",
2902 "push",
2903 "registration",
2904 "relay",
2905 "settings",
2906 "status",
2907 "tag",
2908 "user-search",
2909 "user_exists",
2910 "users",
2911 "web"
2912 ]
2913 }
2914 ]
2915 },
2916 %{
2917 group: :cors_plug,
2918 type: :group,
2919 children: [
2920 %{
2921 key: :max_age,
2922 type: :integer,
2923 suggestions: [86_400]
2924 },
2925 %{
2926 key: :methods,
2927 type: {:list, :string},
2928 suggestions: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"]
2929 },
2930 %{
2931 key: :expose,
2932 type: {:list, :string},
2933 suggestions: [
2934 "Link",
2935 "X-RateLimit-Reset",
2936 "X-RateLimit-Limit",
2937 "X-RateLimit-Remaining",
2938 "X-Request-Id",
2939 "Idempotency-Key"
2940 ]
2941 },
2942 %{
2943 key: :credentials,
2944 type: :boolean
2945 },
2946 %{
2947 key: :headers,
2948 type: {:list, :string},
2949 suggestions: ["Authorization", "Content-Type", "Idempotency-Key"]
2950 }
2951 ]
2952 },
2953 %{
2954 group: :pleroma,
2955 key: Pleroma.Plugs.RemoteIp,
2956 type: :group,
2957 description: """
2958 `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
2959 **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
2960 """,
2961 children: [
2962 %{
2963 key: :enabled,
2964 type: :boolean,
2965 description: "Enable/disable the plug. Default: `false`."
2966 },
2967 %{
2968 key: :headers,
2969 type: {:list, :string},
2970 description:
2971 "A list of strings naming the `req_headers` to use when deriving the `remote_ip`. Order does not matter. Default: `~w[forwarded x-forwarded-for x-client-ip x-real-ip]`."
2972 },
2973 %{
2974 key: :proxies,
2975 type: {:list, :string},
2976 description:
2977 "A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Default: `[]`."
2978 },
2979 %{
2980 key: :reserved,
2981 type: {:list, :string},
2982 description:
2983 "Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network)."
2984 }
2985 ]
2986 },
2987 %{
2988 group: :pleroma,
2989 key: :web_cache_ttl,
2990 type: :group,
2991 description:
2992 "The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.",
2993 children: [
2994 %{
2995 key: :activity_pub,
2996 type: :integer,
2997 description:
2998 "Activity pub routes (except question activities). Default: `nil` (no expiration).",
2999 suggestions: [30_000, nil]
3000 },
3001 %{
3002 key: :activity_pub_question,
3003 type: :integer,
3004 description: "Activity pub routes (question activities). Default: `30_000` (30 seconds).",
3005 suggestions: [30_000]
3006 }
3007 ]
3008 },
3009 %{
3010 group: :pleroma,
3011 key: :static_fe,
3012 type: :group,
3013 description:
3014 "Render profiles and posts using server-generated HTML that is viewable without using JavaScript.",
3015 children: [
3016 %{
3017 key: :enabled,
3018 type: :boolean,
3019 description: "Enables the rendering of static HTML. Defaults to `false`."
3020 }
3021 ]
3022 },
3023 %{
3024 group: :pleroma,
3025 key: :feed,
3026 type: :group,
3027 description: "Configure feed rendering.",
3028 children: [
3029 %{
3030 key: :post_title,
3031 type: :map,
3032 description: "Configure title rendering.",
3033 children: [
3034 %{
3035 key: :max_length,
3036 type: :integer,
3037 description: "Maximum number of characters before truncating title.",
3038 suggestions: [100]
3039 },
3040 %{
3041 key: :omission,
3042 type: :string,
3043 description: "Replacement which will be used after truncating string.",
3044 suggestions: ["..."]
3045 }
3046 ]
3047 }
3048 ]
3049 },
3050 %{
3051 group: :pleroma,
3052 key: :mrf_object_age,
3053 type: :group,
3054 description: "Rejects or delists posts based on their age when received.",
3055 children: [
3056 %{
3057 key: :threshold,
3058 type: :integer,
3059 description: "Required age (in seconds) of a post before actions are taken.",
3060 suggestions: [172_800]
3061 },
3062 %{
3063 key: :actions,
3064 type: {:list, :atom},
3065 description:
3066 "A list of actions to apply to the post. `:delist` removes the post from public timelines; " <>
3067 "`:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines; " <>
3068 "`:reject` rejects the message entirely",
3069 suggestions: [:delist, :strip_followers, :reject]
3070 }
3071 ]
3072 },
3073 %{
3074 group: :pleroma,
3075 key: :modules,
3076 type: :group,
3077 description: "Custom Runtime Modules.",
3078 children: [
3079 %{
3080 key: :runtime_dir,
3081 type: :string,
3082 description: "A path to custom Elixir modules (such as MRF policies)."
3083 }
3084 ]
3085 },
3086 %{
3087 group: :pleroma,
3088 type: :group,
3089 description: "Allow instance configuration from database.",
3090 children: [
3091 %{
3092 key: :configurable_from_database,
3093 type: :boolean,
3094 description:
3095 "Allow transferring configuration to DB with the subsequent customization from Admin api. Defaults to `false`"
3096 }
3097 ]
3098 }
3099 ]