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
  safe_dm_mentions: false,
Alexander Strizhakov's avatar
Alexander Strizhakov committed
235
  healthcheck: false
lain's avatar
lain committed
236

237 238
config :pleroma, :app_account_creation, enabled: false, max_requests: 5, interval: 1800

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

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

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

291 292 293
config :pleroma, :activitypub,
  accept_blocks: true,
  unfollow_blocked: true,
294 295
  outgoing_blocks: true,
  follow_handshake_timeout: 500
296

squidboi's avatar
squidboi committed
297
config :pleroma, :user, deny_follow_blocked: true
298

299 300
config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default

301 302 303 304
config :pleroma, :mrf_rejectnonpublic,
  allow_followersonly: false,
  allow_direct: false

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

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

316 317
config :pleroma, :mrf_keyword,
  reject: [],
318
  federated_timeline_removal: [],
319 320
  replace: []

rinpatch's avatar
rinpatch committed
321
config :pleroma, :rich_media, enabled: true
322

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

config :pleroma, :chat, enabled: true
336

lain's avatar
lain committed
337
config :phoenix, :format_encoders, json: Jason
lain's avatar
lain committed
338

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

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

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

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

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

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

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

424 425 426 427
config :pleroma, :fetch_initial_posts,
  enabled: false,
  pages: 5

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

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

lain's avatar
lain committed
449 450 451
config :esshd,
  enabled: false

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

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

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

466
config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
Ivan Tashkinov's avatar
Ivan Tashkinov committed
467

468
config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail
469

470 471
config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"

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

Maksim's avatar
Maksim committed
477 478 479 480
config :pleroma, :oauth2,
  token_expires_in: 600,
  issue_new_refresh_token: true

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