Kaiteki-Fedi / Kaiteki

The comfy SNS client for everything, everywhere
https://kaiteki.app
GNU Affero General Public License v3.0
488 stars 31 forks source link

Cannot login to Mastodon instance if a local process uses socket port 8080 #480

Open EricBrunel opened 11 months ago

EricBrunel commented 11 months ago

What happened?

After entering the Mastodon instance name, the fields for the user name and password on the instance never appear. Instead, an error message is displayed, saying:

Login failed
An error occured with the following message while logging in:
SocketException: Failed to create server socket (OS Error: Address already in use, errno = 98),
address = 127.0.0.1, port = 8080

Expected behavior

The Mastodon instance name is correct, so fields asking for the user name and passwords should be displayed. It seems Kaiteki tries to open a server socket on the local machine on port 8080, which cannot work, since there's already a server running that uses that port.

How to reproduce

On a machine where a server using the psocket port 8080 is running:

  1. Launch Kaiteki (this was the first time I was running it, so no account was recorded yet);
  2. Click the "Add account" button;
  3. In the "Instance" field, enter a correct Mastodon instance name;
  4. Click the "Next" button.

What platform are you seeing the issue on?

Linux

Additional context

The server running on my computer that uses socket port 8080 would be very unpractical to move to another port. Also, 8080 is a very common port number to use for various servers, so having it hardcoded is really not a good idea. There should be a way to configure this port number. I'm using the Flatpak version of Kaiteki, version is 1.1.0. The problem happened on Linux, but I'm sure it would be the same on any machine with a server using port 8080.

Craftplacer commented 10 months ago

The Mastodon instance name is correct, so fields asking for the user name and passwords should be displayed.

Kaiteki does support credential authentication, but it is generally discouraged by backend-makers to use these endpoints.

EricBrunel commented 10 months ago

Kaiteki does support credential authentication, but it is generally discouraged by backend-makers to use these endpoints.

Well, I could change the existing server that was using the port number 8080 and I finally got past the instance name input. And indeed, the connection is done via an authorization token, and I managed to make it work. The problem stands though: 8080 is a very common port number for a web server, and some users will not be able to change it if they have one running. So it really should be made configurable.