Giter Club home page Giter Club logo

pairdrop's People

Contributors

akkoyk avatar ann0see avatar bellisario avatar citrusui avatar comradekingu avatar deftdawg avatar dependabot[bot] avatar farline99 avatar fasih avatar fm-sys avatar haocen avatar ianz56 avatar jalbrecq avatar jbyoshi avatar kylethedeveloper avatar montelale avatar mopamo avatar mrigank11 avatar notangelmario avatar pa7ryk avatar paulszymanski avatar penguix0 avatar quacksire avatar rintan avatar robinlinus avatar schlagmichdoch avatar spar34vi avatar victorwads avatar weblate avatar xstar97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pairdrop's Issues

Add explanation

Hey, first of all: GREAT PROJECT! I really wanted to see a pairing functionality on Snapdrop and it's really cool to see it implemented finally! I'm currently trying to figure out how it works and thought maybe it'd be nice for new people to see kind of how this all works. Could you create some kind of flow chart on how PairDrop works on a high level or explain it in text? I'd be really interested in learning it :)

Bug:/Enhancement:/Feature Request: share menu with Android 13 not working

share menu with Android not working

Steps to reproduce the behavior:

  • Installed the PWA with Chrome
  • if I open the PWA directly, it shows https://pairdrop.net as expected
  • if I try to share via the share menu, select the pairdrop icon
    PWA starts but displays an ERR_FAILED (Website is not reachable)
    starting the PWA direct after the error direct, it works.

Expected behavior
both ways should work :-)

Smartphone (please complete the following information):

  • Samsung fold 4
  • OneUI 5.1 Android 13
  • Chrome Browser 110.0.5481.65

Self-Hosted
No

Self-Hosted Setup
Proxy: Nginx | Apache2
Deployment: docker run | docker-compose | npm run start:prod

Additional context
Add any other context about the problem here.

Bug: Pairing not working on self-hosted with Nginx Reverse Proxy

Hi there! My issue seems to be similar to #24 .. I successfully set PairDrop up on my server (via Nginx reverse proxy) according to the self-host docs and sharing files works fine. But as soon as I try to pair it says

No server connection. Retry in 5s...

The server is actually unreachable then for a few seconds before returning, when reloading the page immediately I get

An error occurred.

Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx.

In the browser console all I see is

