FE
[akkoma] / test / config / config_db_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.ConfigDBTest do
6 use Pleroma.DataCase, async: true
7 import Pleroma.Factory
8 alias Pleroma.ConfigDB
9
10 test "get_by_key/1" do
11 config = insert(:config)
12 insert(:config)
13
14 assert config == ConfigDB.get_by_params(%{group: config.group, key: config.key})
15 end
16
17 test "create/1" do
18 {:ok, config} = ConfigDB.create(%{group: ":pleroma", key: ":some_key", value: "some_value"})
19 assert config == ConfigDB.get_by_params(%{group: ":pleroma", key: ":some_key"})
20 end
21
22 test "update/1" do
23 config = insert(:config)
24 {:ok, updated} = ConfigDB.update(config, %{value: "some_value"})
25 loaded = ConfigDB.get_by_params(%{group: config.group, key: config.key})
26 assert loaded == updated
27 end
28
29 test "get_all_as_keyword/0" do
30 saved = insert(:config)
31 insert(:config, group: ":quack", key: ":level", value: ConfigDB.to_binary(:info))
32 insert(:config, group: ":quack", key: ":meta", value: ConfigDB.to_binary([:none]))
33
34 insert(:config,
35 group: ":quack",
36 key: ":webhook_url",
37 value: ConfigDB.to_binary("https://hooks.slack.com/services/KEY/some_val")
38 )
39
40 config = ConfigDB.get_all_as_keyword()
41
42 assert config[:pleroma] == [
43 {ConfigDB.from_string(saved.key), ConfigDB.from_binary(saved.value)}
44 ]
45
46 assert config[:quack] == [
47 level: :info,
48 meta: [:none],
49 webhook_url: "https://hooks.slack.com/services/KEY/some_val"
50 ]
51 end
52
53 describe "update_or_create/1" do
54 test "common" do
55 config = insert(:config)
56 key2 = "another_key"
57
58 params = [
59 %{group: "pleroma", key: key2, value: "another_value"},
60 %{group: config.group, key: config.key, value: "new_value"}
61 ]
62
63 assert Repo.all(ConfigDB) |> length() == 1
64
65 Enum.each(params, &ConfigDB.update_or_create(&1))
66
67 assert Repo.all(ConfigDB) |> length() == 2
68
69 config1 = ConfigDB.get_by_params(%{group: config.group, key: config.key})
70 config2 = ConfigDB.get_by_params(%{group: "pleroma", key: key2})
71
72 assert config1.value == ConfigDB.transform("new_value")
73 assert config2.value == ConfigDB.transform("another_value")
74 end
75
76 test "partial update" do
77 config = insert(:config, value: ConfigDB.to_binary(key1: "val1", key2: :val2))
78
79 {:ok, _config} =
80 ConfigDB.update_or_create(%{
81 group: config.group,
82 key: config.key,
83 value: [key1: :val1, key3: :val3]
84 })
85
86 updated = ConfigDB.get_by_params(%{group: config.group, key: config.key})
87
88 value = ConfigDB.from_binary(updated.value)
89 assert length(value) == 3
90 assert value[:key1] == :val1
91 assert value[:key2] == :val2
92 assert value[:key3] == :val3
93 end
94
95 test "deep merge" do
96 config = insert(:config, value: ConfigDB.to_binary(key1: "val1", key2: [k1: :v1, k2: "v2"]))
97
98 {:ok, config} =
99 ConfigDB.update_or_create(%{
100 group: config.group,
101 key: config.key,
102 value: [key1: :val1, key2: [k2: :v2, k3: :v3], key3: :val3]
103 })
104
105 updated = ConfigDB.get_by_params(%{group: config.group, key: config.key})
106
107 assert config.value == updated.value
108
109 value = ConfigDB.from_binary(updated.value)
110 assert value[:key1] == :val1
111 assert value[:key2] == [k1: :v1, k2: :v2, k3: :v3]
112 assert value[:key3] == :val3
113 end
114
115 test "only full update for some keys" do
116 config1 = insert(:config, key: ":ecto_repos", value: ConfigDB.to_binary(repo: Pleroma.Repo))
117
118 config2 =
119 insert(:config, group: ":cors_plug", key: ":max_age", value: ConfigDB.to_binary(18))
120
121 {:ok, _config} =
122 ConfigDB.update_or_create(%{
123 group: config1.group,
124 key: config1.key,
125 value: [another_repo: [Pleroma.Repo]]
126 })
127
128 {:ok, _config} =
129 ConfigDB.update_or_create(%{
130 group: config2.group,
131 key: config2.key,
132 value: 777
133 })
134
135 updated1 = ConfigDB.get_by_params(%{group: config1.group, key: config1.key})
136 updated2 = ConfigDB.get_by_params(%{group: config2.group, key: config2.key})
137
138 assert ConfigDB.from_binary(updated1.value) == [another_repo: [Pleroma.Repo]]
139 assert ConfigDB.from_binary(updated2.value) == 777
140 end
141
142 test "full update if value is not keyword" do
143 config =
144 insert(:config,
145 group: ":tesla",
146 key: ":adapter",
147 value: ConfigDB.to_binary(Tesla.Adapter.Hackney)
148 )
149
150 {:ok, _config} =
151 ConfigDB.update_or_create(%{
152 group: config.group,
153 key: config.key,
154 value: Tesla.Adapter.Httpc
155 })
156
157 updated = ConfigDB.get_by_params(%{group: config.group, key: config.key})
158
159 assert ConfigDB.from_binary(updated.value) == Tesla.Adapter.Httpc
160 end
161
162 test "only full update for some subkeys" do
163 config1 =
164 insert(:config,
165 key: ":emoji",
166 value: ConfigDB.to_binary(groups: [a: 1, b: 2], key: [a: 1])
167 )
168
169 config2 =
170 insert(:config,
171 key: ":assets",
172 value: ConfigDB.to_binary(mascots: [a: 1, b: 2], key: [a: 1])
173 )
174
175 {:ok, _config} =
176 ConfigDB.update_or_create(%{
177 group: config1.group,
178 key: config1.key,
179 value: [groups: [c: 3, d: 4], key: [b: 2]]
180 })
181
182 {:ok, _config} =
183 ConfigDB.update_or_create(%{
184 group: config2.group,
185 key: config2.key,
186 value: [mascots: [c: 3, d: 4], key: [b: 2]]
187 })
188
189 updated1 = ConfigDB.get_by_params(%{group: config1.group, key: config1.key})
190 updated2 = ConfigDB.get_by_params(%{group: config2.group, key: config2.key})
191
192 assert ConfigDB.from_binary(updated1.value) == [groups: [c: 3, d: 4], key: [a: 1, b: 2]]
193 assert ConfigDB.from_binary(updated2.value) == [mascots: [c: 3, d: 4], key: [a: 1, b: 2]]
194 end
195 end
196
197 describe "delete/1" do
198 test "error on deleting non existing setting" do
199 {:error, error} = ConfigDB.delete(%{group: ":pleroma", key: ":key"})
200 assert error =~ "Config with params %{group: \":pleroma\", key: \":key\"} not found"
201 end
202
203 test "full delete" do
204 config = insert(:config)
205 {:ok, deleted} = ConfigDB.delete(%{group: config.group, key: config.key})
206 assert Ecto.get_meta(deleted, :state) == :deleted
207 refute ConfigDB.get_by_params(%{group: config.group, key: config.key})
208 end
209
210 test "partial subkeys delete" do
211 config = insert(:config, value: ConfigDB.to_binary(groups: [a: 1, b: 2], key: [a: 1]))
212
213 {:ok, deleted} =
214 ConfigDB.delete(%{group: config.group, key: config.key, subkeys: [":groups"]})
215
216 assert Ecto.get_meta(deleted, :state) == :loaded
217
218 assert deleted.value == ConfigDB.to_binary(key: [a: 1])
219
220 updated = ConfigDB.get_by_params(%{group: config.group, key: config.key})
221
222 assert updated.value == deleted.value
223 end
224
225 test "full delete if remaining value after subkeys deletion is empty list" do
226 config = insert(:config, value: ConfigDB.to_binary(groups: [a: 1, b: 2]))
227
228 {:ok, deleted} =
229 ConfigDB.delete(%{group: config.group, key: config.key, subkeys: [":groups"]})
230
231 assert Ecto.get_meta(deleted, :state) == :deleted
232
233 refute ConfigDB.get_by_params(%{group: config.group, key: config.key})
234 end
235 end
236
237 describe "transform/1" do
238 test "string" do
239 binary = ConfigDB.transform("value as string")
240 assert binary == :erlang.term_to_binary("value as string")
241 assert ConfigDB.from_binary(binary) == "value as string"
242 end
243
244 test "boolean" do
245 binary = ConfigDB.transform(false)
246 assert binary == :erlang.term_to_binary(false)
247 assert ConfigDB.from_binary(binary) == false
248 end
249
250 test "nil" do
251 binary = ConfigDB.transform(nil)
252 assert binary == :erlang.term_to_binary(nil)
253 assert ConfigDB.from_binary(binary) == nil
254 end
255
256 test "integer" do
257 binary = ConfigDB.transform(150)
258 assert binary == :erlang.term_to_binary(150)
259 assert ConfigDB.from_binary(binary) == 150
260 end
261
262 test "atom" do
263 binary = ConfigDB.transform(":atom")
264 assert binary == :erlang.term_to_binary(:atom)
265 assert ConfigDB.from_binary(binary) == :atom
266 end
267
268 test "ssl options" do
269 binary = ConfigDB.transform([":tlsv1", ":tlsv1.1", ":tlsv1.2"])
270 assert binary == :erlang.term_to_binary([:tlsv1, :"tlsv1.1", :"tlsv1.2"])
271 assert ConfigDB.from_binary(binary) == [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
272 end
273
274 test "pleroma module" do
275 binary = ConfigDB.transform("Pleroma.Bookmark")
276 assert binary == :erlang.term_to_binary(Pleroma.Bookmark)
277 assert ConfigDB.from_binary(binary) == Pleroma.Bookmark
278 end
279
280 test "pleroma string" do
281 binary = ConfigDB.transform("Pleroma")
282 assert binary == :erlang.term_to_binary("Pleroma")
283 assert ConfigDB.from_binary(binary) == "Pleroma"
284 end
285
286 test "phoenix module" do
287 binary = ConfigDB.transform("Phoenix.Socket.V1.JSONSerializer")
288 assert binary == :erlang.term_to_binary(Phoenix.Socket.V1.JSONSerializer)
289 assert ConfigDB.from_binary(binary) == Phoenix.Socket.V1.JSONSerializer
290 end
291
292 test "tesla module" do
293 binary = ConfigDB.transform("Tesla.Adapter.Hackney")
294 assert binary == :erlang.term_to_binary(Tesla.Adapter.Hackney)
295 assert ConfigDB.from_binary(binary) == Tesla.Adapter.Hackney
296 end
297
298 test "ExSyslogger module" do
299 binary = ConfigDB.transform("ExSyslogger")
300 assert binary == :erlang.term_to_binary(ExSyslogger)
301 assert ConfigDB.from_binary(binary) == ExSyslogger
302 end
303
304 test "Quack.Logger module" do
305 binary = ConfigDB.transform("Quack.Logger")
306 assert binary == :erlang.term_to_binary(Quack.Logger)
307 assert ConfigDB.from_binary(binary) == Quack.Logger
308 end
309
310 test "sigil" do
311 binary = ConfigDB.transform("~r[comp[lL][aA][iI][nN]er]")
312 assert binary == :erlang.term_to_binary(~r/comp[lL][aA][iI][nN]er/)
313 assert ConfigDB.from_binary(binary) == ~r/comp[lL][aA][iI][nN]er/
314 end
315
316 test "link sigil" do
317 binary = ConfigDB.transform("~r/https:\/\/example.com/")
318 assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/)
319 assert ConfigDB.from_binary(binary) == ~r/https:\/\/example.com/
320 end
321
322 test "link sigil with um modifiers" do
323 binary = ConfigDB.transform("~r/https:\/\/example.com/um")
324 assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/um)
325 assert ConfigDB.from_binary(binary) == ~r/https:\/\/example.com/um
326 end
327
328 test "link sigil with i modifier" do
329 binary = ConfigDB.transform("~r/https:\/\/example.com/i")
330 assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/i)
331 assert ConfigDB.from_binary(binary) == ~r/https:\/\/example.com/i
332 end
333
334 test "link sigil with s modifier" do
335 binary = ConfigDB.transform("~r/https:\/\/example.com/s")
336 assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/s)
337 assert ConfigDB.from_binary(binary) == ~r/https:\/\/example.com/s
338 end
339
340 test "raise if valid delimiter not found" do
341 assert_raise ArgumentError, "valid delimiter for Regex expression not found", fn ->
342 ConfigDB.transform("~r/https://[]{}<>\"'()|example.com/s")
343 end
344 end
345
346 test "2 child tuple" do
347 binary = ConfigDB.transform(%{"tuple" => ["v1", ":v2"]})
348 assert binary == :erlang.term_to_binary({"v1", :v2})
349 assert ConfigDB.from_binary(binary) == {"v1", :v2}
350 end
351
352 test "proxy tuple with localhost" do
353 binary =
354 ConfigDB.transform(%{
355 "tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]
356 })
357
358 assert binary == :erlang.term_to_binary({:proxy_url, {:socks5, :localhost, 1234}})
359 assert ConfigDB.from_binary(binary) == {:proxy_url, {:socks5, :localhost, 1234}}
360 end
361
362 test "proxy tuple with domain" do
363 binary =
364 ConfigDB.transform(%{
365 "tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]
366 })
367
368 assert binary == :erlang.term_to_binary({:proxy_url, {:socks5, 'domain.com', 1234}})
369 assert ConfigDB.from_binary(binary) == {:proxy_url, {:socks5, 'domain.com', 1234}}
370 end
371
372 test "proxy tuple with ip" do
373 binary =
374 ConfigDB.transform(%{
375 "tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]
376 })
377
378 assert binary == :erlang.term_to_binary({:proxy_url, {:socks5, {127, 0, 0, 1}, 1234}})
379 assert ConfigDB.from_binary(binary) == {:proxy_url, {:socks5, {127, 0, 0, 1}, 1234}}
380 end
381
382 test "tuple with n childs" do
383 binary =
384 ConfigDB.transform(%{
385 "tuple" => [
386 "v1",
387 ":v2",
388 "Pleroma.Bookmark",
389 150,
390 false,
391 "Phoenix.Socket.V1.JSONSerializer"
392 ]
393 })
394
395 assert binary ==
396 :erlang.term_to_binary(
397 {"v1", :v2, Pleroma.Bookmark, 150, false, Phoenix.Socket.V1.JSONSerializer}
398 )
399
400 assert ConfigDB.from_binary(binary) ==
401 {"v1", :v2, Pleroma.Bookmark, 150, false, Phoenix.Socket.V1.JSONSerializer}
402 end
403
404 test "map with string key" do
405 binary = ConfigDB.transform(%{"key" => "value"})
406 assert binary == :erlang.term_to_binary(%{"key" => "value"})
407 assert ConfigDB.from_binary(binary) == %{"key" => "value"}
408 end
409
410 test "map with atom key" do
411 binary = ConfigDB.transform(%{":key" => "value"})
412 assert binary == :erlang.term_to_binary(%{key: "value"})
413 assert ConfigDB.from_binary(binary) == %{key: "value"}
414 end
415
416 test "list of strings" do
417 binary = ConfigDB.transform(["v1", "v2", "v3"])
418 assert binary == :erlang.term_to_binary(["v1", "v2", "v3"])
419 assert ConfigDB.from_binary(binary) == ["v1", "v2", "v3"]
420 end
421
422 test "list of modules" do
423 binary = ConfigDB.transform(["Pleroma.Repo", "Pleroma.Activity"])
424 assert binary == :erlang.term_to_binary([Pleroma.Repo, Pleroma.Activity])
425 assert ConfigDB.from_binary(binary) == [Pleroma.Repo, Pleroma.Activity]
426 end
427
428 test "list of atoms" do
429 binary = ConfigDB.transform([":v1", ":v2", ":v3"])
430 assert binary == :erlang.term_to_binary([:v1, :v2, :v3])
431 assert ConfigDB.from_binary(binary) == [:v1, :v2, :v3]
432 end
433
434 test "list of mixed values" do
435 binary =
436 ConfigDB.transform([
437 "v1",
438 ":v2",
439 "Pleroma.Repo",
440 "Phoenix.Socket.V1.JSONSerializer",
441 15,
442 false
443 ])
444
445 assert binary ==
446 :erlang.term_to_binary([
447 "v1",
448 :v2,
449 Pleroma.Repo,
450 Phoenix.Socket.V1.JSONSerializer,
451 15,
452 false
453 ])
454
455 assert ConfigDB.from_binary(binary) == [
456 "v1",
457 :v2,
458 Pleroma.Repo,
459 Phoenix.Socket.V1.JSONSerializer,
460 15,
461 false
462 ]
463 end
464
465 test "simple keyword" do
466 binary = ConfigDB.transform([%{"tuple" => [":key", "value"]}])
467 assert binary == :erlang.term_to_binary([{:key, "value"}])
468 assert ConfigDB.from_binary(binary) == [{:key, "value"}]
469 assert ConfigDB.from_binary(binary) == [key: "value"]
470 end
471
472 test "keyword with partial_chain key" do
473 binary =
474 ConfigDB.transform([%{"tuple" => [":partial_chain", "&:hackney_connect.partial_chain/1"]}])
475
476 assert binary == :erlang.term_to_binary(partial_chain: &:hackney_connect.partial_chain/1)
477 assert ConfigDB.from_binary(binary) == [partial_chain: &:hackney_connect.partial_chain/1]
478 end
479
480 test "keyword" do
481 binary =
482 ConfigDB.transform([
483 %{"tuple" => [":types", "Pleroma.PostgresTypes"]},
484 %{"tuple" => [":telemetry_event", ["Pleroma.Repo.Instrumenter"]]},
485 %{"tuple" => [":migration_lock", nil]},
486 %{"tuple" => [":key1", 150]},
487 %{"tuple" => [":key2", "string"]}
488 ])
489
490 assert binary ==
491 :erlang.term_to_binary(
492 types: Pleroma.PostgresTypes,
493 telemetry_event: [Pleroma.Repo.Instrumenter],
494 migration_lock: nil,
495 key1: 150,
496 key2: "string"
497 )
498
499 assert ConfigDB.from_binary(binary) == [
500 types: Pleroma.PostgresTypes,
501 telemetry_event: [Pleroma.Repo.Instrumenter],
502 migration_lock: nil,
503 key1: 150,
504 key2: "string"
505 ]
506 end
507
508 test "complex keyword with nested mixed childs" do
509 binary =
510 ConfigDB.transform([
511 %{"tuple" => [":uploader", "Pleroma.Uploaders.Local"]},
512 %{"tuple" => [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
513 %{"tuple" => [":link_name", true]},
514 %{"tuple" => [":proxy_remote", false]},
515 %{"tuple" => [":common_map", %{":key" => "value"}]},
516 %{
517 "tuple" => [
518 ":proxy_opts",
519 [
520 %{"tuple" => [":redirect_on_failure", false]},
521 %{"tuple" => [":max_body_length", 1_048_576]},
522 %{
523 "tuple" => [
524 ":http",
525 [%{"tuple" => [":follow_redirect", true]}, %{"tuple" => [":pool", ":upload"]}]
526 ]
527 }
528 ]
529 ]
530 }
531 ])
532
533 assert binary ==
534 :erlang.term_to_binary(
535 uploader: Pleroma.Uploaders.Local,
536 filters: [Pleroma.Upload.Filter.Dedupe],
537 link_name: true,
538 proxy_remote: false,
539 common_map: %{key: "value"},
540 proxy_opts: [
541 redirect_on_failure: false,
542 max_body_length: 1_048_576,
543 http: [
544 follow_redirect: true,
545 pool: :upload
546 ]
547 ]
548 )
549
550 assert ConfigDB.from_binary(binary) ==
551 [
552 uploader: Pleroma.Uploaders.Local,
553 filters: [Pleroma.Upload.Filter.Dedupe],
554 link_name: true,
555 proxy_remote: false,
556 common_map: %{key: "value"},
557 proxy_opts: [
558 redirect_on_failure: false,
559 max_body_length: 1_048_576,
560 http: [
561 follow_redirect: true,
562 pool: :upload
563 ]
564 ]
565 ]
566 end
567
568 test "common keyword" do
569 binary =
570 ConfigDB.transform([
571 %{"tuple" => [":level", ":warn"]},
572 %{"tuple" => [":meta", [":all"]]},
573 %{"tuple" => [":path", ""]},
574 %{"tuple" => [":val", nil]},
575 %{"tuple" => [":webhook_url", "https://hooks.slack.com/services/YOUR-KEY-HERE"]}
576 ])
577
578 assert binary ==
579 :erlang.term_to_binary(
580 level: :warn,
581 meta: [:all],
582 path: "",
583 val: nil,
584 webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
585 )
586
587 assert ConfigDB.from_binary(binary) == [
588 level: :warn,
589 meta: [:all],
590 path: "",
591 val: nil,
592 webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
593 ]
594 end
595
596 test "complex keyword with sigil" do
597 binary =
598 ConfigDB.transform([
599 %{"tuple" => [":federated_timeline_removal", []]},
600 %{"tuple" => [":reject", ["~r/comp[lL][aA][iI][nN]er/"]]},
601 %{"tuple" => [":replace", []]}
602 ])
603
604 assert binary ==
605 :erlang.term_to_binary(
606 federated_timeline_removal: [],
607 reject: [~r/comp[lL][aA][iI][nN]er/],
608 replace: []
609 )
610
611 assert ConfigDB.from_binary(binary) ==
612 [federated_timeline_removal: [], reject: [~r/comp[lL][aA][iI][nN]er/], replace: []]
613 end
614
615 test "complex keyword with tuples with more than 2 values" do
616 binary =
617 ConfigDB.transform([
618 %{
619 "tuple" => [
620 ":http",
621 [
622 %{
623 "tuple" => [
624 ":key1",
625 [
626 %{
627 "tuple" => [
628 ":_",
629 [
630 %{
631 "tuple" => [
632 "/api/v1/streaming",
633 "Pleroma.Web.MastodonAPI.WebsocketHandler",
634 []
635 ]
636 },
637 %{
638 "tuple" => [
639 "/websocket",
640 "Phoenix.Endpoint.CowboyWebSocket",
641 %{
642 "tuple" => [
643 "Phoenix.Transports.WebSocket",
644 %{
645 "tuple" => [
646 "Pleroma.Web.Endpoint",
647 "Pleroma.Web.UserSocket",
648 []
649 ]
650 }
651 ]
652 }
653 ]
654 },
655 %{
656 "tuple" => [
657 ":_",
658 "Phoenix.Endpoint.Cowboy2Handler",
659 %{"tuple" => ["Pleroma.Web.Endpoint", []]}
660 ]
661 }
662 ]
663 ]
664 }
665 ]
666 ]
667 }
668 ]
669 ]
670 }
671 ])
672
673 assert binary ==
674 :erlang.term_to_binary(
675 http: [
676 key1: [
677 _: [
678 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
679 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
680 {Phoenix.Transports.WebSocket,
681 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, []}}},
682 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
683 ]
684 ]
685 ]
686 )
687
688 assert ConfigDB.from_binary(binary) == [
689 http: [
690 key1: [
691 {:_,
692 [
693 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
694 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
695 {Phoenix.Transports.WebSocket,
696 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, []}}},
697 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
698 ]}
699 ]
700 ]
701 ]
702 end
703 end
704 end