config.exs 13.1 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,
minibikini's avatar
minibikini committed
51
  telemetry_event: [Pleroma.Repo.Instrumenter]
href's avatar
href committed
52

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

href's avatar
href committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
  ]

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

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

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

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

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

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

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

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

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

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

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

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

lain's avatar
lain committed
186
187
config :pleroma, :websub, Pleroma.Web.Websub
config :pleroma, :ostatus, Pleroma.Web.OStatus
188
config :pleroma, :httpoison, Pleroma.HTTP
189
config :tesla, adapter: Tesla.Adapter.Hackney
190

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

lain's avatar
lain committed
201
202
config :pleroma, :instance,
  name: "Pleroma",
203
  email: "example@example.com",
204
  notify_email: "noreply@example.com",
205
  description: "A Pleroma instance, an alternative fediverse server",
206
  limit: 5_000,
lain's avatar
lain committed
207
  remote_limit: 100_000,
208
  upload_limit: 16_000_000,
209
210
211
  avatar_upload_limit: 2_000_000,
  background_upload_limit: 4_000_000,
  banner_upload_limit: 4_000_000,
lain's avatar
lain committed
212
  registrations_open: true,
213
  federating: true,
214
  federation_reachability_timeout_days: 7,
215
  allow_relay: true,
lain's avatar
lain committed
216
  rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
217
  public: true,
218
  quarantined_instances: [],
219
  managed_config: true,
href's avatar
href committed
220
  static_dir: "instance/static/",
221
222
223
  allowed_post_formats: [
    "text/plain",
    "text/html",
kaniini's avatar
kaniini committed
224
225
    "text/markdown",
    "text/bbcode"
226
  ],
227
  mrf_transparency: true,
228
  autofollowed_nicknames: [],
feld's avatar
feld committed
229
  max_pinned_statuses: 1,
lain's avatar
lain committed
230
231
  no_attachment_links: false,
  welcome_user_nickname: nil,
minibikini's avatar
Reports    
minibikini committed
232
  welcome_message: nil,
lain's avatar
lain committed
233
  max_report_comment_size: 1000,
234
235
  safe_dm_mentions: false,
  healthcheck: false
lain's avatar
lain committed
236

237
config :pleroma, :markup,
238
239
240
  # 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,
241
242
243
  allow_headings: false,
  allow_tables: false,
  allow_fonts: false,
244
245
246
247
  scrub_policy: [
    Pleroma.HTML.Transform.MediaProxy,
    Pleroma.HTML.Scrubber.Default
  ]
248

lain's avatar
lain committed
249
# Deprecated, will be gone in 1.0
250
251
252
config :pleroma, :fe,
  theme: "pleroma-dark",
  logo: "/static/logo.png",
253
254
  logo_mask: true,
  logo_margin: "0.1em",
255
  background: "/static/aurora_borealis.jpg",
lain's avatar
lain committed
256
257
  redirect_root_no_login: "/main/all",
  redirect_root_login: "/main/friends",
258
  show_instance_panel: true,
259
  scope_options_enabled: false,
260
  formatting_options_enabled: false,
261
262
  collapse_message_with_subject: false,
  hide_post_stats: false,
263
264
265
266
  hide_user_stats: false,
  scope_copy: true,
  subject_line_behavior: "email",
  always_show_subject_input: true
267

lain's avatar
lain committed
268
269
270
271
config :pleroma, :frontend_configurations,
  pleroma_fe: %{
    theme: "pleroma-dark",
    logo: "/static/logo.png",
lain's avatar
lain committed
272
    background: "/images/city.jpg",
lain's avatar
lain committed
273
274
275
276
277
278
279
280
281
282
283
    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
284
285
286
  },
  masto_fe: %{
    showInstanceSpecificPanel: true
lain's avatar
lain committed
287
288
  }

289
290
291
config :pleroma, :activitypub,
  accept_blocks: true,
  unfollow_blocked: true,
292
293
  outgoing_blocks: true,
  follow_handshake_timeout: 500
294

squidboi's avatar
squidboi committed
295
config :pleroma, :user, deny_follow_blocked: true
296

297
298
config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default

299
300
301
302
config :pleroma, :mrf_rejectnonpublic,
  allow_followersonly: false,
  allow_direct: false

Karen Konou's avatar
Karen Konou committed
303
config :pleroma, :mrf_hellthread,
304
305
  delist_threshold: 10,
  reject_threshold: 20
Karen Konou's avatar
Karen Konou committed
306

307
308
309
310
config :pleroma, :mrf_simple,
  media_removal: [],
  media_nsfw: [],
  federated_timeline_removal: [],
kaniini's avatar
kaniini committed
311
312
  reject: [],
  accept: []
rinpatch's avatar
rinpatch committed
313

314
315
config :pleroma, :mrf_keyword,
  reject: [],
316
  federated_timeline_removal: [],
317
318
  replace: []

rinpatch's avatar
rinpatch committed
319
config :pleroma, :rich_media, enabled: true
320

href's avatar
href committed
321
322
323
324
325
326
327
328
329
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
330
331
  ],
  whitelist: []
lain's avatar
lain committed
332
333

