summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Gamble2021-03-26 00:13:00 +1100
committerMatthew Gamble2021-03-26 00:13:00 +1100
commit46ce0cec730099f9df08fbcb91da6b4041eff239 (patch)
treec82206042fec37179834cc5b1202b36e3e5c2760
downloadaur-46ce0cec730099f9df08fbcb91da6b4041eff239.tar.gz
Initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD40
-rw-r--r--example-nginx.conf22
4 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c7e4767e8ace
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = snapdrop
+ pkgdesc = A Progressive Web App for local file sharing
+ pkgver = 2021.03.10
+ pkgrel = 1
+ url = https://github.com/RobinLinus/snapdrop
+ arch = any
+ license = GPL3
+ makedepends = npm
+ depends = nodejs
+ source = https://github.com/RobinLinus/snapdrop/archive/fad4632eb903ea6de9ecbec90df0ac6bd7410e68.tar.gz
+ source = example-nginx.conf
+ sha256sums = 8886ae45aa5910606c8125e27cc589ae26fe162eedc11a396ca864f4788f2c2a
+ sha256sums = a20b5daf7e2b49d0dc54e93911e22b2fea244ecf2ef3ee58960e3c2aacde586a
+
+pkgname = snapdrop
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..fefba76be301
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/pkg/
+/src/
+
+*.pkg.tar.*
+*.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..58a3f2cadb3a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Matthew Gamble <git@matthewgamble.net>
+
+pkgname="snapdrop"
+pkgver=2021.03.10
+pkgrel=1
+_githash="fad4632eb903ea6de9ecbec90df0ac6bd7410e68"
+pkgdesc="A Progressive Web App for local file sharing"
+url="https://github.com/RobinLinus/snapdrop"
+license=("GPL3" "MIT")
+arch=("any")
+depends=("nodejs")
+makedepends=("npm")
+source=(
+ "https://github.com/RobinLinus/snapdrop/archive/${_githash}.tar.gz"
+ "example-nginx.conf"
+)
+sha256sums=(
+ "8886ae45aa5910606c8125e27cc589ae26fe162eedc11a396ca864f4788f2c2a"
+ "a20b5daf7e2b49d0dc54e93911e22b2fea244ecf2ef3ee58960e3c2aacde586a"
+)
+
+prepare() {
+ cd "snapdrop-${_githash}/server"
+ npm ci
+}
+
+package() {
+ cd "snapdrop-${_githash}"
+
+ install -dm755 "${pkgdir}/usr/share/snapdrop"
+ cp -r client server "${pkgdir}/usr/share/snapdrop/"
+
+ install -dm755 "${pkgdir}/usr/share/doc"
+ cp -r docs "${pkgdir}/usr/share/doc/snapdrop"
+ install -Dm644 "README.md" "${pkgdir}/usr/share/doc/snapdrop/README.md"
+ install -Dm644 "${srcdir}/example-nginx.conf" "${pkgdir}/usr/share/doc/snapdrop/example-nginx.conf"
+
+ chmod -R 0000 "${pkgdir}/usr/share"
+ chmod -R u+rwX,g+rX,o+rX "${pkgdir}/usr/share"
+}
diff --git a/example-nginx.conf b/example-nginx.conf
new file mode 100644
index 000000000000..2baf96d0510d
--- /dev/null
+++ b/example-nginx.conf
@@ -0,0 +1,22 @@
+server {
+ listen 80 http2;
+ listen 443 ssl http2;
+
+ server_name snapdrop.example.com;
+
+ ssl_certificate /etc/nginx/ssl/snapdrop.example.com.crt;
+ ssl_certificate_key /etc/nginx/ssl/snapdrop/example.com.key;
+
+ root /usr/share/snapdrop/client;
+ index index.html;
+
+ client_max_body_size 0;
+
+ location /server {
+ proxy_connect_timeout 300;
+ proxy_pass http://localhost:3000;
+ proxy_set_header Connection "upgrade";
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
+ }
+}