linuxrun commited on
Commit
f2b0008
·
verified ·
1 Parent(s): 3b62151

Upload 167 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .dockerignore +13 -0
  2. .gitattributes +49 -0
  3. .github/FUNDING.yml +12 -0
  4. .github/ISSUE_TEMPLATE/bug-report.md +50 -0
  5. .github/ISSUE_TEMPLATE/enhancement.md +20 -0
  6. .github/dependabot.yml +11 -0
  7. .github/workflows/docker-image.yml +29 -0
  8. .github/workflows/github-image.yml +60 -0
  9. .github/workflows/zip-release.yml +36 -0
  10. .gitignore +7 -0
  11. .npmrc +1 -0
  12. CONTRIBUTING.md +18 -0
  13. Dockerfile +21 -0
  14. LICENSE +674 -0
  15. dev/nginx-with-openssl.Dockerfile +3 -0
  16. dev/nginx/default.conf +42 -0
  17. dev/openssl/create.sh +9 -0
  18. dev/openssl/pairdropCA.cnf +26 -0
  19. dev/openssl/pairdropCert.cnf +29 -0
  20. docker-compose-coturn.yml +31 -0
  21. docker-compose-dev.yml +34 -0
  22. docker-compose.yml +16 -0
  23. docs/docker-swarm-usage.md +47 -0
  24. docs/faq.md +275 -0
  25. docs/host-your-own.md +709 -0
  26. docs/how-to.md +142 -0
  27. docs/pairdrop_screenshot_desktop.png +3 -0
  28. docs/pairdrop_screenshot_mobile.gif +3 -0
  29. docs/pwa-install.png +0 -0
  30. docs/technical-documentation.md +82 -0
  31. licenses/BSD_3-Clause-zip-js +28 -0
  32. licenses/MIT-NoSleep +22 -0
  33. licenses/MIT-heic2any +22 -0
  34. package-lock.json +838 -0
  35. package.json +23 -0
  36. pairdrop-cli/.gitignore +1 -0
  37. pairdrop-cli/.pairdrop-cli-config.example +1 -0
  38. pairdrop-cli/pairdrop +382 -0
  39. pairdrop-cli/pairdrop.sh +6 -0
  40. pairdrop-cli/send with PairDrop.lnk +0 -0
  41. pairdrop-cli/send-with-pairdrop +17 -0
  42. pairdrop-cli/send-with-pairdrop.ps1 +3 -0
  43. public/fonts/OpenSans/OFL.txt +93 -0
  44. public/fonts/OpenSans/OpenSans-Italic-VariableFont_wdth,wght.ttf +3 -0
  45. public/fonts/OpenSans/OpenSans-VariableFont_wdth,wght.ttf +3 -0
  46. public/fonts/OpenSans/README.txt +100 -0
  47. public/fonts/OpenSans/static/OpenSans-Bold.ttf +3 -0
  48. public/fonts/OpenSans/static/OpenSans-BoldItalic.ttf +3 -0
  49. public/fonts/OpenSans/static/OpenSans-ExtraBold.ttf +3 -0
  50. public/fonts/OpenSans/static/OpenSans-ExtraBoldItalic.ttf +3 -0
