config.exs 13.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#                                 .i;;;;i.
#                               iYcviii;vXY:
#                             .YXi       .i1c.
#                            .YC.     .    in7.
#                           .vc.   ......   ;1c.
#                           i7,   ..        .;1;
#                          i7,   .. ...      .Y1i
#                         ,7v     .6MMM@;     .YX,
#                        .7;.   ..IMMMMMM1     :t7.
#                       .;Y.     ;$MMMMMM9.     :tc.
#                       vY.   .. .nMMM@MMU.      ;1v.
#                      i7i   ...  .#MM@M@C. .....:71i
#                     it:   ....   $MMM@9;.,i;;;i,;tti
#                    :t7.  .....   0MMMWv.,iii:::,,;St.
#                   .nC.   .....   IMMMQ..,::::::,.,czX.
#                  .ct:   ....... .ZMMMI..,:::::::,,:76Y.
#                  c2:   ......,i..Y$M@t..:::::::,,..inZY
#                 vov   ......:ii..c$MBc..,,,,,,,,,,..iI9i
#                i9Y   ......iii:..7@MA,..,,,,,,,,,....;AA:
#               iIS.  ......:ii::..;@MI....,............;Ez.
#              .I9.  ......:i::::...8M1..................C0z.
#             .z9;  ......:i::::,.. .i:...................zWX.
#             vbv  ......,i::::,,.      ................. :AQY
#            c6Y.  .,...,::::,,..:t0@@QY. ................ :8bi
#           :6S. ..,,...,:::,,,..EMMMMMMI. ............... .;bZ,
#          :6o,  .,,,,..:::,,,..i#MMMMMM#v.................  YW2.
#         .n8i ..,,,,,,,::,,,,.. tMMMMM@C:.................. .1Wn
#         7Uc. .:::,,,,,::,,,,..   i1t;,..................... .UEi
#         7C...::::::::::::,,,,..        ....................  vSi.
#         ;1;...,,::::::,.........       ..................    Yz:
#          v97,.........                                     .voC.
#           izAotX7777777777777777777777777777777777777777Y7n92:
#             .;CoIIIIIUAA666666699999ZZZZZZZZZZZZZZZZZZZZ6ov.
#
#                          !!! ATTENTION !!!
# DO NOT EDIT THIS FILE! THIS FILE CONTAINS THE DEFAULT VALUES FOR THE CON-
# FIGURATION! EDIT YOUR SECRET FILE (either prod.secret.exs, dev.secret.exs).
#
lain's avatar
lain committed
39
40
41
42
43
44
45
46
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config

# General application configuration
lain's avatar
lain committed
47
config :pleroma, ecto_repos: [Pleroma.Repo]
lain's avatar
lain committed
48

href's avatar
href committed
49
50
config :pleroma, Pleroma.Repo,
  types: Pleroma.PostgresTypes,
lain's avatar
lain committed
51
52
  telemetry_event: [Pleroma.Repo.Instrumenter],
  migration_lock: nil
href's avatar
href committed
53

54
config :pleroma, Pleroma.Captcha,
vaartis's avatar
vaartis committed
55
  enabled: false,
56
  seconds_valid: 60,
57
58
  method: Pleroma.Captcha.Kocaptcha

href's avatar
href committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
config :pleroma, :hackney_pools,
  federation: [
    max_connections: 50,
    timeout: 150_000
  ],
  media: [
    max_connections: 50,
    timeout: 150_000
  ],
  upload: [
    max_connections: 25,
    timeout: 300_000
  ]

73
config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
74

href's avatar
href committed
75
# Upload configuration
gled's avatar
gled committed
76
config :pleroma, Pleroma.Upload,
Thurloat's avatar
Thurloat committed
77
  uploader: Pleroma.Uploaders.Local,
rinpatch's avatar
rinpatch committed
78
  filters: [Pleroma.Upload.Filter.Dedupe],
rinpatch's avatar
rinpatch committed
79
  link_name: true,
href's avatar
href committed
80
  proxy_remote: false,
