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

54
config :pleroma, Pleroma.Captcha,
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
  pack_extensions: [".png", ".gif"],
103
  groups: [
104
    # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
105
    Custom: ["/emoji/*.png", "/emoji/**/*.png"]
106
  ],
107
  default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"
108

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

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

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

170 171
config :logger, :ex_syslogger,
  level: :debug,
172
  ident: "pleroma",
173
  format: "$metadata[$level] $message",
174 175
  metadata: [:request_id]

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

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

189
config :tesla, adapter: Tesla.Adapter.Hackney
190

jeff's avatar
jeff committed
191
# Configures http settings, upstream proxy etc.
192 193
config :pleroma, :http,
  proxy_url: nil,
194
  send_user_agent: true,
195 196
  adapter: [
    ssl_options: [
197 198
      # Workaround for remote server certificate chain issues
      partial_chain: &:hackney_connect.partial_chain/1,
199 200 201 202
      # We don't support TLS v1.3 yet
      versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
    ]
  ]
203

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

257
config :pleroma, :markup,
258 259 260
  # 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,
261 262 263
  allow_headings: false,
  allow_tables: false,
  allow_fonts: false,
264 265 266 267
  scrub_policy: [
    Pleroma.HTML.Transform.MediaProxy,
    Pleroma.HTML.Scrubber.Default
  ]
268

269 270 271 272
config :pleroma, :frontend_configurations,
  pleroma_fe: %{
    theme: "pleroma-dark",
    logo: "/static/logo.png",
273
    background: "/images/city.jpg",
274 275 276 277 278 279 280 281 282 283 284
    redirectRootNoLogin: "/main/all",
    redirectRootLogin: "/main/friends",
    showInstanceSpecificPanel: true,
    scopeOptionsEnabled: false,
    formattingOptionsEnabled: false,
    collapseMessageWithSubject: false,
    hidePostStats: false,
    hideUserStats: false,
    scopeCopy: true,
    subjectLineBehavior: "email",
    alwaysShowSubjectInput: true
285 286 287
  },
  masto_fe: %{
    showInstanceSpecificPanel: true
288 289
  }

290 291 292 293 294 295 296 297 298 299 300 301 302
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

303 304
config :pleroma, :activitypub,
  unfollow_blocked: true,
305 306
  outgoing_blocks: true,
  follow_handshake_timeout: 500
307

squidboi's avatar
squidboi committed
308
config :pleroma, :user, deny_follow_blocked: true
309

310 311
config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default

312 313 314 315
config :pleroma, :mrf_rejectnonpublic,
  allow_followersonly: false,
  allow_direct: false

316
config :pleroma, :mrf_hellthread,
317 318
  delist_threshold: 10,
  reject_threshold: 20
319

320 321 322 323
config :pleroma, :mrf_simple,
  media_removal: [],
  media_nsfw: [],
  federated_timeline_removal: [],
324
  report_removal: [],
kaniini's avatar
kaniini committed
325
  reject: [],
326 327 328
  accept: [],
  avatar_removal: [],
  banner_removal: []
329

330 331
config :pleroma, :mrf_keyword,
  reject: [],
332
  federated_timeline_removal: [],
333 334
  replace: []

kaniini's avatar
kaniini committed
335
config :pleroma, :mrf_subchain, match_actor: %{}
kaniini's avatar
kaniini committed
336

337 338 339 340
config :pleroma, :mrf_vocabulary,
  accept: [],
  reject: []

341 342 343 344
config :pleroma, :rich_media,
  enabled: true,
  ignore_hosts: [],
  ignore_tld: ["local", "localdomain", "lan"]
345

href's avatar
href committed
346 347 348 349 350 351 352 353 354
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
    ]
355 356
  ],
  whitelist: []
lain's avatar
lain committed
357 358

config :pleroma, :chat, enabled: true
359

lain's avatar
lain committed
360
config :phoenix, :format_encoders, json: Jason
361

lain's avatar
lain committed
362 363 364 365 366
config :pleroma, :gopher,
  enabled: false,
  ip: {0, 0, 0, 0},
  port: 9999

Alexander Strizhakov's avatar
Alexander Strizhakov committed
367
config :pleroma, Pleroma.Web.Metadata,
368 369 370 371 372
  providers: [
    Pleroma.Web.Metadata.Providers.OpenGraph,
    Pleroma.Web.Metadata.Providers.TwitterCard,
    Pleroma.Web.Metadata.Providers.RelMe
  ],