WS: server disconnected [network.js:152:17](https://domain-redacted/scripts/network.js)

The docker logs show the following

pairdrop-node-1  | ----- Uncaught exception -----
pairdrop-node-1  | TypeError: Cannot read property 'getRandomValues' of undefined
pairdrop-node-1  |     at PairDropServer.getRandomString (/home/node/app/index.js:222:30)
pairdrop-node-1  |     at PairDropServer._onPairDeviceInitiate (/home/node/app/index.js:237:31)
pairdrop-node-1  |     at PairDropServer._onMessage (/home/node/app/index.js:146:22)
pairdrop-node-1  |     at WebSocket.<anonymous> (/home/node/app/index.js:106:51)
pairdrop-node-1  |     at WebSocket.emit (events.js:375:28)
pairdrop-node-1  |     at Receiver.receiverOnMessage (/home/node/app/node_modules/ws/lib/websocket.js:1180:20)
pairdrop-node-1  |     at Receiver.emit (events.js:375:28)
pairdrop-node-1  |     at Receiver.dataMessage (/home/node/app/node_modules/ws/lib/receiver.js:541:14)
pairdrop-node-1  |     at Receiver.getData (/home/node/app/node_modules/ws/lib/receiver.js:459:17)
pairdrop-node-1  |     at Receiver.startLoop (/home/node/app/node_modules/ws/lib/receiver.js:158:23)

Self-Hosted
Yes

Self-Hosted Setup
Proxy: Nginx
Deployment: docker-compose

Thanks for your work on PairDrop! Besides the pairing issue it is super reliable and makes our life sharing files between different devices/platforms easy!

edit:

For reference, here is my nginx configuration

upstream snapdrop {
	server pairdrop-node-1:3000;
}

server {
	listen 80;
	server_name domain-redacted;
	return 301 https://$host$request_uri;
}

server {
	listen 443 ssl http2;
	server_name domain-redacted;
	ssl_certificate /etc/nginx/ssl/domain-redacted/cert.pem;
	ssl_certificate_key /etc/nginx/ssl/domain-redacted/key.pem;
	include /etc/nginx/includes/ssl.conf;
	include /etc/nginx/includes/gzip.conf;

	expires epoch;

	location / {
		proxy_connect_timeout 300;
		proxy_pass http://snapdrop;
		proxy_set_header Connection "upgrade";
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header X-Forwarded-for $remote_addr;
	}

	location ~ /.well-known {
		allow all;
		root /var/www/html;
	}
}

File sent successfully but not displayed

I use Mac Chrome to send a large file to iPhone Safari, and it shows that it has been successfully sent, but iPhone Safari does not give any prompts. Normally, the sharing menu will appear, but it does not appear.
Tried many times, all failed.
Sending small files works fine.

Running PairDrop on subfolder

Hi,

I am running PairDrop on a subfolder instead of a subdomain using Traefik and redirect rules.
https://my.domain/pairdrop/

I got this working, by only removing the absolute path to the sound files in public/index.html
/sounds/blob.mp3 --> sounds/blob.mp3

Possible to change this in the code?

Thanks!

Bug: Firefox on Android doesn't discover other devices

Describe the bug
Using Firefox on Android doesn't find other devices in the same network

Smartphone (please complete the following information):

  • Device: Pixel 7 Pro
  • OS: Android 13
  • Browser: Firefox
  • Version: 109.2.0

Additional context
With Chrome on the same device it works

Bug:/Enhancement:/Feature Request:

Describe the bug
A clear and concise description of what the bug is.

The npm-version seems too old.
When i look into docker logs, i get this notice on startup:

node_1  | npm notice 
node_1  | npm notice New minor version of npm available! 9.3.1 -> 9.4.2
node_1  | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.4.2>
node_1  | npm notice Run `npm install -g [email protected]` to update!
node_1  | npm notice 

In docker-complose.yml ist this image: "node:lts-alpine"

Feature Request: Temporary Public Room

Similar to the current pairing mode where it is able to identify devices across different networks.
An option to just temporary create a room, and for other devices to enter these rooms for file sharing would be great.

This is useful when sharing files between family members across networks, but since they are not my own devices, I would not want them to be paired.

P.S: Thank you for this amazing stable fork โœ”.

Bug:Share button doesn't work on Android after receiving a file

Describe the bug
When you receive a file on android, you get a pop up asking "close" or "share". Tapping "share" doesn't do anything.
Seems like it only happens with bigger files.
I tried sending an 80kb file and it worked fine. It didn't work with a 70mb video (video was mp4 h264 so the phone should be able to handle it no problem)

To Reproduce
Steps to reproduce the behavior:

  1. Receive a file on Android
  2. Tap on share
  3. Nothing happens

Expected behavior
You should be able to open the share menu, or at least download the file.
To be fair, I'd rather have PairDrop download files by default, instead of opening the share menu.

Maybe we could have a pop up with 3 buttons: "Close / Share / Download"

Screenshots
If applicable, add screenshots to help explain your problem.

https://user-images.githubusercontent.com/23201434/221225226-f54035f3-b729-433a-9221-0223aa8e9bbb.mp4
In this recording, i got the "reconnecting" pop up and whatnot, but it doesn't seem related. I tried again and got the same issue.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: Chrome 110.0.5481.105

Smartphone (please complete the following information):

  • Device: Samsung A72
  • OS: Android 12
  • Browser: Chrome (I actually installed the PWA, so I assume it's chrome)
  • Version: Chrome 110.0.5481.65

Self-Hosted
No

Additional context
I can upload the video file if needed, but seems reproducible with any bigger file

Bug: Android Share Error "this site can't be reached"

I saw that this feature is still being developed. But when Pairdop gets installed and it accessible from the android share menu it fails to load. "This site can't be reached" is but if you hit the hamburger menu and request it open in Chrome it opens up fine. The problem is when you do that you have to find and reselect the file you wanted to share in the first place.

Bug:/Enhancement:/Feature Request: "No server connection. Retry in 5s..."

Describe the bug
No server connection. Retry in 5s...

To Reproduce
Steps to reproduce the behavior:

  1. Install Docker with the description here on github.
  2. start it up behind caddy reverse proxy
  3. go to domain in browser
  4. See error "No server connection. Retry in 5s..."

Expected behavior
Expect it to work even if "X-Forwarded-For" is not set. Or at least have the guide reflect that it wouldn't work at all without it.

Screenshots
https://ibb.co/VSFJYpZ

Desktop (please complete the following information):

  • OS: Fedora Silverblue / Fedora Workstation / Arch Linux
  • Browser: Librewolf, default Firefox, default Chromium
  • Version: All latest versions available (non beta)

Smartphone (please complete the following information):

  • Device: Pixel 7 / Pixel 4
  • OS: GrapheneOS/Google Android
  • Browser: Vanadium / Android Chrome / Bromite
  • Version: latest non beta

Additional context
It also doesn't seem to work even with X-Forwarded-For set. Unless I got the synthax wrong for Caddy proxy, because there is only a description for Nginx and Apache unfortunately.

Opening on multiple tabs throws error `Cannot set remote answer in state stable` in some browser environments

When opening PairDrop on multiple tabs on Firefox, it tries to restart the connection contiuously as the following error is thrown: Cannot set remote answer in state stable.

This happens on Firefox but it is not an issue on Firefox Private Mode. Maybe because the tabs themselves are better sandboxed.
Interestingly this error is also thrown on the original Snapdrop.

With PairDrop the error is not thrown on Edge (chromium) but for Snapdrop it is, as every tab has the same peerId.

Can anyone test this on other browsers?

Bug: Own STUN/TURN server config file issue

Describe the bug
When using the RTC_CONFIG env variable, I can't connect to anyone to send files.
It looks like it stems from where the file is read in index.js. It doesn't parse the JSON, so it has a bunch of escaped characters it doesn't know what to do with.
badrtc

This is not how it looks when no RTC_CONFIG var is set.
nortc

I was able to fix the issue by wrapping the line:

? fs.readFileSync(process.env.RTC_CONFIG, 'utf8')

with:

? JSON.parse(fs.readFileSync(process.env.RTC_CONFIG, 'utf8'))

Using that new index.js with the RTC_CONFIG var, I get the expected results.
goodrtc

I was able to connect to my own STUN server and see other people on my network to send files to.

Extra Troubleshooting Steps:
I tried using the already made example rtc_config by setting RTC_CONFIG=/app/pairdrop/rtc_config_example.json. It still had all the escaped newlines and quotes like in the top screenshot. So I don't think the issue was my rtc_config.json formatting.

To Reproduce
Steps to reproduce the behavior:

  1. Set RTC_CONFIG env var to a json file with the appropriate config data.

Expected behavior
Parse the JSON data.

Screenshots
See above

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 22

Self-Hosted
Yes

Self-Hosted Setup
Proxy: Nginx
Deployment: docker-compose

Incompatible license

๐Ÿ‘‹ Just came across this project from a Reddit post. To make it clear, I am not a lawyer, just someone that often looks at license in open source.

Noticed that this is a fork of https://github.com/RobinLinus/snapdrop, but this project is licensed via an MIT license whereas RobinLinus/snapdrop is licensed via a GPL3 license.
You can't just change the license in this way, not without getting permission to do so from past contributors (or the copyright holders if ownership has been reassigned).

If you do not have such permission, your forked work would need to provide the same freedoms and requirements as provided in the GPLv3 license, For simplicity most people would keep the license the same.

Buy [REDACTED] domain

Hey I just found out there's a domain available that would perfectly fit to this project. It's not expensive (about 20โ‚ฌ per year) and it has something to do with PairDrop / AirDrop. I don't want to write the domain here publicly because there will probably be bots or people around here waiting to claim such names. I don't think I can write direct messages here on GitHub, can't I? You could write me an email (my email is in my bio) or type your email here. Or you can reach out to me via Mastodon or Twitter, or of course any other communication channel you prefer :D

Bug: Sharing via CLI doesn't work on Firefox

Describe the bug
The web app relies on the Clipboard API's readText method. Unfortunately, this method is not available in Firefox except inside browser extensions.

Maybe instead of just failing it could display an autoselected textarea element to paste the text into?

To Reproduce
Steps to reproduce the behavior:

  1. Either share a larger file via the CLI or open the Pairdrop webpage with ?base64zip=paste appended in Firefox
  2. Click the button that says "Tap here to paste files"
  3. Button vanished and popup appears that says "This feature is not available on your browser."

Expected behavior
The base64-encoded file is loaded into Pairdrop

Desktop (please complete the following information):

  • OS: MacOS Ventura 13.2.1
  • Browser: Firefox
  • Version: 110.0.1

Self-Hosted
Yes, but issue occurs on pairdrop.net as well.

Self-Hosted Setup
Proxy: Traefik 2.9
Deployment: docker compose/swarm

Additional context
None

Enhancement: How to change the display name?

It says in the readme: Change your display name permanently to easily differentiate your devices

I have tried multiple things like right-clicking, searching through the code, clicking on several button but I just don't know how to change the display name of the current device (or any paired device).

How do I change my display name and maybe also add this to the FAQ / readme, thank you!

File transfer often interrupted

Hello,

Thank you for making PairDrop a better alternative to Snapdrop. I used to use Snapdrop to transfer files/photos between my Windows laptop and my Android phone (sometimes with my friends iphones, or with school's iMacs).

When using Snapdrop at my student apartment, devices are detected but the transfer doesn't want to start. PairDrop fixes this problem and seems to have the capability to transfer multiple files at a time (with zip I guess idk).

When the transfer taking too much time (for example with 40 photos/280mb total), Idk why but the connection is interrupted during the transfer (device quickly disappear and it shows a message "You are back online" or something).

Thank you in advance

Bug: Can not connect with SnapDrop App on Android

Describe the bug
I installed the app "Snapdrop for Android" from fm-sys from F-Droid store in Version 1.11.3 and tried to set my PairDrop-Instance as Server. And i get the error "Seems not to be a snapdrop-instance"

Expected behavior
I want to set my Pairdrop-instance as backend for Snapdrop for Android

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Android
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Samsung A53
  • OS: Android
  • Snapdrop for Android
  • Version: 1.11.3 from fm-sys

Additional context
On my other phone i set the same server, when i run the original snapdrop-container. Switching to PairDrop was no problem. I can use the app without problem with my own pairdrop-server (on the same domain as snapdrop before)

Bug in UI when 2 device send files to another simultaneously

"For example: A and B send requests to C simultaneously (both file and message requests). On C side, only one dialog box is displayed because the dialog box is too big and covers the middle of the screen, causing one request from the requesting device to be missed."

Enhancement: Make 2 prompts for accepting and downloading more intuitive

Describe the bug
Sending 1 file from device A to device B I get two prompts on B to download

To Reproduce
Steps to reproduce the behaviour:

  1. Share a file from Android using latest Chrome browser
  2. Receive on Win 10 latest Chrome browser.

The first pop-up on B is:
image

After clicking accept, the file gets downloaded and the second prompt pops up:
image

If I click download, it downloads the file a second time.

And the pop-up doesn't close, I can keep clicking on โ€œdownloadโ€
image

Expected behaviour
I expected to get one pop-up, accept the download and the pop-up goes away.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win 10
  • Browser [chrome]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version 110.0.5481.96

Self-Hosted
Yes

Self-Hosted Setup
Proxy: traefik
Deployment: docker-compose

Additional context
The same behaviour happens with laptop 2 laptop, it's not related to me using the phone for the firsts tests. Also, the exact same behaviour happens if I use pairdrop.net

[Improvement] Larger QR code

When clicking the pair button, a QR Code image is shown in addition to a Pairing Code.

Can this QR Code image be larger so it is easier for a guest to scan with their phone? It is pretty small currently. This is true in Both the desktop web view or mobile view.

This improvement would make it much easier to quickly pair devices...and that's kinda the point of a tool like this. Quick/Easy/Secure access

Pairdrop has reset all my windows file associations?

Hi,

I "installed" Pairdrop in my Windows computer, but now every time I open a file, Pairdrop wants to be the default app to open that file type, and that is quite annoying.

Can you review that?

I managed to reproduce in a clean Windows Sandbox. See attached gif

Pairdrop_Small

  1. Create a text file, for example.
  2. Double click to confirm it's open with its default app, in this case notepad
  3. Install Pairdrop
  4. Open the text file again, a dialog appears suggesting Pairdrop as a potential default opener for text files.

I opened the file associations setting in Windows. Pairdrop has associated with .*.

image

I removed it from the registry, but I did a search for its key (Chrome.2803962851) and it appears hundreds of times for different, odd, extensions, I can't remove them by hand

image

I uninstalled the app, and the issue disappears, but the registry entries remain.

Bug: cancelling "clear all paired devices" still clears them

Describe the bug
cancelling "clear all paired devices" still clears them

To Reproduce
Steps to reproduce the behavior:

  1. Go to pairdrop.net on two different devices on two different networks
  2. Pair the two devices
  3. Click on "clear all paired devices" on one of the two devices
  4. In the pop-up select cancel
  5. The result: all paired devices are cleared

Expected behavior
Selecting cancel does cancel the clearing of paired devices.

Screenshots
image

clicking cancel results in:
image

Self-Hosted
Yes

Set an own tun/turn server

How can i set my own tun/stun/turn/sturn-Server for devices behind NAT?

I can not find any howtow for it...

Bug: Paired devices are not showing unless on same network

Describe the bug
I get the error "Paired devices are not persistent." when attempting to link two instances that have been installed as a Chrome PWA.

In the Console it says: "This browser does not support IndexedDB. Paired devices will be gone after the browser is closed."

To Reproduce

  • Install PWA on Computer 1
  • Install PWA on Computer 2
  • Get Code from Computer 2
  • Pair Code on Computer 1
  • Message: "Paired devices are not persistent."

Expected behavior

  • Devices should pair and persist connections.

Desktop (please complete the following information):

  • OS: Mac and Windows
  • Browser: Chrome
  • Version: 110.0.5481.177

Self-Hosted
Yes

Self-Hosted Setup
Proxy: Nginx Proxy Manager
Deployment: docker-compose

Feature Request: ability to change the name of a device

Hope I'm not missing something silly. Could it be possible to change the name of a device? I'd like to name devices on my own instance things like "my phone" or "my laptop" instead of "Magenta Beetle". Does this already exist and I've missed it somewhere?

Translation (Feature Request)

I would like to translate this docker container into spanish. Actually i'm translator of another open projects here in github like stashapp.

If you implement template variables for text strings I will translate them into spanish.

Thanks for your hard work with this tool.
Faileador.

Can't connect on Vanadium (on Graphene OS)

Describe the bug
I just came across this software and really like it. It is pretty neat and seems to work flawlessly. However, when I tried to use it with my Vanadium browser on my GrapheneOS Android phone, I can't make any connections. When I try to connect by entering the 6-digit number, it says "Paird devices are not persistent".

When I tried with Firefox, the connection was made immediately.

To Reproduce
Steps to reproduce the behavior:

  1. Open Vanadium
  2. Go to https://pairdrop.net/
  3. Open https://pairdrop.net/ on a computer in the same network
  4. Fail to see the other device

Expected behavior
The other device should show up.

Desktop (please complete the following information):

  • OS: Window 10
  • Browser Firefox
  • Version 109.0.1

Smartphone (please complete the following information):

  • Device: Pixel 7 Pro
  • OS: GrapheneOS Build number TQ1A.230205.002.2023021000
  • Browser Vanadium
  • Version 110.0.5481.64

Bug: You need to be online to pair devices.

Hi there,
i just set up PairDrop on my netcup.de Webhosting via node.js.
So far so good, but as soon as I try to use it, it either says "No server connection. Retry in 5s..." or "You need to be online to pair devices."

Devices do not see each other. PC <-> Smartphone

if i open PairDrop on the PC (Windows) and Smartphone (iOS) i cant see each other, even if i pair the devices successfully.
I can send files to other Smartphones (iOS) and i can see my computer itself as seperate device if i open it in two browsers.

Sometimes if i wait 1-2 minutes i see the device but most times not at all. from time to time i get "You are back online." message at the smartphone.

if i opened snapdrop, both devices saw each other instantly. any idea what is causing this?

Bug: devices on dfferent networks pair but can't share

Describe the bug
When I pair 2 devices on different network the pairing seams to be working, but the device doesn't show on either browser

To Reproduce
Steps to reproduce the behavior:

  1. open pairdrop on 2 devices that are on different networks
  2. click on the link button on top right on both devices
  3. insert the code visible on device 1 into device 2
  4. the code disappears on both devices, so it seems that they have "seen" each other
  5. the page stays "empty" and the other device doesn't show up

Expected behavior
After pairing I expect to see device 1 on browser 2 and device 2 on browser 1

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox/Chrome
  • Version: latest versions

Smartphone (please complete the following information):

  • Device: Pixel 7 Pro
  • OS: Android 13
  • Browser: Firefox/Chrome
  • Version: latest versions

[Feature Request] Add an authentication page

Is there anyway you could add an authentication page that people would have to login to in order to share files? Below are a few things you could implement.

  • Authentication (username and password)
  • Disable or enable authentication in the docker environment variables
  • Disable or enable new user registration in the docker environment variables
  • 2FA (FIDO2 or TOTP)

Love the project by the way!

Waves stopping, files not transferring

Hi,

I wanted to try out PairDrop because I was having an issue with SnapDrop (and then I saw that PairDrop will also work across networks - which I think is a great improvement!): After a couple of seconds the "waves" (or whatever they are) stop moving and a file will not transfer (no error message).

Unfortunately, I am having the same issue with PairDrop.

Might this have to do with my running docker rootless?

Or do you maybe have another idea what the issue might be?

Thanks!

Bug:Does not work properly in some browsers

I use Chrome on an Android phone, and I have been unable to enter PairDrop normally (the name and other devices are not displayed), the problem persists after reinstalling Chrome, and the screenshot shows the error provided by the debugging tool.

The same browser can normally access and use the services built by Snapdrop. So the browser should be fine.

Oddly, another Android phone works fine.

Screenshots
CleanShot 2023-03-13 at 13 26 08@2x

Self-Hosted
No

Devices do not appear at all while they did on snapdrop through VPN

I've two devices that are on a 10.0.0.0/24 subnet created by wireguard on pfsense. My main LAN net is not this. I can connect to the web-service and pair them, but unlike snapdrop (where I couldn't send anything), I can't even see the other device. Does this have to do with a firewall setting on nginx?

The behavior is exactly the same when I connect via. my reverse proxy, or directly via HTTPS and HTTP. I've tried combinations of Firefox and Edge on Windows 10 with Firefox and Safari on iOS 16.0.2

[feature request] Using PairDrop from commandline uses existing tab instead of opening a new one everytime

The only thing, what happens... every time using pairdrop from commandline, opens a new tab in firefox.

I run pairdrop from debian bullseye with firefox 102.8.0esr (64-Bit)

I don't know, if there is a possibility to reuse existing tab/window with this url, and only create a new one, if no pairdrop-tab/window exists.

Originally posted by @xundeenergie in #39 (comment)

This is a more general problem so I moved it to this issue to be discussed.

I like the idea of being able to reuse open tabs instead of opening another one, it should however still be possible to open PairDrop in multiple tabs.
There is a draft for focusing existing instances for PWAs using manifest.json:

    "launch_handler": {
        "client_mode": "focus-existing"
    }

This is not implemented in many browsers and only works if the PWA is installed on the device with the default browser:
https://developer.mozilla.org/en-US/docs/Web/Manifest/launch_handler#browser_compatibility
Opening urls in existing tabs is not per se possible

So I think about letting the tabs communicate to each other to find out whether another tab is already open and if yes, load the url there and close the new tab.

Tabs are indeed able to communicate with each other using a modern API: https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API

Possible Workflow:

  1. (pairdrop-cli is used with a additional flag like --use-existing-tab / -u)
  2. A new PairDrop tab tab_A is opened with a specific argument like ?focus_existing=true
  3. tab_A broadcasts its url (without the fucus_existing argument"). The broadcast is received by all tabs of the same domain.
  4. If another tab tab_B is open and not busy it:
    1. broadcasts that it overtakes the url
    2. loads the specified url
    3. changes the favicon and creates a notification that opens the tab if clicked
  5. To prevent multiple tabs from overtaking the url, if a third tab tab_C receives the overtake message, it will stop overtaking the url itself
  6. If tab_A receives the overtake message it will close itself using window.close()

@xundenergie Do you think this would be sensible?

Indicate if a new file has been received

It'd be cool to see some kind of indication when the tab has received a file, because sometimes you have a lot of tabs open and search for the correct one. I'd suggest to change the color of the tab icon.

E.g. original

android-chrome-512x512

indicator icon

android-chrome-512x512

Bug: High CPU Load

Describe the bug
Simply opening https://pairdrop.net causes about 50% CPU load in Firefox. Or, in other terms: +30W CPU power consumption and +7W iGPU power consumption.
In MS Edge it's less severe with "only" ~10% additional CPU load (resulting in +10W CPU and + 1.5W GPU power consumption), but still more than enough to make the fans ramp up - and much more than I'd expect.

Expected behavior
No excessive CPU load.

Screenshots
Note: Both the jumps in CPU and GPU load come from opening PairDrop. The high network load is unrelated.
image

Same test with Microsoft Edge. Less severe but still noticeable CPU load. GPU load looks similar, but according to CoreTemp it's much less significant, too.
image

Desktop (please complete the following information):

  • OS: Windows 11 Pro 22H2, Build 22621.1265
  • Hardware: MSI Creator 17 B11UE
    • Processor: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz 2.30 GHz
    • Installed RAM: 32,0 GB
  • Browser: Firefox 110.0.1 x64 | Microsoft Edge 110.0.1587.69 x64
  • Other: Core Temp 1.17.1
  • Version: Not sure what's meant...?

Self-Hosted
No

Additional context
I'm pretty sure this wasn't an issue a few days ago - or at least not as much of an issue. I remember using it to transfer some pictures to my computer and I'm pretty sure the fans did not ramp up that day. Unfortunately I can't remember when exactly that was.
Opening the page in a private window does not solve the issue.

Bug? device discovery not working without manual pairing

N.B. In the details below mydomain.com is a placeholder for the actual domain I'm using, which I prefer to keep private

Sorry to raise this as a bug, since it's more likely my ignorance on some part of the setup. I'm trying to set up a selfhosted PairDrop instance. I have read host-your-own.md and combed through the Issues but I can't figure this out.

  • I'm using the LSCR docker image (version at the time of this writing is: v1.4.4-ls13)
  • The docker host is running Ubuntu Ubuntu 22.04.1 LTS
  • I'm using a Cloudflare (Argo) tunnel to handle the HTTPS proxying (routing to localhost:8081)
  • I'm running an instance of coturn for my own STUN server
  • The host is behind a NAT but has the STUN TCP/UDP ports 3478,5349,49152-49200 forwarded to the internal IP. I have confirmed that's all working via Trickle ICE as well as from the CLI: stunclient stun.mydomain.com 3478

All of that seems to work fine!

I then prepared the PairDrop docker image with the following:

docker create \
--name=pairdrop \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=America/New_York \
-e RATE_LIMIT=true \
-e RTC_CONFIG="rtc_config.json" \
-e WS_FALLBACK=true \
-p 127.0.0.1:8081:3000 \
-v pairdrop:/app \
--restart unless-stopped \
lscr.io/linuxserver/pairdrop:latest

I created my custom rtc_config.json via:

cd /var/snap/docker/common/var-lib-docker/volumes/pairdrop/_data/pairdrop
cat <<EOF >rtc_config.json
{
  "sdpSemantics": "unified-plan",
  "iceServers": [
    {
      "urls": "stun:stun.mydomain.com:3478"
    }
  ]
}
EOF

And finally, start the PairDrop container and tail the logs:

docker start pairdrop && docker logs -f pairdrop

It all opens and runs fine (with the exception of a node error about not being able to write to /root/.npm/_logs, which I believe is totally unrelated, but the output is below anyway)

BUT, upon visiting the page (drop.mydomain.com) no devices are seeing each other. It doesn't matter whether I'm accessing from desktop browser (Chrome, Safari) or mobile device, 4G LTE network or over WiFi/Ethernet.

I've tried it also with WS_FALLBACK=false, as well as with and without the custom RTC_CONFIG. No differences noted.

I opened the Chrome devtools console and don't see any errors there.

If I manually pair the devices with a pairing code, everything works fine. It's just the autodiscovery that's broken for me. Any help would be wonderfully appreciated ๐Ÿ™


Output of the docker logs -f pairdrop below

pairdrop
[migrations] started
[migrations] no migrations found
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

      โ–ˆโ–ˆโ•—     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
      โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—
      โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘
      โ–ˆโ–ˆโ•‘     โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘
      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•
      โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•

   Brought to you by linuxserver.io
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

To support the app dev(s) visit:
PairDrop: https://www.buymeacoffee.com/pairdrop

To support LSIO projects visit:
https://www.linuxserver.io/donate/

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
GID/UID
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

User UID:    1000
User GID:    1000
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

[custom-init] No custom files found, skipping...
npm WARN logfile Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm WARN logfile  error cleaning log files [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
npm WARN logfile   errno: -13,
npm WARN logfile   code: 'EACCES',
npm WARN logfile   syscall: 'scandir',
npm WARN logfile   path: '/root/.npm/_logs'
npm WARN logfile }

> [email protected] start
> node index.js

PairDrop is running on port 3000
[ls.io-init] done.

Bug: My own device name is not visible on Firefox for Android

My own device name is not visible on Firefox for Android. See screenshot. It is possible to work-around the issue by turning on "Desktop site", but that makes the site hard to read or use.

Smartphone (please complete the following information):

  • Device: Samsung S21
  • OS: Android 13
  • Browser: Firefox for Android
  • Version: Firefox v 110.1.0

Self-Hosted
No

Screenshots
Screenshot_20230310_105335_Firefox

Bug: transfers are incredibly slow

Attempting to transfer a file between clients is unimaginably slow

Steps to reproduce the behavior:

  1. Go to pairdrop.net
  2. Click on link in top right
  3. Pair with device
  4. Transfer file

Expected behavior
I expect the speed of the connection between the two devices

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Edge, Firefox
  • Version 110.0.1587.50,110

Self-Hosted
Both self-hosted and Pairdrop official site

Self-Hosted Setup
Proxy: Nginx
Deployment: Unraid

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.