phanpy icon indicating copy to clipboard operation
phanpy copied to clipboard

Enable running using http

Open HelgeKrueger opened this issue 1 year ago • 3 comments

This means that by adding PHANPY_SCHEME=http to the file ".env" phanpy will use http instead of https to connect to remote instances.

This is useful to test local versions of various Fediverse applications. These can be created following the instructions on

https://funfedi.dev/quickstart/#running-an-application-from-the-fediverse-pasture

HelgeKrueger avatar Mar 09 '24 16:03 HelgeKrueger

Sorry for the very late response. I think I've had a thought about this at some point, briefly discussed with some folks (many months ago), got distracted and worked on other things. But I do vaguely remember this 🙈:

  • Using env var config is not the right solution. In the end, http or https depends on the domain that you're trying to log in, not by the client built with this specific env var config that assumes all domains to be http://
  • A better solution is allowing users to enter "http://mastodon.domain". Now the login page only allow domain without protocol. Even if you accidentally put in the scheme, the code will auto-strip it away. So for this case, we don't strip them if there's "http://". And then we need to store this somewhere (maybe part of instances key in localStorage, and hack a __insecure__ key or the more generic __scheme__=http key in the Instance object?).

What do you think?

cheeaun avatar Sep 11 '25 13:09 cheeaun

What do you think?

I think it's complicated. The option of allowing inputting "http://mastodon.domain" has the charm that I will not need to run my own phanpy installation locally, but can use the one at https://phanpy.social/. So I'm all for it.

However, I do not possess sufficient expertise to know if this will have unintended side effects.

Also note: While I use this change, I don't use it often. As you can see by this pull request sitting around for a year and a half.

HelgeKrueger avatar Sep 11 '25 14:09 HelgeKrueger

I don't think you can talk to http urls from https pages?

In any case, I would like it to be an option - and perhaps the better solution indeed would be to allow the user to enter the scheme. Aside from local development needs, it would allow to use it in overlay networks (tor, i2p, yggdrasil, etc), where https is neither guaranteed nor necessary, as a bonus.

burning-lnkr avatar Sep 19 '25 17:09 burning-lnkr