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