href's avatar
href committed
81
82
83
84
85
86
87
88
  proxy_opts: [
    redirect_on_failure: false,
    max_body_length: 25 * 1_048_576,
    http: [
      follow_redirect: true,
      pool: :upload
    ]
  ]
href's avatar
href committed
89

href's avatar
href committed
90
config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
91

92
93
config :pleroma, Pleroma.Uploaders.S3,
  bucket: nil,
href's avatar
href committed
94
  public_endpoint: "https://s3.amazonaws.com"
lain's avatar
lain committed
95

hakabahitoyo's avatar
hakabahitoyo committed
96
config :pleroma, Pleroma.Uploaders.MDII,
hakabahitoyo's avatar
hakabahitoyo committed
97
98
  cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
  files: "https://mdii.sakura.ne.jp"
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
99

100
101
config :pleroma, :emoji,
  shortcode_globs: ["/emoji/custom/**/*.png"],
102
  groups: [
103
    # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
104
    Custom: ["/emoji/*.png", "/emoji/**/*.png"]
105
  ],
106
  default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"
Jorty's avatar
Jorty committed
107

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
config :pleroma, :uri_schemes,
  valid_schemes: [
    "https",
    "http",
    "dat",
    "dweb",
    "gopher",
    "ipfs",
    "ipns",
    "irc",
    "ircs",
    "magnet",
    "mailto",
    "mumble",
    "ssb",
    "xmpp"
  ]
125

lain's avatar
lain committed
126
127
128
129
130
131
132
133
134
135
136
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
137
138
# Configures the endpoint
config :pleroma, Pleroma.Web.Endpoint,
href's avatar
href committed
139
  instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
lain's avatar
lain committed
140
  url: [host: "localhost"],
