description.exs 97.2 KB
Newer Older
1
import Config
Alexander Strizhakov's avatar
Alexander Strizhakov committed
2
3
4
5
6
7
8
9
10
11
12
13

websocket_config = [
  path: "/websocket",
  serializer: [
    {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
    {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
  ],
  timeout: 60_000,
  transport_log: false,
  compress: false
]

lain's avatar
lain committed
14
installed_frontend_options = [
lain's avatar
lain committed
15
16
  %{
    key: "name",
17
    label: "Name",
lain's avatar
lain committed
18
    type: :string,
19
    description:
lain's avatar
lain committed
20
      "Name of the installed frontend. Valid config must include both `Name` and `Reference` values."
lain's avatar
lain committed
21
22
23
  },
  %{
    key: "ref",
24
    label: "Reference",
lain's avatar
lain committed
25
    type: :string,
26
    description:
lain's avatar
lain committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
      "Reference of the installed frontend to be used. Valid config must include both `Name` and `Reference` values."
  }
]

frontend_options = [
  %{
    key: "name",
    label: "Name",
    type: :string,
    description: "Name of the frontend."
  },
  %{
    key: "ref",
    label: "Reference",
    type: :string,
    description: "Reference of the frontend to be used."
lain's avatar
lain committed
43
44
45
  },
  %{
    key: "git",
Angelina Filippova's avatar
Angelina Filippova committed
46
    label: "Git Repository URL",
lain's avatar
lain committed
47
48
49
50
51
    type: :string,
    description: "URL of the git repository of the frontend"
  },
  %{
    key: "build_url",
52
    label: "Build URL",
lain's avatar
lain committed
53
54
55
56
57
58
59
    type: :string,
    description:
      "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`.",
    example: "https://some.url/builds/${ref}.zip"
  },
  %{
    key: "build_dir",
Angelina Filippova's avatar
Angelina Filippova committed
60
    label: "Build directory",
lain's avatar
lain committed
61
62
    type: :string,
    description: "The directory inside the zip file "
63
64
65
66
67
68
  },
  %{
    key: "custom-http-headers",
    label: "Custom HTTP headers",
    type: {:list, :string},
    description: "The custom HTTP headers for the frontend"
lain's avatar
lain committed
69
70
71
  }
]

Alexander Strizhakov's avatar
Alexander Strizhakov committed
72
73
74
75
76
77
78
79
80
81
82
config :pleroma, :config_description, [
  %{
    group: :pleroma,
    key: Pleroma.Upload,
    type: :group,
    description: "Upload general settings",
    children: [
      %{
        key: :uploader,
        type: :module,
        description: "Module which will be used for uploads",
83
        suggestions: {:list_behaviour_implementations, Pleroma.Uploaders.Uploader}
Alexander Strizhakov's avatar
Alexander Strizhakov committed
84
85
86
87
      },
      %{
        key: :filters,
        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}
Alexander Strizhakov's avatar
Alexander Strizhakov committed
91
92
93
94
      },
      %{
        key: :link_name,
        type: :boolean,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
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`."
Alexander Strizhakov's avatar
Alexander Strizhakov committed
97
98
99
      },
      %{
        key: :base_url,
100
        label: "Base URL",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
101
        type: :string,
feld's avatar
feld committed
102
103
        description:
          "Base URL for the uploads. Required if you use a CDN or host attachments under a different domain.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
104
105
106
107
108
109
110
        suggestions: [
          "https://cdn-host.com"
        ]
      },
      %{
        key: :proxy_remote,
        type: :boolean,
feld's avatar
feld committed
111
112
113
114
        description: """
        Proxy requests to the remote uploader.\n
        Useful if media upload endpoint is not internet accessible.
        """
Roman Chvanikov's avatar
Roman Chvanikov committed
115
116
117
118
119
      },
      %{
        key: :filename_display_max_length,
        type: :integer,
        description: "Set max length of a filename to display. 0 = no limit. Default: 30"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
120
121
122
123
124
125
126
127
128
129
130
131
      }
    ]
  },
  %{
    group: :pleroma,
    key: Pleroma.Uploaders.Local,
    type: :group,
    description: "Local uploader-related settings",
    children: [
      %{
        key: :uploads,
        type: :string,
132
        description: "Path where user's uploads will be saved",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
133
134
135
136
137
138
139
140
141
142
143
144
145
146
        suggestions: [
          "uploads"
        ]
      }
    ]
  },
  %{
    group: :pleroma,
    key: Pleroma.Uploaders.S3,
    type: :group,
    description: "S3 uploader-related settings",
    children: [
      %{
        key: :bucket,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
147
        type: :string,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
        description: "S3 bucket",
        suggestions: [
          "bucket"
        ]
      },
      %{
        key: :bucket_namespace,
        type: :string,
        description: "S3 bucket namespace",
        suggestions: ["pleroma"]
      },
      %{
        key: :truncated_namespace,
        type: :string,
        description:
          "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
168
169
170
      },
      %{
        key: :streaming_enabled,
        type: :boolean,
        description:
          "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."
Alexander Strizhakov's avatar
Alexander Strizhakov committed
171
172
173
174
175
176
177
178
179
180
181
182
      }
    ]
  },
  %{
    group: :pleroma,
    key: Pleroma.Upload.Filter.Mogrify,
    type: :group,
    description: "Uploads mogrify filter settings",
    children: [
      %{
        key: :args,
        type: [:string, {:list, :string}, {:list, :tuple}],
183
184
        description:
          "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.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
186
187
        suggestions: [
          "strip",
188
189
          "auto-orient",
          {"implode", "1"}
Alexander Strizhakov's avatar
Alexander Strizhakov committed
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
        ]
      }
    ]
  },
  %{
    group: :pleroma,
    key: Pleroma.Upload.Filter.AnonymizeFilename,
    type: :group,
    description: "Filter replaces the filename of the upload",
    children: [
      %{
        key: :text,
        type: :string,
        description:
          "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}.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
206
        suggestions: [
207
          "custom-file-name.{extension}"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
208
209
210
211
212
213
214
215
216
217
        ]
      }
    ]
  },
  %{
    group: :pleroma,
    key: Pleroma.Emails.Mailer,
    type: :group,
    description: "Mailer-related settings",
    children: [
218
219
      %{
        key: :enabled,
feld's avatar
feld committed
220
        label: "Mailer Enabled",
feld's avatar
feld committed
221
        type: :boolean
222
      },
Alexander Strizhakov's avatar
Alexander Strizhakov committed
223
224
225
226
      %{
        key: :adapter,
        type: :module,
        description:
feld's avatar
feld committed
227
          "One of the mail adapters listed in [Swoosh documentation](https://hexdocs.pm/swoosh/Swoosh.html#module-adapters)",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
228
        suggestions: [
feld's avatar
feld committed
229
230
231
          Swoosh.Adapters.AmazonSES,
          Swoosh.Adapters.Dyn,
          Swoosh.Adapters.Gmail,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
232
233
          Swoosh.Adapters.Mailgun,
          Swoosh.Adapters.Mailjet,
feld's avatar
feld committed
234
          Swoosh.Adapters.Mandrill,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
235
          Swoosh.Adapters.Postmark,
feld's avatar
feld committed
236
237
238
          Swoosh.Adapters.SMTP,
          Swoosh.Adapters.Sendgrid,
          Swoosh.Adapters.Sendmail,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
239
          Swoosh.Adapters.SocketLabs,
feld's avatar
feld committed
240
          Swoosh.Adapters.SparkPost
Alexander Strizhakov's avatar
Alexander Strizhakov committed
241
242
243
244
245
246
        ]
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SMTP},
        key: :relay,
        type: :string,
247
248
249
250
251
252
253
        description: "Hostname or IP address",
        suggestions: ["smtp.example.com"]
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SMTP},
        key: :port,
        type: :integer,
feld's avatar
feld committed
254
255
        description: "SMTP port",
        suggestions: ["1025"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
256
257
258
259
260
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SMTP},
        key: :username,
        type: :string,
feld's avatar
feld committed
261
        description: "SMTP AUTH username",
262
        suggestions: ["user@example.com"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
263
264
265
266
267
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SMTP},
        key: :password,
        type: :string,
feld's avatar
feld committed
268
        description: "SMTP AUTH password",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
269
270
271
272
273
        suggestions: ["password"]
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SMTP},
        key: :ssl,
feld's avatar
feld committed
274
        label: "Use SSL",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
275
        type: :boolean,
feld's avatar
feld committed
276
        description: "Use Implicit SSL/TLS. e.g. port 465"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
277
278
279
280
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SMTP},
        key: :tls,
feld's avatar
feld committed
281
        label: "STARTTLS Mode",
282
        type: {:dropdown, :atom},
feld's avatar
feld committed
283
        description: "Explicit TLS (STARTTLS) enforcement mode",
284
        suggestions: [:if_available, :always, :never]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
285
286
287
288
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SMTP},
        key: :auth,
feld's avatar
feld committed
289
        label: "AUTH Mode",
290
        type: {:dropdown, :atom},
feld's avatar
feld committed
291
        description: "SMTP AUTH enforcement mode",
292
        suggestions: [:if_available, :always, :never]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
293
294
295
296
297
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SMTP},
        key: :retries,
        type: :integer,
298
299
        description: "SMTP temporary (4xx) error retries",
        suggestions: [1]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
300
301
302
303
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Sendgrid},
        key: :api_key,
feld's avatar
feld committed
304
        label: "SendGrid API Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
305
        type: :string,
feld's avatar
feld committed
306
        suggestions: ["YOUR_API_KEY"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Sendmail},
        key: :cmd_path,
        type: :string,
        suggestions: ["/usr/bin/sendmail"]
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Sendmail},
        key: :cmd_args,
        type: :string,
        suggestions: ["-N delay,failure,success"]
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Sendmail},
        key: :qmail,
feld's avatar
feld committed
323
        label: "Qmail compat mode",
feld's avatar
feld committed
324
        type: :boolean
Alexander Strizhakov's avatar
Alexander Strizhakov committed
325
326
327
328
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Mandrill},
        key: :api_key,
feld's avatar
feld committed
329
        label: "Mandrill API Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
330
        type: :string,
feld's avatar
feld committed
331
        suggestions: ["YOUR_API_KEY"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
332
333
334
335
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Mailgun},
        key: :api_key,
feld's avatar
feld committed
336
        label: "Mailgun API Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
337
        type: :string,
feld's avatar
feld committed
338
        suggestions: ["YOUR_API_KEY"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
339
340
341
342
343
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Mailgun},
        key: :domain,
        type: :string,
feld's avatar
feld committed
344
        suggestions: ["YOUR_DOMAIN_NAME"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
345
346
347
348
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Mailjet},
        key: :api_key,
feld's avatar
feld committed
349
        label: "MailJet Public API Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
350
        type: :string,
feld's avatar
feld committed
351
        suggestions: ["MJ_APIKEY_PUBLIC"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
352
353
354
355
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Mailjet},
        key: :secret,
feld's avatar
feld committed
356
        label: "MailJet Private API Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
357
        type: :string,
feld's avatar
feld committed
358
        suggestions: ["MJ_APIKEY_PRIVATE"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
359
360
361
362
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Postmark},
        key: :api_key,
feld's avatar
feld committed
363
        label: "Postmark API Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
364
        type: :string,
feld's avatar
feld committed
365
        suggestions: ["X-Postmark-Server-Token"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
366
367
368
369
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SparkPost},
        key: :api_key,
feld's avatar
feld committed
370
        label: "SparkPost API key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
371
        type: :string,
feld's avatar
feld committed
372
        suggestions: ["YOUR_API_KEY"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
373
374
375
376
377
378
379
380
381
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SparkPost},
        key: :endpoint,
        type: :string,
        suggestions: ["https://api.sparkpost.com/api/v1"]
      },
      %{
        group: {:subgroup, Swoosh.Adapters.AmazonSES},
feld's avatar
feld committed
382
383
        key: :access_key,
        label: "AWS Access Key",
384
        type: :string,
feld's avatar
feld committed
385
        suggestions: ["AWS_ACCESS_KEY"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
386
387
388
      },
      %{
        group: {:subgroup, Swoosh.Adapters.AmazonSES},
feld's avatar
feld committed
389
390
        key: :secret,
        label: "AWS Secret Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
391
        type: :string,
feld's avatar
feld committed
392
        suggestions: ["AWS_SECRET_KEY"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
393
394
395
      },
      %{
        group: {:subgroup, Swoosh.Adapters.AmazonSES},
feld's avatar
feld committed
396
397
        key: :region,
        label: "AWS Region",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
398
        type: :string,
feld's avatar
feld committed
399
        suggestions: ["us-east-1", "us-east-2"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
400
401
402
403
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Dyn},
        key: :api_key,
feld's avatar
feld committed
404
        label: "Dyn API Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
405
        type: :string,
feld's avatar
feld committed
406
        suggestions: ["apikey"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
407
408
409
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SocketLabs},
feld's avatar
feld committed
410
411
        key: :api_key,
        label: "SocketLabs API Key",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
412
        type: :string,
feld's avatar
feld committed
413
        suggestions: ["INJECTION_API_KEY"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
414
415
416
      },
      %{
        group: {:subgroup, Swoosh.Adapters.SocketLabs},
feld's avatar
feld committed
417
418
        key: :server_id,
        label: "Server ID",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
419
        type: :string,
feld's avatar
feld committed
420
        suggestions: ["SERVER_ID"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
421
422
423
424
      },
      %{
        group: {:subgroup, Swoosh.Adapters.Gmail},
        key: :access_token,
feld's avatar
feld committed
425
        label: "GMail API Access Token",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
426
        type: :string,
feld's avatar
feld committed
427
        suggestions: ["GMAIL_API_ACCESS_TOKEN"]
Alexander Strizhakov's avatar
Alexander Strizhakov committed
428
429
430
      }
    ]
  },
Alexander Strizhakov's avatar
Alexander Strizhakov committed
431
432
433
  %{
    group: :pleroma,
    key: :uri_schemes,
434
    label: "URI Schemes",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
435
436
437
438
439
440
441
442
    type: :group,
    description: "URI schemes related settings",
    children: [
      %{
        key: :valid_schemes,
        type: {:list, :string},
        description: "List of the scheme part that is considered valid to be an URL",
        suggestions: [
443
444
445
446
447
          "https",
          "http",
          "dat",
          "dweb",
          "gopher",
DYM's avatar
DYM committed
448
          "hyper",
449
450
451
452
453
454
455
456
457
          "ipfs",
          "ipns",
          "irc",
          "ircs",
          "magnet",
          "mailto",
          "mumble",
          "ssb",
          "xmpp"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
458
459
460
461
        ]
      }
    ]
  },
462
463
  %{
    group: :pleroma,
464
    key: :features,
465
    type: :group,
466
    description: "Customizable features",
467
468
469
    children: [
      %{
        key: :improved_hashtag_timeline,
470
        type: {:dropdown, :atom},
471
        description:
472
473
          "Setting to force toggle / force disable improved hashtags timeline. `:enabled` forces hashtags to be fetched from `hashtags` table for hashtags timeline. `:disabled` forces object-embedded hashtags to be used (slower). Keep it `:auto` for automatic behaviour (it is auto-set to `:enabled` [unless overridden] when HashtagsTableMigrator completes).",
        suggestions: [:auto, :enabled, :disabled]
474
475
476
      }
    ]
  },
477
478
479
480
481
482
  %{
    group: :pleroma,
    key: :populate_hashtags_table,
    type: :group,
    description: "`populate_hashtags_table` background migration settings",
    children: [
483
484
485
486
      %{
        key: :fault_rate_allowance,
        type: :float,
        description:
487
          "Max accepted rate of objects that failed in the migration. Any value from 0.0 which tolerates no errors to 1.0 which will enable the feature even if hashtags transfer failed for all records.",
488
489
        suggestions: [0.01]
      },
490
491
492
493
494
495
496
497
      %{
        key: :sleep_interval_ms,
        type: :integer,
        description:
          "Sleep interval between each chunk of processed records in order to decrease the load on the system (defaults to 0 and should be keep default on most instances)."
      }
    ]
  },
Alexander Strizhakov's avatar
Alexander Strizhakov committed
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
  %{
    group: :pleroma,
    key: :instance,
    type: :group,
    description: "Instance-related settings",
    children: [
      %{
        key: :name,
        type: :string,
        description: "Name of the instance",
        suggestions: [
          "Pleroma"
        ]
      },
      %{
        key: :email,
514
        label: "Admin Email Address",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
515
516
517
518
519
520
521
522
        type: :string,
        description: "Email used to reach an Administrator/Moderator of the instance",
        suggestions: [
          "email@example.com"
        ]
      },
      %{
        key: :notify_email,
523
        label: "Sender Email Address",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
524
        type: :string,
525
        description: "Envelope FROM address for mail sent via Pleroma",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
526
527
528
529
530
531
532
        suggestions: [
          "notify@example.com"
        ]
      },
      %{
        key: :description,
        type: :string,
feld's avatar
feld committed
533
534
        description:
          "The instance's description. It can be seen in nodeinfo and `/api/v1/instance`",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
535
536
537
538
539
540
541
542
543
544
545
546
        suggestions: [
          "Very cool instance"
        ]
      },
      %{
        key: :limit,
        type: :integer,
        description: "Posts character limit (CW/Subject included in the counter)",
        suggestions: [
          5_000
        ]
      },
547
548
549
550
551
552
553
554
      %{
        key: :chat_limit,
        type: :integer,
        description: "Character limit of the instance chat messages",
        suggestions: [
          5_000
        ]
      },
Alexander Strizhakov's avatar
Alexander Strizhakov committed
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
      %{
        key: :remote_limit,
        type: :integer,
        description: "Hard character limit beyond which remote posts will be dropped",
        suggestions: [
          100_000
        ]
      },
      %{
        key: :upload_limit,
        type: :integer,
        description: "File size limit of uploads (except for avatar, background, banner)",
        suggestions: [
          16_000_000
        ]
      },
      %{
        key: :avatar_upload_limit,
        type: :integer,
        description: "File size limit of user's profile avatars",
        suggestions: [
          2_000_000
        ]
      },
      %{
        key: :background_upload_limit,
        type: :integer,
        description: "File size limit of user's profile backgrounds",
        suggestions: [
          4_000_000
        ]
      },
      %{
        key: :banner_upload_limit,
        type: :integer,
        description: "File size limit of user's profile banners",
        suggestions: [
          4_000_000
        ]
      },
      %{
        key: :poll_limits,
        type: :map,
        description: "A map with poll limits for local polls",
        suggestions: [
          %{
            max_options: 20,
            max_option_chars: 200,
            min_expiration: 0,
            max_expiration: 31_536_000
          }
        ],
        children: [
          %{
            key: :max_options,
            type: :integer,
            description: "Maximum number of options",
            suggestions: [20]
          },
          %{
            key: :max_option_chars,
            type: :integer,
            description: "Maximum number of characters per option",
            suggestions: [200]
          },
          %{
            key: :min_expiration,
            type: :integer,
            description: "Minimum expiration time (in seconds)",
            suggestions: [0]
          },
          %{
            key: :max_expiration,
            type: :integer,
            description: "Maximum expiration time (in seconds)",
            suggestions: [3600]
          }
        ]
      },
      %{
        key: :registrations_open,
        type: :boolean,
feld's avatar
feld committed
637
638
        description:
          "Enable registrations for anyone. Invitations require this setting to be disabled."
Alexander Strizhakov's avatar
Alexander Strizhakov committed
639
640
641
642
      },
      %{
        key: :invites_enabled,
        type: :boolean,
feld's avatar
feld committed
643
        description:
644
          "Enable user invitations for admins (depends on `registrations_open` being disabled)"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
645
646
647
648
      },
      %{
        key: :account_activation_required,
        type: :boolean,
649
        description: "Require users to confirm their emails before signing in"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
650
      },
651
652
653
654
655
      %{
        key: :account_approval_required,
        type: :boolean,
        description: "Require users to be manually approved by an admin before signing in"
      },
Alexander Strizhakov's avatar
Alexander Strizhakov committed
656
657
658
      %{
        key: :federating,
        type: :boolean,
659
        description: "Enable federation with other instances"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
660
661
662
      },
      %{
        key: :federation_incoming_replies_max_depth,
663
        label: "Fed. incoming replies max depth",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
664
665
        type: :integer,
        description:
666
          "Max. depth of reply-to and reply activities fetching on incoming federation, to prevent out-of-memory situations while" <>
667
            " 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.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
668
669
670
671
672
673
        suggestions: [
          100
        ]
      },
      %{
        key: :federation_reachability_timeout_days,
674
        label: "Fed. reachability timeout days",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
675
676
        type: :integer,
        description:
677
          "Timeout (in days) of each external federation target being unreachable prior to pausing federating to it",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
678
679
680
681
682
683
684
        suggestions: [
          7
        ]
      },
      %{
        key: :allow_relay,
        type: :boolean,
685
        description: "Enable Pleroma's Relay, which makes it possible to follow a whole instance"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
686
687
688
689
690
      },
      %{
        key: :public,
        type: :boolean,
        description:
691
692
693
          "Makes the client API in authenticated mode-only except for user-profiles." <>
            " Useful for disabling the Local Timeline and The Whole Known Network. " <>
            " Note: when setting to `false`, please also check `:restrict_unauthenticated` setting."
Alexander Strizhakov's avatar
Alexander Strizhakov committed
694
695
696
697
698
      },
      %{
        key: :quarantined_instances,
        type: {:list, :string},
        description:
feld's avatar
feld committed
699
          "List of ActivityPub instances where private (DMs, followers-only) activities will not be sent",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
        suggestions: [
          "quarantined.com",
          "*.quarantined.com"
        ]
      },
      %{
        key: :static_dir,
        type: :string,
        description: "Instance static directory",
        suggestions: [
          "instance/static/"
        ]
      },
      %{
        key: :allowed_post_formats,
        type: {:list, :string},
        description: "MIME-type list of formats allowed to be posted (transformed into HTML)",
        suggestions: [
Alexander Strizhakov's avatar
Alexander Strizhakov committed
718
719
720
721
          "text/plain",
          "text/html",
          "text/markdown",
          "text/bbcode"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
722
723
724
725
726
727
        ]
      },
      %{
        key: :extended_nickname_format,
        type: :boolean,
        description:
feld's avatar
feld committed
728
          "Enable to use extended local nicknames format (allows underscores/dashes)." <>
729
            " This will break federation with older software for theses nicknames."
Alexander Strizhakov's avatar
Alexander Strizhakov committed
730
      },
731
732
733
734
      %{
        key: :cleanup_attachments,
        type: :boolean,
        description: """
feld's avatar
feld committed
735
        Enable to remove associated attachments when status is removed.
736
737
738
739
        This will not affect duplicates and attachments without status.
        Enabling this will increase load to database when deleting statuses on larger instances.
        """
      },
Alexander Strizhakov's avatar
Alexander Strizhakov committed
740
741
742
      %{
        key: :max_pinned_statuses,
        type: :integer,
743
        description: "The maximum number of pinned statuses. 0 will disable the feature.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
744
745
746
747
748
749
750
751
752
753
        suggestions: [
          0,
          1,
          3
        ]
      },
      %{
        key: :autofollowed_nicknames,
        type: {:list, :string},
        description:
754
          "Set to nicknames of (local) users that every new user should automatically follow"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
755
      },
756
757
758
759
      %{
        key: :autofollowing_nicknames,
        type: {:list, :string},
        description:
feld's avatar
feld committed
760
          "Set to nicknames of (local) users that automatically follows every newly registered user"
761
      },
Alexander Strizhakov's avatar
Alexander Strizhakov committed
762
      %{
763
        key: :attachment_links,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
764
        type: :boolean,
feld's avatar
feld committed
765
        description: "Enable to automatically add attachment link text to statuses"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
766
767
768
769
      },
      %{
        key: :max_report_comment_size,
        type: :integer,
770
        description: "The maximum size of the report comment. Default: 1000.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
771
772
773
774
775
776
        suggestions: [
          1_000
        ]
      },
      %{
        key: :safe_dm_mentions,
777
        label: "Safe DM mentions",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
778
779
        type: :boolean,
        description:
feld's avatar
feld committed
780
          "If enabled, only mentions at the beginning of a post will be used to address people in direct messages." <>
781
            " This is to prevent accidental mentioning of people when talking about them (e.g. \"@admin please keep an eye on @bad_actor\")." <>
feld's avatar
feld committed
782
            " Default: disabled"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
783
784
785
786
      },
      %{
        key: :healthcheck,
        type: :boolean,
feld's avatar
feld committed
787
        description: "If enabled, system data will be shown on `/api/pleroma/healthcheck`"
Alexander Strizhakov's avatar
Alexander Strizhakov committed
788
789
790
791
792
793
794
795
796
797
798
799
800
      },
      %{
        key: :remote_post_retention_days,
        type: :integer,
        description:
          "The default amount of days to retain remote posts when pruning the database",
        suggestions: [
          90
        ]
      },
      %{
        key: :user_bio_length,
        type: :integer,
801
        description: "A user bio maximum length. Default: 5000.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
802
803
804
805
806
807
808
        suggestions: [
          5_000
        ]
      },
      %{
        key: :user_name_length,
        type: :integer,
809
        description: "A user name maximum length. Default: 100.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
810
811
812
813
814
815
816
        suggestions: [
          100
        ]
      },
      %{
        key: :skip_thread_containment,
        type: :boolean,
817
        description: "Skip filtering out broken threads. Default: enabled."
Alexander Strizhakov's avatar
Alexander Strizhakov committed
818
819
820
      },
      %{
        key: :limit_to_local_content,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
821
        type: {:dropdown, :atom},
Alexander Strizhakov's avatar
Alexander Strizhakov committed
822
        description:
823
          "Limit unauthenticated users to search for local statutes and users only. Default: `:unauthenticated`.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
824
825
826
827
828
829
830
831
832
        suggestions: [
          :unauthenticated,
          :all,
          false
        ]
      },
      %{
        key: :max_account_fields,
        type: :integer,
833
        description: "The maximum number of custom fields in the user profile. Default: 10.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
834
835
836
837
838
839
840
841
        suggestions: [
          10
        ]
      },
      %{
        key: :max_remote_account_fields,
        type: :integer,
        description:
842
          "The maximum number of custom fields in the remote user profile. Default: 20.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
843
844
845
846
847
848
849
        suggestions: [
          20
        ]
      },
      %{
        key: :account_field_name_length,
        type: :integer,
850
        description: "An account field name maximum length. Default: 512.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
851
852
853
854
855
856
857
        suggestions: [
          512
        ]
      },
      %{
        key: :account_field_value_length,
        type: :integer,
858
        description: "An account field value maximum length. Default: 2048.",
Alexander Strizhakov's avatar
Alexander Strizhakov committed
859
        suggestions: [
860
          2048
Alexander Strizhakov's avatar
Alexander Strizhakov committed
861
862
        ]
      },
863
864
865
866
867
868
869
870
      %{
        key: :registration_reason_length,
        type: :integer,
        description: "Maximum registration reason length. Default: 500.",
        suggestions: [
          500
        ]
      },
Alexander Strizhakov's avatar
Alexander Strizhakov committed
871
872
873
      %{
        key: :external_user_synchronization,
        type: :boolean,
874
        description: "Enabling following/followers counters synchronization for external users"
875
876
877
878
879
880
881
882
883
884
885
886
887
888
      },
      %{
        key: :multi_factor_authentication,
        type: :keyword,
        description: "Multi-factor authentication settings",
        suggestions: [
          [
            totp: [digits: 6, period: 30],
            backup_codes: [number: 5, length: 16]
          ]
        ],
        children: [
          %{
            key: :totp,
889
            label: "TOTP settings",
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
            type: :keyword,
            description: "TOTP settings",
            suggestions: [digits: 6, period: 30],
            children: [
              %{
                key: :digits,
                type: :integer,
                suggestions: [6],
                description:
                  "Determines the length of a one-time pass-code, in characters. Defaults to 6 characters."
              },
              %{
                key: :period,
                type: :integer,
                suggestions: [30],
                description:
906
                  "A period for which the TOTP code will be valid, in seconds. Defaults to 30 seconds."
907
908
909
910
911
912
913
914
915
916
917
918
919
              }
            ]
          },
          %{
            key: :backup_codes,
            type: :keyword,
            description: "MFA backup codes settings",
            suggestions: [number: 5, length: 16],
            children: [
              %{
                key: :number,
                type: :integer,
                suggestions: [5],
920
                description: "Number of backup codes to generate."
921
922
923
924
925
926
927
928
929
930
931
              },
              %{
                key: :length,
                type: :integer,
                suggestions: [16],
                description:
                  "Determines the length of backup one-time pass-codes, in characters. Defaults to 16 characters."
              }
            ]
          }
        ]
932
933
934
      },
      %{
        key: :instance_thumbnail,
935
        type: {:string, :image},
936
        description:
937
          "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.",
938
        suggestions: ["/instance/thumbnail.jpeg"]
939
940
941
942
943
      },
      %{
        key: :show_reactions,
        type: :boolean,
        description: "Let favourites and emoji reactions be viewed through the API."
Alexander Strizhakov's avatar
Alexander Strizhakov committed
944
945
946
      }
    ]
  },
Maksim's avatar
Maksim committed
947
  %{
948
949
    group: :pleroma,
    key: :welcome,
Maksim's avatar
Maksim committed
950
951
952
953
    type: :group,
    description: "Welcome messages settings",
    children: [
      %{
954
955
        key: :direct_message,
        type: :keyword,
Maksim's avatar
Maksim committed
956
957
958
959
960
        descpiption: "Direct message settings",
        children: [
          %{
            key: :enabled,
            type: :boolean,
961
            description: "Enables sending a direct message to newly registered users"
Maksim's avatar
Maksim committed
962
963
964
965
          },
          %{
            key: :message,
            type: :string,
Maksim's avatar
Maksim committed
966
            description: "A message that will be sent to newly registered users",
Maksim's avatar
Maksim committed
967
968
969
970
971
972
973
            suggestions: [
              "Hi, @username! Welcome on board!"
            ]
          },
          %{
            key: :sender_nickname,
            type: :string,
974
            description: "The nickname of the local user that sends a welcome message",
Maksim's avatar
Maksim committed
975
976
977
978
979
980
            suggestions: [
              "lain"
            ]
          }
        ]
      },
Ilja's avatar
Ilja committed
981
      %{
982
983
        key: :chat_message,
        type: :keyword,
Ilja's avatar
Ilja committed
984
985
986
987
988
        descpiption: "Chat message settings",
        children: [
          %{
            key: :enabled,
            type: :boolean,
989
            description: "Enables sending a chat message to newly registered users"
Ilja's avatar
Ilja committed
990
991
992
993
994
          },
          %{
            key: :message,
            type: :string,
            description:
995
              "A message that will be sent to newly registered users as a chat message",
Ilja's avatar
Ilja committed
996
            suggestions: [
Ilja's avatar
Ilja committed
997
              "Hello, welcome on board!"
Ilja's avatar
Ilja committed
998
999
1000
            ]
          },
          %{
For faster browsing, not all history is shown. View entire blame