From e666ee070043ed4b1c70c64dbe3bf31d9d744b8d Mon Sep 17 00:00:00 2001 From: Celeste <20312-Celeste@users.gitlab.alpinelinux.org> Date: Tue, 16 Apr 2024 03:07:23 +0000 Subject: community/matrix2051: move from testing --- community/matrix2051/APKBUILD | 62 ++++++++++ community/matrix2051/matrix2051.initd | 30 +++++ community/matrix2051/no-erts.patch | 12 ++ community/matrix2051/pantalaimon.patch | 199 +++++++++++++++++++++++++++++++++ testing/matrix2051/APKBUILD | 69 ------------ testing/matrix2051/matrix2051.initd | 30 ----- testing/matrix2051/no-erts.patch | 12 -- testing/matrix2051/pantalaimon.patch | 199 --------------------------------- 8 files changed, 303 insertions(+), 310 deletions(-) create mode 100644 community/matrix2051/APKBUILD create mode 100644 community/matrix2051/matrix2051.initd create mode 100644 community/matrix2051/no-erts.patch create mode 100644 community/matrix2051/pantalaimon.patch delete mode 100644 testing/matrix2051/APKBUILD delete mode 100644 testing/matrix2051/matrix2051.initd delete mode 100644 testing/matrix2051/no-erts.patch delete mode 100644 testing/matrix2051/pantalaimon.patch diff --git a/community/matrix2051/APKBUILD b/community/matrix2051/APKBUILD new file mode 100644 index 00000000000..3c05b148d36 --- /dev/null +++ b/community/matrix2051/APKBUILD @@ -0,0 +1,62 @@ +# Contributor: Celeste +# Maintainer: Celeste +pkgname=matrix2051 +pkgver=0_git20240215 +_gitrev=99da81db0ed0e71f50cd924d24ee30f9780518e0 +pkgrel=0 +pkgdesc="Matrix gateway for IRC" +url="https://github.com/progval/matrix2051" +arch="noarch" +license="AGPL-3.0-only" +depends="erlang" +makedepends="elixir rebar3" +subpackages="$pkgname-openrc" +source="$pkgname-$pkgver.tar.gz::https://github.com/progval/matrix2051/archive/$_gitrev.tar.gz + matrix2051.initd + no-erts.patch + pantalaimon.patch + " +builddir="$srcdir/$pkgname-$_gitrev" + +export HEX_HOME="${HEX_HOME:-"$srcdir/hex"}" +export MIX_HOME="${MIX_HOME:-"$srcdir/mix"}" +export MIX_ARCHIVES="${MIX_ARCHIVES:-"$srcdir/mix/archives"}" + +export MIX_ENV=prod +export REBAR_DEPS_PREFER_LIBS="TRUE" +export ERL_LIBS="/usr/lib/erlang/lib" + +prepare() { + default_prepare + + msg "Using precompiled hex" + mix local.hex --force + msg "Using system rebar3" + mix local.rebar --force rebar3 /usr/bin/rebar3 + + mix deps.get --only prod +} + +build() { + mix release --path build +} + +check() { + ./build/bin/matrix2051 version +} + +package() { + install -dvm755 "$pkgdir"/usr/lib + cp -a build "$pkgdir"/usr/lib/matrix2051 + find "$pkgdir"/usr/lib/matrix2051 -name '*.bat' -delete + + install -Dvm755 "$srcdir"/matrix2051.initd \ + "$pkgdir"/etc/init.d/matrix2051 +} + +sha512sums=" +ea9dab812abf16657ee44157ac588fc78ab1d0b1c5bfb6cc22ffac27d240b395b8b4bf7af3e4226ddb71141af90f4328585f9a4c4bb4f779b508a03ca094be2d matrix2051-0_git20240215.tar.gz +8cb570ee1d6c9b36c34f38bdc7a999a921ac81d8ba08bcd4bdf8d66ca9b8c94d895111599c65ab8ff8f7fb1be6c0158318c9a4f2b8f1cbee608fe50ef66f700d matrix2051.initd +974396c6ce87fb264cb901aac37bee25e2a83264633ff607024ebf9e08cfc2f669ab3ab4ae010d12561d0bcfcd167be99ba418f336685ec2afc2312e12ebbf51 no-erts.patch +f4af9b1a0bb1f6628da54119e604ff5af2765c037b69602ccc2e726ed33a1f60f68b31acad1fa38e5e95222cad1d73fcf488636569fe87b05324173c59234500 pantalaimon.patch +" diff --git a/community/matrix2051/matrix2051.initd b/community/matrix2051/matrix2051.initd new file mode 100644 index 00000000000..30593bbc517 --- /dev/null +++ b/community/matrix2051/matrix2051.initd @@ -0,0 +1,30 @@ +#!/sbin/openrc-run + +name=matrix2051 +description="Matrix2051 is a Matrix gateway for IRC" + +: ${command_user:="nobody:nobody"} +: ${EPMD:="/usr/bin/epmd"} + +export ELIXIR_ERL_OPTIONS="${ELIXIR_ERL_OPTIONS:-"-kernel inet_dist_use_interface {127,0,0,1}"}" +export ERL_EPMD_ADDRESS="${ERL_EPMD_ADDRESS:-"127.0.0.1"}" + +command="/usr/lib/matrix2051/bin/matrix2051" +command_args="start $command_args" +command_background="yes" +pidfile="/run/${RC_SVCNAME}.pid" +output_log="/var/log/matrix2051.log" +error_log="/var/log/matrix2051.log" + +depend() { + need localmount net + after firewall +} + +start_pre() { + checkpath -f -m 0640 -o "$command_user" "$output_log" "$error_log" +} + +stop_post() { + "$EPMD" -names 2>/dev/null | grep -q '^name' || "$EPMD" -kill >/dev/null +} diff --git a/community/matrix2051/no-erts.patch b/community/matrix2051/no-erts.patch new file mode 100644 index 00000000000..f29c867013a --- /dev/null +++ b/community/matrix2051/no-erts.patch @@ -0,0 +1,12 @@ +--- a/mix.exs ++++ b/mix.exs +@@ -27,7 +27,8 @@ + releases: [ + matrix2051: [ + version: version(), +- applications: [matrix2051: :permanent] ++ applications: [matrix2051: :permanent], ++ include_erts: false + ] + ] + ] diff --git a/community/matrix2051/pantalaimon.patch b/community/matrix2051/pantalaimon.patch new file mode 100644 index 00000000000..a1b1c277047 --- /dev/null +++ b/community/matrix2051/pantalaimon.patch @@ -0,0 +1,199 @@ +From 4ecd6ebbff52dc3b3b0f44b77bfc38fb3ba324e5 Mon Sep 17 00:00:00 2001 +From: Val Lorentz +Date: Sun, 13 Nov 2022 13:22:33 +0100 +Subject: [PATCH 1/2] Add support for using a proxy + +--- + README.md | 6 ++++++ + lib/irc/handler.ex | 16 ++++++++++++++-- + lib/matrix_client/client.ex | 8 ++++---- + test/matrix_client/client_test.exs | 10 +++++----- + test/test_helper.exs | 2 +- + 5 files changed, 30 insertions(+), 12 deletions(-) + +diff --git a/README.md b/README.md +index 07d4849..8da832f 100644 +--- a/README.md ++++ b/README.md +@@ -83,6 +83,12 @@ See below for extra instructions to work with web clients. + + See `INSTALL.md` for a more production-oriented guide. + ++## End-to-end encryption ++ ++Matrix2051 does not support Matrix's end-to-end encryption (E2EE), but can optionally be used with [Pantalaimon](https://github.com/matrix-org/pantalaimon). ++ ++To do so, setup Pantalaimon locally, and configure `plaintextproxy=http://localhost:8009/` as your IRC client's GECOS/"real name". ++ + ## Architecture + + * `matrix2051.exs` starts M51.Application, which starts M51.Supervisor, which +diff --git a/lib/irc/handler.ex b/lib/irc/handler.ex +index 6fcad82..02bf001 100644 +--- a/lib/irc/handler.ex ++++ b/lib/irc/handler.ex +@@ -170,7 +170,6 @@ defmodule M51.IrcConn.Handler do + state = M51.IrcConn.Supervisor.state(sup_pid) + + M51.IrcConn.State.set_nick(state, nick) +- M51.IrcConn.State.set_gecos(state, gecos) + + case user_id do + # all good +@@ -321,6 +320,8 @@ defmodule M51.IrcConn.Handler do + nil + + {"USER", [_, _, _, gecos | _]} -> ++ state = M51.IrcConn.Supervisor.state(sup_pid) ++ M51.IrcConn.State.set_gecos(state, gecos) + {:user, gecos} + + {"USER", _} -> +@@ -407,6 +408,7 @@ defmodule M51.IrcConn.Handler do + + # TODO: support multi-line AUTHENTICATE + ++ state = M51.IrcConn.Supervisor.state(sup_pid) + matrix_client = M51.IrcConn.Supervisor.matrix_client(sup_pid) + + case M51.MatrixClient.Client.user_id(matrix_client) do +@@ -419,11 +421,21 @@ defmodule M51.IrcConn.Handler do + {:ok, {local_name, hostname}} -> + user_id = authcid + ++ proxy = ++ case Regex.named_captures( ++ ~R(plaintextproxy=(?https?://\S*\)), ++ M51.IrcConn.State.gecos(state) || "" ++ ) do ++ nil -> nil ++ %{"url" => url} -> url ++ end ++ + case M51.MatrixClient.Client.connect( + matrix_client, + local_name, + hostname, +- passwd ++ passwd, ++ proxy + ) do + {:ok} -> + # RPL_LOGGEDIN +diff --git a/lib/matrix_client/client.ex b/lib/matrix_client/client.ex +index 27ffab6..45920c4 100644 +--- a/lib/matrix_client/client.ex ++++ b/lib/matrix_client/client.ex +@@ -66,14 +66,14 @@ defmodule M51.MatrixClient.Client do + end + + @impl true +- def handle_call({:connect, local_name, hostname, password}, _from, state) do ++ def handle_call({:connect, local_name, hostname, password, proxy}, _from, state) do + case state do + %M51.MatrixClient.Client{ + state: :initial_state, + irc_pid: irc_pid + } -> + httpoison = M51.Config.httpoison() +- base_url = get_base_url(hostname) ++ base_url = proxy || get_base_url(hostname) + + # Check the server supports password login + url = base_url <> "/_matrix/client/r0/login" +@@ -491,8 +491,8 @@ defmodule M51.MatrixClient.Client do + end + end + +- def connect(pid, local_name, hostname, password) do +- GenServer.call(pid, {:connect, local_name, hostname, password}, @timeout) ++ def connect(pid, local_name, hostname, password, proxy \\ nil) do ++ GenServer.call(pid, {:connect, local_name, hostname, password, proxy}, @timeout) + end + + def raw_client(pid) do +diff --git a/test/matrix_client/client_test.exs b/test/matrix_client/client_test.exs +index 78b496f..0e6f5b6 100644 +--- a/test/matrix_client/client_test.exs ++++ b/test/matrix_client/client_test.exs +@@ -105,7 +105,7 @@ defmodule M51.MatrixClient.ClientTest do + client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) + + assert {:error, :unknown, message} = +- GenServer.call(client, {:connect, "user", "example.org", "p4ssw0rd"}) ++ GenServer.call(client, {:connect, "user", "example.org", "p4ssw0rd", nil}) + + assert Regex.match?(~r/Could not reach the Matrix homeserver for example.org.*/, message) + +@@ -168,7 +168,7 @@ defmodule M51.MatrixClient.ClientTest do + + client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) + +- assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd"}) == {:ok} ++ assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd", nil}) == {:ok} + + assert GenServer.call(client, {:dump_state}) == + %M51.MatrixClient.Client{ +@@ -246,7 +246,7 @@ defmodule M51.MatrixClient.ClientTest do + + client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) + +- assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd"}) == {:ok} ++ assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd", nil}) == {:ok} + + assert GenServer.call(client, {:dump_state}) == + %M51.MatrixClient.Client{ +@@ -299,7 +299,7 @@ defmodule M51.MatrixClient.ClientTest do + + client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) + +- assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd"}) == ++ assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd", nil}) == + {:error, :no_password_flow, "No password flow"} + + assert GenServer.call(client, {:dump_state}) == +@@ -359,7 +359,7 @@ defmodule M51.MatrixClient.ClientTest do + + client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) + +- assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd"}) == ++ assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd", nil}) == + {:error, :denied, "Invalid password"} + + assert GenServer.call(client, {:dump_state}) == +diff --git a/test/test_helper.exs b/test/test_helper.exs +index 66acf53..c4d7904 100644 +--- a/test/test_helper.exs ++++ b/test/test_helper.exs +@@ -96,7 +96,7 @@ defmodule MockMatrixClient do + end + + @impl true +- def handle_call({:connect, local_name, hostname, password}, _from, state) do ++ def handle_call({:connect, local_name, hostname, password, nil}, _from, state) do + case {hostname, password} do + {"i-hate-passwords.example.org", _} -> + {:reply, {:error, :no_password_flow, "No password flow"}, state} + +From 50db541f89968a59a2de16ea850a526772291acf Mon Sep 17 00:00:00 2001 +From: Val Lorentz +Date: Wed, 16 Nov 2022 11:25:49 +0100 +Subject: [PATCH 2/2] Fix typo + +--- + README.md | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/README.md b/README.md +index 8da832f..64dca11 100644 +--- a/README.md ++++ b/README.md +@@ -87,7 +87,7 @@ See `INSTALL.md` for a more production-oriented guide. + + Matrix2051 does not support Matrix's end-to-end encryption (E2EE), but can optionally be used with [Pantalaimon](https://github.com/matrix-org/pantalaimon). + +-To do so, setup Pantalaimon locally, and configure `plaintextproxy=http://localhost:8009/` as your IRC client's GECOS/"real name". ++To do so, setup Pantalaimon locally, and configure `plaintextproxy=http://localhost:8009` as your IRC client's GECOS/"real name". + + ## Architecture + diff --git a/testing/matrix2051/APKBUILD b/testing/matrix2051/APKBUILD deleted file mode 100644 index 58645f1a20b..00000000000 --- a/testing/matrix2051/APKBUILD +++ /dev/null @@ -1,69 +0,0 @@ -# Contributor: Celeste -# Maintainer: Celeste -pkgname=matrix2051 -pkgver=0_git20240215 -_gitrev=99da81db0ed0e71f50cd924d24ee30f9780518e0 -pkgrel=0 -pkgdesc="Matrix gateway for IRC" -url="https://github.com/progval/matrix2051" -arch="noarch" -license="AGPL-3.0-only" -depends="erlang" -makedepends="elixir rebar3" -subpackages="$pkgname-openrc" -source="$pkgname-$pkgver.tar.gz::https://github.com/progval/matrix2051/archive/$_gitrev.tar.gz - matrix2051.initd - no-erts.patch - pantalaimon.patch - " -builddir="$srcdir/$pkgname-$_gitrev" - -export HEX_HOME="${HEX_HOME:-"$srcdir/hex"}" -export MIX_HOME="${MIX_HOME:-"$srcdir/mix"}" -export MIX_ARCHIVES="${MIX_ARCHIVES:-"$srcdir/mix/archives"}" - -export MIX_ENV=prod -export REBAR_DEPS_PREFER_LIBS="TRUE" -export ERL_LIBS="/usr/lib/erlang/lib" - -prepare() { - default_prepare - - # Precompiled hex doesn't work on aarch64 when using Erlang 26.2.3 - # Apply workaround mentioned in https://elixirforum.com/t/62154/9 - if [ "$CARCH" = "aarch64" ]; then - msg "Recompiling hex" - mix archive.install --force github hexpm/hex tag v2.0.6 - else - msg "Using precompiled hex" - mix local.hex --force - fi - - mix local.rebar --force rebar3 /usr/bin/rebar3 - - mix deps.get --only prod -} - -build() { - mix release --path build -} - -check() { - ./build/bin/matrix2051 version -} - -package() { - install -dvm755 "$pkgdir"/usr/lib - cp -a build "$pkgdir"/usr/lib/matrix2051 - find "$pkgdir"/usr/lib/matrix2051 -name '*.bat' -delete - - install -Dvm755 "$srcdir"/matrix2051.initd \ - "$pkgdir"/etc/init.d/matrix2051 -} - -sha512sums=" -ea9dab812abf16657ee44157ac588fc78ab1d0b1c5bfb6cc22ffac27d240b395b8b4bf7af3e4226ddb71141af90f4328585f9a4c4bb4f779b508a03ca094be2d matrix2051-0_git20240215.tar.gz -8cb570ee1d6c9b36c34f38bdc7a999a921ac81d8ba08bcd4bdf8d66ca9b8c94d895111599c65ab8ff8f7fb1be6c0158318c9a4f2b8f1cbee608fe50ef66f700d matrix2051.initd -974396c6ce87fb264cb901aac37bee25e2a83264633ff607024ebf9e08cfc2f669ab3ab4ae010d12561d0bcfcd167be99ba418f336685ec2afc2312e12ebbf51 no-erts.patch -f4af9b1a0bb1f6628da54119e604ff5af2765c037b69602ccc2e726ed33a1f60f68b31acad1fa38e5e95222cad1d73fcf488636569fe87b05324173c59234500 pantalaimon.patch -" diff --git a/testing/matrix2051/matrix2051.initd b/testing/matrix2051/matrix2051.initd deleted file mode 100644 index 30593bbc517..00000000000 --- a/testing/matrix2051/matrix2051.initd +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/openrc-run - -name=matrix2051 -description="Matrix2051 is a Matrix gateway for IRC" - -: ${command_user:="nobody:nobody"} -: ${EPMD:="/usr/bin/epmd"} - -export ELIXIR_ERL_OPTIONS="${ELIXIR_ERL_OPTIONS:-"-kernel inet_dist_use_interface {127,0,0,1}"}" -export ERL_EPMD_ADDRESS="${ERL_EPMD_ADDRESS:-"127.0.0.1"}" - -command="/usr/lib/matrix2051/bin/matrix2051" -command_args="start $command_args" -command_background="yes" -pidfile="/run/${RC_SVCNAME}.pid" -output_log="/var/log/matrix2051.log" -error_log="/var/log/matrix2051.log" - -depend() { - need localmount net - after firewall -} - -start_pre() { - checkpath -f -m 0640 -o "$command_user" "$output_log" "$error_log" -} - -stop_post() { - "$EPMD" -names 2>/dev/null | grep -q '^name' || "$EPMD" -kill >/dev/null -} diff --git a/testing/matrix2051/no-erts.patch b/testing/matrix2051/no-erts.patch deleted file mode 100644 index f29c867013a..00000000000 --- a/testing/matrix2051/no-erts.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/mix.exs -+++ b/mix.exs -@@ -27,7 +27,8 @@ - releases: [ - matrix2051: [ - version: version(), -- applications: [matrix2051: :permanent] -+ applications: [matrix2051: :permanent], -+ include_erts: false - ] - ] - ] diff --git a/testing/matrix2051/pantalaimon.patch b/testing/matrix2051/pantalaimon.patch deleted file mode 100644 index a1b1c277047..00000000000 --- a/testing/matrix2051/pantalaimon.patch +++ /dev/null @@ -1,199 +0,0 @@ -From 4ecd6ebbff52dc3b3b0f44b77bfc38fb3ba324e5 Mon Sep 17 00:00:00 2001 -From: Val Lorentz -Date: Sun, 13 Nov 2022 13:22:33 +0100 -Subject: [PATCH 1/2] Add support for using a proxy - ---- - README.md | 6 ++++++ - lib/irc/handler.ex | 16 ++++++++++++++-- - lib/matrix_client/client.ex | 8 ++++---- - test/matrix_client/client_test.exs | 10 +++++----- - test/test_helper.exs | 2 +- - 5 files changed, 30 insertions(+), 12 deletions(-) - -diff --git a/README.md b/README.md -index 07d4849..8da832f 100644 ---- a/README.md -+++ b/README.md -@@ -83,6 +83,12 @@ See below for extra instructions to work with web clients. - - See `INSTALL.md` for a more production-oriented guide. - -+## End-to-end encryption -+ -+Matrix2051 does not support Matrix's end-to-end encryption (E2EE), but can optionally be used with [Pantalaimon](https://github.com/matrix-org/pantalaimon). -+ -+To do so, setup Pantalaimon locally, and configure `plaintextproxy=http://localhost:8009/` as your IRC client's GECOS/"real name". -+ - ## Architecture - - * `matrix2051.exs` starts M51.Application, which starts M51.Supervisor, which -diff --git a/lib/irc/handler.ex b/lib/irc/handler.ex -index 6fcad82..02bf001 100644 ---- a/lib/irc/handler.ex -+++ b/lib/irc/handler.ex -@@ -170,7 +170,6 @@ defmodule M51.IrcConn.Handler do - state = M51.IrcConn.Supervisor.state(sup_pid) - - M51.IrcConn.State.set_nick(state, nick) -- M51.IrcConn.State.set_gecos(state, gecos) - - case user_id do - # all good -@@ -321,6 +320,8 @@ defmodule M51.IrcConn.Handler do - nil - - {"USER", [_, _, _, gecos | _]} -> -+ state = M51.IrcConn.Supervisor.state(sup_pid) -+ M51.IrcConn.State.set_gecos(state, gecos) - {:user, gecos} - - {"USER", _} -> -@@ -407,6 +408,7 @@ defmodule M51.IrcConn.Handler do - - # TODO: support multi-line AUTHENTICATE - -+ state = M51.IrcConn.Supervisor.state(sup_pid) - matrix_client = M51.IrcConn.Supervisor.matrix_client(sup_pid) - - case M51.MatrixClient.Client.user_id(matrix_client) do -@@ -419,11 +421,21 @@ defmodule M51.IrcConn.Handler do - {:ok, {local_name, hostname}} -> - user_id = authcid - -+ proxy = -+ case Regex.named_captures( -+ ~R(plaintextproxy=(?https?://\S*\)), -+ M51.IrcConn.State.gecos(state) || "" -+ ) do -+ nil -> nil -+ %{"url" => url} -> url -+ end -+ - case M51.MatrixClient.Client.connect( - matrix_client, - local_name, - hostname, -- passwd -+ passwd, -+ proxy - ) do - {:ok} -> - # RPL_LOGGEDIN -diff --git a/lib/matrix_client/client.ex b/lib/matrix_client/client.ex -index 27ffab6..45920c4 100644 ---- a/lib/matrix_client/client.ex -+++ b/lib/matrix_client/client.ex -@@ -66,14 +66,14 @@ defmodule M51.MatrixClient.Client do - end - - @impl true -- def handle_call({:connect, local_name, hostname, password}, _from, state) do -+ def handle_call({:connect, local_name, hostname, password, proxy}, _from, state) do - case state do - %M51.MatrixClient.Client{ - state: :initial_state, - irc_pid: irc_pid - } -> - httpoison = M51.Config.httpoison() -- base_url = get_base_url(hostname) -+ base_url = proxy || get_base_url(hostname) - - # Check the server supports password login - url = base_url <> "/_matrix/client/r0/login" -@@ -491,8 +491,8 @@ defmodule M51.MatrixClient.Client do - end - end - -- def connect(pid, local_name, hostname, password) do -- GenServer.call(pid, {:connect, local_name, hostname, password}, @timeout) -+ def connect(pid, local_name, hostname, password, proxy \\ nil) do -+ GenServer.call(pid, {:connect, local_name, hostname, password, proxy}, @timeout) - end - - def raw_client(pid) do -diff --git a/test/matrix_client/client_test.exs b/test/matrix_client/client_test.exs -index 78b496f..0e6f5b6 100644 ---- a/test/matrix_client/client_test.exs -+++ b/test/matrix_client/client_test.exs -@@ -105,7 +105,7 @@ defmodule M51.MatrixClient.ClientTest do - client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) - - assert {:error, :unknown, message} = -- GenServer.call(client, {:connect, "user", "example.org", "p4ssw0rd"}) -+ GenServer.call(client, {:connect, "user", "example.org", "p4ssw0rd", nil}) - - assert Regex.match?(~r/Could not reach the Matrix homeserver for example.org.*/, message) - -@@ -168,7 +168,7 @@ defmodule M51.MatrixClient.ClientTest do - - client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) - -- assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd"}) == {:ok} -+ assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd", nil}) == {:ok} - - assert GenServer.call(client, {:dump_state}) == - %M51.MatrixClient.Client{ -@@ -246,7 +246,7 @@ defmodule M51.MatrixClient.ClientTest do - - client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) - -- assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd"}) == {:ok} -+ assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd", nil}) == {:ok} - - assert GenServer.call(client, {:dump_state}) == - %M51.MatrixClient.Client{ -@@ -299,7 +299,7 @@ defmodule M51.MatrixClient.ClientTest do - - client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) - -- assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd"}) == -+ assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd", nil}) == - {:error, :no_password_flow, "No password flow"} - - assert GenServer.call(client, {:dump_state}) == -@@ -359,7 +359,7 @@ defmodule M51.MatrixClient.ClientTest do - - client = start_supervised!({M51.MatrixClient.Client, {sup_pid, [httpoison: MockHTTPoison]}}) - -- assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd"}) == -+ assert GenServer.call(client, {:connect, "user", "matrix.example.org", "p4ssw0rd", nil}) == - {:error, :denied, "Invalid password"} - - assert GenServer.call(client, {:dump_state}) == -diff --git a/test/test_helper.exs b/test/test_helper.exs -index 66acf53..c4d7904 100644 ---- a/test/test_helper.exs -+++ b/test/test_helper.exs -@@ -96,7 +96,7 @@ defmodule MockMatrixClient do - end - - @impl true -- def handle_call({:connect, local_name, hostname, password}, _from, state) do -+ def handle_call({:connect, local_name, hostname, password, nil}, _from, state) do - case {hostname, password} do - {"i-hate-passwords.example.org", _} -> - {:reply, {:error, :no_password_flow, "No password flow"}, state} - -From 50db541f89968a59a2de16ea850a526772291acf Mon Sep 17 00:00:00 2001 -From: Val Lorentz -Date: Wed, 16 Nov 2022 11:25:49 +0100 -Subject: [PATCH 2/2] Fix typo - ---- - README.md | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/README.md b/README.md -index 8da832f..64dca11 100644 ---- a/README.md -+++ b/README.md -@@ -87,7 +87,7 @@ See `INSTALL.md` for a more production-oriented guide. - - Matrix2051 does not support Matrix's end-to-end encryption (E2EE), but can optionally be used with [Pantalaimon](https://github.com/matrix-org/pantalaimon). - --To do so, setup Pantalaimon locally, and configure `plaintextproxy=http://localhost:8009/` as your IRC client's GECOS/"real name". -+To do so, setup Pantalaimon locally, and configure `plaintextproxy=http://localhost:8009` as your IRC client's GECOS/"real name". - - ## Architecture - -- cgit v1.2.3