config :pleroma, :chat, enabled: true
334

lain's avatar
lain committed
335
config :phoenix, :format_encoders, json: Jason
lain's avatar
lain committed
336

lain's avatar
lain committed
337
338
339
340
341
config :pleroma, :gopher,
  enabled: false,
  ip: {0, 0, 0, 0},
  port: 9999

Alexander Strizhakov's avatar
Alexander Strizhakov committed
342
343
344
config :pleroma, Pleroma.Web.Metadata,
  providers: [Pleroma.Web.Metadata.Providers.RelMe],
  unfurl_nsfw: false
345

Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
346
347
348
config :pleroma, :suggestions,
  enabled: false,
  third_party_engine:
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
349
    "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
350
  timeout: 300_000,
351
  limit: 23,
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
352
  web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
hakabahitoyo's avatar
hakabahitoyo committed
353

kaniini's avatar
kaniini committed
354
config :pleroma, :http_security,
355
356
  enabled: true,
  sts: false,
357
  sts_max_age: 31_536_000,
358
359
  ct_max_age: 2_592_000,
  referrer_policy: "same-origin"
360

kaniini's avatar
kaniini committed
361
362
363
364
365
366
367
368
369
370
371
372
373
374
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
375
376
config :pleroma, Pleroma.User,
  restricted_nicknames: [
feld's avatar
feld committed
377
    ".well-known",
lain's avatar
lain committed
378
    "~",
feld's avatar
feld committed
379
    "about",
lain's avatar
lain committed
380
381
    "activities",
    "api",
feld's avatar
feld committed
382
383
384
385
386
387
388
389
    "auth",
    "dev",
    "friend-requests",
    "inbox",
    "internal",
    "main",
    "media",
    "nodeinfo",
lain's avatar
lain committed
390
391
    "notice",
    "oauth",
feld's avatar
feld committed
392
393
394
395
    "objects",
    "ostatus_subscribe",
    "pleroma",
    "proxy",
lain's avatar
lain committed
396
    "push",
feld's avatar
feld committed
397
    "registration",
lain's avatar
lain committed
398
    "relay",
feld's avatar
feld committed
399
400
401
402
403
404
    "settings",
    "status",
    "tag",
    "user-search",
    "users",
    "web"
lain's avatar
lain committed
405
406
  ]

lain's avatar
lain committed
407
408
409
410
411
412
config :pleroma, Pleroma.Web.Federator.RetryQueue,
  enabled: false,
  max_jobs: 20,
  initial_timeout: 30,
  max_retries: 5

413
414
415
config :pleroma_job_queue, :queues,
  federator_incoming: 50,
  federator_outgoing: 50,
416
  web_push: 50,
417
  mailer: 10,
418
  transmogrifier: 20,
419
420
  scheduled_activities: 10,
  background: 5
minibikini's avatar
minibikini committed
421

422
423
424
425
config :pleroma, :fetch_initial_posts,
  enabled: false,
  pages: 5

minibikini's avatar
minibikini committed
426
427
428
429
430
431
432
433
434
435
config :auto_linker,
  opts: [
    scheme: true,
    extra: true,
    class: false,
    strip_prefix: false,
    new_window: false,
    rel: false
  ]

link0ff's avatar
link0ff committed
436
437
438
439
440
441
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
442
443
  tls: System.get_env("LDAP_TLS") == "true",
  tlsopts: [],
link0ff's avatar
link0ff committed
444
445
446
  base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  uid: System.get_env("LDAP_UID") || "cn"

lain's avatar
lain committed
447
448
449
config :esshd,
  enabled: false

Ivan Tashkinov's avatar
Ivan Tashkinov committed
450
oauth_consumer_strategies = String.split(System.get_env("OAUTH_CONSUMER_STRATEGIES") || "")
451
452
453

ueberauth_providers =
  for strategy <- oauth_consumer_strategies do
454
    strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
455
456
457
    strategy_module = String.to_atom(strategy_module_name)
    {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
  end
458

Ivan Tashkinov's avatar
Ivan Tashkinov committed
459
460
461
config :ueberauth,
       Ueberauth,
       base_path: "/oauth",
462
463
       providers: ueberauth_providers

464
config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
Ivan Tashkinov's avatar
Ivan Tashkinov committed
465

466
config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail
467

468
469
config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"

470
471
472
473
474
config :pleroma, Pleroma.ScheduledActivity,
  daily_user_limit: 25,
  total_user_limit: 300,
  enabled: true

Roman Chvanikov's avatar
Roman Chvanikov committed
475
476
config :pleroma, :email_notifications,
  digest: %{
Roman Chvanikov's avatar
Roman Chvanikov committed
477
    active: true,
Roman Chvanikov's avatar
Roman Chvanikov committed
478
479
480
481
482
    schedule: "0 0 * * 0",
    interval: 7,
    inactivity_threshold: 7
  }

Maksim's avatar
Maksim committed
483
484
485
486
config :pleroma, :oauth2,
  token_expires_in: 600,
  issue_new_refresh_token: true

lain's avatar
lain committed
487
488
# 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
489
import_config "#{Mix.env()}.exs"