Add native captcha and enable it by default.
[akkoma] / config / config.exs
1 # .i;;;;i.
2 # iYcviii;vXY:
3 # .YXi .i1c.
4 # .YC. . in7.
5 # .vc. ...... ;1c.
6 # i7, .. .;1;
7 # i7, .. ... .Y1i
8 # ,7v .6MMM@; .YX,
9 # .7;. ..IMMMMMM1 :t7.
10 # .;Y. ;$MMMMMM9. :tc.
11 # vY. .. .nMMM@MMU. ;1v.
12 # i7i ... .#MM@M@C. .....:71i
13 # it: .... $MMM@9;.,i;;;i,;tti
14 # :t7. ..... 0MMMWv.,iii:::,,;St.
15 # .nC. ..... IMMMQ..,::::::,.,czX.
16 # .ct: ....... .ZMMMI..,:::::::,,:76Y.
17 # c2: ......,i..Y$M@t..:::::::,,..inZY
18 # vov ......:ii..c$MBc..,,,,,,,,,,..iI9i
19 # i9Y ......iii:..7@MA,..,,,,,,,,,....;AA:
20 # iIS. ......:ii::..;@MI....,............;Ez.
21 # .I9. ......:i::::...8M1..................C0z.
22 # .z9; ......:i::::,.. .i:...................zWX.
23 # vbv ......,i::::,,. ................. :AQY
24 # c6Y. .,...,::::,,..:t0@@QY. ................ :8bi
25 # :6S. ..,,...,:::,,,..EMMMMMMI. ............... .;bZ,
26 # :6o, .,,,,..:::,,,..i#MMMMMM#v................. YW2.
27 # .n8i ..,,,,,,,::,,,,.. tMMMMM@C:.................. .1Wn
28 # 7Uc. .:::,,,,,::,,,,.. i1t;,..................... .UEi
29 # 7C...::::::::::::,,,,.. .................... vSi.
30 # ;1;...,,::::::,......... .................. Yz:
31 # v97,......... .voC.
32 # izAotX7777777777777777777777777777777777777777Y7n92:
33 # .;CoIIIIIUAA666666699999ZZZZZZZZZZZZZZZZZZZZ6ov.
34 #
35 # !!! ATTENTION !!!
36 # DO NOT EDIT THIS FILE! THIS FILE CONTAINS THE DEFAULT VALUES FOR THE CON-
37 # FIGURATION! EDIT YOUR SECRET FILE (either prod.secret.exs, dev.secret.exs).
38 #
39 # This file is responsible for configuring your application
40 # and its dependencies with the aid of the Mix.Config module.
41 #
42 # This configuration file is loaded before any dependency and
43 # is restricted to this project.
44 use Mix.Config
45
46 # General application configuration
47 config :pleroma, ecto_repos: [Pleroma.Repo]
48
49 config :pleroma, Pleroma.Repo,
50 types: Pleroma.PostgresTypes,
51 telemetry_event: [Pleroma.Repo.Instrumenter],
52 migration_lock: nil
53
54 config :pleroma, Pleroma.Captcha,
55 enabled: true,
56 seconds_valid: 60,
57 method: Pleroma.Captcha.Native
58
59 config :pleroma, :hackney_pools,
60 federation: [
61 max_connections: 50,
62 timeout: 150_000
63 ],
64 media: [
65 max_connections: 50,
66 timeout: 150_000
67 ],
68 upload: [
69 max_connections: 25,
70 timeout: 300_000
71 ]
72
73 # Upload configuration
74 config :pleroma, Pleroma.Upload,
75 uploader: Pleroma.Uploaders.Local,
76 filters: [Pleroma.Upload.Filter.Dedupe],
77 link_name: true,
78 proxy_remote: false,
79 proxy_opts: [
80 redirect_on_failure: false,
81 max_body_length: 25 * 1_048_576,
82 http: [
83 follow_redirect: true,
84 pool: :upload
85 ]
86 ]
87
88 config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
89
90 config :pleroma, Pleroma.Uploaders.S3,
91 bucket: nil,
92 public_endpoint: "https://s3.amazonaws.com"
93
94 config :pleroma, Pleroma.Uploaders.MDII,
95 cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
96 files: "https://mdii.sakura.ne.jp"
97
98 config :pleroma, :emoji,
99 shortcode_globs: ["/emoji/custom/**/*.png"],
100 pack_extensions: [".png", ".gif"],
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"
106
107 config :pleroma, :uri_schemes,
108 valid_schemes: [
109 "https",
110 "http",
111 "dat",
112 "dweb",
113 "gopher",
114 "ipfs",
115 "ipns",
116 "irc",
117 "ircs",
118 "magnet",
119 "mailto",
120 "mumble",
121 "ssb",
122 "xmpp"
123 ]
124
125 websocket_config = [
126 path: "/websocket",
127 serializer: [
128 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
129 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
130 ],
131 timeout: 60_000,
132 transport_log: false,
133 compress: false
134 ]
135
136 # Configures the endpoint
137 config :pleroma, Pleroma.Web.Endpoint,
138 instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
139 url: [host: "localhost"],
140 http: [
141 ip: {127, 0, 0, 1},
142 dispatch: [
143 {:_,
144 [
145 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
146 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
147 {Phoenix.Transports.WebSocket,
148 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
149 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
150 ]}
151 ]
152 ],
153 protocol: "https",
154 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
155 signing_salt: "CqaoopA2",
156 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
157 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
158 secure_cookie_flag: true,
159 extra_cookie_attrs: [
160 "SameSite=Lax"
161 ]
162
163 # Configures Elixir's Logger
164 config :logger, :console,
165 format: "$time $metadata[$level] $message\n",
166 metadata: [:request_id]
167
168 config :logger, :ex_syslogger,
169 level: :debug,
170 ident: "pleroma",
171 format: "$metadata[$level] $message",
172 metadata: [:request_id]
173
174 config :quack,
175 level: :warn,
176 meta: [:all],
177 webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
178
179 config :mime, :types, %{
180 "application/xml" => ["xml"],
181 "application/xrd+xml" => ["xrd+xml"],
182 "application/jrd+json" => ["jrd+json"],
183 "application/activity+json" => ["activity+json"],
184 "application/ld+json" => ["activity+json"]
185 }
186
187 config :tesla, adapter: Tesla.Adapter.Hackney
188
189 # Configures http settings, upstream proxy etc.
190 config :pleroma, :http,
191 proxy_url: nil,
192 send_user_agent: true,
193 adapter: [
194 ssl_options: [
195 # Workaround for remote server certificate chain issues
196 partial_chain: &:hackney_connect.partial_chain/1,
197 # We don't support TLS v1.3 yet
198 versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
199 ]
200 ]
201
202 config :pleroma, :instance,
203 name: "Pleroma",
204 email: "example@example.com",
205 notify_email: "noreply@example.com",
206 description: "A Pleroma instance, an alternative fediverse server",
207 limit: 5_000,
208 remote_limit: 100_000,
209 upload_limit: 16_000_000,
210 avatar_upload_limit: 2_000_000,
211 background_upload_limit: 4_000_000,
212 banner_upload_limit: 4_000_000,
213 poll_limits: %{
214 max_options: 20,
215 max_option_chars: 200,
216 min_expiration: 0,
217 max_expiration: 365 * 24 * 60 * 60
218 },
219 registrations_open: true,
220 federating: true,
221 federation_incoming_replies_max_depth: 100,
222 federation_reachability_timeout_days: 7,
223 federation_publisher_modules: [
224 Pleroma.Web.ActivityPub.Publisher,
225 Pleroma.Web.Websub,
226 Pleroma.Web.Salmon
227 ],
228 allow_relay: true,
229 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
230 public: true,
231 quarantined_instances: [],
232 managed_config: true,
233 static_dir: "instance/static/",
234 allowed_post_formats: [
235 "text/plain",
236 "text/html",
237 "text/markdown",
238 "text/bbcode"
239 ],
240 mrf_transparency: true,
241 mrf_transparency_exclusions: [],
242 autofollowed_nicknames: [],
243 max_pinned_statuses: 1,
244 no_attachment_links: false,
245 welcome_user_nickname: nil,
246 welcome_message: nil,
247 max_report_comment_size: 1000,
248 safe_dm_mentions: false,
249 healthcheck: false,
250 remote_post_retention_days: 90,
251 skip_thread_containment: true,
252 limit_to_local_content: :unauthenticated,
253 dynamic_configuration: false,
254 user_bio_length: 5000,
255 user_name_length: 100,
256 max_account_fields: 10,
257 max_remote_account_fields: 20,
258 account_field_name_length: 512,
259 account_field_value_length: 512,
260 external_user_synchronization: true
261
262 config :pleroma, :markup,
263 # XXX - unfortunately, inline images must be enabled by default right now, because
264 # of custom emoji. Issue #275 discusses defanging that somehow.
265 allow_inline_images: true,
266 allow_headings: false,
267 allow_tables: false,
268 allow_fonts: false,
269 scrub_policy: [
270 Pleroma.HTML.Transform.MediaProxy,
271 Pleroma.HTML.Scrubber.Default
272 ]
273
274 config :pleroma, :frontend_configurations,
275 pleroma_fe: %{
276 theme: "pleroma-dark",
277 logo: "/static/logo.png",
278 background: "/images/city.jpg",
279 redirectRootNoLogin: "/main/all",
280 redirectRootLogin: "/main/friends",
281 showInstanceSpecificPanel: true,
282 scopeOptionsEnabled: false,
283 formattingOptionsEnabled: false,
284 collapseMessageWithSubject: false,
285 hidePostStats: false,
286 hideUserStats: false,
287 scopeCopy: true,
288 subjectLineBehavior: "email",
289 alwaysShowSubjectInput: true
290 },
291 masto_fe: %{
292 showInstanceSpecificPanel: true
293 }
294
295 config :pleroma, :assets,
296 mascots: [
297 pleroma_fox_tan: %{
298 url: "/images/pleroma-fox-tan-smol.png",
299 mime_type: "image/png"
300 },
301 pleroma_fox_tan_shy: %{
302 url: "/images/pleroma-fox-tan-shy.png",
303 mime_type: "image/png"
304 }
305 ],
306 default_mascot: :pleroma_fox_tan
307
308 config :pleroma, :activitypub,
309 unfollow_blocked: true,
310 outgoing_blocks: true,
311 follow_handshake_timeout: 500,
312 sign_object_fetches: true
313
314 config :pleroma, :streamer,
315 workers: 3,
316 overflow_workers: 2
317
318 config :pleroma, :user, deny_follow_blocked: true
319
320 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
321
322 config :pleroma, :mrf_rejectnonpublic,
323 allow_followersonly: false,
324 allow_direct: false
325
326 config :pleroma, :mrf_hellthread,
327 delist_threshold: 10,
328 reject_threshold: 20
329
330 config :pleroma, :mrf_simple,
331 media_removal: [],
332 media_nsfw: [],
333 federated_timeline_removal: [],
334 report_removal: [],
335 reject: [],
336 accept: [],
337 avatar_removal: [],
338 banner_removal: []
339
340 config :pleroma, :mrf_keyword,
341 reject: [],
342 federated_timeline_removal: [],
343 replace: []
344
345 config :pleroma, :mrf_subchain, match_actor: %{}
346
347 config :pleroma, :mrf_vocabulary,
348 accept: [],
349 reject: []
350
351 config :pleroma, :rich_media,
352 enabled: true,
353 ignore_hosts: [],
354 ignore_tld: ["local", "localdomain", "lan"],
355 parsers: [
356 Pleroma.Web.RichMedia.Parsers.TwitterCard,
357 Pleroma.Web.RichMedia.Parsers.OGP,
358 Pleroma.Web.RichMedia.Parsers.OEmbed
359 ],
360 ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
361
362 config :pleroma, :media_proxy,
363 enabled: false,
364 proxy_opts: [
365 redirect_on_failure: false,
366 max_body_length: 25 * 1_048_576,
367 http: [
368 follow_redirect: true,
369 pool: :media
370 ]
371 ],
372 whitelist: []
373
374 config :pleroma, :chat, enabled: true
375
376 config :phoenix, :format_encoders, json: Jason
377
378 config :phoenix, :json_library, Jason
379
380 config :pleroma, :gopher,
381 enabled: false,
382 ip: {0, 0, 0, 0},
383 port: 9999
384
385 config :pleroma, Pleroma.Web.Metadata,
386 providers: [
387 Pleroma.Web.Metadata.Providers.OpenGraph,
388 Pleroma.Web.Metadata.Providers.TwitterCard,
389 Pleroma.Web.Metadata.Providers.RelMe
390 ],
391 unfurl_nsfw: false
392
393 config :pleroma, :suggestions,
394 enabled: false,
395 third_party_engine:
396 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
397 timeout: 300_000,
398 limit: 40,
399 web: "https://vinayaka.distsn.org"
400
401 config :pleroma, :http_security,
402 enabled: true,
403 sts: false,
404 sts_max_age: 31_536_000,
405 ct_max_age: 2_592_000,
406 referrer_policy: "same-origin"
407
408 config :cors_plug,
409 max_age: 86_400,
410 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
411 expose: [
412 "Link",
413 "X-RateLimit-Reset",
414 "X-RateLimit-Limit",
415 "X-RateLimit-Remaining",
416 "X-Request-Id",
417 "Idempotency-Key"
418 ],
419 credentials: true,
420 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
421
422 config :pleroma, Pleroma.User,
423 restricted_nicknames: [
424 ".well-known",
425 "~",
426 "about",
427 "activities",
428 "api",
429 "auth",
430 "check_password",
431 "dev",
432 "friend-requests",
433 "inbox",
434 "internal",
435 "main",
436 "media",
437 "nodeinfo",
438 "notice",
439 "oauth",
440 "objects",
441 "ostatus_subscribe",
442 "pleroma",
443 "proxy",
444 "push",
445 "registration",
446 "relay",
447 "settings",
448 "status",
449 "tag",
450 "user-search",
451 "user_exists",
452 "users",
453 "web"
454 ]
455
456 config :pleroma, Pleroma.Web.Federator.RetryQueue,
457 enabled: false,
458 max_jobs: 20,
459 initial_timeout: 30,
460 max_retries: 5
461
462 config :pleroma_job_queue, :queues,
463 activity_expiration: 10,
464 federator_incoming: 50,
465 federator_outgoing: 50,
466 web_push: 50,
467 mailer: 10,
468 transmogrifier: 20,
469 scheduled_activities: 10,
470 background: 5
471
472 config :pleroma, :fetch_initial_posts,
473 enabled: false,
474 pages: 5
475
476 config :auto_linker,
477 opts: [
478 scheme: true,
479 extra: true,
480 # TODO: Set to :no_scheme when it works properly
481 validate_tld: true,
482 class: false,
483 strip_prefix: false,
484 new_window: false,
485 rel: false
486 ]
487
488 config :pleroma, :ldap,
489 enabled: System.get_env("LDAP_ENABLED") == "true",
490 host: System.get_env("LDAP_HOST") || "localhost",
491 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
492 ssl: System.get_env("LDAP_SSL") == "true",
493 sslopts: [],
494 tls: System.get_env("LDAP_TLS") == "true",
495 tlsopts: [],
496 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
497 uid: System.get_env("LDAP_UID") || "cn"
498
499 config :esshd,
500 enabled: false
501
502 oauth_consumer_strategies =
503 System.get_env("OAUTH_CONSUMER_STRATEGIES")
504 |> to_string()
505 |> String.split()
506 |> Enum.map(&hd(String.split(&1, ":")))
507
508 ueberauth_providers =
509 for strategy <- oauth_consumer_strategies do
510 strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
511 strategy_module = String.to_atom(strategy_module_name)
512 {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
513 end
514
515 config :ueberauth,
516 Ueberauth,
517 base_path: "/oauth",
518 providers: ueberauth_providers
519
520 config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
521
522 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
523
524 config :pleroma, Pleroma.Emails.UserEmail,
525 logo: nil,
526 styling: %{
527 link_color: "#d8a070",
528 background_color: "#2C3645",
529 content_background_color: "#1B2635",
530 header_color: "#d8a070",
531 text_color: "#b9b9ba",
532 text_muted_color: "#b9b9ba"
533 }
534
535 config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
536
537 config :pleroma, Pleroma.ScheduledActivity,
538 daily_user_limit: 25,
539 total_user_limit: 300,
540 enabled: true
541
542 config :pleroma, :email_notifications,
543 digest: %{
544 active: false,
545 schedule: "0 0 * * 0",
546 interval: 7,
547 inactivity_threshold: 7
548 }
549
550 config :pleroma, :oauth2,
551 token_expires_in: 600,
552 issue_new_refresh_token: true,
553 clean_expired_tokens: false,
554 clean_expired_tokens_interval: 86_400_000
555
556 config :pleroma, :database, rum_enabled: false
557
558 config :pleroma, :env, Mix.env()
559
560 config :http_signatures,
561 adapter: Pleroma.Signature
562
563 config :pleroma, :rate_limit, nil
564
565 config :pleroma, Pleroma.ActivityExpiration, enabled: true
566
567 config :pleroma, :web_cache_ttl,
568 activity_pub: nil,
569 activity_pub_question: 30_000
570
571 # Import environment specific config. This must remain at the bottom
572 # of this file so it overrides the configuration defined above.
573 import_config "#{Mix.env()}.exs"