Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠️ Community request: Chitchatter needs a TURN server! #112

Open
jeremyckahn opened this issue Mar 16, 2023 · 32 comments
Open

⚠️ Community request: Chitchatter needs a TURN server! #112

jeremyckahn opened this issue Mar 16, 2023 · 32 comments
Labels
help wanted Extra attention is needed

Comments

@jeremyckahn
Copy link
Owner

jeremyckahn commented Mar 16, 2023

Hi all, it appears that Open Relay, which Chitchatter uses to establish peer connections when P2P access is unavailable, is changing such that Chitchatter may not be able to use it going forward.

Open Relay no longer provides public STUN/TURN server credentials and instructs readers to sign up. I did this, and upon doing so I needed to agree to the operator of Open Relay's Terms of Service. These terms are a nonstarter for Chitchatter, as they would restrict free use of the app.

It appears that the Open Relay credentials in use by Chitchatter are still working (based on my testing with https://icetest.info/), and the project is still in compliance with the Open Relay project's terms and conditions (which is separate from metered.ca's terms). However, I expect this may change at any time and negatively affect Chitchatter's connection reliability.

So, we need to find an alternative solution.

Call to action

I would like to ask the community to donate TURN server resources to Chitchatter. It's easy enough to set Chitchatter up to use different TURN servers (I can take care of that), but actually hosting and running such servers costs money. I can't cover this cost myself, as Chitchatter generates no income. So, I would like to request support from those that can provide such resources to do so.

If you are in a position to financially support truly free speech and private communication, please get in touch with me either in this issue thread or privately via email (my address is at https://github.com/jeremyckahn). I am more than happy to do the development work, but I cannot cover the financial cost.

Please help this project thrive!

@jeremyckahn jeremyckahn added the help wanted Extra attention is needed label Mar 16, 2023
@dillfrescott
Copy link

Is there the option to somehow avoid using a TURN server entirely? I think the more decentralized chitchatter is, the better of course!

@jeremyckahn
Copy link
Owner Author

We can certainly go without TURN servers (and may end up needing to do so if nobody can help with this issue), but then Chitchatter peers will simply fail to connect in some scenarios. In particular, Chitchatter users on mobile and corporate networks will probably be most affected. For home "desktop" use, connections should still generally work in my experience.

This is a fundamental issue with all P2P applications and is not specific to Chitchatter. I think that some non-web apps such as BitTorrent have various ways to mitigate this, but they do not seem to be an option for Chitchatter given that it is a pure web app.

@dillfrescott
Copy link

Not sure if this would help at all, but Oracle cloud allows you up to 2 "always free" rather low powered VPS servers with unlimited bandwidth. They would be more than enough to run a coturn server on for free.

@jeremyckahn
Copy link
Owner Author

Oracle cloud allows you up to 2 "always free" rather low powered VPS servers with unlimited bandwidth. They would be more than enough to run a coturn server on for free.

That's an interesting idea! I have reservations about using Oracle's platform (I haven't heard great things about them as a company), but this might be a good solution to our problem. I will explore it!

@jeremyckahn
Copy link
Owner Author

I spent some time looking into Oracle's free VPS. Even for the free tier, I need to provide credit card info. I don't really feel comfortable with giving Oracle this information, so I'd prefer not to go this route.

If someone else is interested in setting up a free account with Oracle and hosting a Coturn instance for Chitchatter, please let me know!

@MansiVisuals
Copy link

Hi Jeremy,

If personal creditcard details is an issue i think i got a solution. There are multiple Turkish apps the easiest one would be Oldubil is a good one that give out a prepaid creditcard number without the need to fill in personal details or deposit money.
They just need a phone number which can be get anonymously using crypto for example from 5sim.net

If you need help let me know.

@jeremyckahn
Copy link
Owner Author

Hi @ThatsMyCall, thanks for the suggestion! I'm US-based, so I'd prefer to stick with US-based solutions such as https://privacy.com/ to avoid any regulatory issues. Regardless, I see your point. I can look into one of these options to see if it would safely enable use of Oracle's VPS. 🙂

@jeremyckahn
Copy link
Owner Author

Someone reached out to me privately about contacting the EFF about potentially providing/funding a TURN server for Chitchatter. I think this is a great idea and I will try to do that soon. 🙂

@dbd5
Copy link

dbd5 commented May 19, 2023

Hi @jeremyckahn,
Did you have any luck with EFF?
It may be helpful if you could determine the budget and share the information for those that are willing to contribute

@jeremyckahn
Copy link
Owner Author

Hi @dbd5, I haven't had much time to focus on this in recent weeks, but I'm hoping to get back to it soon. You raise a great point about determining budgetary needs. That should probably be figured out before we reach out to anyone specifically.

Does anyone here have experience with hosting a TURN server? I never have, so it's hard for me to gauge what it might cost. Chitchatter (intentionally) has no analytics, so I have no idea how many people use it and what the usage looks like in terms of TURN relay bandwidth. Generally speaking, we should probably determine a max bandwidth budget because unbounded usage could result in exorbitant server costs.

@jeremyckahn
Copy link
Owner Author

Great news: With 7a4862f we now have a TURN server! Huge thanks to @sini6a for offering to configure and host the server. Now many more people can connect with Chitchatter! 🙌

@jeremyckahn
Copy link
Owner Author

Update: The volunteered TURN server that Chitchatter has been using for the last several months is temporarily unavailable. I anticipate that it will become available again in the future, but it's unclear when that may happen. In any case, Chitchatter once again needs a TURN server in order to facilitate reliable P2P connections.

Are any members of the community able to provide a TURN server for Chitchatter in the meantime? If so, please let me know either by responding in this thread or by emailing me (my address can be found on my GitHub profile at @jeremyckahn). Historically, the TURN server has relayed roughly 50-100 GB of bandwidth per month:

Screenshot of Chitchatter TURN server usage

Please help support this project and enable reliable P2P connections for all! 🙏

@jeremyckahn
Copy link
Owner Author

I've found a free TURN service: https://www.expressturn.com/

And I've configured Chitchatter to use it in ff03190. It seems to be working!

According to expressturn.com, the free tier gets 1000 GB of bandwidth a month and I can pay $9 a month to increase that to 5000GB. This should hopefully get us pretty far, so let's see how it goes!

@jeremyckahn jeremyckahn unpinned this issue Jun 7, 2024
@dillfrescott
Copy link

Wow! that pricing and free allowance blows metered.ca out of the water!

@jeremyckahn
Copy link
Owner Author

@dillfrescott yeah! I'm a bit uneasy with a free service that's offering this much. I have a feeling that there must be some sort of drawback that we may discover later. Fortunately WebRTC traffic is E2E encrypted, so I don't think there's any privacy concerns here.

@dillfrescott
Copy link

yes, I made my own account on that site and changed my instance's credentials, I also think it is a bit odd that you can't even view the amount of bandwidth used, and you could pretty easily use anything @yourdomain.com as the email and get a ton of free usage (probably not morally right) but I dont recall even an email confirmation...

@dillfrescott
Copy link

My best guess is that they are probably tapping into unencrypted connections for data mining. But since chitchatter is encrypted it doesnt matter much

@jeremyckahn
Copy link
Owner Author

Yeah it's definitely a little sketchy. We don't have a better option at the moment though. I'd still prefer to use resources offered by someone from the community to avoid any issues with this service, but for now we should be okay! :)

@dillfrescott
Copy link

There is always the option of installing coturn on a cheap VPS with unlimited traffic. IONOS offers an unlimited traffic VPS Linux XS VPS with 1 GB of ram and a 10 GB ssd for 2 dollars a month.

I used to use them and they offer decent service.

So thats always an option!

@jeremyckahn
Copy link
Owner Author

There is always the option of installing coturn on a cheap VPS with unlimited traffic. IONOS offers an unlimited traffic VPS Linux XS VPS with 1 GB of ram and a 10 GB ssd for 2 dollars a month.

I used to use them and they offer decent service.

So thats always an option!

Technically this seems like a fine approach, but I have two reservations with doing this:

  1. I don't want to pay money to provide Chitchatter. I spend a significant amount of my time working on Chitchatter and giving it away for free, and I am happy to do so (even at the opportunity cost to myself). However, I don't feel as comfortable spending money out of my pocket to provide a service that doesn't make me any money in return.
  2. More importantly, I don't want to be accountable for any infrastructure that touches user data (even if it's encrypted). In this case, that's just the TURN server. Although it's highly unlikely, it's conceivable that I could be subject to subpoenas or other legal repercussions because of the anonymous nature of Chitchatter. I don't build it to support illegal activity, but the reality is that people likely will use it for that regardless of what I do. Given the retributive nature of American politics and law enforcement, I choose to retain plausible deniability by never having access to anything that touches user data.

Ideally someone from a country other than the one I live in (America) would provide the TURN server to deter any conceivable legal entanglements. I don't think there's any material legal risk in hosting Chitchatter's TURN server, but for my own peace of mind I'd prefer not to be managing that aspect of the project.

@dillfrescott
Copy link

Ah that makes sense! I'm from America too and I didn't even think about that!

@jeremyckahn
Copy link
Owner Author

It seems that the ExpressTURN server isn't particularly reliable and is frequently unavailable. I'll reopen this issue so that someone can potentially see it and offer a TURN server.

@jeremyckahn jeremyckahn reopened this Jul 7, 2024
@jeremyckahn jeremyckahn pinned this issue Jul 7, 2024
@dillfrescott
Copy link

It seems that the ExpressTURN server isn't particularly reliable and is frequently unavailable

I noticed that too a few days ago. It was too good to be true unfortunately.

@jeremyckahn
Copy link
Owner Author

I noticed that too a few days ago. It was too good to be true unfortunately.

Yeah... I'm not surprised that ExpressTURN is flaky. 😕

I think finding good TURN server resources is going to be a perpetual cat-and-mouse game for Chitchatter. That's a drawback of a community-driven, noncommercial project like this. But I think that's still better than being beholden to commercial interests!

@0wwafa
Copy link

0wwafa commented Sep 5, 2024

@jeremyckahn is there anywhere we can chat privately? I have a great solution.

@jeremyckahn
Copy link
Owner Author

@0wwafa feel free to send me an email. That can be found on my GitHub profile page.

@NOXCIS
Copy link

NOXCIS commented Sep 17, 2024

@jeremyckahn how are p2p cottons handled in a local environment. Let's say I wanted to deploy chitchatter locally so only Lan peers can connect to each other?

@jeremyckahn
Copy link
Owner Author

@jeremyckahn how are p2p cottons handled in a local environment. Let's say I wanted to deploy chitchatter locally so only Lan peers can connect to each other?

This is more of a general WebRTC question that's not really appropriate for this thread. Here's a ChatGPT-generated answer that might help you. If you have further questions, consider starting a Discussion thread and see if someone from the community can help.

@NOXCIS
Copy link

NOXCIS commented Sep 19, 2024

@jeremyckahn Too much connection latency to be worth the trouble, however i did make a docker image for chitchatter i can make a PR if thats okay.

@jeremyckahn
Copy link
Owner Author

@jeremyckahn Too much connection latency to be worth the trouble, however i did make a docker image for chitchatter i can make a PR if thats okay.

Please do! That'd be great. I'm looking forward to seeing it!

@platomedical
Copy link

Awesome product @jeremyckahn!

My knowledge on this matter might be limited - so please excuse my ignorance.

AWS seems to have a relatively cheap TURN service (https://aws.amazon.com/kinesis/video-streams/pricing/) - it is only priced at $0.12/1000 minutes. It does not seem like the normal data transfer rates apply to this service (can't find a clear answer in their documentation).

Perhaps you can add a BYO-AWS-Account option to this project? If I am reading the pricing correctly, the total cost for anyone hosting this app should be quite low.

@jeremyckahn
Copy link
Owner Author

Thank you @platomedical! What you're describing seems like a fine approach technically, but there a handful of nontechnical reasons why I don't want to be the one to manage the TURN server infrastructure directly. My hope is that someone from a non-US country will be willing to offer the infrastructure that this project needs in order to minimize liability.

Perhaps you can add a BYO-AWS-Account option to this project?

This would work well in a fork of Chitchatter, as hosts of the app are free to modify their instance's config as they'd like. But for the principal deployment at https://chitchatter.im/, I don't know that it would work well in practice because all peers would need to bring their own AWS credentials. It might work in theory, but the barrier to entry would be extremely high. Given that, it's not something I'd expect people to actually do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants