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