Merge branch '963_oob_oauth_redirect_fix' into 'develop'
[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: false,
56 seconds_valid: 60,
57 method: Pleroma.Captcha.Kocaptcha
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 config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
74
75 # Upload configuration
76 config :pleroma, Pleroma.Upload,
77 uploader: Pleroma.Uploaders.Local,
78 filters: [Pleroma.Upload.Filter.Dedupe],
79 link_name: true,
80 proxy_remote: false,
81 proxy_opts: [
82 redirect_on_failure: false,
83 max_body_length: 25 * 1_048_576,
84 http: [
85 follow_redirect: true,
86 pool: :upload
87 ]
88 ]
89
90 config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
91
92 config :pleroma, Pleroma.Uploaders.S3,
93 bucket: nil,
94 public_endpoint: "https://s3.amazonaws.com"
95
96 config :pleroma, Pleroma.Uploaders.MDII,
97 cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
98 files: "https://mdii.sakura.ne.jp"
99
100 config :pleroma, :emoji,
101 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"
107
108 config :pleroma, :uri_schemes,
109 valid_schemes: [
110 "https",
111 "http",
112 "dat",
113 "dweb",
114 "gopher",
115 "ipfs",
116 "ipns",
117 "irc",
118 "ircs",
119 "magnet",
120 "mailto",
121 "mumble",
122 "ssb",
123 "xmpp"
124 ]
125
126 websocket_config = [
127 path: "/websocket",
128 serializer: [
129 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
130 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
131 ],
132 timeout: 60_000,
133 transport_log: false,
134 compress: false
135 ]
136
137 # Configures the endpoint
138 config :pleroma, Pleroma.Web.Endpoint,
139 instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
140 url: [host: "localhost"],
141 http: [
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 # We don't support TLS v1.3 yet
196 versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
197 ]
198 ]
199
200 config :pleroma, :instance,
201 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,
206 remote_limit: 100_000,
207 upload_limit: 16_000_000,
208 avatar_upload_limit: 2_000_000,
209 background_upload_limit: 4_000_000,
210 banner_upload_limit: 4_000_000,
211 poll_limits: %{
212 max_options: 20,
213 max_option_chars: 200,
214 min_expiration: 0,
215 max_expiration: 365 * 24 * 60 * 60
216 },
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,
226 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
227 public: true,
228 quarantined_instances: [],
229 managed_config: true,
230 static_dir: "instance/static/",
231 allowed_post_formats: [
232 "text/plain",
233 "text/html",
234 "text/markdown",
235 "text/bbcode"
236 ],
237 mrf_transparency: true,
238 autofollowed_nicknames: [],
239 max_pinned_statuses: 1,
240 no_attachment_links: false,
241 welcome_user_nickname: nil,
242 welcome_message: nil,
243 max_report_comment_size: 1000,
244 safe_dm_mentions: false,
245 healthcheck: false,
246 remote_post_retention_days: 90,
247 skip_thread_containment: true,
248 limit_to_local_content: :unauthenticated,
249 dynamic_configuration: false
250
251 config :pleroma, :markup,
252 # XXX - unfortunately, inline images must be enabled by default right now, because
253 # of custom emoji. Issue #275 discusses defanging that somehow.
254 allow_inline_images: true,
255 allow_headings: false,
256 allow_tables: false,
257 allow_fonts: false,
258 scrub_policy: [
259 Pleroma.HTML.Transform.MediaProxy,
260 Pleroma.HTML.Scrubber.Default
261 ]
262
263 config :pleroma, :frontend_configurations,
264 pleroma_fe: %{
265 theme: "pleroma-dark",
266 logo: "/static/logo.png",
267 background: "/images/city.jpg",
268 redirectRootNoLogin: "/main/all",
269 redirectRootLogin: "/main/friends",
270 showInstanceSpecificPanel: true,
271 scopeOptionsEnabled: false,
272 formattingOptionsEnabled: false,
273 collapseMessageWithSubject: false,
274 hidePostStats: false,
275 hideUserStats: false,
276 scopeCopy: true,
277 subjectLineBehavior: "email",
278 alwaysShowSubjectInput: true
279 },
280 masto_fe: %{
281 showInstanceSpecificPanel: true
282 }
283
284 config :pleroma, :assets,
285 mascots: [
286 pleroma_fox_tan: %{
287 url: "/images/pleroma-fox-tan-smol.png",
288 mime_type: "image/png"
289 },
290 pleroma_fox_tan_shy: %{
291 url: "/images/pleroma-fox-tan-shy.png",
292 mime_type: "image/png"
293 }
294 ],
295 default_mascot: :pleroma_fox_tan
296
297 config :pleroma, :activitypub,
298 accept_blocks: true,
299 unfollow_blocked: true,
300 outgoing_blocks: true,
301 follow_handshake_timeout: 500
302
303 config :pleroma, :user, deny_follow_blocked: true
304
305 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
306
307 config :pleroma, :mrf_rejectnonpublic,
308 allow_followersonly: false,
309 allow_direct: false
310
311 config :pleroma, :mrf_hellthread,
312 delist_threshold: 10,
313 reject_threshold: 20
314
315 config :pleroma, :mrf_simple,
316 media_removal: [],
317 media_nsfw: [],
318 federated_timeline_removal: [],
319 report_removal: [],
320 reject: [],
321 accept: [],
322 avatar_removal: [],
323 banner_removal: []
324
325 config :pleroma, :mrf_keyword,
326 reject: [],
327 federated_timeline_removal: [],
328 replace: []
329
330 config :pleroma, :mrf_subchain, match_actor: %{}
331
332 config :pleroma, :rich_media, enabled: true
333
334 config :pleroma, :media_proxy,
335 enabled: false,
336 proxy_opts: [
337 redirect_on_failure: false,
338 max_body_length: 25 * 1_048_576,
339 http: [
340 follow_redirect: true,
341 pool: :media
342 ]
343 ],
344 whitelist: []
345
346 config :pleroma, :chat, enabled: true
347
348 config :phoenix, :format_encoders, json: Jason
349
350 config :pleroma, :gopher,
351 enabled: false,
352 ip: {0, 0, 0, 0},
353 port: 9999
354
355 config :pleroma, Pleroma.Web.Metadata,
356 providers: [Pleroma.Web.Metadata.Providers.RelMe],
357 unfurl_nsfw: false
358
359 config :pleroma, :suggestions,
360 enabled: false,
361 third_party_engine:
362 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
363 timeout: 300_000,
364 limit: 40,
365 web: "https://vinayaka.distsn.org"
366
367 config :pleroma, :http_security,
368 enabled: true,
369 sts: false,
370 sts_max_age: 31_536_000,
371 ct_max_age: 2_592_000,
372 referrer_policy: "same-origin"
373
374 config :cors_plug,
375 max_age: 86_400,
376 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
377 expose: [
378 "Link",
379 "X-RateLimit-Reset",
380 "X-RateLimit-Limit",
381 "X-RateLimit-Remaining",
382 "X-Request-Id",
383 "Idempotency-Key"
384 ],
385 credentials: true,
386 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
387
388 config :pleroma, Pleroma.User,
389 restricted_nicknames: [
390 ".well-known",
391 "~",
392 "about",
393 "activities",
394 "api",
395 "auth",
396 "check_password",
397 "dev",
398 "friend-requests",
399 "inbox",
400 "internal",
401 "main",
402 "media",
403 "nodeinfo",
404 "notice",
405 "oauth",
406 "objects",
407 "ostatus_subscribe",
408 "pleroma",
409 "proxy",
410 "push",
411 "registration",
412 "relay",
413 "settings",
414 "status",
415 "tag",
416 "user-search",
417 "user_exists",
418 "users",
419 "web"
420 ]
421
422 config :pleroma, Pleroma.Web.Federator.RetryQueue,
423 enabled: false,
424 max_jobs: 20,
425 initial_timeout: 30,
426 max_retries: 5
427
428 config :pleroma_job_queue, :queues,
429 federator_incoming: 50,
430 federator_outgoing: 50,
431 web_push: 50,
432 mailer: 10,
433 transmogrifier: 20,
434 scheduled_activities: 10,
435 background: 5
436
437 config :pleroma, :fetch_initial_posts,
438 enabled: false,
439 pages: 5
440
441 config :auto_linker,
442 opts: [
443 scheme: true,
444 extra: true,
445 class: false,
446 strip_prefix: false,
447 new_window: false,
448 rel: false
449 ]
450
451 config :pleroma, :ldap,
452 enabled: System.get_env("LDAP_ENABLED") == "true",
453 host: System.get_env("LDAP_HOST") || "localhost",
454 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
455 ssl: System.get_env("LDAP_SSL") == "true",
456 sslopts: [],
457 tls: System.get_env("LDAP_TLS") == "true",
458 tlsopts: [],
459 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
460 uid: System.get_env("LDAP_UID") || "cn"
461
462 config :esshd,
463 enabled: false
464
465 oauth_consumer_strategies =
466 System.get_env("OAUTH_CONSUMER_STRATEGIES")
467 |> to_string()
468 |> String.split()
469 |> Enum.map(&hd(String.split(&1, ":")))
470
471 ueberauth_providers =
472 for strategy <- oauth_consumer_strategies do
473 strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
474 strategy_module = String.to_atom(strategy_module_name)
475 {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
476 end
477
478 config :ueberauth,
479 Ueberauth,
480 base_path: "/oauth",
481 providers: ueberauth_providers
482
483 config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
484
485 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail
486
487 config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
488
489 config :pleroma, Pleroma.ScheduledActivity,
490 daily_user_limit: 25,
491 total_user_limit: 300,
492 enabled: true
493
494 config :pleroma, :oauth2,
495 token_expires_in: 600,
496 issue_new_refresh_token: true,
497 clean_expired_tokens: false,
498 clean_expired_tokens_interval: 86_400_000
499
500 config :pleroma, :database, rum_enabled: false
501
502 config :pleroma, :env, Mix.env()
503
504 config :http_signatures,
505 adapter: Pleroma.Signature
506
507 config :pleroma, :rate_limit,
508 search: [{1000, 10}, {1000, 30}],
509 app_account_creation: {1_800_000, 25}
510
511 # Import environment specific config. This must remain at the bottom
512 # of this file so it overrides the configuration defined above.
513 import_config "#{Mix.env()}.exs"