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