.dockerignore ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .github
2
+ .git*
3
+ .idea
4
+ dev
5
+ docs
6
+ licenses
7
+ node_modules
8
+ pairdrop-cli
9
+ *.md
10
+ *.yml
11
+ Dockerfile
12
+ rtc_config_example.json
13
+ turnserver_example.conf
.gitattributes CHANGED
@@ -33,3 +33,52 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ docs/pairdrop_screenshot_desktop.png filter=lfs diff=lfs merge=lfs -text
37
+ docs/pairdrop_screenshot_mobile.gif filter=lfs diff=lfs merge=lfs -text
38
+ public/fonts/OpenSans/OpenSans-Italic-VariableFont_wdth,wght.ttf filter=lfs diff=lfs merge=lfs -text
39
+ public/fonts/OpenSans/OpenSans-VariableFont_wdth,wght.ttf filter=lfs diff=lfs merge=lfs -text
40
+ public/fonts/OpenSans/static/OpenSans_Condensed-Bold.ttf filter=lfs diff=lfs merge=lfs -text
41
+ public/fonts/OpenSans/static/OpenSans_Condensed-BoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
42
+ public/fonts/OpenSans/static/OpenSans_Condensed-ExtraBold.ttf filter=lfs diff=lfs merge=lfs -text
43
+ public/fonts/OpenSans/static/OpenSans_Condensed-ExtraBoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
44
+ public/fonts/OpenSans/static/OpenSans_Condensed-Italic.ttf filter=lfs diff=lfs merge=lfs -text
45
+ public/fonts/OpenSans/static/OpenSans_Condensed-Light.ttf filter=lfs diff=lfs merge=lfs -text
46
+ public/fonts/OpenSans/static/OpenSans_Condensed-LightItalic.ttf filter=lfs diff=lfs merge=lfs -text
47
+ public/fonts/OpenSans/static/OpenSans_Condensed-Medium.ttf filter=lfs diff=lfs merge=lfs -text
48
+ public/fonts/OpenSans/static/OpenSans_Condensed-MediumItalic.ttf filter=lfs diff=lfs merge=lfs -text
49
+ public/fonts/OpenSans/static/OpenSans_Condensed-Regular.ttf filter=lfs diff=lfs merge=lfs -text
50
+ public/fonts/OpenSans/static/OpenSans_Condensed-SemiBold.ttf filter=lfs diff=lfs merge=lfs -text
51
+ public/fonts/OpenSans/static/OpenSans_Condensed-SemiBoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
52
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-Bold.ttf filter=lfs diff=lfs merge=lfs -text
53
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-BoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
54
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-ExtraBold.ttf filter=lfs diff=lfs merge=lfs -text
55
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-ExtraBoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
56
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-Italic.ttf filter=lfs diff=lfs merge=lfs -text
57
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-Light.ttf filter=lfs diff=lfs merge=lfs -text
58
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-LightItalic.ttf filter=lfs diff=lfs merge=lfs -text
59
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-Medium.ttf filter=lfs diff=lfs merge=lfs -text
60
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-MediumItalic.ttf filter=lfs diff=lfs merge=lfs -text
61
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-Regular.ttf filter=lfs diff=lfs merge=lfs -text
62
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-SemiBold.ttf filter=lfs diff=lfs merge=lfs -text
63
+ public/fonts/OpenSans/static/OpenSans_SemiCondensed-SemiBoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
64
+ public/fonts/OpenSans/static/OpenSans-Bold.ttf filter=lfs diff=lfs merge=lfs -text
65
+ public/fonts/OpenSans/static/OpenSans-BoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
66
+ public/fonts/OpenSans/static/OpenSans-ExtraBold.ttf filter=lfs diff=lfs merge=lfs -text
67
+ public/fonts/OpenSans/static/OpenSans-ExtraBoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
68
+ public/fonts/OpenSans/static/OpenSans-Italic.ttf filter=lfs diff=lfs merge=lfs -text
69
+ public/fonts/OpenSans/static/OpenSans-Light.ttf filter=lfs diff=lfs merge=lfs -text
70
+ public/fonts/OpenSans/static/OpenSans-LightItalic.ttf filter=lfs diff=lfs merge=lfs -text
71
+ public/fonts/OpenSans/static/OpenSans-Medium.ttf filter=lfs diff=lfs merge=lfs -text
72
+ public/fonts/OpenSans/static/OpenSans-MediumItalic.ttf filter=lfs diff=lfs merge=lfs -text
73
+ public/fonts/OpenSans/static/OpenSans-Regular.ttf filter=lfs diff=lfs merge=lfs -text
74
+ public/fonts/OpenSans/static/OpenSans-SemiBold.ttf filter=lfs diff=lfs merge=lfs -text
75
+ public/fonts/OpenSans/static/OpenSans-SemiBoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
76
+ public/images/pairdrop_screenshot_mobile_1.png filter=lfs diff=lfs merge=lfs -text
77
+ public/images/pairdrop_screenshot_mobile_2.png filter=lfs diff=lfs merge=lfs -text
78
+ public/images/pairdrop_screenshot_mobile_3.png filter=lfs diff=lfs merge=lfs -text
79
+ public/images/pairdrop_screenshot_mobile_4.png filter=lfs diff=lfs merge=lfs -text
80
+ public/images/pairdrop_screenshot_mobile_5.png filter=lfs diff=lfs merge=lfs -text
81
+ public/images/pairdrop_screenshot_mobile_6.png filter=lfs diff=lfs merge=lfs -text
82
+ public/images/pairdrop_screenshot_mobile_7.png filter=lfs diff=lfs merge=lfs -text
83
+ public/images/pairdrop_screenshot_mobile_8.png filter=lfs diff=lfs merge=lfs -text
84
+ public/images/snapdrop-graphics.sketch filter=lfs diff=lfs merge=lfs -text
.github/FUNDING.yml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # These are supported funding model platforms
2
+
3
+ github: schlagmichdoch
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: https://buymeacoffee.com/pairdrop
.github/ISSUE_TEMPLATE/bug-report.md ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Bug Report
3
+ about: Create a report to help us improve. Please check the FAQ first.
4
+ title: '[Bug] '
5
+ labels: 'bug'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Bug occurs on official PairDrop instance https://pairdrop.net/**
38
+ No | Yes
39
+ Version: v1.11.2
40
+
41
+ **Bug occurs on self-hosted PairDrop instance**
42
+ No | Yes
43
+
44
+ **Self-Hosted Setup**
45
+ Proxy: Nginx | Apache2
46
+ Deployment: docker run | docker compose | npm run start:prod
47
+ Version: v1.11.2
48
+
49
+ **Additional context**
50
+ Add any other context about the problem here.
.github/ISSUE_TEMPLATE/enhancement.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Enhancement
3
+ about: Enhancements and feature requests are always welcome. See discussions regarding central topics.
4
+ title: '[Enhancement] '
5
+ labels: 'enhancement'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **What problem is solved by the new feature**
11
+ What's the motivation for this topic
12
+
13
+ **Describe the feature**
14
+ A clear and concise description of what the new feature/enhancement is.
15
+
16
+ **Drafts**
17
+ Screenshots of Draw.io graph or drawn sketch.
18
+
19
+ **Additional context**
20
+ Add any other context here.
.github/dependabot.yml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "npm" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
.github/workflows/docker-image.yml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
10
+ # Build a Docker image whenever it is pushed to master
11
+
12
+ name: Docker Image CI
13
+
14
+ on:
15
+ push:
16
+ branches: [ "master" ]
17
+ pull_request:
18
+ branches: [ "master" ]
19
+
20
+ jobs:
21
+
22
+ build:
23
+
24
+ runs-on: ubuntu-latest
25
+
26
+ steps:
27
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28
+ - name: Build the Docker image
29
+ run: docker build --pull . -f Dockerfile -t pairdrop
.github/workflows/github-image.yml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
10
+ # Create a Docker image and push it to ghcr.io whenever a new version tag is pushed
11
+
12
+ name: GHCR Image CI
13
+
14
+ on:
15
+ push:
16
+ tags:
17
+ - "v*.*.*"
18
+
19
+ env:
20
+ REGISTRY: ghcr.io
21
+ IMAGE_NAME: ${{ github.repository }}
22
+
23
+ jobs:
24
+ build-and-push-image:
25
+ runs-on: ubuntu-latest
26
+ permissions:
27
+ contents: read
28
+ packages: write
29
+
30
+ steps:
31
+ - name: Checkout repository
32
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
33
+
34
+ - name: Setup qemu
35
+ uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
36
+
37
+ - name: Setup Docker Buildx
38
+ uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
39
+
40
+ - name: Log in to the Container registry
41
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
42
+ with:
43
+ registry: ${{ env.REGISTRY }}
44
+ username: ${{ github.actor }}
45
+ password: ${{ secrets.GITHUB_TOKEN }}
46
+
47
+ - name: Extract metadata (tags, labels) for Docker
48
+ id: meta
49
+ uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4 # v5.3.0
50
+ with:
51
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
52
+
53
+ - name: Build and push Docker image
54
+ uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
55
+ with:
56
+ context: .
57
+ platforms: linux/amd64,linux/arm64
58
+ push: true
59
+ tags: ${{ steps.meta.outputs.tags }}
60
+ labels: ${{ steps.meta.outputs.labels }}
.github/workflows/zip-release.yml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
10
+ # Create a new zip file from pairdrop-cli whenever a new version tag is pushed
11
+
12
+ name: Zip Release
13
+
14
+ on:
15
+ push:
16
+ tags:
17
+ - "v*.*.*"
18
+
19
+ jobs:
20
+ build:
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ contents: write
24
+ steps:
25
+ - uses: actions/checkout@master
26
+ - name: Archive Release
27
+ uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # v0.7.6
28
+ with:
29
+ filename: 'pairdrop-cli.zip'
30
+ directory: 'pairdrop-cli'
31
+ exclusions: '*.git* /*node_modules/* .editorconfig'
32
+ - name: Upload Release
33
+ uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
34
+ with:
35
+ artifacts: "pairdrop-cli/pairdrop-cli.zip"
36
+ token: ${{ secrets.GITHUB_TOKEN }}
.gitignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ node_modules
2
+ .DS_Store
3
+ /dev/certs
4
+ qrcode-svg/
5
+ turnserver.conf
6
+ rtc_config.json
7
+ ssl/
.npmrc ADDED
@@ -0,0 +1 @@
 
 
1
+ engine-strict=true
CONTRIBUTING.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Priorities
2
+ - PairDrop should be extremely simple, clean, and easy to use.
3
+ - The main user flow should never be obstructed!
4
+ - New features must be tested thoroughly before we are able to merge them.
5
+ - Stability always comes first!
6
+
7
+ # Agenda
8
+ PairDrop is a study in radical simplicity. The user interface is insanely simple. Features are chosen very carefully because complexity grows quadratically since every feature potentially interferes with each other feature. We focus very narrowly on a single use case: instant file transfer.
9
+ We are not trying to optimize for some edge-cases. We are optimizing the user flow of the average users. Don't be sad if we decline your feature request for the sake of simplicity.
10
+
11
+ If you want to learn more about simplicity you can read [Insanely Simple: The Obsession that Drives Apple's Success](https://www.amazon.com/Insanely-Simple-Ken-Segall-audiobook/dp/B007Z9686O) or [Thinking, Fast and Slow](https://www.amazon.com/Thinking-Fast-Slow-Daniel-Kahneman/dp/0374533555).
12
+
13
+ # Contributing guidelines
14
+ Make sure to follow these guidelines before opening an [issue](https://github.com/schlagmichdoch/pairdrop/issues/new/choose) or a [pull request](https://github.com/schlagmichdoch/pairdrop/pulls):
15
+
16
+ - Before opening an issue of a pull request, please check if the issue or the pull request already exists.
17
+ - Pull requests for packages updates are not allowed since there is [Dependabot](https://github.com/schlagmichdoch/pairdrop/blob/master/.github/dependabot.yml) that checks them automatically.
18
+ - If you don't know how to contribute, also if you don't know JavaScript or Node.js, you can still share your awesome ideas with a new issue (feature request) and check the whole project for misspellings, too.
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:latest
2
+
3
+ WORKDIR /home/node/app
4
+
5
+ COPY package*.json ./
6
+
7
+ RUN apk add --no-cache nodejs npm
8
+ RUN NODE_ENV="production" npm ci --omit=dev
9
+
10
+ # Directories and files excluded via .dockerignore
11
+ COPY . .
12
+
13
+ # environment settings
14
+ ENV NODE_ENV="production"
15
+
16
+ EXPOSE 3000
17
+
18
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
19
+ CMD wget --quiet --tries=1 --spider http://localhost:3000 || exit 1
20
+
21
+ ENTRYPOINT ["npm", "start"]
LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <https://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <https://www.gnu.org/licenses/why-not-lgpl.html>.
dev/nginx-with-openssl.Dockerfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ FROM nginx:alpine
2
+
3
+ RUN apk add --no-cache openssl
dev/nginx/default.conf ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 80;
3
+
4
+ expires epoch;
5
+
6
+ location / {
7
+ proxy_connect_timeout 300;
8
+ proxy_pass http://pairdrop:3000;
9
+ proxy_set_header Connection "upgrade";
10
+ proxy_set_header Upgrade $http_upgrade;
11
+ }
12
+
13
+ location /ca.crt {
14
+ alias /etc/ssl/certs/pairdropCA.crt;
15
+ }
16
+
17
+ # To allow POST on static pages
18
+ error_page 405 =200 $uri;
19
+ }
20
+
21
+ server {
22
+ listen 443 ssl;
23
+ http2 on;
24
+ ssl_certificate /etc/ssl/certs/pairdrop-dev.crt;
25
+ ssl_certificate_key /etc/ssl/certs/pairdrop-dev.key;
26
+
27
+ expires epoch;
28
+
29
+ location / {
30
+ proxy_connect_timeout 300;
31
+ proxy_pass http://pairdrop:3000;
32
+ proxy_set_header Connection "upgrade";
33
+ proxy_set_header Upgrade $http_upgrade;
34
+ }
35
+
36
+ location /ca.crt {
37
+ alias /etc/ssl/certs/pairdropCA.crt;
38
+ }
39
+ # To allow POST on static pages
40
+ error_page 405 =200 $uri;
41
+ }
42
+
dev/openssl/create.sh ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+ cnf_dir='/mnt/openssl/'
4
+ certs_dir='/etc/ssl/certs/'
5
+ openssl req -config ${cnf_dir}pairdropCA.cnf -new -x509 -days 1 -keyout ${certs_dir}pairdropCA.key -out ${certs_dir}pairdropCA.crt
6
+ openssl req -config ${cnf_dir}pairdropCert.cnf -new -out /tmp/pairdrop-dev.csr -keyout ${certs_dir}pairdrop-dev.key
7
+ openssl x509 -req -in /tmp/pairdrop-dev.csr -CA ${certs_dir}pairdropCA.crt -CAkey ${certs_dir}pairdropCA.key -CAcreateserial -extensions req_ext -extfile ${cnf_dir}pairdropCert.cnf -sha512 -days 1 -out ${certs_dir}pairdrop-dev.crt
8
+
9
+ exec "$@"
dev/openssl/pairdropCA.cnf ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [ req ]
2
+ default_bits = 2048
3
+ default_md = sha256
4
+ default_days = 1
5
+ encrypt_key = no
6
+ distinguished_name = subject
7
+ x509_extensions = x509_ext
8
+ string_mask = utf8only
9
+ prompt = no
10
+
11
+ [ subject ]
12
+ organizationName = PairDrop
13
+ OU = CA
14
+ commonName = pairdrop-CA
15
+
16
+ [ x509_ext ]
17
+ subjectKeyIdentifier = hash
18
+ authorityKeyIdentifier = keyid:always,issuer
19
+
20
+ # You only need digitalSignature below. *If* you don't allow
21
+ # RSA Key transport (i.e., you use ephemeral cipher suites), then
22
+ # omit keyEncipherment because that's key transport.
23
+
24
+ basicConstraints = critical, CA:TRUE, pathlen:0
25
+ keyUsage = critical, digitalSignature, keyEncipherment, cRLSign, keyCertSign
26
+
dev/openssl/pairdropCert.cnf ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [ req ]
2
+ default_bits = 2048
3
+ default_md = sha256
4
+ default_days = 1
5
+ encrypt_key = no
6
+ distinguished_name = subject
7
+ req_extensions = req_ext
8
+ string_mask = utf8only
9
+ prompt = no
10
+
11
+ [ subject ]
12
+ organizationName = PairDrop
13
+ OU = Development
14
+
15
+ # Use a friendly name here because it's presented to the user. The server's DNS
16
+ # names are placed in Subject Alternate Names. Plus, DNS names here is deprecated
17
+ # by both IETF and CA/Browser Forums. If you place a DNS name here, then you
18
+ # must include the DNS name in the SAN too (otherwise, Chrome and others that
19
+ # strictly follow the CA/Browser Baseline Requirements will fail).
20
+
21
+ commonName = ${ENV::FQDN}
22
+
23
+ [ req_ext ]
24
+ subjectKeyIdentifier = hash
25
+ basicConstraints = CA:FALSE
26
+ keyUsage = digitalSignature, keyEncipherment
27
+ subjectAltName = DNS:${ENV::FQDN}
28
+ nsComment = "OpenSSL Generated Certificate"
29
+ extendedKeyUsage = serverAuth
docker-compose-coturn.yml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3"
2
+ services:
3
+ pairdrop:
4
+ image: "lscr.io/linuxserver/pairdrop:latest"
5
+ container_name: pairdrop
6
+ restart: unless-stopped
7
+ volumes:
8
+ - ./rtc_config.json:/home/node/app/rtc_config.json
9
+ environment:
10
+ - PUID=1000 # UID to run the application as
11
+ - PGID=1000 # GID to run the application as
12
+ - WS_FALLBACK=false # Set to true to enable websocket fallback if the peer to peer WebRTC connection is not available to the client.
13
+ - RATE_LIMIT=false # Set to true to limit clients to 1000 requests per 5 min.
14
+ - RTC_CONFIG=/home/node/app/rtc_config.json # Set to the path of a file that specifies the STUN/TURN servers.
15
+ - DEBUG_MODE=false # Set to true to debug container and peer connections.
16
+ - TZ=Etc/UTC # Time Zone
17
+ ports:
18
+ - "127.0.0.1:3000:3000" # Web UI. Change the port number before the last colon e.g. `127.0.0.1:9000:3000`
19
+ coturn_server:
20
+ image: "coturn/coturn"
21
+ restart: unless-stopped
22
+ volumes:
23
+ - ./turnserver.conf:/etc/coturn/turnserver.conf
24
+ - ./ssl/:/etc/coturn/ssl/
25
+ ports:
26
+ - "3478:3478"
27
+ - "3478:3478/udp"
28
+ - "5349:5349"
29
+ - "5349:5349/udp"
30
+ - "10000-20000:10000-20000/udp"
31
+ # see guide at docs/host-your-own.md#coturn-and-pairdrop-via-docker-compose
docker-compose-dev.yml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3"
2
+ services:
3
+ pairdrop:
4
+ build: .
5
+ container_name: pairdrop
6
+ restart: unless-stopped
7
+ environment:
8
+ - PUID=1000 # UID to run the application as
9
+ - PGID=1000 # GID to run the application as
10
+ - WS_FALLBACK=false # Set to true to enable websocket fallback if the peer to peer WebRTC connection is not available to the client.
11
+ - RATE_LIMIT=false # Set to true to limit clients to 1000 requests per 5 min.
12
+ - RTC_CONFIG=false # Set to the path of a file that specifies the STUN/TURN servers.
13
+ - DEBUG_MODE=false # Set to true to debug container and peer connections.
14
+ - TZ=Etc/UTC # Time Zone
15
+ ports:
16
+ - "127.0.0.1:3000:3000" # Web UI. Change the port number before the last colon e.g. `127.0.0.1:9000:3000`
17
+ nginx:
18
+ build:
19
+ context: dev/
20
+ dockerfile: nginx-with-openssl.Dockerfile
21
+ image: "nginx-with-openssl"
22
+ volumes:
23
+ - ./public:/usr/share/nginx/html
24
+ - ./dev/certs:/etc/ssl/certs
25
+ - ./dev/openssl:/mnt/openssl
26
+ - ./dev/nginx/default.conf:/etc/nginx/conf.d/default.conf
27
+ ports:
28
+ - "8080:80"
29
+ - "8443:443"
30
+ environment:
31
+ - FQDN=localhost
32
+ entrypoint: /mnt/openssl/create.sh
33
+ command: ["nginx", "-g", "daemon off;"]
34
+ restart: unless-stopped
docker-compose.yml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3"
2
+ services:
3
+ pairdrop:
4
+ image: "lscr.io/linuxserver/pairdrop:latest"
5
+ container_name: pairdrop
6
+ restart: unless-stopped
7
+ environment:
8
+ - PUID=1000 # UID to run the application as
9
+ - PGID=1000 # GID to run the application as
10
+ - WS_FALLBACK=false # Set to true to enable websocket fallback if the peer to peer WebRTC connection is not available to the client.
11
+ - RATE_LIMIT=false # Set to true to limit clients to 1000 requests per 5 min.
12
+ - RTC_CONFIG=false # Set to the path of a file that specifies the STUN/TURN servers.
13
+ - DEBUG_MODE=false # Set to true to debug container and peer connections.
14
+ - TZ=Etc/UTC # Time Zone
15
+ ports:
16
+ - "127.0.0.1:3000:3000" # Web UI. Change the port number before the last colon e.g. `127.0.0.1:9000:3000`
docs/docker-swarm-usage.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Docker Swarm Usage
2
+
3
+ ## Healthcheck
4
+
5
+ The [Docker Image](../Dockerfile) includes a health check with the following options:
6
+
7
+ ```
8
+ --interval=30s
9
+ ```
10
+ > Specifies the time interval to run the health check. \
11
+ > In this case, the health check is performed every 30 seconds.
12
+ <br>
13
+
14
+ ```
15
+ --timeout=10s
16
+ ```
17
+ > Specifies the amount of time to wait for a response from the \"HEALTHCHECK\" command. \
18
+ > If the response does not arrive within 10 seconds, the health check fails.
19
+ <br>
20
+
21
+ ```
22
+ --start-period=5s
23
+ ```
24
+ > Specifies the amount of time to wait before starting the health check process. \
25
+ > In this case, the health check process will begin 5 seconds after the container is started.
26
+ <br>
27
+
28
+ ```
29
+ --retries=3
30
+ ```
31
+ > Specifies the number of times Docker should retry the health check \
32
+ > before considering the container to be unhealthy.
33
+ <br>
34
+
35
+
36
+ The CMD instruction is used to define the command that will be run as part of the health check. \
37
+ In this case, the command is `wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1`. \
38
+ This command will attempt to connect to `http://localhost:3000/` \
39
+ and if it fails it will exit with a status code of `1`. \
40
+ If this command returns a status code other than `0`, the health check fails.
41
+
42
+ Overall, this \"HEALTHCHECK\" instruction is defining a health check process \
43
+ that runs every 30 seconds, and waits up to 10 seconds for a response, \
44
+ begins 5 seconds after the container is started, and retries up to 3 times. \
45
+ The health check attempts to connect to http://localhost:3000/ \
46
+ and will considers the container unhealthy if unable to connect.
47
+
docs/faq.md ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Frequently Asked Questions
2
+
3
+ <details>
4
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
5
+ Help! I can't install the PWA!
6
+ </summary>
7
+
8
+ <br>
9
+
10
+ Here is a good guide on how to install PWAs on different platforms: \
11
+ https://www.cdc.gov/niosh/mining/content/hearingloss/installPWA.html
12
+
13
+
14
+ **Chromium-based browser on Desktop (Chrome, Edge, Vivaldi, Brave, etc.)** \
15
+ Easily install PairDrop PWA on your desktop by clicking the install-button in the top-right corner while on [pairdrop.net](https://pairdrop.net).
16
+
17
+ <img width="400" src="pwa-install.png" alt="Example on how to install a pwa with Edge">
18
+
19
+ **Desktop Firefox** \
20
+ On Firefox, PWAs are installable via [this browser extensions](https://addons.mozilla.org/de/firefox/addon/pwas-for-firefox/)
21
+
22
+ **Android** \
23
+ PWAs are installable only by using Google Chrome or Samsung Browser:
24
+ 1. Visit [pairdrop.net](https://pairdrop.net)
25
+ 2. Click _Install_ on the installation pop-up or use the three-dot-menu and click on _Add to Home screen_
26
+ 3. Click _Add_ on the pop-up
27
+
28
+ **iOS** \
29
+ PWAs are installable only by using Safari:
30
+ 1. Visit [pairdrop.net](https://pairdrop.net)
31
+ 2. Click on the share icon
32
+ 3. Click _Add to Home Screen_
33
+ 4. Click _Add_ in the top right corner
34
+
35
+ <br>
36
+
37
+ **Self-Hosted Instance?** \
38
+ To be able to install the PWA from a self-hosted instance, the connection needs to be [established through HTTPS](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installable_PWAs).
39
+ See [this host your own section](https://github.com/schlagmichdoch/PairDrop/blob/master/docs/host-your-own.md#testing-pwa-related-features) for more info.
40
+
41
+ <br>
42
+
43
+ </details>
44
+
45
+ <details>
46
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
47
+ Shortcuts?
48
+ </summary>
49
+
50
+ <br>
51
+
52
+ Available shortcuts:
53
+ - Send a message with `CTRL + ENTER`
54
+ - Close all "Send" and "Pair" dialogs by pressing `Esc`.
55
+ - Copy a received message to the clipboard with `CTRL/⌘ + C`.
56
+ - Accept file-transfer requests with `Enter` and decline with `Esc`.
57
+ <br>
58
+
59
+ </details>
60
+
61
+ <details>
62
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
63
+ How to save images directly to the gallery on iOS?
64
+ </summary>
65
+
66
+ <br>
67
+
68
+ ~~Apparently, iOS does not allow images shared from a website to be saved to the gallery directly.~~
69
+ ~~It simply does not offer that option for images shared from a website.~~
70
+
71
+ ~~iOS Shortcuts saves the day:~~ \
72
+ I created a simple iOS shortcut that takes your photos and saves them to your gallery:
73
+ https://routinehub.co/shortcut/13988/
74
+
75
+ Update: \
76
+ Apparently, this was only a bug that is fixed in recent iOS version (https://github.com/WebKit/WebKit/pull/13111). \
77
+ If you use an older affected iOS version this might still be of use. \
78
+ Luckily, you can now simply use `Save Image`/`Save X Images` 🎉
79
+
80
+ <br>
81
+
82
+ </details>
83
+
84
+ <details>
85
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
86
+ Is it possible to send files or text directly from the "Context" or "Share" menu?
87
+ </summary>
88
+
89
+ <br>
90
+
91
+ Yes, it finally is.
92
+ * [Send files directly from the "Context" menu on Windows](/docs/how-to.md#send-files-directly-from-context-menu-on-windows)
93
+ * [Send directly from the "Share" menu on iOS](/docs/how-to.md#send-directly-from-share-menu-on-ios)
94
+ * [Send directly from the "Share" menu on Android](/docs/how-to.md#send-directly-from-share-menu-on-android)
95
+
96
+ <br>
97
+
98
+ </details>
99
+
100
+ <details>
101
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
102
+ Is it possible to send files or text directly via CLI?
103
+ </summary>
104
+
105
+ <br>
106
+
107
+ Yes.
108
+
109
+ * [Send directly from a command-line interface](/docs/how-to.md#send-directly-via-command-line-interface)
110
+
111
+ <br>
112
+
113
+ </details>
114
+
115
+ <details>
116
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
117
+ Are there any third-party Apps?
118
+ </summary>
119
+
120
+ <br>
121
+
122
+ These third-party apps are compatible with PairDrop:
123
+
124
+ 1. [Snapdrop Android App](https://github.com/fm-sys/snapdrop-android)
125
+ 2. [Snapdrop for Firefox (Addon)](https://github.com/ueen/SnapdropFirefoxAddon)
126
+ 3. Feel free to make one :)
127
+
128
+ <br>
129
+
130
+ </details>
131
+
132
+ <details>
133
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
134
+ What about the connection? Is it a P2P connection directly from device to device or is there any third-party-server?
135
+ </summary>
136
+
137
+ <br>
138
+
139
+ It uses a WebRTC peer-to-peer connection.
140
+ WebRTC needs a signaling server that is only used to establish a connection.
141
+ The server is not involved in the file transfer.
142
+
143
+ If the devices are on the same network,
144
+ none of your files are ever sent to any server.
145
+
146
+ If your devices are paired and behind a NAT,
147
+ the PairDrop TURN Server is used to route your files and messages.
148
+ See the [Technical Documentation](technical-documentation.md#encryption-webrtc-stun-and-turn)
149
+ to learn more about STUN, TURN and WebRTC.
150
+
151
+ If you host your own instance
152
+ and want to support devices that do not support WebRTC,
153
+ you can [start the PairDrop instance with an activated WebSocket fallback](https://github.com/schlagmichdoch/PairDrop/blob/master/docs/host-your-own.md#websocket-fallback-for-vpn).
154
+
155
+ <br>
156
+
157
+ </details>
158
+
159
+ <details>
160
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
161
+ What about privacy? Will files be saved on third-party servers?
162
+ </summary>
163
+
164
+ <br>
165
+
166
+ Files are sent directly between peers.
167
+ PairDrop doesn't even use a database.
168
+ If curious, study [the signaling server](https://github.com/schlagmichdoch/PairDrop/blob/master/server/ws-server.js).
169
+ WebRTC encrypts the files in transit.
170
+
171
+ If the devices are on the same network,
172
+ none of your files are ever sent to any server.
173
+
174
+ If your devices are paired and behind a NAT,
175
+ the PairDrop TURN Server is used to route your files and messages.
176
+ See the [Technical Documentation](technical-documentation.md#encryption-webrtc-stun-and-turn)
177
+ to learn more about STUN, TURN and WebRTC.
178
+
179
+ <br>
180
+
181
+ </details>
182
+
183
+ <details>
184
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
185
+ What about security? Are my files encrypted while sent between the computers?
186
+ </summary>
187
+
188
+ <br>
189
+
190
+ Yes. Your files are sent using WebRTC, encrypting them in transit.
191
+ Still you have to trust the PairDrop server. To ensure the connection is secure and there is no [MITM](https://en.m.wikipedia.org/wiki/Man-in-the-middle_attack) there is a plan to make PairDrop
192
+ zero trust by encrypting the signaling and implementing a verification process. See [issue #180](https://github.com/schlagmichdoch/PairDrop/issues/180) to keep updated.
193
+
194
+ <br>
195
+
196
+ </details>
197
+
198
+ <details>
199
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
200
+ Transferring many files with paired devices takes too long
201
+ </summary>
202
+
203
+ <br>
204
+
205
+ Naturally, if traffic needs to be routed through the TURN server
206
+ because your devices are behind different NATs, transfer speed decreases.
207
+
208
+ You can open a hotspot on one of your devices to bridge the connection,
209
+ which omits the need of the TURN server.
210
+
211
+ - [How to open a hotspot on Windows](https://support.microsoft.com/en-us/windows/use-your-windows-pc-as-a-mobile-hotspot-c89b0fad-72d5-41e8-f7ea-406ad9036b85#WindowsVersion=Windows_11)
212
+ - [How to open a hotspot on macOS](https://support.apple.com/guide/mac-help/share-internet-connection-mac-network-users-mchlp1540/mac)
213
+ - [Library to open a hotspot on Linux](https://github.com/lakinduakash/linux-wifi-hotspot)
214
+
215
+ You can also use mobile hotspots on phones to do that.
216
+ Then, all data should be sent directly between devices and not use your data plan.
217
+
218
+ <br>
219
+
220
+ </details>
221
+
222
+ <details>
223
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
224
+ Why don't you implement feature xyz?
225
+ </summary>
226
+
227
+ <br>
228
+
229
+ Snapdrop and PairDrop are a study in radical simplicity.
230
+ The user interface is insanely simple.
231
+ Features are chosen very carefully because complexity grows quadratically
232
+ since every feature potentially interferes with each other feature.
233
+ We focus very narrowly on a single use case: instant file transfer.
234
+ Not facilitating optimal edge-cases means better flow for average users.
235
+ Don't be sad. We may decline your feature request for the sake of simplicity.
236
+
237
+ Read *Insanely Simple: The Obsession that Drives Apple's Success*,
238
+ and/or *Thinking, Fast and Slow* to learn more.
239
+
240
+ <br>
241
+
242
+ </details>
243
+
244
+ <details>
245
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
246
+ PairDrop is awesome. How can I support it?
247
+ </summary>
248
+
249
+ <br>
250
+
251
+ * [Buy me a coffee](https://www.buymeacoffee.com/pairdrop) to pay for the domain and the server, and support libre software.
252
+ * [File bugs, give feedback, submit suggestions](https://github.com/schlagmichdoch/pairdrop/issues)
253
+ * Share PairDrop on social media.
254
+ * Fix bugs and create a pull request.
255
+ * Do some security analysis and make suggestions.
256
+ * Participate in [active discussions](https://github.com/schlagmichdoch/PairDrop/discussions)
257
+
258
+ <br>
259
+
260
+ </details>
261
+
262
+ <details>
263
+ <summary style="font-size:1.25em;margin-top: 24px; margin-bottom: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25;">
264
+ How does it work?
265
+ </summary>
266
+
267
+ <br>
268
+
269
+ [See here for info about the technical implementation](/docs/technical-documentation.md)
270
+
271
+ <br>
272
+
273
+ </details>
274
+
275
+ [< Back](/README.md)
docs/host-your-own.md ADDED
@@ -0,0 +1,709 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Deployment Notes
2
+
3
+ ## TURN server for Internet Transfer
4
+
5
+ Beware that you have to host your own TURN server to enable transfers between different networks.
6
+
7
+ Follow [this guide](https://gabrieltanner.org/blog/turn-server/) to either install coturn directly on your system (Step 1)
8
+ or deploy it via Docker (Step 5).
9
+
10
+ You can use the `docker-compose-coturn.yml` in this repository. See [Coturn and PairDrop via Docker Compose](#coturn-and-pairdrop-via-docker-compose).
11
+
12
+ Alternatively, use a free, pre-configured TURN server like [OpenRelay](https://www.metered.ca/tools/openrelay/)
13
+
14
+ <br>
15
+
16
+ ## PairDrop via HTTPS
17
+
18
+ On some browsers PairDrop must be served over TLS in order for some features to work properly.
19
+ These may include:
20
+ - Copying an incoming message via the 'copy' button
21
+ - Installing PairDrop as PWA
22
+ - Persistent pairing of devices
23
+ - Changing of the display name
24
+ - Notifications
25
+
26
+ Naturally, this is also recommended to increase security.
27
+
28
+ <br>
29
+
30
+ ## Deployment with Docker
31
+
32
+ The easiest way to get PairDrop up and running is by using Docker.
33
+
34
+ ### Docker Image from Docker Hub
35
+
36
+ ```bash
37
+ docker run -d --restart=unless-stopped --name=pairdrop -p 127.0.0.1:3000:3000 lscr.io/linuxserver/pairdrop
38
+ ```
39
+ > This image is hosted by [linuxserver.io](https://linuxserver.io). For more information visit https://hub.docker.com/r/linuxserver/pairdrop
40
+
41
+
42
+ <br>
43
+
44
+ ### Docker Image from GitHub Container Registry (ghcr.io)
45
+
46
+ ```bash
47
+ docker run -d --restart=unless-stopped --name=pairdrop -p 127.0.0.1:3000:3000 ghcr.io/schlagmichdoch/pairdrop
48
+ ```
49
+
50
+
51
+ <br>
52
+
53
+ ### Docker Image self-built
54
+
55
+ #### Build the image
56
+
57
+ ```bash
58
+ docker build --pull . -f Dockerfile -t pairdrop
59
+ ```
60
+
61
+ > A GitHub action is set up to do this step automatically at the release of new versions.
62
+ >
63
+ > `--pull` ensures always the latest node image is used.
64
+
65
+ #### Run the image
66
+
67
+ ```bash
68
+ docker run -d --restart=unless-stopped --name=pairdrop -p 127.0.0.1:3000:3000 -it pairdrop
69
+ ```
70
+
71
+ > You must use a server proxy to set the `X-Forwarded-For` header
72
+ > to prevent all clients from discovering each other (See [#HTTP-Server](#http-server)).
73
+ >
74
+ > To prevent bypassing the proxy by reaching the docker container directly,
75
+ > `127.0.0.1` is specified in the run command.
76
+
77
+
78
+ <br>
79
+
80
+ ### Flags
81
+
82
+ Set options by using the following flags in the `docker run` command:
83
+
84
+ #### Port
85
+
86
+ ```bash
87
+ -p 127.0.0.1:8080:3000
88
+ ```
89
+
90
+ > Specify the port used by the docker image
91
+ >
92
+ > - 3000 -> `-p 127.0.0.1:3000:3000`
93
+ > - 8080 -> `-p 127.0.0.1:8080:3000`
94
+
95
+ #### Set Environment Variables via Docker
96
+
97
+ Environment Variables are set directly in the `docker run` command: \
98
+ e.g. `docker run -p 127.0.0.1:3000:3000 -it pairdrop -e DEBUG_MODE="true"`
99
+
100
+ Overview of available Environment Variables are found [here](#environment-variables).
101
+
102
+ Example:
103
+ ```bash
104
+ docker run -d \
105
+ --name=pairdrop \
106
+ --restart=unless-stopped \
107
+ -p 127.0.0.1:3000:3000 \
108
+ -e PUID=1000 \
109
+ -e PGID=1000 \
110
+ -e WS_SERVER=false \
111
+ -e WS_FALLBACK=false \
112
+ -e RTC_CONFIG=false \
113
+ -e RATE_LIMIT=false \
114
+ -e DEBUG_MODE=false \
115
+ -e TZ=Etc/UTC \
116
+ lscr.io/linuxserver/pairdrop
117
+ ```
118
+
119
+ <br>
120
+
121
+ ## Deployment with Docker Compose
122
+
123
+ Here's an example docker compose file:
124
+
125
+ ```yaml
126
+ version: "3"
127
+ services:
128
+ pairdrop:
129
+ image: "lscr.io/linuxserver/pairdrop:latest"
130
+ container_name: pairdrop
131
+ restart: unless-stopped
132
+ environment:
133
+ - PUID=1000 # UID to run the application as
134
+ - PGID=1000 # GID to run the application as
135
+ - WS_FALLBACK=false # Set to true to enable websocket fallback if the peer to peer WebRTC connection is not available to the client.
136
+ - RATE_LIMIT=false # Set to true to limit clients to 1000 requests per 5 min.
137
+ - RTC_CONFIG=false # Set to the path of a file that specifies the STUN/TURN servers.
138
+ - DEBUG_MODE=false # Set to true to debug container and peer connections.
139
+ - TZ=Etc/UTC # Time Zone
140
+ ports:
141
+ - "127.0.0.1:3000:3000" # Web UI
142
+ ```
143
+
144
+ Run the compose file with `docker compose up -d`.
145
+
146
+ > You must use a server proxy to set the `X-Forwarded-For` header
147
+ > to prevent all clients from discovering each other (See [#HTTP-Server](#http-server)).
148
+ >
149
+ > To prevent bypassing the proxy by reaching the Docker container
150
+ > directly, `127.0.0.1` is specified in the `ports` argument.
151
+
152
+ <br>
153
+
154
+ ## Deployment with Node.js
155
+
156
+ Clone this repository and enter the folder
157
+
158
+ ```bash
159
+ git clone https://github.com/schlagmichdoch/PairDrop.git && cd PairDrop
160
+ ```
161
+
162
+ Install all dependencies with NPM:
163
+
164
+ ```bash
165
+ npm install
166
+ ```
167
+
168
+ Start the server with:
169
+
170
+ ```bash
171
+ npm start
172
+ ```
173
+
174
+ > By default, the node server listens on port 3000.
175
+
176
+
177
+ <br>
178
+
179
+ ### Options / Flags
180
+
181
+ These are some flags only reasonable when deploying via Node.js
182
+
183
+ #### Port
184
+
185
+ ```bash
186
+ PORT=3000
187
+ ```
188
+
189
+ > Default: `3000`
190
+ >
191
+ > Environment variable to specify the port used by the Node.js server \
192
+ > e.g. `PORT=3010 npm start`
193
+
194
+ #### Local Run
195
+
196
+ ```bash
197
+ npm start -- --localhost-only
198
+ ```
199
+
200
+ > Only allow connections from localhost.
201
+ >
202
+ > You must use a server proxy to set the `X-Forwarded-For` header
203
+ > to prevent all clients from discovering each other (See [#HTTP-Server](#http-server)).
204
+ >
205
+ > Use this when deploying PairDrop with node to prevent
206
+ > bypassing the reverse proxy by reaching the Node.js server directly.
207
+
208
+ #### Automatic restart on error
209
+
210
+ ```bash
211
+ npm start -- --auto-restart
212
+ ```
213
+
214
+ > Restarts server automatically on error
215
+
216
+ #### Production (autostart and rate-limit)
217
+
218
+ ```bash
219
+ npm run start:prod
220
+ ```
221
+
222
+ > shortcut for `RATE_LIMIT=5 npm start -- --auto-restart`
223
+
224
+ #### Production (autostart, rate-limit, localhost-only)
225
+
226
+ ```bash
227
+ npm run start:prod -- --localhost-only
228
+ ```
229
+
230
+ > To prevent connections to the node server from bypassing \
231
+ > the proxy server you should always use "--localhost-only" on production.
232
+
233
+ #### Set Environment Variables via Node.js
234
+
235
+ To specify environment variables set them in the run command in front of `npm start`.
236
+ The syntax is different on Unix and Windows.
237
+
238
+ On Unix based systems
239
+
240
+ ```bash
241
+ PORT=3000 RTC_CONFIG="rtc_config.json" npm start
242
+ ```
243
+
244
+ On Windows
245
+
246
+ ```bash
247
+ $env:PORT=3000 RTC_CONFIG="rtc_config.json"; npm start
248
+ ```
249
+
250
+ Overview of available Environment Variables are found [here](#environment-variables).
251
+
252
+ <br>
253
+
254
+ ## Environment Variables
255
+
256
+ ### Debug Mode
257
+
258
+ ```bash
259
+ DEBUG_MODE="true"
260
+ ```
261
+
262
+ > Default: `false`
263
+ >
264
+ > Logs the used environment variables for debugging.
265
+ >
266
+ > Prints debugging information about the connecting peers IP addresses.
267
+ >
268
+ > This is quite useful to check whether the [#HTTP-Server](#http-server)
269
+ > is configured correctly, so the auto-discovery feature works correctly.
270
+ > Otherwise, all clients discover each other mutually, independently of their network status.
271
+ >
272
+ > If this flag is set to `"true"` each peer that connects to the PairDrop server will produce a log to STDOUT like this:
273
+ >
274
+ > ```
275
+ > ----DEBUGGING-PEER-IP-START----
276
+ > remoteAddress: ::ffff:172.17.0.1
277
+ > x-forwarded-for: 19.117.63.126
278
+ > cf-connecting-ip: undefined
279
+ > PairDrop uses: 19.117.63.126
280
+ > IP is private: false
281
+ > if IP is private, '127.0.0.1' is used instead
282
+ > ----DEBUGGING-PEER-IP-END----
283
+ > ```
284
+ >
285
+ > If the IP address "PairDrop uses" matches the public IP address of the client device, everything is set up correctly. \
286
+ > To find out the public IP address of the client device visit https://whatsmyip.com/.
287
+ >
288
+ > To preserve your clients' privacy: \
289
+ > **Never use this environment variable in production!**
290
+
291
+
292
+ <br>
293
+
294
+ ### Rate limiting requests
295
+
296
+ ```bash
297
+ RATE_LIMIT=1
298
+ ```
299
+
300
+ > Default: `false`
301
+ >
302
+ > Limits clients to 1000 requests per 5 min
303
+ >
304
+ > "If you are behind a proxy/load balancer (usually the case with most hosting services, e.g. Heroku, Bluemix, AWS ELB,
305
+ > Render, Nginx, Cloudflare, Akamai, Fastly, Firebase Hosting, Rackspace LB, Riverbed Stingray, etc.), the IP address of
306
+ > the request might be the IP of the load balancer/reverse proxy (making the rate limiter effectively a global one and
307
+ > blocking all requests once the limit is reached) or undefined."
308
+ > (See: https://express-rate-limit.mintlify.app/guides/troubleshooting-proxy-issues)
309
+ >
310
+ > To find the correct number to use for this setting:
311
+ >
312
+ > 1. Start PairDrop with `DEBUG_MODE=True` and `RATE_LIMIT=1`
313
+ > 2. Make a `get` request to `/ip` of the PairDrop instance (e.g. `https://pairdrop-example.net/ip`)
314
+ > 3. Check if the IP address returned in the response matches your public IP address (find out by visiting e.g. https://whatsmyip.com/)
315
+ > 4. You have found the correct number if the IP addresses match. If not, then increase `RATE_LIMIT` by one and redo 1. - 4.
316
+ >
317
+ > e.g. on Render you must use RATE_LIMIT=5
318
+
319
+
320
+ <br>
321
+
322
+ ### IPv6 Localization
323
+
324
+ ```bash
325
+ IPV6_LOCALIZE=4
326
+ ```
327
+
328
+ > Default: `false`
329
+ >
330
+ > To enable Peer Auto-Discovery among IPv6 peers, you can specify a reduced number of segments \
331
+ > of the client IPv6 address to be evaluated as the peer's IP. \
332
+ > This can be especially useful when using Cloudflare as a proxy.
333
+ >
334
+ > The flag must be set to an **integer** between `1` and `7`. \
335
+ > The number represents the number of IPv6 [hextets](https://en.wikipedia.org/wiki/IPv6#Address_representation) \
336
+ > to match the client IP against. The most common value would be `4`, \
337
+ > which will group peers within the same `/64` subnet.
338
+
339
+
340
+ <br>
341
+
342
+ ### Websocket Fallback (for VPN)
343
+
344
+ ```bash
345
+ WS_FALLBACK=true
346
+ ```
347
+
348
+ > Default: `false`
349
+ >
350
+ > Provides PairDrop to clients with an included websocket fallback \
351
+ > if the peer to peer WebRTC connection is not available to the client.
352
+ >
353
+ > This is not used on the official https://pairdrop.net website,
354
+ > but you can activate it on your self-hosted instance.\
355
+ > This is especially useful if you connect to your instance via a VPN (as most VPN services block WebRTC completely in
356
+ > order to hide your real IP address). ([Read more here](https://privacysavvy.com/security/safe-browsing/disable-webrtc-chrome-firefox-safari-opera-edge/)).
357
+ >
358
+ > **Warning:** \
359
+ > All traffic sent between devices using this fallback
360
+ > is routed through the server and therefor not peer to peer!
361
+ >
362
+ > Beware that the traffic routed via this fallback is readable by the server. \
363
+ > Only ever use this on instances you can trust.
364
+ >
365
+ > Additionally, beware that all traffic using this fallback debits the servers data plan.
366
+
367
+
368
+ <br>
369
+
370
+ ### Specify STUN/TURN Servers
371
+
372
+ ```bash
373
+ RTC_CONFIG="rtc_config.json"
374
+ ```
375
+
376
+ > Default: `false`
377
+ >
378
+ > Specify the STUN/TURN servers PairDrop clients use by setting \
379
+ > `RTC_CONFIG` to a JSON file including the configuration. \
380
+ > You can use `rtc_config_example.json` as a starting point.
381
+ >
382
+ > To host your own TURN server you can follow this guide: https://gabrieltanner.org/blog/turn-server/
383
+ > Alternatively, use a free, pre-configured TURN server like [OpenRelay](<[url](https://www.metered.ca/tools/openrelay/)>)
384
+ >
385
+ > Default configuration:
386
+ >
387
+ > ```json
388
+ > {
389
+ > "sdpSemantics": "unified-plan",
390
+ > "iceServers": [
391
+ > {
392
+ > "urls": "stun:stun.l.google.com:19302"
393
+ > }
394
+ > ]
395
+ > }
396
+ > ```
397
+
398
+ <br>
399
+
400
+ You can host an instance that uses another signaling server
401
+ This can be useful if you don't want to trust the client files that are hosted on another instance but still want to connect to devices that use https://pairdrop.net.
402
+
403
+ ### Specify Signaling Server
404
+
405
+ ```bash
406
+ SIGNALING_SERVER="pairdrop.net"
407
+ ```
408
+
409
+ > Default: `false`
410
+ >
411
+ > By default, clients connecting to your instance use the signaling server of your instance to connect to other devices.
412
+ >
413
+ > By using `SIGNALING_SERVER`, you can host an instance that uses another signaling server.
414
+ >
415
+ > This can be useful if you want to ensure the integrity of the client files and don't want to trust the client files that are hosted on another PairDrop instance but still want to connect to devices that use the other instance.
416
+ > E.g. host your own client files under *pairdrop.your-domain.com* but use the official signaling server under *pairdrop.net*
417
+ > This way devices connecting to *pairdrop.your-domain.com* and *pairdrop.net* can discover each other.
418
+ >
419
+ > Beware that the version of your PairDrop server must be compatible with the version of the signaling server.
420
+ >
421
+ > `SIGNALING_SERVER` must be a valid url without the protocol prefix.
422
+ > Examples of valid values: `pairdrop.net`, `pairdrop.your-domain.com:3000`, `your-domain.com/pairdrop`
423
+
424
+ <br>
425
+
426
+ ### Customizable buttons for the _About PairDrop_ page
427
+
428
+ ```bash
429
+ DONATION_BUTTON_ACTIVE=true
430
+ DONATION_BUTTON_LINK="https://www.buymeacoffee.com/pairdrop"
431
+ DONATION_BUTTON_TITLE="Buy me a coffee"
432
+ TWITTER_BUTTON_ACTIVE=true
433
+ TWITTER_BUTTON_LINK="https://twitter.com/account"
434
+ TWITTER_BUTTON_TITLE="Find me on Twitter"
435
+ MASTODON_BUTTON_ACTIVE=true
436
+ MASTODON_BUTTON_LINK="https://mastodon.social/account"
437
+ MASTODON_BUTTON_TITLE="Find me on Mastodon"
438
+ BLUESKY_BUTTON_ACTIVE=true
439
+ BLUESKY_BUTTON_LINK="https://bsky.app/profile/account"
440
+ BLUESKY_BUTTON_TITLE="Find me on Bluesky"
441
+ CUSTOM_BUTTON_ACTIVE=true
442
+ CUSTOM_BUTTON_LINK="https://your-custom-social-network.net/account"
443
+ CUSTOM_BUTTON_TITLE="Find me on this custom social network"
444
+ PRIVACYPOLICY_BUTTON_ACTIVE=true
445
+ PRIVACYPOLICY_BUTTON_LINK="https://link-to-your-privacy-policy.net"
446
+ PRIVACYPOLICY_BUTTON_TITLE="Open our privacy policy"
447
+ ```
448
+
449
+ > Default: unset
450
+ >
451
+ > By default, clients will show the default button configuration: GitHub, BuyMeACoffee, Twitter, and FAQ on GitHub.
452
+ >
453
+ > The GitHub and FAQ on GitHub buttons are essential, so they are always shown.
454
+ >
455
+ > The other buttons can be customized:
456
+ >
457
+ > * `*_BUTTON_ACTIVE`: set this to `true` to show a natively hidden button or to `false` to hide a normally shown button
458
+ > * `*_BUTTON_LINK`: set this to any URL to overwrite the href attribute of the button
459
+ > * `*_BUTTON_TITLE`: set this to overwrite the hover title of the button. This will prevent the title from being translated.
460
+
461
+ <br>
462
+
463
+ ## Healthcheck
464
+
465
+ > The Docker Image hosted on `ghcr.io` and the self-built Docker Image include a healthcheck.
466
+ >
467
+ > Read more about [Docker Swarm Usage](docker-swarm-usage.md#docker-swarm-usage).
468
+
469
+ <br>
470
+
471
+ ## HTTP-Server
472
+
473
+ When running PairDrop, the `X-Forwarded-For` header has to be set by a proxy. \
474
+ Otherwise, all clients will be mutually visible.
475
+
476
+ To check if your setup is configured correctly [use the environment variable `DEBUG_MODE="true"`](#debug-mode).
477
+
478
+ ### Using nginx
479
+
480
+ #### Allow http and https requests
481
+
482
+ ```
483
+ server {
484
+ listen 80;
485
+
486
+ expires epoch;
487
+
488
+ location / {
489
+ proxy_connect_timeout 300;
490
+ proxy_pass http://127.0.0.1:3000;
491
+ proxy_set_header Connection "upgrade";
492
+ proxy_set_header Upgrade $http_upgrade;
493
+ proxy_set_header X-Forwarded-for $remote_addr;
494
+ }
495
+ }
496
+
497
+ server {
498
+ listen 443 ssl http2;
499
+ ssl_certificate /etc/ssl/certs/pairdrop-dev.crt;
500
+ ssl_certificate_key /etc/ssl/certs/pairdrop-dev.key;
501
+
502
+ expires epoch;
503
+
504
+ location / {
505
+ proxy_connect_timeout 300;
506
+ proxy_pass http://127.0.0.1:3000;
507
+ proxy_set_header Connection "upgrade";
508
+ proxy_set_header Upgrade $http_upgrade;
509
+ proxy_set_header X-Forwarded-for $remote_addr;
510
+ }
511
+ }
512
+ ```
513
+
514
+ #### Automatic http to https redirect:
515
+
516
+ ```
517
+ server {
518
+ listen 80;
519
+
520
+ expires epoch;
521
+
522
+ location / {
523
+ return 301 https://$host:3000$request_uri;
524
+ }
525
+ }
526
+
527
+ server {
528
+ listen 443 ssl http2;
529
+ ssl_certificate /etc/ssl/certs/pairdrop-dev.crt;
530
+ ssl_certificate_key /etc/ssl/certs/pairdrop-dev.key;
531
+
532
+ expires epoch;
533
+
534
+ location / {
535
+ proxy_connect_timeout 300;
536
+ proxy_pass http://127.0.0.1:3000;
537
+ proxy_set_header Connection "upgrade";
538
+ proxy_set_header Upgrade $http_upgrade;
539
+ proxy_set_header X-Forwarded-for $remote_addr;
540
+ }
541
+ }
542
+ ```
543
+
544
+
545
+ <br>
546
+
547
+ ### Using Apache
548
+
549
+ install modules `proxy`, `proxy_http`, `mod_proxy_wstunnel`
550
+
551
+ ```bash
552
+ a2enmod proxy
553
+ ```
554
+
555
+ ```bash
556
+ a2enmod proxy_http
557
+ ```
558
+
559
+ <br>
560
+
561
+ Create a new configuration file under `/etc/apache2/sites-available` (on Debian)
562
+
563
+ **pairdrop.conf**
564
+
565
+ #### Allow HTTP and HTTPS requests
566
+
567
+ ```apacheconf
568
+ <VirtualHost *:80>
569
+ ProxyPass / http://127.0.0.1:3000/ upgrade=websocket
570
+ </VirtualHost>
571
+ <VirtualHost *:443>
572
+ ProxyPass / https://127.0.0.1:3000/ upgrade=websocket
573
+ </VirtualHost>
574
+ ```
575
+
576
+ #### Automatic HTTP to HTTPS redirect:
577
+
578
+ ```apacheconf
579
+ <VirtualHost *:80>
580
+ Redirect permanent / https://127.0.0.1:3000/
581
+ </VirtualHost>
582
+ <VirtualHost *:443>
583
+ ProxyPass / http://127.0.0.1:3000/ upgrade=websocket
584
+ </VirtualHost>
585
+ ```
586
+
587
+ Activate the new virtual host and reload Apache:
588
+
589
+ ```bash
590
+ a2ensite pairdrop
591
+ ```
592
+
593
+ ```bash
594
+ service apache2 reload
595
+ ```
596
+
597
+ <br>
598
+
599
+ ## Coturn and PairDrop via Docker Compose
600
+
601
+ ### Setup container
602
+ To run coturn and PairDrop at once by using the `docker-compose-coturn.yml` with TURN over TLS enabled
603
+ you need to follow these steps:
604
+
605
+ 1. Generate or retrieve certificates for your `<DOMAIN>` (e.g. letsencrypt / certbot)
606
+ 2. Create `./ssl` folder: `mkdir ssl`
607
+ 3. Copy your ssl-certificates and the privkey to `./ssl`
608
+ 4. Restrict access to `./ssl`: `chown -R nobody:nogroup ./ssl`
609
+ 5. Create a dh-params file: `openssl dhparam -out ./ssl/dhparams.pem 4096`
610
+ 6. Copy `rtc_config_example.json` to `rtc_config.json`
611
+ 7. Copy `turnserver_example.conf` to `turnserver.conf`
612
+ 8. Change `<DOMAIN>` in both files to the domain where your PairDrop instance is running
613
+ 9. Change `username` and `password` in `turnserver.conf` and `rtc-config.json`
614
+ 10. To start the container including coturn run: \
615
+ `docker compose -f docker-compose-coturn.yml up -d`
616
+
617
+ <br>
618
+
619
+ #### Setup container
620
+ To restart the container including coturn run: \
621
+ `docker compose -f docker-compose-coturn.yml restart`
622
+
623
+ <br>
624
+
625
+ #### Setup container
626
+ To stop the container including coturn run: \
627
+ `docker compose -f docker-compose-coturn.yml stop`
628
+
629
+ <br>
630
+
631
+ ### Firewall
632
+ To run PairDrop including its own coturn-server you need to punch holes in the firewall. These ports must be opened additionally:
633
+ - 3478 tcp/udp
634
+ - 5349 tcp/udp
635
+ - 10000:20000 tcp/udp
636
+
637
+ <br>
638
+
639
+ ## Local Development
640
+
641
+ ### Install
642
+
643
+ All files needed for developing are available in the folder `./dev`.
644
+
645
+ For convenience, there is also a docker compose file for developing:
646
+
647
+ #### Developing with docker compose
648
+ First, [Install docker with docker compose.](https://docs.docker.com/compose/install/)
649
+
650
+ Then, clone the repository and run docker compose:
651
+
652
+ ```bash
653
+ git clone https://github.com/schlagmichdoch/PairDrop.git && cd PairDrop
654
+ ```
655
+ ```bash
656
+ docker compose -f docker-compose-dev.yml up --no-deps --build
657
+ ```
658
+
659
+ Now point your web browser to `http://localhost:8080`.
660
+
661
+ - To debug the Node.js server, run `docker logs pairdrop`.
662
+ - After changes to the code you have to rerun the `docker compose` command
663
+
664
+ <br>
665
+
666
+ #### Testing PWA related features
667
+
668
+ PWAs requires the app to be served under a correctly set up and trusted TLS endpoint.
669
+
670
+ The NGINX container creates a CA certificate and a website certificate for you.
671
+ To correctly set the common name of the certificate,
672
+ you need to change the FQDN environment variable in `docker-compose-dev.yml`
673
+ to the fully qualified domain name of your workstation. (Default: localhost)
674
+
675
+ If you want to test PWA features, you need to trust the CA of the certificate for your local deployment. \
676
+ For your convenience, you can download the crt file from `http://<Your FQDN>:8080/ca.crt`. \
677
+ Install that certificate to the trust store of your operating system. \
678
+
679
+ ##### Windows
680
+ - Make sure to install it to the `Trusted Root Certification Authorities` store.
681
+
682
+ ##### macOS
683
+ - Double-click the installed CA certificate in `Keychain Access`,
684
+ - expand `Trust`, and select `Always Trust` for SSL.
685
+
686
+ ##### Firefox
687
+ Firefox uses its own trust store. To install the CA:
688
+ - point Firefox at `http://<Your FQDN>:8080/ca.crt` (Default: `http://localhost:8080/ca.crt`)
689
+ - When prompted, select `Trust this CA to identify websites` and click _OK_.
690
+
691
+ Alternatively:
692
+ 1. Download `ca.crt` from `http://<Your FQDN>:8080/ca.crt` (Default: `http://localhost:8080/ca.crt`)
693
+ 2. Go to `about:preferences#privacy` scroll down to `Security` and `Certificates` and click `View Certificates`
694
+ 3. Import the downloaded certificate file (step 1)
695
+
696
+ ##### Chrome
697
+ - When using Chrome, you need to restart Chrome so it reloads the trust store (`chrome://restart`).
698
+ - Additionally, after installing a new cert, you need to clear the Storage (DevTools → Application → Clear storage → Clear site data).
699
+
700
+ ##### Google Chrome
701
+ - To skip the installation of the certificate, you can also open `chrome://flags/#unsafely-treat-insecure-origin-as-secure`
702
+ - The feature `Insecure origins treated as secure` must be enabled and the list must include your PairDrop test instance. E.g.: `http://127.0.0.1:3000,https://127.0.0.1:8443`
703
+
704
+ Please note that the certificates (CA and webserver cert) expire after a day.
705
+ Also, whenever you restart the NGINX Docker container new certificates are created.
706
+
707
+ The site is served on `https://<Your FQDN>:8443` (Default: `https://localhost:8443`).
708
+
709
+ [< Back](/README.md)
docs/how-to.md ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # How-To
2
+
3
+ ## Send directly from share menu on iOS
4
+ I created an iOS shortcut to send images, files, folder, URLs \
5
+ or text directly from the share-menu
6
+ https://routinehub.co/shortcut/13990/
7
+
8
+ [//]: # (Todo: Add screenshots)
9
+
10
+ <br>
11
+
12
+ ## Send directly from share menu on Android
13
+ The [Web Share Target API](https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target) is implemented.
14
+
15
+ When the PWA is installed, it will register itself to the share-menu of the device automatically.
16
+
17
+ <br>
18
+
19
+ ## Send directly via command-line interface
20
+ Send files or text with PairDrop via command-line interface. \
21
+ This opens PairDrop in the default browser where you can choose the receiver.
22
+
23
+ ### Usage
24
+ ```bash
25
+ pairdrop -h
26
+ ```
27
+ ```
28
+ Send files or text with PairDrop via command-line interface.
29
+ Current domain: https://pairdrop-dev.onrender.com/
30
+
31
+ Usage:
32
+ Open PairDrop: pairdrop
33
+ Send files: pairdrop file1/directory1 (file2/directory2 file3/directory3 ...)
34
+ Send text: pairdrop -t "text"
35
+ Specify domain: pairdrop -d "https://pairdrop.net/"
36
+ Show this help text: pairdrop (-h|--help)
37
+
38
+ This pairdrop-cli version was released alongside v1.10.4
39
+ ```
40
+
41
+ <br>
42
+
43
+ ### Setup
44
+
45
+ #### Linux / Mac
46
+ 1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
47
+ ```shell
48
+ wget "https://github.com/schlagmichdoch/PairDrop/releases/download/v1.11.2/pairdrop-cli.zip"
49
+ ```
50
+ or
51
+ ```shell
52
+ curl -LO "https://github.com/schlagmichdoch/PairDrop/releases/download/v1.11.2/pairdrop-cli.zip"
53
+ ```
54
+ 2. Unzip the archive to a folder of your choice e.g. `/usr/share/pairdrop-cli/`
55
+ ```shell
56
+ sudo unzip pairdrop-cli.zip -d /usr/share/pairdrop-cli/
57
+ ```
58
+ 3. Copy the file _.pairdrop-cli-config.example_ to _.pairdrop-cli-config_
59
+ ```shell
60
+ sudo cp /usr/share/pairdrop-cli/.pairdrop-cli-config.example /usr/share/pairdrop-cli/.pairdrop-cli-config
61
+ ```
62
+ 4. Make the bash file _pairdrop_ executable
63
+ ```shell
64
+ sudo chmod +x /usr/share/pairdrop-cli/pairdrop
65
+ ```
66
+ 5. Add a symlink to /usr/local/bin/ to include _pairdrop_ to _PATH_
67
+ ```shell
68
+ sudo ln -s /usr/share/pairdrop-cli/pairdrop /usr/local/bin/pairdrop
69
+ ```
70
+
71
+ <br>
72
+
73
+ #### Windows
74
+ 1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
75
+ 2. Put file in a preferred folder e.g. `C:\Program Files\pairdrop-cli`
76
+ 3. Inside this folder, copy the file _.pairdrop-cli-config.example_ to _.pairdrop-cli-config_
77
+ 4. Search for and open `Edit environment variables for your account`
78
+ 5. Click `Environment Variables…`
79
+ 6. Under _System Variables_ select `Path` and click _Edit..._
80
+ 7. Click _New_, insert the preferred folder (`C:\Program Files\pairdrop-cli`), click *OK* until all windows are closed
81
+ 8. Reopen Command prompt window
82
+
83
+ **Requirements**
84
+
85
+ As Windows cannot execute bash scripts natively, you need to install [Git Bash](https://gitforwindows.org/).
86
+
87
+ Then, you can also use pairdrop-cli from the default Windows Command Prompt
88
+ by using the shell file instead of the bash file which then itself executes
89
+ _pairdrop-cli_ (the bash file) via the Git Bash.
90
+ ```shell
91
+ pairdrop.sh -h
92
+ ```
93
+
94
+ <br>
95
+
96
+ ## Send multiple files and directories directly from context menu on Windows
97
+
98
+ ### Registering to open files with PairDrop
99
+ It is possible to send multiple files with PairDrop via the context menu by adding pairdrop-cli to Windows `Send to` menu:
100
+ 1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
101
+ 2. Unzip the archive to a folder of your choice e.g. `C:\Program Files\pairdrop-cli\`
102
+ 3. Inside this folder, copy the file _.pairdrop-cli-config.example_ to _.pairdrop-cli-config_
103
+ 4. Copy the shortcut _send with PairDrop.lnk_
104
+ 5. Hit Windows Key+R, type: `shell:sendto` and hit Enter.
105
+ 6. Paste the copied shortcut into the directory
106
+ 7. Open the properties window of the shortcut and edit the link field to point to _send-with-pairdrop.ps1_ located in the folder you used in step 2: \
107
+ `"C:\Program Files\PowerShell\7\pwsh.exe" -File "C:\Program Files\pairdrop-cli\send-with-pairdrop.ps1"`
108
+ 8. You are done! You can now send multiple files and directories directly via PairDrop:
109
+
110
+ _context menu_ > _Send to_ > _PairDrop_
111
+
112
+ ##### Requirements
113
+ As Windows cannot execute bash scripts natively, you need to install [Git Bash](https://gitforwindows.org/).
114
+
115
+ <br>
116
+
117
+ ## Send multiple files and directories directly from context menu on Ubuntu using Nautilus
118
+
119
+ ### Registering to open files with PairDrop
120
+ It is possible to send multiple files with PairDrop via the context menu by adding pairdrop-cli to Nautilus `Scripts` menu:
121
+ 1. Register _pairdrop_ as executable via [guide above](#linux).
122
+ 2. Copy the shell file _send-with-pairdrop_ to `~/.local/share/nautilus/scripts/` to include it in the context menu
123
+ ```shell
124
+ cp /usr/share/pairdrop-cli/send-with-pairdrop ~/.local/share/nautilus/scripts/
125
+ ```
126
+ 3. Make the shell file _send-with-pairdrop_ executable
127
+ ```shell
128
+ chmod +x ~/.local/share/nautilus/scripts/send-with-pairdrop
129
+ ```
130
+ 4. You are done! You can now send multiple files and directories directly via PairDrop:
131
+
132
+ _context menu_ > _Scripts_ > _send-with-pairdrop_
133
+
134
+ <br>
135
+
136
+ ## File Handling API
137
+ The [File Handling API](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/handle-files)
138
+ was implemented, but it was removed as default file associations were overwritten ([#17](https://github.com/schlagmichdoch/PairDrop/issues/17),
139
+ [#116](https://github.com/schlagmichdoch/PairDrop/issues/116) [#190](https://github.com/schlagmichdoch/PairDrop/issues/190))
140
+ and it only worked with explicitly specified file types and couldn't handle directories at all.
141
+
142
+ [< Back](/README.md)
docs/pairdrop_screenshot_desktop.png ADDED

Git LFS Details

  • SHA256: 9cd9a3ad408ca34557a712f89fb7bc9ac1e294fb2844eddb59105577cfa6e6a9
  • Pointer size: 131 Bytes
  • Size of remote file: 357 kB
docs/pairdrop_screenshot_mobile.gif ADDED

Git LFS Details

  • SHA256: 5fbcde5219d660dc106c62f4d6f3f0a41cca92b423435bc3e85dc4ea98357033
  • Pointer size: 132 Bytes
  • Size of remote file: 1.54 MB
docs/pwa-install.png ADDED
docs/technical-documentation.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Technical Documentation
2
+ ## Encryption, WebRTC, STUN and TURN
3
+
4
+ Encryption is mandatory for WebRTC connections and completely done by the browser itself.
5
+
6
+ When the peers are first connecting, \
7
+ a channel is created by exchanging their signaling info. \
8
+ This signaling information includes some sort of public key \
9
+ and is specific to the clients IP address. \
10
+ That is what the STUN Server is used for: \
11
+ it simply returns your public IP address \
12
+ as you only know your local ip address \
13
+ if behind a NAT (router).
14
+
15
+ The transfer of the signaling info is done by the \
16
+ PairDrop / Snapdrop server using secure websockets. \
17
+ After that the channel itself is completely peer-to-peer \
18
+ and all info can only be decrypted by the receiver. \
19
+ When the two peers are on the same network \
20
+ or when they are not behind any NAT system \
21
+ (which they are always for classic \
22
+ Snapdrop and for not paired users on PairDrop) \
23
+ the files are send directly peer-to-peer.
24
+
25
+ When a user is behind a NAT (behind a router) \
26
+ the contents are channeled through a TURN server. \
27
+ But again, the contents send via the channel \
28
+ can only be decrypted by the receiver. \
29
+ So a rogue TURN server could only \
30
+ see that there is a connection, but not what is sent. \
31
+ Obviously, connections which are channeled through a TURN server \
32
+ are not as fast as peer-to-peer.
33
+
34
+ The selection whether a TURN server is needed \
35
+ or not is also done automatically by the web browser. \
36
+ It simply iterated through the configured \
37
+ RTC iceServers and checks what works. \
38
+ Only if the STUN server is not sufficient, \
39
+ the TURN server is used.
40
+
41
+ ![img](https://www.wowza.com/wp-content/uploads/WeRTC-Encryption-Diagrams-01.jpg)
42
+ _Diagram created by wowza.com_
43
+
44
+ Good thing: if your device has an IPv6 address \
45
+ it is uniquely reachable by that address. \
46
+ As I understand it, when both devices are using \
47
+ IPv6 addresses there is no need for a TURN server in any scenario.
48
+
49
+ Learn more by reading https://www.wowza.com/blog/webrtc-encryption-and-security \
50
+ which gives a good insight into STUN, TURN and WebRTC.
51
+
52
+
53
+ ## Device Pairing
54
+
55
+ The pairing functionality uses the [IndexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API).
56
+
57
+ It works by creating long secrets that are served \
58
+ by the server to the initiating and requesting pair peer, \
59
+ when the inserted key is correct. \
60
+ These long secrets are then saved to an \
61
+ indexedDB database in the web browser. \
62
+ IndexedDB is somewhat the successor of localStorage \
63
+ as saved data is shared between all tabs. \
64
+ It goes one step further by making the data persistent \
65
+ and available offline if implemented to a PWA.
66
+
67
+ All secrets a client has saved to its database \
68
+ are sent to the PairDrop server. \
69
+ Peers with a common secret are discoverable \
70
+ to each other analog to peers with the same \
71
+ IP address are discoverable by each other.
72
+
73
+ What I really like about this approach (and the reason I implemented it) \
74
+ is that devices on the same network are always \
75
+ visible regardless whether any devices are paired or not. \
76
+ The main user flow is never obstructed. \
77
+ Paired devices are simply shown additionally. \
78
+ This makes it in my idea better than the idea of \
79
+ using a room system as [discussed here](https://github.com/RobinLinus/snapdrop/pull/214).
80
+
81
+
82
+ [< Back](/README.md)
licenses/BSD_3-Clause-zip-js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, Gildas Lormeau
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
licenses/MIT-NoSleep ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Rich Tibbett
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
licenses/MIT-heic2any ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Alex Corvi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package-lock.json ADDED
@@ -0,0 +1,838 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "pairdrop",
3
+ "version": "1.11.2",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "pairdrop",
9
+ "version": "1.11.2",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "express": "^4.18.2",
13
+ "express-rate-limit": "^7.1.5",
14
+ "ua-parser-js": "^1.0.37",
15
+ "unique-names-generator": "^4.3.0",
16
+ "ws": "^8.16.0"
17
+ },
18
+ "engines": {
19
+ "node": ">=15"
20
+ }
21
+ },
22
+ "node_modules/accepts": {
23
+ "version": "1.3.8",
24
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
25
+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
26
+ "dependencies": {
27
+ "mime-types": "~2.1.34",
28
+ "negotiator": "0.6.3"
29
+ },
30
+ "engines": {
31
+ "node": ">= 0.6"
32
+ }
33
+ },
34
+ "node_modules/array-flatten": {
35
+ "version": "1.1.1",
36
+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
37
+ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
38
+ },
39
+ "node_modules/body-parser": {
40
+ "version": "1.20.3",
41
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
42
+ "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
43
+ "dependencies": {
44
+ "bytes": "3.1.2",
45
+ "content-type": "~1.0.5",
46
+ "debug": "2.6.9",
47
+ "depd": "2.0.0",
48
+ "destroy": "1.2.0",
49
+ "http-errors": "2.0.0",
50
+ "iconv-lite": "0.4.24",
51
+ "on-finished": "2.4.1",
52
+ "qs": "6.13.0",
53
+ "raw-body": "2.5.2",
54
+ "type-is": "~1.6.18",
55
+ "unpipe": "1.0.0"
56
+ },
57
+ "engines": {
58
+ "node": ">= 0.8",
59
+ "npm": "1.2.8000 || >= 1.4.16"
60
+ }
61
+ },
62
+ "node_modules/bytes": {
63
+ "version": "3.1.2",
64
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
65
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
66
+ "engines": {
67
+ "node": ">= 0.8"
68
+ }
69
+ },
70
+ "node_modules/call-bind-apply-helpers": {
71
+ "version": "1.0.2",
72
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
73
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
74
+ "dependencies": {
75
+ "es-errors": "^1.3.0",
76
+ "function-bind": "^1.1.2"
77
+ },
78
+ "engines": {
79
+ "node": ">= 0.4"
80
+ }
81
+ },
82
+ "node_modules/call-bound": {
83
+ "version": "1.0.3",
84
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz",
85
+ "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==",
86
+ "dependencies": {
87
+ "call-bind-apply-helpers": "^1.0.1",
88
+ "get-intrinsic": "^1.2.6"
89
+ },
90
+ "engines": {
91
+ "node": ">= 0.4"
92
+ },
93
+ "funding": {
94
+ "url": "https://github.com/sponsors/ljharb"
95
+ }
96
+ },
97
+ "node_modules/content-disposition": {
98
+ "version": "0.5.4",
99
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
100
+ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
101
+ "dependencies": {
102
+ "safe-buffer": "5.2.1"
103
+ },
104
+ "engines": {
105
+ "node": ">= 0.6"
106
+ }
107
+ },
108
+ "node_modules/content-type": {
109
+ "version": "1.0.5",
110
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
111
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
112
+ "engines": {
113
+ "node": ">= 0.6"
114
+ }
115
+ },
116
+ "node_modules/cookie": {
117
+ "version": "0.7.1",
118
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
119
+ "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
120
+ "engines": {
121
+ "node": ">= 0.6"
122
+ }
123
+ },
124
+ "node_modules/cookie-signature": {
125
+ "version": "1.0.6",
126
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
127
+ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
128
+ },
129
+ "node_modules/debug": {
130
+ "version": "2.6.9",
131
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
132
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
133
+ "dependencies": {
134
+ "ms": "2.0.0"
135
+ }
136
+ },
137
+ "node_modules/depd": {
138
+ "version": "2.0.0",
139
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
140
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
141
+ "engines": {
142
+ "node": ">= 0.8"
143
+ }
144
+ },
145
+ "node_modules/destroy": {
146
+ "version": "1.2.0",
147
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
148
+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
149
+ "engines": {
150
+ "node": ">= 0.8",
151
+ "npm": "1.2.8000 || >= 1.4.16"
152
+ }
153
+ },
154
+ "node_modules/dunder-proto": {
155
+ "version": "1.0.1",
156
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
157
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
158
+ "dependencies": {
159
+ "call-bind-apply-helpers": "^1.0.1",
160
+ "es-errors": "^1.3.0",
161
+ "gopd": "^1.2.0"
162
+ },
163
+ "engines": {
164
+ "node": ">= 0.4"
165
+ }
166
+ },
167
+ "node_modules/ee-first": {
168
+ "version": "1.1.1",
169
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
170
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
171
+ },
172
+ "node_modules/encodeurl": {
173
+ "version": "2.0.0",
174
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
175
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
176
+ "engines": {
177
+ "node": ">= 0.8"
178
+ }
179
+ },
180
+ "node_modules/es-define-property": {
181
+ "version": "1.0.1",
182
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
183
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
184
+ "engines": {
185
+ "node": ">= 0.4"
186
+ }
187
+ },
188
+ "node_modules/es-errors": {
189
+ "version": "1.3.0",
190
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
191
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
192
+ "engines": {
193
+ "node": ">= 0.4"
194
+ }
195
+ },
196
+ "node_modules/es-object-atoms": {
197
+ "version": "1.1.1",
198
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
199
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
200
+ "dependencies": {
201
+ "es-errors": "^1.3.0"
202
+ },
203
+ "engines": {
204
+ "node": ">= 0.4"
205
+ }
206
+ },
207
+ "node_modules/escape-html": {
208
+ "version": "1.0.3",
209
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
210
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
211
+ },
212
+ "node_modules/etag": {
213
+ "version": "1.8.1",
214
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
215
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
216
+ "engines": {
217
+ "node": ">= 0.6"
218
+ }
219
+ },
220
+ "node_modules/express": {
221
+ "version": "4.21.2",
222
+ "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
223
+ "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
224
+ "dependencies": {
225
+ "accepts": "~1.3.8",
226
+ "array-flatten": "1.1.1",
227
+ "body-parser": "1.20.3",
228
+ "content-disposition": "0.5.4",
229
+ "content-type": "~1.0.4",
230
+ "cookie": "0.7.1",
231
+ "cookie-signature": "1.0.6",
232
+ "debug": "2.6.9",
233
+ "depd": "2.0.0",
234
+ "encodeurl": "~2.0.0",
235
+ "escape-html": "~1.0.3",
236
+ "etag": "~1.8.1",
237
+ "finalhandler": "1.3.1",
238
+ "fresh": "0.5.2",
239
+ "http-errors": "2.0.0",
240
+ "merge-descriptors": "1.0.3",
241
+ "methods": "~1.1.2",
242
+ "on-finished": "2.4.1",
243
+ "parseurl": "~1.3.3",
244
+ "path-to-regexp": "0.1.12",
245
+ "proxy-addr": "~2.0.7",
246
+ "qs": "6.13.0",
247
+ "range-parser": "~1.2.1",
248
+ "safe-buffer": "5.2.1",
249
+ "send": "0.19.0",
250
+ "serve-static": "1.16.2",
251
+ "setprototypeof": "1.2.0",
252
+ "statuses": "2.0.1",
253
+ "type-is": "~1.6.18",
254
+ "utils-merge": "1.0.1",
255
+ "vary": "~1.1.2"
256
+ },
257
+ "engines": {
258
+ "node": ">= 0.10.0"
259
+ },
260
+ "funding": {
261
+ "type": "opencollective",
262
+ "url": "https://opencollective.com/express"
263
+ }
264
+ },
265
+ "node_modules/express-rate-limit": {
266
+ "version": "7.5.0",
267
+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz",
268
+ "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==",
269
+ "engines": {
270
+ "node": ">= 16"
271
+ },
272
+ "funding": {
273
+ "url": "https://github.com/sponsors/express-rate-limit"
274
+ },
275
+ "peerDependencies": {
276
+ "express": "^4.11 || 5 || ^5.0.0-beta.1"
277
+ }
278
+ },
279
+ "node_modules/finalhandler": {
280
+ "version": "1.3.1",
281
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
282
+ "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
283
+ "dependencies": {
284
+ "debug": "2.6.9",
285
+ "encodeurl": "~2.0.0",
286
+ "escape-html": "~1.0.3",
287
+ "on-finished": "2.4.1",
288
+ "parseurl": "~1.3.3",
289
+ "statuses": "2.0.1",
290
+ "unpipe": "~1.0.0"
291
+ },
292
+ "engines": {
293
+ "node": ">= 0.8"
294
+ }
295
+ },
296
+ "node_modules/forwarded": {
297
+ "version": "0.2.0",
298
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
299
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
300
+ "engines": {
301
+ "node": ">= 0.6"
302
+ }
303
+ },
304
+ "node_modules/fresh": {
305
+ "version": "0.5.2",
306
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
307
+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
308
+ "engines": {
309
+ "node": ">= 0.6"
310
+ }
311
+ },
312
+ "node_modules/function-bind": {
313
+ "version": "1.1.2",
314
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
315
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
316
+ "funding": {
317
+ "url": "https://github.com/sponsors/ljharb"
318
+ }
319
+ },
320
+ "node_modules/get-intrinsic": {
321
+ "version": "1.3.0",
322
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
323
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
324
+ "dependencies": {
325
+ "call-bind-apply-helpers": "^1.0.2",
326
+ "es-define-property": "^1.0.1",
327
+ "es-errors": "^1.3.0",
328
+ "es-object-atoms": "^1.1.1",
329
+ "function-bind": "^1.1.2",
330
+ "get-proto": "^1.0.1",
331
+ "gopd": "^1.2.0",
332
+ "has-symbols": "^1.1.0",
333
+ "hasown": "^2.0.2",
334
+ "math-intrinsics": "^1.1.0"
335
+ },
336
+ "engines": {
337
+ "node": ">= 0.4"
338
+ },
339
+ "funding": {
340
+ "url": "https://github.com/sponsors/ljharb"
341
+ }
342
+ },
343
+ "node_modules/get-proto": {
344
+ "version": "1.0.1",
345
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
346
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
347
+ "dependencies": {
348
+ "dunder-proto": "^1.0.1",
349
+ "es-object-atoms": "^1.0.0"
350
+ },
351
+ "engines": {
352
+ "node": ">= 0.4"
353
+ }
354
+ },
355
+ "node_modules/gopd": {
356
+ "version": "1.2.0",
357
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
358
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
359
+ "engines": {
360
+ "node": ">= 0.4"
361
+ },
362
+ "funding": {
363
+ "url": "https://github.com/sponsors/ljharb"
364
+ }
365
+ },
366
+ "node_modules/has-symbols": {
367
+ "version": "1.1.0",
368
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
369
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
370
+ "engines": {
371
+ "node": ">= 0.4"
372
+ },
373
+ "funding": {
374
+ "url": "https://github.com/sponsors/ljharb"
375
+ }
376
+ },
377
+ "node_modules/hasown": {
378
+ "version": "2.0.2",
379
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
380
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
381
+ "dependencies": {
382
+ "function-bind": "^1.1.2"
383
+ },
384
+ "engines": {
385
+ "node": ">= 0.4"
386
+ }
387
+ },
388
+ "node_modules/http-errors": {
389
+ "version": "2.0.0",
390
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
391
+ "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
392
+ "dependencies": {
393
+ "depd": "2.0.0",
394
+ "inherits": "2.0.4",
395
+ "setprototypeof": "1.2.0",
396
+ "statuses": "2.0.1",
397
+ "toidentifier": "1.0.1"
398
+ },
399
+ "engines": {
400
+ "node": ">= 0.8"
401
+ }
402
+ },
403
+ "node_modules/iconv-lite": {
404
+ "version": "0.4.24",
405
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
406
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
407
+ "dependencies": {
408
+ "safer-buffer": ">= 2.1.2 < 3"
409
+ },
410
+ "engines": {
411
+ "node": ">=0.10.0"
412
+ }
413
+ },
414
+ "node_modules/inherits": {
415
+ "version": "2.0.4",
416
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
417
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
418
+ },
419
+ "node_modules/ipaddr.js": {
420
+ "version": "1.9.1",
421
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
422
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
423
+ "engines": {
424
+ "node": ">= 0.10"
425
+ }
426
+ },
427
+ "node_modules/math-intrinsics": {
428
+ "version": "1.1.0",
429
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
430
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
431
+ "engines": {
432
+ "node": ">= 0.4"
433
+ }
434
+ },
435
+ "node_modules/media-typer": {
436
+ "version": "0.3.0",
437
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
438
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
439
+ "engines": {
440
+ "node": ">= 0.6"
441
+ }
442
+ },
443
+ "node_modules/merge-descriptors": {
444
+ "version": "1.0.3",
445
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
446
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
447
+ "funding": {
448
+ "url": "https://github.com/sponsors/sindresorhus"
449
+ }
450
+ },
451
+ "node_modules/methods": {
452
+ "version": "1.1.2",
453
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
454
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
455
+ "engines": {
456
+ "node": ">= 0.6"
457
+ }
458
+ },
459
+ "node_modules/mime": {
460
+ "version": "1.6.0",
461
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
462
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
463
+ "bin": {
464
+ "mime": "cli.js"
465
+ },
466
+ "engines": {
467
+ "node": ">=4"
468
+ }
469
+ },
470
+ "node_modules/mime-db": {
471
+ "version": "1.52.0",
472
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
473
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
474
+ "engines": {
475
+ "node": ">= 0.6"
476
+ }
477
+ },
478
+ "node_modules/mime-types": {
479
+ "version": "2.1.35",
480
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
481
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
482
+ "dependencies": {
483
+ "mime-db": "1.52.0"
484
+ },
485
+ "engines": {
486
+ "node": ">= 0.6"
487
+ }
488
+ },
489
+ "node_modules/ms": {
490
+ "version": "2.0.0",
491
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
492
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
493
+ },
494
+ "node_modules/negotiator": {
495
+ "version": "0.6.3",
496
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
497
+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
498
+ "engines": {
499
+ "node": ">= 0.6"
500
+ }
501
+ },
502
+ "node_modules/object-inspect": {
503
+ "version": "1.13.4",
504
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
505
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
506
+ "engines": {
507
+ "node": ">= 0.4"
508
+ },
509
+ "funding": {
510
+ "url": "https://github.com/sponsors/ljharb"
511
+ }
512
+ },
513
+ "node_modules/on-finished": {
514
+ "version": "2.4.1",
515
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
516
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
517
+ "dependencies": {
518
+ "ee-first": "1.1.1"
519
+ },
520
+ "engines": {
521
+ "node": ">= 0.8"
522
+ }
523
+ },
524
+ "node_modules/parseurl": {
525
+ "version": "1.3.3",
526
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
527
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
528
+ "engines": {
529
+ "node": ">= 0.8"
530
+ }
531
+ },
532
+ "node_modules/path-to-regexp": {
533
+ "version": "0.1.12",
534
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
535
+ "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ=="
536
+ },
537
+ "node_modules/proxy-addr": {
538
+ "version": "2.0.7",
539
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
540
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
541
+ "dependencies": {
542
+ "forwarded": "0.2.0",
543
+ "ipaddr.js": "1.9.1"
544
+ },
545
+ "engines": {
546
+ "node": ">= 0.10"
547
+ }
548
+ },
549
+ "node_modules/qs": {
550
+ "version": "6.13.0",
551
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
552
+ "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
553
+ "dependencies": {
554
+ "side-channel": "^1.0.6"
555
+ },
556
+ "engines": {
557
+ "node": ">=0.6"
558
+ },
559
+ "funding": {
560
+ "url": "https://github.com/sponsors/ljharb"
561
+ }
562
+ },
563
+ "node_modules/range-parser": {
564
+ "version": "1.2.1",
565
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
566
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
567
+ "engines": {
568
+ "node": ">= 0.6"
569
+ }
570
+ },
571
+ "node_modules/raw-body": {
572
+ "version": "2.5.2",
573
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
574
+ "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
575
+ "dependencies": {
576
+ "bytes": "3.1.2",
577
+ "http-errors": "2.0.0",
578
+ "iconv-lite": "0.4.24",
579
+ "unpipe": "1.0.0"
580
+ },
581
+ "engines": {
582
+ "node": ">= 0.8"
583
+ }
584
+ },
585
+ "node_modules/safe-buffer": {
586
+ "version": "5.2.1",
587
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
588
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
589
+ "funding": [
590
+ {
591
+ "type": "github",
592
+ "url": "https://github.com/sponsors/feross"
593
+ },
594
+ {
595
+ "type": "patreon",
596
+ "url": "https://www.patreon.com/feross"
597
+ },
598
+ {
599
+ "type": "consulting",
600
+ "url": "https://feross.org/support"
601
+ }
602
+ ]
603
+ },
604
+ "node_modules/safer-buffer": {
605
+ "version": "2.1.2",
606
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
607
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
608
+ },
609
+ "node_modules/send": {
610
+ "version": "0.19.0",
611
+ "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
612
+ "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
613
+ "dependencies": {
614
+ "debug": "2.6.9",
615
+ "depd": "2.0.0",
616
+ "destroy": "1.2.0",
617
+ "encodeurl": "~1.0.2",
618
+ "escape-html": "~1.0.3",
619
+ "etag": "~1.8.1",
620
+ "fresh": "0.5.2",
621
+ "http-errors": "2.0.0",
622
+ "mime": "1.6.0",
623
+ "ms": "2.1.3",
624
+ "on-finished": "2.4.1",
625
+ "range-parser": "~1.2.1",
626
+ "statuses": "2.0.1"
627
+ },
628
+ "engines": {
629
+ "node": ">= 0.8.0"
630
+ }
631
+ },
632
+ "node_modules/send/node_modules/encodeurl": {
633
+ "version": "1.0.2",
634
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
635
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
636
+ "engines": {
637
+ "node": ">= 0.8"
638
+ }
639
+ },
640
+ "node_modules/send/node_modules/ms": {
641
+ "version": "2.1.3",
642
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
643
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
644
+ },
645
+ "node_modules/serve-static": {
646
+ "version": "1.16.2",
647
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
648
+ "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
649
+ "dependencies": {
650
+ "encodeurl": "~2.0.0",
651
+ "escape-html": "~1.0.3",
652
+ "parseurl": "~1.3.3",
653
+ "send": "0.19.0"
654
+ },
655
+ "engines": {
656
+ "node": ">= 0.8.0"
657
+ }
658
+ },
659
+ "node_modules/setprototypeof": {
660
+ "version": "1.2.0",
661
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
662
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
663
+ },
664
+ "node_modules/side-channel": {
665
+ "version": "1.1.0",
666
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
667
+ "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
668
+ "dependencies": {
669
+ "es-errors": "^1.3.0",
670
+ "object-inspect": "^1.13.3",
671
+ "side-channel-list": "^1.0.0",
672
+ "side-channel-map": "^1.0.1",
673
+ "side-channel-weakmap": "^1.0.2"
674
+ },
675
+ "engines": {
676
+ "node": ">= 0.4"
677
+ },
678
+ "funding": {
679
+ "url": "https://github.com/sponsors/ljharb"
680
+ }
681
+ },
682
+ "node_modules/side-channel-list": {
683
+ "version": "1.0.0",
684
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
685
+ "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
686
+ "dependencies": {
687
+ "es-errors": "^1.3.0",
688
+ "object-inspect": "^1.13.3"
689
+ },
690
+ "engines": {
691
+ "node": ">= 0.4"
692
+ },
693
+ "funding": {
694
+ "url": "https://github.com/sponsors/ljharb"
695
+ }
696
+ },
697
+ "node_modules/side-channel-map": {
698
+ "version": "1.0.1",
699
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
700
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
701
+ "dependencies": {
702
+ "call-bound": "^1.0.2",
703
+ "es-errors": "^1.3.0",
704
+ "get-intrinsic": "^1.2.5",
705
+ "object-inspect": "^1.13.3"
706
+ },
707
+ "engines": {
708
+ "node": ">= 0.4"
709
+ },
710
+ "funding": {
711
+ "url": "https://github.com/sponsors/ljharb"
712
+ }
713
+ },
714
+ "node_modules/side-channel-weakmap": {
715
+ "version": "1.0.2",
716
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
717
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
718
+ "dependencies": {
719
+ "call-bound": "^1.0.2",
720
+ "es-errors": "^1.3.0",
721
+ "get-intrinsic": "^1.2.5",
722
+ "object-inspect": "^1.13.3",
723
+ "side-channel-map": "^1.0.1"
724
+ },
725
+ "engines": {
726
+ "node": ">= 0.4"
727
+ },
728
+ "funding": {
729
+ "url": "https://github.com/sponsors/ljharb"
730
+ }
731
+ },
732
+ "node_modules/statuses": {
733
+ "version": "2.0.1",
734
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
735
+ "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
736
+ "engines": {
737
+ "node": ">= 0.8"
738
+ }
739
+ },
740
+ "node_modules/toidentifier": {
741
+ "version": "1.0.1",
742
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
743
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
744
+ "engines": {
745
+ "node": ">=0.6"
746
+ }
747
+ },
748
+ "node_modules/type-is": {
749
+ "version": "1.6.18",
750
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
751
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
752
+ "dependencies": {
753
+ "media-typer": "0.3.0",
754
+ "mime-types": "~2.1.24"
755
+ },
756
+ "engines": {
757
+ "node": ">= 0.6"
758
+ }
759
+ },
760
+ "node_modules/ua-parser-js": {
761
+ "version": "1.0.40",
762
+ "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.40.tgz",
763
+ "integrity": "sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew==",
764
+ "funding": [
765
+ {
766
+ "type": "opencollective",
767
+ "url": "https://opencollective.com/ua-parser-js"
768
+ },
769
+ {
770
+ "type": "paypal",
771
+ "url": "https://paypal.me/faisalman"
772
+ },
773
+ {
774
+ "type": "github",
775
+ "url": "https://github.com/sponsors/faisalman"
776
+ }
777
+ ],
778
+ "bin": {
779
+ "ua-parser-js": "script/cli.js"
780
+ },
781
+ "engines": {
782
+ "node": "*"
783
+ }
784
+ },
785
+ "node_modules/unique-names-generator": {
786
+ "version": "4.7.1",
787
+ "resolved": "https://registry.npmjs.org/unique-names-generator/-/unique-names-generator-4.7.1.tgz",
788
+ "integrity": "sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==",
789
+ "engines": {
790
+ "node": ">=8"
791
+ }
792
+ },
793
+ "node_modules/unpipe": {
794
+ "version": "1.0.0",
795
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
796
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
797
+ "engines": {
798
+ "node": ">= 0.8"
799
+ }
800
+ },
801
+ "node_modules/utils-merge": {
802
+ "version": "1.0.1",
803
+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
804
+ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
805
+ "engines": {
806
+ "node": ">= 0.4.0"
807
+ }
808
+ },
809
+ "node_modules/vary": {
810
+ "version": "1.1.2",
811
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
812
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
813
+ "engines": {
814
+ "node": ">= 0.8"
815
+ }
816
+ },
817
+ "node_modules/ws": {
818
+ "version": "8.18.1",
819
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz",
820
+ "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==",
821
+ "engines": {
822
+ "node": ">=10.0.0"
823
+ },
824
+ "peerDependencies": {
825
+ "bufferutil": "^4.0.1",
826
+ "utf-8-validate": ">=5.0.2"
827
+ },
828
+ "peerDependenciesMeta": {
829
+ "bufferutil": {
830
+ "optional": true
831
+ },
832
+ "utf-8-validate": {
833
+ "optional": true
834
+ }
835
+ }
836
+ }
837
+ }
838
+ }
package.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "pairdrop",
3
+ "version": "1.11.2",
4
+ "type": "module",
5
+ "description": "",
6
+ "main": "server/index.js",
7
+ "scripts": {
8
+ "start": "node server/index.js",
9
+ "start:prod": "node server/index.js --rate-limit --auto-restart"
10
+ },
11
+ "author": "",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "express": "^4.18.2",
15
+ "express-rate-limit": "^7.1.5",
16
+ "ua-parser-js": "^1.0.37",
17
+ "unique-names-generator": "^4.3.0",
18
+ "ws": "^8.16.0"
19
+ },
20
+ "engines": {
21
+ "node": ">=15"
22
+ }
23
+ }
pairdrop-cli/.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .pairdrop-cli-config
pairdrop-cli/.pairdrop-cli-config.example ADDED
@@ -0,0 +1 @@
 
 
1
+ DOMAIN=https://pairdrop.net/
pairdrop-cli/pairdrop ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # PairDrop version when this file was last changed
5
+ version="v1.10.4"
6
+
7
+ ############################################################
8
+ # Help #
9
+ ############################################################
10
+ help()
11
+ {
12
+ # Display Help
13
+ echo "Send files or text with PairDrop via command-line interface."
14
+ echo "Current domain: ${DOMAIN}"
15
+ echo
16
+ echo "Usage:"
17
+ echo -e "Open PairDrop:\t\t$(basename "$0")"
18
+ echo -e "Send files:\t\t$(basename "$0") file1/directory1 (file2/directory2 file3/directory3 ...)"
19
+ echo -e "Send text:\t\t$(basename "$0") -t \"text\""
20
+ echo -e "Specify domain:\t\t$(basename "$0") -d \"https://pairdrop.net/\""
21
+ echo -e "Show this help text:\t$(basename "$0") (-h|--help)"
22
+ echo
23
+ echo "This pairdrop-cli version was released alongside ${version}"
24
+ }
25
+
26
+ openPairDrop()
27
+ {
28
+ url="$DOMAIN"
29
+ if [[ -n $params ]];then
30
+ url="${url}?${params}"
31
+ fi
32
+ if [[ -n $hash ]];then
33
+ url="${url}#${hash}"
34
+ fi
35
+
36
+ echo "PairDrop is opening at $DOMAIN"
37
+ if [[ $OS == "Windows" ]];then
38
+ start "$url"
39
+ elif [[ $OS == "Mac" ]];then
40
+ open "$url"
41
+ elif [[ $OS == "WSL" || $OS == "WSL2" ]];then
42
+ powershell.exe /c "Start-Process ${url}"
43
+ else
44
+ xdg-open "$url" > /dev/null 2>&1
45
+ fi
46
+
47
+
48
+ exit
49
+
50
+ }
51
+
52
+ setOs()
53
+ {
54
+ unameOut=$(uname -a)
55
+ case "${unameOut}" in
56
+ *Microsoft*) OS="WSL";; #must be first since Windows subsystem for linux will have Linux in the name too
57
+ *microsoft*) OS="WSL2";; #WARNING: My v2 uses ubuntu 20.4 at the moment slightly different name may not always work
58
+ Linux*) OS="Linux";;
59
+ Darwin*) OS="Mac";;
60
+ CYGWIN*) OS="Cygwin";;
61
+ MINGW*) OS="Windows";;
62
+ *Msys) OS="Windows";;
63
+ *) OS="UNKNOWN:${unameOut}"
64
+ esac
65
+ }
66
+
67
+ specifyDomain()
68
+ {
69
+ [[ ! $1 = http* ]] || [[ ! $1 = */ ]] && echo "Incorrect format. Specify domain like https://pairdrop.net/" && exit
70
+ echo "DOMAIN=${1}" > "$config_path"
71
+ echo -e "Domain is now set to:\n$1\n"
72
+ }
73
+
74
+ sendText()
75
+ {
76
+ params="base64text=hash"
77
+ hash=$(echo -n "${OPTARG}" | base64)
78
+
79
+ if [[ $(echo -n "$hash" | wc -m) -gt 32600 ]];then
80
+ params="base64text=paste"
81
+ if [[ $OS == "Windows" || $OS == "WSL" || $OS == "WSL2" ]];then
82
+ echo -n "$hash" | clip.exe
83
+ elif [[ $OS == "Mac" ]];then
84
+ echo -n "$hash" | pbcopy
85
+ else
86
+ (echo -n "$hash" | xclip) || echo "You need to install xclip for sending bigger files from cli"
87
+ fi
88
+ hash=
89
+ fi
90
+
91
+ openPairDrop
92
+ exit
93
+ }
94
+
95
+ escapePSPath()
96
+ {
97
+ local path=$1
98
+
99
+ # escape '[' and ']' with grave accent (`) character
100
+ pathPS=${path//[/\`[}
101
+ pathPS=${pathPS//]/\`]}
102
+ # escape single quote (') with another single quote (')
103
+ pathPS=${pathPS//\'/\'\'}
104
+
105
+ # Convert GitHub bash path "/i/path" to Windows path "I:/path"
106
+ if [[ $pathPS == /* ]]; then
107
+ # Remove preceding slash
108
+ pathPS="${pathPS#/}"
109
+ # Convert drive letter to uppercase
110
+ driveLetter=$(echo "${pathPS::1}" | tr '[:lower:]' '[:upper:]')
111
+ # Put together absolute path as used in Windows
112
+ pathPS="${driveLetter}:${pathPS:1}"
113
+ fi
114
+
115
+ echo "$pathPS"
116
+ }
117
+
118
+ sendFiles()
119
+ {
120
+ params="base64zip=hash"
121
+ workingDir="$(pwd)"
122
+ tmpDir="/tmp/pairdrop-cli-temp/"
123
+ tmpDirPS="\$env:TEMP/pairdrop-cli-temp/"
124
+
125
+ index=0
126
+ directoryBaseNamesUnix=()
127
+ directoryPathsUnix=()
128
+ filePathsUnix=()
129
+ directoryCount=0
130
+ fileCount=0
131
+ pathsPS=""
132
+
133
+ #create tmp folder if it does not exist already
134
+ if [[ ! -d "$tmpDir" ]]; then
135
+ mkdir "$tmpDir"
136
+ fi
137
+
138
+ for arg in "$@"; do
139
+ echo "$arg"
140
+ [[ ! -e "$arg" ]] && echo "The given path $arg does not exist." && exit
141
+
142
+ # Remove trailing slash from directory
143
+ arg="${arg%/}"
144
+
145
+ # get absolute path and basename of file/directory
146
+ absolutePath=$(realpath "$arg")
147
+ baseName=$(basename "$absolutePath")
148
+ directoryPath=$(dirname "$absolutePath")
149
+
150
+ if [[ -d $absolutePath ]]; then
151
+ # is directory
152
+ ((directoryCount+=1))
153
+ # add basename and directory path to arrays
154
+ directoryBaseNamesUnix+=("$baseName")
155
+ directoryPathsUnix+=("$directoryPath")
156
+ else
157
+ # is file
158
+ ((fileCount+=1))
159
+ absolutePathUnix=$absolutePath
160
+ # append new path and separate paths with space
161
+ filePathsUnix+=("$absolutePathUnix")
162
+ fi
163
+
164
+ # Prepare paths for PowerShell on Windows
165
+ if [[ $OS == "Windows" ]];then
166
+ absolutePathPS=$(escapePSPath "$absolutePath")
167
+
168
+ # append new path and separate paths with commas
169
+ pathsPS+="'${absolutePathPS}', "
170
+ fi
171
+
172
+ # set fileNames on first loop
173
+ if [[ $index == 0 ]]; then
174
+ baseNameU=${baseName// /_}
175
+
176
+ # Prevent baseNameU being empty for hidden files by removing the preceding dot
177
+ if [[ $baseNameU == .* ]]; then
178
+ baseNameU=${baseNameU#.*}
179
+ fi
180
+
181
+ # only use trunk of basename "document.txt" -> "document"
182
+ baseNameTrunk=${baseNameU%.*}
183
+
184
+ # remove all special characters
185
+ zipName=${baseNameTrunk//[^a-zA-Z0-9_]/}
186
+
187
+ zipToSendAbs="${tmpDir}${zipName}_pairdrop.zip"
188
+ wrapperZipAbs="${tmpDir}${zipName}_pairdrop_wrapper.zip"
189
+
190
+ if [[ $OS == "Windows" ]];then
191
+ zipToSendAbsPS="${tmpDirPS}${zipName}_pairdrop.zip"
192
+ wrapperZipAbsPS="${tmpDirPS}${zipName}_pairdrop_wrapper.zip"
193
+ fi
194
+ fi
195
+
196
+ ((index+=1)) # somehow ((index++)) stops the script
197
+ done
198
+
199
+ # Prepare paths for PowerShell on Windows
200
+ if [[ $OS == "Windows" ]];then
201
+ # remove trailing comma
202
+ pathsPS=${pathsPS%??}
203
+ fi
204
+
205
+ echo "Preparing ${fileCount} files and ${directoryCount} directories..."
206
+
207
+ # if arguments include files only -> zip files once so files it is unzipped by sending browser
208
+ # if arguments include directories -> wrap first zip in a second wrapper zip so that after unzip by sending browser a zip file is sent to receiver
209
+ #
210
+ # Preferred zip structure:
211
+ # pairdrop "d1/d2/d3/f1" "../../d4/d5/d6/f2" "d7/" "../d8/" "f5"
212
+ # zip structure: pairdrop.zip
213
+ # |-f1
214
+ # |-f2
215
+ # |-d7/
216
+ # |-d8/
217
+ # |-f5
218
+ # -> truncate (relative) paths but keep directories
219
+
220
+ [[ -e "$zipToSendAbs" ]] && echo "Cannot overwrite $zipToSendAbs. Please remove first." && exit
221
+
222
+ if [[ $OS == "Windows" ]];then
223
+ # Powershell does preferred zip structure natively
224
+ powershell.exe -Command "Compress-Archive -Path ${pathsPS} -DestinationPath ${zipToSendAbsPS}"
225
+ else
226
+ # Workaround needed to create preferred zip structure on unix systems
227
+ # Create zip file with all single files by junking the path
228
+ if [[ $fileCount != 0 ]]; then
229
+ zip -q -b /tmp/ -j -0 -r "$zipToSendAbs" "${filePathsUnix[@]}"
230
+ fi
231
+
232
+ # Add directories recursively to zip file
233
+ index=0
234
+ while [[ $index < $directoryCount ]]; do
235
+ # workaround to keep directory name but junk the rest of the paths
236
+
237
+ # cd to path above directory
238
+ cd "${directoryPathsUnix[index]}"
239
+
240
+ # add directory to zip without junking the path
241
+ zip -q -b /tmp/ -0 -u -r "$zipToSendAbs" "${directoryBaseNamesUnix[index]}"
242
+
243
+ # cd back to working directory
244
+ cd "$workingDir"
245
+
246
+ ((index+=1)) # somehow ((index++)) stops the script
247
+ done
248
+ fi
249
+
250
+ # If directories are included send as zip
251
+ # -> Create additional zip wrapper which will be unzipped by the sending browser
252
+ if [[ "$directoryCount" != 0 ]]; then
253
+ echo "Bundle as ZIP file..."
254
+
255
+ # Prevent filename from being absolute zip path by "cd"ing to directory before zipping
256
+ zipToSendDirectory=$(dirname "$zipToSendAbs")
257
+ zipToSendBaseName=$(basename "$zipToSendAbs")
258
+
259
+ cd "$zipToSendDirectory"
260
+
261
+ [[ -e "$wrapperZipAbs" ]] && echo "Cannot overwrite $wrapperZipAbs. Please remove first." && exit
262
+
263
+ if [[ $OS == "Windows" ]];then
264
+ powershell.exe -Command "Compress-Archive -Path ${zipToSendBaseName} -DestinationPath ${wrapperZipAbsPS} -CompressionLevel Optimal"
265
+ else
266
+ zip -q -b /tmp/ -0 "$wrapperZipAbs" "$zipToSendBaseName"
267
+ fi
268
+ cd "$workingDir"
269
+
270
+ # remove inner zip file and set wrapper as zipToSend (do not differentiate between OS as this is done via Git Bash on Windows)
271
+ rm "$zipToSendAbs"
272
+
273
+ zipToSendAbs=$wrapperZipAbs
274
+ fi
275
+
276
+ # base64 encode zip file
277
+ if [[ $OS == "Mac" ]];then
278
+ hash=$(base64 -i "$zipToSendAbs")
279
+ else
280
+ hash=$(base64 -w 0 "$zipToSendAbs")
281
+ fi
282
+
283
+ # remove zip file (do not differentiate between OS as this is done via Git Bash on Windows)
284
+ rm "$zipToSendAbs"
285
+
286
+ if [[ $(echo -n "$hash" | wc -m) -gt 1000 ]];then
287
+ params="base64zip=paste"
288
+
289
+ # Copy $hash to clipboard
290
+ if [[ $OS == "Windows" || $OS == "WSL" || $OS == "WSL2" ]];then
291
+ echo -n "$hash" | clip.exe
292
+ elif [[ $OS == "Mac" ]];then
293
+ echo -n "$hash" | pbcopy
294
+ elif [ -n "$WAYLAND_DISPLAY" ]; then
295
+ # Wayland
296
+ if ! command -v wl-copy &> /dev/null; then
297
+ echo -e "You need to install 'wl-copy' to send bigger filePathsUnix from cli"
298
+ echo "Try: sudo apt install wl-clipboard"
299
+ exit 1
300
+ fi
301
+ # Workaround to prevent use of Pipe which has a max letter limit
302
+ echo -n "$hash" > /tmp/pairdrop-cli-temp/pairdrop_hash_temp
303
+ wl-copy < /tmp/pairdrop-cli-temp/pairdrop_hash_temp
304
+ rm /tmp/pairdrop-cli-temp/pairdrop_hash_temp
305
+ else
306
+ # X11
307
+ if ! command -v xclip &> /dev/null; then
308
+ echo -e "You need to install 'xclip' to send bigger filePathsUnix from cli"
309
+ echo "Try: sudo apt install xclip"
310
+ exit 1
311
+ fi
312
+ echo -n "$hash" | xclip -sel c
313
+ fi
314
+ hash=
315
+ fi
316
+
317
+ openPairDrop
318
+ exit
319
+ }
320
+
321
+ ############################################################
322
+ ############################################################
323
+ # Main program #
324
+ ############################################################
325
+ ############################################################
326
+ script_path="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
327
+
328
+ pushd . > '/dev/null';
329
+ script_path="${BASH_SOURCE[0]:-$0}";
330
+
331
+ while [ -h "$script_path" ];
332
+ do
333
+ cd "$( dirname -- "$script_path"; )";
334
+ script_path="$( readlink -f -- "$script_path"; )";
335
+ done
336
+
337
+ cd "$( dirname -- "$script_path"; )" > '/dev/null';
338
+ script_path="$( pwd; )";
339
+ popd > '/dev/null';
340
+
341
+ config_path="${script_path}/.pairdrop-cli-config"
342
+
343
+ # If config file does not exist, try to create it. If it fails log error message and exit
344
+ [ ! -f "$config_path" ] &&
345
+ specifyDomain "https://pairdrop.net/" &&
346
+ [ ! -f "$config_path" ] &&
347
+ echo "Could not create config file. Add 'DOMAIN=https://pairdrop.net/' to a file called .pairdrop-cli-config in the same file as this 'pairdrop' bash file (${script_path})" &&
348
+ exit
349
+
350
+ # Read config variables
351
+ export "$(grep -v '^#' "$config_path" | xargs)"
352
+
353
+ setOs
354
+
355
+ ############################################################
356
+ # Process the input options. Add options as needed. #
357
+ ############################################################
358
+ # Get the options
359
+ # open PairDrop if no options are given
360
+ [[ $# -eq 0 ]] && openPairDrop && exit
361
+
362
+ # display help and exit if first argument is "--help" or more than 2 arguments are given
363
+ [ "$1" == "--help" ] && help && exit
364
+
365
+ while getopts "d:ht:*" option; do
366
+ case $option in
367
+ d) # specify domain - show help and exit if too many arguments
368
+ [[ $# -gt 2 ]] && help && exit
369
+ specifyDomain "$2"
370
+ exit;;
371
+ t) # Send text - show help and exit if too many arguments
372
+ [[ $# -gt 2 ]] && help && exit
373
+ sendText
374
+ exit;;
375
+ h | ?) # display help and exit
376
+ help
377
+ exit;;
378
+ esac
379
+ done
380
+
381
+ # Send file(s)
382
+ sendFiles "$@"
pairdrop-cli/pairdrop.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
3
+
4
+ cd "$parent_path" || exit
5
+
6
+ ./pairdrop "$@"
pairdrop-cli/send with PairDrop.lnk ADDED
Binary file (1.98 kB). View file
 
pairdrop-cli/send-with-pairdrop ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Initialize an array
4
+ lines=()
5
+
6
+ # Read each line into the array
7
+ while IFS= read -r line; do
8
+ lines+=("$line")
9
+ done <<< "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
10
+
11
+ # Get the length of the array
12
+ length=${#lines[@]}
13
+
14
+ # Remove the last entry
15
+ unset 'lines[length-1]'
16
+
17
+ pairdrop "${lines[@]}"
pairdrop-cli/send-with-pairdrop.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
2
+
3
+ & "$scriptDir\pairdrop.sh" $args
public/fonts/OpenSans/OFL.txt ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright 2020 The Open Sans Project Authors (https://github.com/googlefonts/opensans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
public/fonts/OpenSans/OpenSans-Italic-VariableFont_wdth,wght.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:602606bec0b527ba124c6da553e9aa790e21187f8261c7e96af547c400abd15d
3
+ size 580356
public/fonts/OpenSans/OpenSans-VariableFont_wdth,wght.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1b1331ba90e949be8664b073976b4f0369b831f381e13e506d728e50ce29083
3
+ size 529700
public/fonts/OpenSans/README.txt ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Open Sans Variable Font
2
+ =======================
3
+
4
+ This download contains Open Sans as both variable fonts and static fonts.
5
+
6
+ Open Sans is a variable font with these axes:
7
+ wdth
8
+ wght
9
+
10
+ This means all the styles are contained in these files:
11
+ OpenSans-VariableFont_wdth,wght.ttf
12
+ OpenSans-Italic-VariableFont_wdth,wght.ttf
13
+
14
+ If your app fully supports variable fonts, you can now pick intermediate styles
15
+ that aren’t available as static fonts. Not all apps support variable fonts, and
16
+ in those cases you can use the static font files for Open Sans:
17
+ static/OpenSans_Condensed-Light.ttf
18
+ static/OpenSans_Condensed-Regular.ttf
19
+ static/OpenSans_Condensed-Medium.ttf
20
+ static/OpenSans_Condensed-SemiBold.ttf
21
+ static/OpenSans_Condensed-Bold.ttf
22
+ static/OpenSans_Condensed-ExtraBold.ttf
23
+ static/OpenSans_SemiCondensed-Light.ttf
24
+ static/OpenSans_SemiCondensed-Regular.ttf
25
+ static/OpenSans_SemiCondensed-Medium.ttf
26
+ static/OpenSans_SemiCondensed-SemiBold.ttf
27
+ static/OpenSans_SemiCondensed-Bold.ttf
28
+ static/OpenSans_SemiCondensed-ExtraBold.ttf
29
+ static/OpenSans-Light.ttf
30
+ static/OpenSans-Regular.ttf
31
+ static/OpenSans-Medium.ttf
32
+ static/OpenSans-SemiBold.ttf
33
+ static/OpenSans-Bold.ttf
34
+ static/OpenSans-ExtraBold.ttf
35
+ static/OpenSans_Condensed-LightItalic.ttf
36
+ static/OpenSans_Condensed-Italic.ttf
37
+ static/OpenSans_Condensed-MediumItalic.ttf
38
+ static/OpenSans_Condensed-SemiBoldItalic.ttf
39
+ static/OpenSans_Condensed-BoldItalic.ttf
40
+ static/OpenSans_Condensed-ExtraBoldItalic.ttf
41
+ static/OpenSans_SemiCondensed-LightItalic.ttf
42
+ static/OpenSans_SemiCondensed-Italic.ttf
43
+ static/OpenSans_SemiCondensed-MediumItalic.ttf
44
+ static/OpenSans_SemiCondensed-SemiBoldItalic.ttf
45
+ static/OpenSans_SemiCondensed-BoldItalic.ttf
46
+ static/OpenSans_SemiCondensed-ExtraBoldItalic.ttf
47
+ static/OpenSans-LightItalic.ttf
48
+ static/OpenSans-Italic.ttf
49
+ static/OpenSans-MediumItalic.ttf
50
+ static/OpenSans-SemiBoldItalic.ttf
51
+ static/OpenSans-BoldItalic.ttf
52
+ static/OpenSans-ExtraBoldItalic.ttf
53
+
54
+ Get started
55
+ -----------
56
+
57
+ 1. Install the font files you want to use
58
+
59
+ 2. Use your app's font picker to view the font family and all the
60
+ available styles
61
+
62
+ Learn more about variable fonts
63
+ -------------------------------
64
+
65
+ https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
66
+ https://variablefonts.typenetwork.com
67
+ https://medium.com/variable-fonts
68
+
69
+ In desktop apps
70
+
71
+ https://theblog.adobe.com/can-variable-fonts-illustrator-cc
72
+ https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
73
+
74
+ Online
75
+
76
+ https://developers.google.com/fonts/docs/getting_started
77
+ https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
78
+ https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
79
+
80
+ Installing fonts
81
+
82
+ MacOS: https://support.apple.com/en-us/HT201749
83
+ Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
84
+ Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
85
+
86
+ Android Apps
87
+
88
+ https://developers.google.com/fonts/docs/android
89
+ https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
90
+
91
+ License
92
+ -------
93
+ Please read the full license text (OFL.txt) to understand the permissions,
94
+ restrictions and requirements for usage, redistribution, and modification.
95
+
96
+ You can use them in your products & projects – print or digital,
97
+ commercial or otherwise.
98
+
99
+ This isn't legal advice, please consider consulting a lawyer and see the full
100
+ license for all details.
public/fonts/OpenSans/static/OpenSans-Bold.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1993fbaf0528afe76aa775d6b496d9df9f03330ece0b8bcb756d6885685a2a8
3
+ size 130864
public/fonts/OpenSans/static/OpenSans-BoldItalic.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d40797790bba2045c6fb6e6ae8b37e64a8e4a6afe80f63fe08f329daa17c4887
3
+ size 136412
public/fonts/OpenSans/static/OpenSans-ExtraBold.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e71f734fa079d489834b07d5c117a768d85c53d4e443991a939d95e4bc6c33b4
3
+ size 131248
public/fonts/OpenSans/static/OpenSans-ExtraBoldItalic.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:88f81d234bc8f6acf663469df450a5a30dc10d20e8d6594eeb82769f92242f06
3
+ size 136980