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