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