mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-07 18:32:15 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43824d0de2 | ||
|
|
2efb531765 | ||
|
|
d9686a6706 | ||
|
|
395c3e00a4 | ||
|
|
8869c3c27e | ||
|
|
b07b8316ff | ||
|
|
445a295404 | ||
|
|
29b91cb17a | ||
|
|
26bf4d6dc3 |
5
index.js
5
index.js
@@ -362,6 +362,11 @@ class PairDropServer {
|
||||
_joinRoom(peer, roomType = 'ip', roomSecret = '') {
|
||||
const room = roomType === 'ip' ? peer.ip : roomSecret;
|
||||
|
||||
if (this._rooms[room] && this._rooms[room][peer.id]) {
|
||||
// ensures that otherPeers never receive `peer-left` after `peer-joined` on reconnect.
|
||||
this._leaveRoom(peer, roomType, roomSecret);
|
||||
}
|
||||
|
||||
// if room doesn't exist, create it
|
||||
if (!this._rooms[room]) {
|
||||
this._rooms[room] = {};
|
||||
|
||||
20
package-lock.json
generated
20
package-lock.json
generated
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "pairdrop",
|
||||
"version": "1.7.5",
|
||||
"version": "1.7.7",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "pairdrop",
|
||||
"version": "1.7.5",
|
||||
"version": "1.7.7",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.18.2",
|
||||
"express-rate-limit": "^6.7.0",
|
||||
"express-rate-limit": "^6.9.0",
|
||||
"ua-parser-js": "^1.0.35",
|
||||
"unique-names-generator": "^4.3.0",
|
||||
"ws": "^8.13.0"
|
||||
@@ -204,11 +204,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/express-rate-limit": {
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.7.0.tgz",
|
||||
"integrity": "sha512-vhwIdRoqcYB/72TK3tRZI+0ttS8Ytrk24GfmsxDXK9o9IhHNO5bXRiXQSExPQ4GbaE5tvIS7j1SGrxsuWs+sGA==",
|
||||
"version": "6.9.0",
|
||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.9.0.tgz",
|
||||
"integrity": "sha512-AnISR3V8qy4gpKM62/TzYdoFO9NV84fBx0POXzTryHU/qGUJBWuVGd+JhbvtVmKBv37t8/afmqdnv16xWoQxag==",
|
||||
"engines": {
|
||||
"node": ">= 12.9.0"
|
||||
"node": ">= 14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"express": "^4 || ^5"
|
||||
@@ -801,9 +801,9 @@
|
||||
}
|
||||
},
|
||||
"express-rate-limit": {
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.7.0.tgz",
|
||||
"integrity": "sha512-vhwIdRoqcYB/72TK3tRZI+0ttS8Ytrk24GfmsxDXK9o9IhHNO5bXRiXQSExPQ4GbaE5tvIS7j1SGrxsuWs+sGA==",
|
||||
"version": "6.9.0",
|
||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.9.0.tgz",
|
||||
"integrity": "sha512-AnISR3V8qy4gpKM62/TzYdoFO9NV84fBx0POXzTryHU/qGUJBWuVGd+JhbvtVmKBv37t8/afmqdnv16xWoQxag==",
|
||||
"requires": {}
|
||||
},
|
||||
"finalhandler": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pairdrop",
|
||||
"version": "1.7.5",
|
||||
"version": "1.7.7",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -11,7 +11,7 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.18.2",
|
||||
"express-rate-limit": "^6.7.0",
|
||||
"express-rate-limit": "^6.9.0",
|
||||
"ua-parser-js": "^1.0.35",
|
||||
"unique-names-generator": "^4.3.0",
|
||||
"ws": "^8.13.0"
|
||||
|
||||
@@ -38,7 +38,10 @@ openPairDrop()
|
||||
else
|
||||
xdg-open "$url"
|
||||
fi
|
||||
|
||||
|
||||
exit
|
||||
|
||||
}
|
||||
|
||||
setOs()
|
||||
@@ -98,13 +101,19 @@ sendFiles()
|
||||
[[ -a "$zipPath" ]] && echo "Cannot overwrite $zipPath. Please remove first." && exit
|
||||
|
||||
if [[ -d $path ]]; then
|
||||
zipPathTemp="temp_${zipPath}"
|
||||
zipPathTemp="${path}_pairdrop_temp.zip"
|
||||
[[ -a "$zipPathTemp" ]] && echo "Cannot overwrite $zipPathTemp. Please remove first." && exit
|
||||
echo "Processing directory..."
|
||||
|
||||
# Create zip files temporarily to send directory
|
||||
zip -q -b /tmp/ -r "$zipPath" "$path"
|
||||
zip -q -b /tmp/ "$zipPathTemp" "$zipPath"
|
||||
if [[ $OS == "Windows" ]];then
|
||||
powershell.exe -Command "Compress-Archive -Path ${path} -DestinationPath ${zipPath}"
|
||||
echo "Compress-Archive -Path ${zipPath} -DestinationPath ${zipPathTemp}"
|
||||
powershell.exe -Command "Compress-Archive -Path ${zipPath} -DestinationPath ${zipPathTemp}"
|
||||
else
|
||||
zip -q -b /tmp/ -r "$zipPath" "$path"
|
||||
zip -q -b /tmp/ "$zipPathTemp" "$zipPath"
|
||||
fi
|
||||
|
||||
if [[ $OS == "Mac" ]];then
|
||||
hash=$(base64 -i "$zipPathTemp")
|
||||
@@ -118,8 +127,12 @@ sendFiles()
|
||||
echo "Processing file..."
|
||||
|
||||
# Create zip file temporarily to send file
|
||||
zip -q -b /tmp/ "$zipPath" "$path"
|
||||
|
||||
if [[ $OS == "Windows" ]];then
|
||||
powershell.exe -Command "Compress-Archive -Path ${path} -DestinationPath ${zipPath} -CompressionLevel Optimal"
|
||||
else
|
||||
zip -q -b /tmp/ "$zipPath" "$path"
|
||||
fi
|
||||
if [[ $OS == "Mac" ]];then
|
||||
hash=$(base64 -i "$zipPath")
|
||||
else
|
||||
@@ -142,6 +155,7 @@ sendFiles()
|
||||
hash=
|
||||
fi
|
||||
|
||||
|
||||
openPairDrop
|
||||
exit
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
</svg>
|
||||
<div class="title-wrapper">
|
||||
<h1>PairDrop</h1>
|
||||
<div class="font-subheading">v1.7.5</div>
|
||||
<div class="font-subheading">v1.7.7</div>
|
||||
</div>
|
||||
<div class="font-subheading">The easiest way to transfer files across devices</div>
|
||||
<div class="row">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const cacheVersion = 'v1.7.5';
|
||||
const cacheVersion = 'v1.7.7';
|
||||
const cacheTitle = `pairdrop-cache-${cacheVersion}`;
|
||||
const urlsToCache = [
|
||||
'index.html',
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
</svg>
|
||||
<div class="title-wrapper">
|
||||
<h1>PairDrop</h1>
|
||||
<div class="font-subheading">v1.7.5</div>
|
||||
<div class="font-subheading">v1.7.7</div>
|
||||
</div>
|
||||
<div class="font-subheading">The easiest way to transfer files across devices</div>
|
||||
<div class="row">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const cacheVersion = 'v1.7.5';
|
||||
const cacheVersion = 'v1.7.7';
|
||||
const cacheTitle = `pairdrop-included-ws-fallback-cache-${cacheVersion}`;
|
||||
const urlsToCache = [
|
||||
'index.html',
|
||||
|
||||
Reference in New Issue
Block a user