Alexander Strizhakov's avatar
Alexander Strizhakov committed
373
  unfurl_nsfw: false
374

Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
375 376 377
config :pleroma, :suggestions,
  enabled: false,
  third_party_engine:
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
378
    "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
379
  timeout: 300_000,
380 381
  limit: 40,
  web: "https://vinayaka.distsn.org"
hakabahitoyo's avatar
hakabahitoyo committed
382

383
config :pleroma, :http_security,
384 385
  enabled: true,
  sts: false,
386
  sts_max_age: 31_536_000,
387 388
  ct_max_age: 2_592_000,
  referrer_policy: "same-origin"
389

390 391 392 393 394 395 396 397 398 399 400 401 402 403
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
404 405
config :pleroma, Pleroma.User,
  restricted_nicknames: [
406
    ".well-known",
407
    "~",
408
    "about",
lain's avatar
lain committed
409 410
    "activities",
    "api",
411
    "auth",
feld's avatar
feld committed
412
    "check_password",
413 414 415 416 417 418 419
    "dev",
    "friend-requests",
    "inbox",
    "internal",
    "main",
    "media",
    "nodeinfo",
lain's avatar
lain committed
420 421
    "notice",
    "oauth",
422 423 424 425
    "objects",
    "ostatus_subscribe",
    "pleroma",
    "proxy",
lain's avatar
lain committed
426
    "push",
427
    "registration",
lain's avatar
lain committed
428
    "relay",
429 430 431 432
    "settings",
    "status",
    "tag",
    "user-search",
feld's avatar
feld committed
433
    "user_exists",
434 435
    "users",
    "web"
lain's avatar
lain committed
436 437
  ]

438 439 440 441 442 443
config :pleroma, Pleroma.Web.Federator.RetryQueue,
  enabled: false,
  max_jobs: 20,
  initial_timeout: 30,
  max_retries: 5

444 445 446
config :pleroma_job_queue, :queues,
  federator_incoming: 50,
  federator_outgoing: 50,
447
  web_push: 50,
448
  mailer: 10,
449
  transmogrifier: 20,
450 451
  scheduled_activities: 10,
  background: 5
minibikini's avatar
minibikini committed
452

453 454 455 456
config :pleroma, :fetch_initial_posts,
  enabled: false,
  pages: 5

minibikini's avatar
minibikini committed
457 458 459 460
config :auto_linker,
  opts: [
    scheme: true,
    extra: true,
rinpatch's avatar
rinpatch committed
461 462
    # TODO: Set to :no_scheme when it works properly
    validate_tld: true,
minibikini's avatar
minibikini committed
463 464 465 466 467 468
    class: false,
    strip_prefix: false,
    new_window: false,
    rel: false
  ]

link0ff's avatar
link0ff committed
469 470 471 472 473 474
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
475 476
  tls: System.get_env("LDAP_TLS") == "true",
  tlsopts: [],
link0ff's avatar
link0ff committed
477 478 479
  base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  uid: System.get_env("LDAP_UID") || "cn"

lain's avatar
lain committed
480 481 482
config :esshd,
  enabled: false

483 484 485 486 487
oauth_consumer_strategies =
  System.get_env("OAUTH_CONSUMER_STRATEGIES")
  |> to_string()
  |> String.split()
  |> Enum.map(&hd(String.split(&1, ":")))
488 489 490

ueberauth_providers =
  for strategy <- oauth_consumer_strategies do
491
    strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
492 493 494
    strategy_module = String.to_atom(strategy_module_name)
    {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
  end
495

496 497 498
config :ueberauth,
       Ueberauth,
       base_path: "/oauth",
499 500
       providers: ueberauth_providers

501
config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
502

503
config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail
504

505 506
config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"

507 508 509 510 511
config :pleroma, Pleroma.ScheduledActivity,
  daily_user_limit: 25,
  total_user_limit: 300,
  enabled: true

Maksim's avatar
Maksim committed
512 513
config :pleroma, :oauth2,
  token_expires_in: 600,
514 515 516
  issue_new_refresh_token: true,
  clean_expired_tokens: false,
  clean_expired_tokens_interval: 86_400_000
Maksim's avatar
Maksim committed
517

518 519
config :pleroma, :database, rum_enabled: false

520 521
config :pleroma, :env, Mix.env()

522 523 524
config :http_signatures,
  adapter: Pleroma.Signature

525 526 527
config :pleroma, :rate_limit,
  search: [{1000, 10}, {1000, 30}],
  app_account_creation: {1_800_000, 25}
528

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