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