href's avatar
href committed
141
142
143
144
  http: [
    dispatch: [
      {:_,
       [
145
         {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
kaniini's avatar
kaniini committed
146
147
148
         {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
          {Phoenix.Transports.WebSocket,
           {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
149
         {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
href's avatar
href committed
150
151
152
       ]}
    ]
  ],
lain's avatar
lain committed
153
  protocol: "https",
lain's avatar
lain committed
154
  secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
href's avatar
href committed
155
  signing_salt: "CqaoopA2",
lain's avatar
lain committed
156
  render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
157
  pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
158
159
160
161
  secure_cookie_flag: true,
  extra_cookie_attrs: [
    "SameSite=Lax"
  ]
lain's avatar
lain committed
162
163
164
165
166
167

# Configures Elixir's Logger
config :logger, :console,
  format: "$time $metadata[$level] $message\n",
  metadata: [:request_id]

168
169
170
config :logger, :ex_syslogger,
  level: :debug,
  ident: "Pleroma",
171
  format: "$metadata[$level] $message",
172
173
  metadata: [:request_id]

174
175
176
177
178
config :quack,
  level: :warn,
  meta: [:all],
  webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"

lain's avatar
lain committed
179
config :mime, :types, %{
180
  "application/xml" => ["xml"],
lain's avatar
lain committed
181
  "application/xrd+xml" => ["xrd+xml"],
182
  "application/jrd+json" => ["jrd+json"],
lain's avatar
lain committed
183
184
  "application/activity+json" => ["activity+json"],
  "application/ld+json" => ["activity+json"]
lain's avatar
lain committed
185
186
}

187
config :tesla, adapter: Tesla.Adapter.Hackney
188

jeff's avatar
docs    
jeff committed
189
# Configures http settings, upstream proxy etc.
190
191
config :pleroma, :http,
  proxy_url: nil,
192
  send_user_agent: true,
193
194
195
196
197
198
  adapter: [
    ssl_options: [
      # We don't support TLS v1.3 yet
      versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
    ]
  ]
199

lain's avatar
lain committed
200
201
config :pleroma, :instance,
  name: "Pleroma",
202
  email: "example@example.com",
203
  notify_email: "noreply@example.com",
204
  description: "A Pleroma instance, an alternative fediverse server",
205
  limit: 5_000,
lain's avatar
lain committed
206
  remote_limit: 100_000,
207
  upload_limit: 16_000_000,
208
209
210
  avatar_upload_limit: 2_000_000,
  background_upload_limit: 4_000_000,
  banner_upload_limit: 4_000_000,
211
212
213
214
215
216
  poll_limits: %{
    max_options: 20,
    max_option_chars: 200,
    min_expiration: 0,
    max_expiration: 365 * 24 * 60 * 60
  },
lain's avatar
lain committed
217
  registrations_open: true,
218
  federating: true,
219
  federation_reachability_timeout_days: 7,
220
  federation_publisher_modules: [
221
    Pleroma.Web.ActivityPub.Publisher,
222
    Pleroma.Web.Websub,
223
    Pleroma.Web.Salmon
224
  ],
225
  allow_relay: true,
lain's avatar
lain committed
226
  rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
227
  public: true,
228
  quarantined_instances: [],
229
  managed_config: true,
href's avatar
href committed
230
  static_dir: "instance/static/",
231
232
233
  allowed_post_formats: [
    "text/plain",
    "text/html",
kaniini's avatar
kaniini committed
234
235
    "text/markdown",
    "text/bbcode"
236
  ],
237
  mrf_transparency: true,
238
  autofollowed_nicknames: [],
feld's avatar
feld committed
239
  max_pinned_statuses: 1,
lain's avatar
lain committed
240
241
  no_attachment_links: false,
  welcome_user_nickname: nil,
minibikini's avatar
Reports    
minibikini committed
242
  welcome_message: nil,
lain's avatar
lain committed
243
  max_report_comment_size: 1000,
244
  safe_dm_mentions: false,
245
  healthcheck: false,
Maksim's avatar
Maksim committed
246
  remote_post_retention_days: 90,
247
  skip_thread_containment: true,
248
249
  limit_to_local_content: :unauthenticated,
  dynamic_configuration: false
lain's avatar
lain committed
250

251
config :pleroma, :markup,
252
253
254
  # XXX - unfortunately, inline images must be enabled by default right now, because
  # of custom emoji.  Issue #275 discusses defanging that somehow.
  allow_inline_images: true,
255
256
257
  allow_headings: false,
  allow_tables: false,
  allow_fonts: false,
258
259
260
261
  scrub_policy: [
    Pleroma.HTML.Transform.MediaProxy,
    Pleroma.HTML.Scrubber.Default
  ]
262

lain's avatar
lain committed
263
264
265
266
config :pleroma, :frontend_configurations,
  pleroma_fe: %{
    theme: "pleroma-dark",
    logo: "/static/logo.png",
lain's avatar
lain committed
267
    background: "/images/city.jpg",
lain's avatar
lain committed
268
269
270
271
272
273
274
275
276
277
278
    redirectRootNoLogin: "/main/all",
    redirectRootLogin: "/main/friends",
    showInstanceSpecificPanel: true,
    scopeOptionsEnabled: false,
    formattingOptionsEnabled: false,
    collapseMessageWithSubject: false,
    hidePostStats: false,
    hideUserStats: false,
    scopeCopy: true,
    subjectLineBehavior: "email",
    alwaysShowSubjectInput: true
Haelwenn's avatar
Haelwenn committed
279
280
281
  },
  masto_fe: %{
    showInstanceSpecificPanel: true
lain's avatar
lain committed
282
283
  }

284
285
286
287
288
289
290
291
292
293
294
295
296
config :pleroma, :assets,
  mascots: [
    pleroma_fox_tan: %{
      url: "/images/pleroma-fox-tan-smol.png",
      mime_type: "image/png"
    },
    pleroma_fox_tan_shy: %{
      url: "/images/pleroma-fox-tan-shy.png",
      mime_type: "image/png"
    }
  ],
  default_mascot: :pleroma_fox_tan

297
298
299
config :pleroma, :activitypub,
  accept_blocks: true,
  unfollow_blocked: true,
300
301
  outgoing_blocks: true,
  follow_handshake_timeout: 500
302

squidboi's avatar
squidboi committed
303
config :pleroma, :user, deny_follow_blocked: true
304

305
306
config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default

307
308
309
310
config :pleroma, :mrf_rejectnonpublic,
  allow_followersonly: false,
  allow_direct: false

Karen Konou's avatar
Karen Konou committed
311
config :pleroma, :mrf_hellthread,
312
313
  delist_threshold: 10,
  reject_threshold: 20
Karen Konou's avatar
Karen Konou committed
314

315
316
317
318
config :pleroma, :mrf_simple,
  media_removal: [],
  media_nsfw: [],
  federated_timeline_removal: [],
319
  report_removal: [],
kaniini's avatar
kaniini committed
320
  reject: [],
321
322
323
  accept: [],
  avatar_removal: [],
  banner_removal: []
rinpatch's avatar
rinpatch committed
324

325
326
config :pleroma, :mrf_keyword,
  reject: [],
327
  federated_timeline_removal: [],
328
329
  replace: []

kaniini's avatar
kaniini committed
330
config :pleroma, :mrf_subchain, match_actor: %{}
kaniini's avatar
kaniini committed
331

rinpatch's avatar
rinpatch committed
332
config :pleroma, :rich_media, enabled: true
333

href's avatar
href committed
334
335
336
337
338
339
340
341
342
config :pleroma, :media_proxy,
  enabled: false,
  proxy_opts: [
    redirect_on_failure: false,
    max_body_length: 25 * 1_048_576,
    http: [
      follow_redirect: true,
      pool: :media
    ]
feld's avatar
feld committed
343
344
  ],
  whitelist: []
lain's avatar
lain committed
345
346

config :pleroma, :chat, enabled: true
347

lain's avatar
lain committed
348
config :phoenix, :format_encoders, json: Jason
lain's avatar
lain committed
349

lain's avatar
lain committed
350
351
352
353
354
config :pleroma, :gopher,
  enabled: false,
  ip: {0, 0, 0, 0},
  port: 9999

Alexander Strizhakov's avatar
Alexander Strizhakov committed
355
356
357
config :pleroma, Pleroma.Web.Metadata,
  providers: [Pleroma.Web.Metadata.Providers.RelMe],
  unfurl_nsfw: false
358

Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
359
360
361
config :pleroma, :suggestions,
  enabled: false,
  third_party_engine:
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
362
    "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
363
  timeout: 300_000,
364
365
  limit: 40,
  web: "https://vinayaka.distsn.org"
hakabahitoyo's avatar
hakabahitoyo committed
366

kaniini's avatar
kaniini committed
367
config :pleroma, :http_security,
368
369
  enabled: true,
  sts: false,
370
  sts_max_age: 31_536_000,
371
372
  ct_max_age: 2_592_000,
  referrer_policy: "same-origin"
373

kaniini's avatar
kaniini committed
374
375
376
377
378
379
380
381
382
383
384
385
386
387
config :cors_plug,
  max_age: 86_400,
  methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
  expose: [
    "Link",
    "X-RateLimit-Reset",
    "X-RateLimit-Limit",
    "X-RateLimit-Remaining",
    "X-Request-Id",
    "Idempotency-Key"
  ],
  credentials: true,
  headers: ["Authorization", "Content-Type", "Idempotency-Key"]

lain's avatar
lain committed
388
389
config :pleroma, Pleroma.User,
  restricted_nicknames: [
feld's avatar
feld committed
390
    ".well-known",
lain's avatar
lain committed
391
    "~",
feld's avatar
feld committed
392
    "about",
lain's avatar
lain committed
393
394
    "activities",
    "api",
feld's avatar
feld committed
395
    "auth",
feld's avatar
feld committed
396
    "check_password",
feld's avatar
feld committed
397
398
399
400
401
402
403
    "dev",
    "friend-requests",
    "inbox",
    "internal",
    "main",
    "media",
    "nodeinfo",
lain's avatar
lain committed
404
405
    "notice",
    "oauth",
feld's avatar
feld committed
406
407
408
409
    "objects",
    "ostatus_subscribe",
    "pleroma",
    "proxy",
lain's avatar
lain committed
410
    "push",
feld's avatar
feld committed
411
    "registration",
lain's avatar
lain committed
412
    "relay",
feld's avatar
feld committed
413
414
415
416
    "settings",
    "status",
    "tag",
    "user-search",
feld's avatar
feld committed
417
    "user_exists",
feld's avatar
feld committed
418
419
    "users",
    "web"
lain's avatar
lain committed
420
421
  ]

lain's avatar
lain committed
422
423
424
425
426
427
config :pleroma, Pleroma.Web.Federator.RetryQueue,
  enabled: false,
  max_jobs: 20,
  initial_timeout: 30,
  max_retries: 5

428
429
430
config :pleroma_job_queue, :queues,
  federator_incoming: 50,
  federator_outgoing: 50,
431
  web_push: 50,
432
  mailer: 10,
433
  transmogrifier: 20,
434
435
  scheduled_activities: 10,
  background: 5
minibikini's avatar
minibikini committed
436

437
438
439
440
config :pleroma, :fetch_initial_posts,
  enabled: false,
  pages: 5

minibikini's avatar
minibikini committed
441
442
443
444
config :auto_linker,
  opts: [
    scheme: true,
    extra: true,
rinpatch's avatar
rinpatch committed
445
446
    # TODO: Set to :no_scheme when it works properly
    validate_tld: true,
minibikini's avatar
minibikini committed
447
448
449
450
451
452
    class: false,
    strip_prefix: false,
    new_window: false,
    rel: false
  ]

link0ff's avatar
link0ff committed
453
454
455
456
457
458
config :pleroma, :ldap,
  enabled: System.get_env("LDAP_ENABLED") == "true",
  host: System.get_env("LDAP_HOST") || "localhost",
  port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
  ssl: System.get_env("LDAP_SSL") == "true",
  sslopts: [],
link0ff's avatar
link0ff committed
459
460
  tls: System.get_env("LDAP_TLS") == "true",
  tlsopts: [],
link0ff's avatar
link0ff committed
461
462
463
  base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  uid: System.get_env("LDAP_UID") || "cn"

lain's avatar
lain committed
464
465
466
config :esshd,
  enabled: false

467
468
469
470
471
oauth_consumer_strategies =
  System.get_env("OAUTH_CONSUMER_STRATEGIES")
  |> to_string()
  |> String.split()
  |> Enum.map(&hd(String.split(&1, ":")))
472
473
474

ueberauth_providers =
  for strategy <- oauth_consumer_strategies do
475
    strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
476
477
478
    strategy_module = String.to_atom(strategy_module_name)
    {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
  end
479

Ivan Tashkinov's avatar
Ivan Tashkinov committed
480
481
482
config :ueberauth,
       Ueberauth,
       base_path: "/oauth",
483
484
       providers: ueberauth_providers

485
config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
Ivan Tashkinov's avatar
Ivan Tashkinov committed
486

487
config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail
488

489
490
config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"

491
492
493
494
495
config :pleroma, Pleroma.ScheduledActivity,
  daily_user_limit: 25,
  total_user_limit: 300,
  enabled: true

Maksim's avatar
Maksim committed
496
497
config :pleroma, :oauth2,
  token_expires_in: 600,
498
499
500
  issue_new_refresh_token: true,
  clean_expired_tokens: false,
  clean_expired_tokens_interval: 86_400_000
Maksim's avatar
Maksim committed
501

502
503
config :pleroma, :database, rum_enabled: false

504
505
config :pleroma, :env, Mix.env()

506
507
508
config :http_signatures,
  adapter: Pleroma.Signature

509
510
511
config :pleroma, :rate_limit,
  search: [{1000, 10}, {1000, 30}],
  app_account_creation: {1_800_000, 25}
512

lain's avatar
lain committed
513
514
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
lain's avatar
lain committed
515
import_config "#{Mix.env()}.exs"