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

[Bug] cf tunnel+device discovery not working #189

Closed
rafalohaki opened this issue Oct 23, 2023 · 16 comments
Closed

[Bug] cf tunnel+device discovery not working #189

rafalohaki opened this issue Oct 23, 2023 · 16 comments
Labels
bug Something isn't working

Comments

@rafalohaki
Copy link

rafalohaki commented Oct 23, 2023

I try to host pairdrop and using cloudflare tunnel
i get log about connecting other device to network but its not loading fully and with error
i tried some ways but still not working

this is what i get when i set up IPV6_LOCALIZE=true
raw

this is when i set up IPV6_LOCALIZE=false

raw

with IPV6_LOCALIZE=4 i get
raw
its discovering device in console but not in gui and after 3 seconds, there is an error.

should i set true to Disable Chunked Encoding/No Happy Eyeballs?
what env should i use
which ip exposed/local should i reverse to make it work woth cloudflare tunnel
I tried to solve problem looking through this issue #69
but still no result

my docker compose:

version: "4"
services:
pairdrop:
image: lscr.io/linuxserver/pairdrop
container_name: pairdrop
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Warsaw
- RATE_LIMIT=false #optional
- WS_FALLBACK=false #optional
- RTC_CONFIG= #optional
- DEBUG_MODE=false #optional
- IPV6_LOCALIZE=4
ports:
- 3088:3000
restart: unless-stopped

@rafalohaki rafalohaki added the bug Something isn't working label Oct 23, 2023
@schlagmichdoch
Copy link
Owner

As the error message explains you need to deploy a TURN server alongside PairDrop for it to work behind Cloudflare.
See Deployment notes for instructions.

Probably I should also provide a docker-compose file that does it all at once. I will look into it.

@alexonpeace
Copy link

i got same issue i think only after recent update even without cf bypassed it wouldn't work on a different network

@schlagmichdoch
Copy link
Owner

@alexonpeace have you deployed a TURN server? If at least one device is behind a NAT you need that for connections:

TURN server for Internet Transfer

Beware that you have to host your own TURN server to enable transfers between different networks.

Follow this guide to either install coturn directly on your system (Step 1)
or deploy it via docker-compose (Step 5).

Alternatively, use a free, pre-configured TURN server like OpenRelay

@schlagmichdoch
Copy link
Owner

I have refactored the documentation and fixed the Docker Compose file to host coturn alongside PairDrop.

@alexonpeace @rafalohaki Please checkout this branch to test if everything is as easy as expected:

  1. git clone https://github.com/schlagmichdoch/PairDrop.git
  2. cd PairDrop
  3. git checkout fix-turn-container
  4. Follow the guide at https://github.com/schlagmichdoch/PairDrop/blob/fix-turn-container/docs/host-your-own.md#coturn-and-pairdrop-via-docker-compose

After your feedback I would merge this into master.

@schlagmichdoch
Copy link
Owner

Corresponding PR: #195

Repository owner deleted a comment from schlagmichdoch Feb 17, 2024
@schlagmichdoch
Copy link
Owner

The following comments were deleted by GitHub (via hubot) as part of mistakenly marking this account as spam on 17th February 2024. The correct thread order and the creation date is unclear. I decided to manually restore them anyway in order to complete the information this issue holds even though the restored information might be outdated:

Comment by @schlagmichdoch:

The docker changes have since been released into v1.10.0 so your can also find the documentation on the master branch:
https://github.com/schlagmichdoch/PairDrop/blob/master/docs/host-your-own.md#coturn-and-pairdrop-via-docker-compose

Have you since had any luck in hosting your PairDrop instance? :)

@rafalohaki
Copy link
Author

i used stun server from cloudflare. its working

@dforel

This comment was marked as resolved.

@schlagmichdoch
Copy link
Owner

Closing this as stale. Feel free to reopen if the issue is still present.

@andreapx
Copy link

andreapx commented Aug 22, 2024

i used stun server from cloudflare. its working

@rafalohaki can you share some info on how you did it?
I've added the variable RTC_CONFIG=/config/rtc_config.json into my docker-compose.yaml, I've created the file rtc_config.json like this:

{
  "sdpSemantics": "unified-plan",
  "iceServers": [
    {
      "urls": "stun:stun.cloudflare.com:3478"
    }
  ]
}

The files gets read because in the log I see:

----DEBUG ENVIRONMENT VARIABLES----
pairdrop    | {
pairdrop    |     "debugMode": true,
pairdrop    |     "port": 3000,
pairdrop    |     "wsFallback": false,
pairdrop    |     "rtcConfig": {
pairdrop    |         "sdpSemantics": "unified-plan",
pairdrop    |         "iceServers": [
pairdrop    |             {
pairdrop    |                 "urls": "stun:stun.cloudflare.com:3478"
pairdrop    |             }
pairdrop    |         ]
pairdrop    |     },
pairdrop    |     "signalingServer": false,
pairdrop    |     "ipv6Localize": false,
pairdrop    |     "rateLimit": false,
pairdrop    |     "buttons": {
pairdrop    |         "donation_button": {},
pairdrop    |         "twitter_button": {},
pairdrop    |         "mastodon_button": {},
pairdrop    |         "bluesky_button": {},
pairdrop    |         "custom_button": {},
pairdrop    |         "privacypolicy_button": {}
pairdrop    |     },
pairdrop    |     "autoStart": false,
pairdrop    |     "localhostOnly": false
pairdrop    | }

But it still doesn't see devices outside the same LAN that I pair.

@schlagmichdoch
Copy link
Owner

But it still doesn't see devices outside the same LAN that I pair.

You’ll need to run a turn server alongside PairDrop in order to achieve that:
https://github.com/schlagmichdoch/PairDrop/blob/master/docs/host-your-own.md#turn-server-for-internet-transfer

@andreapx
Copy link

But it still doesn't see devices outside the same LAN that I pair.

You’ll need to run a turn server alongside PairDrop in order to achieve that: https://github.com/schlagmichdoch/PairDrop/blob/master/docs/host-your-own.md#turn-server-for-internet-transfer

Oh, I thought that a STUN server was enough (sorry, I don't know much about STUN/TURN).
Thanks

@schlagmichdoch
Copy link
Owner

@andreapx
Copy link

There’s more info on the topic here: https://github.com/schlagmichdoch/PairDrop/blob/master/docs/technical-documentation.md#encryption-webrtc-stun-and-turn

Thanks a lot! That helped me understand how it works.

@afly007
Copy link

afly007 commented Sep 7, 2024

i used stun server from cloudflare. its working

@rafalohaki any chance you have a config available to share?

@rafalohaki
Copy link
Author

rafalohaki commented Sep 7, 2024

i used stun server from cloudflare. its working

@rafalohaki any chance you have a config available to share?
rtc_config.json
image

docker compose
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants