summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD44
-rw-r--r--append-mime-types.patch26
-rw-r--r--camo.conf11
-rw-r--r--camo.install4
-rw-r--r--camo.service10
6 files changed, 119 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2dea79d6a475
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = camo
+ pkgdesc = a small http proxy to simplify routing images through an SSL host
+ pkgver = 2.2.0
+ pkgrel = 1
+ url = https://github.com/atmos/camo
+ install = camo.install
+ arch = any
+ license = MIT
+ makedepends = coffee-script
+ depends = nodejs
+ backup = etc/camo
+ source = https://github.com/atmos/camo/archive/v2.2.0.tar.gz
+ source = camo.service
+ source = camo.conf
+ source = camo.install
+ source = append-mime-types.patch
+ sha256sums = 0867b6dc6bb3d23f85b8cb67a92f6200df5ebf46365216065fa379fa09d67770
+ sha256sums = 038c7495a899f8d7b9b6487aeed54409afeb266e99c7ee9a700202d758e20b2c
+ sha256sums = 67f178c6f782a2faeec056e21d7fb263f8a4e61b92450cde552fa544bb4bd1d5
+ sha256sums = 276257e3d3024ad514b740cb0c8342e5684875a3d072176a13e524d23e2c54e9
+ sha256sums = dda93ac5660b0a894eb7ea660fd10d0d59988871f3e903354c849a191795a026
+
+pkgname = camo
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..700f558352ff
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Jonne Haß <me@jhass.eu>
+pkgname=camo
+pkgver=2.2.0
+pkgrel=1
+pkgdesc="a small http proxy to simplify routing images through an SSL host"
+arch=('any')
+url="https://github.com/atmos/camo"
+license=('MIT')
+depends=('nodejs')
+makedepends=('coffee-script')
+backup=('etc/camo')
+install=camo.install
+source=("https://github.com/atmos/$pkgname/archive/v$pkgver.tar.gz"
+ 'camo.service'
+ 'camo.conf'
+ 'camo.install'
+ 'append-mime-types.patch')
+
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver"
+ # Patch mime-types.json for easier Amazon S3 and Cloudflare integration
+ patch -p1 < ../append-mime-types.patch
+}
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ coffee -c server.coffee
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ install -Dm644 server.js "$pkgdir/usr/lib/camo/server.js"
+ install -Dm644 package.json "$pkgdir/usr/lib/camo/package.json"
+ install -Dm644 mime-types.json "$pkgdir/usr/lib/camo/mime-types.json"
+ install -Dm644 ../camo.service "$pkgdir/usr/lib/systemd/system/camo.service"
+ install -Dm644 ../camo.conf "$pkgdir/etc/camo"
+ install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
+}
+
+sha256sums=('0867b6dc6bb3d23f85b8cb67a92f6200df5ebf46365216065fa379fa09d67770'
+ '038c7495a899f8d7b9b6487aeed54409afeb266e99c7ee9a700202d758e20b2c'
+ '67f178c6f782a2faeec056e21d7fb263f8a4e61b92450cde552fa544bb4bd1d5'
+ '276257e3d3024ad514b740cb0c8342e5684875a3d072176a13e524d23e2c54e9'
+ 'dda93ac5660b0a894eb7ea660fd10d0d59988871f3e903354c849a191795a026')
diff --git a/append-mime-types.patch b/append-mime-types.patch
new file mode 100644
index 000000000000..fd5b1f664499
--- /dev/null
+++ b/append-mime-types.patch
@@ -0,0 +1,26 @@
+From 6cf180abdf1ad4a91596dc7fae315bad7d8663be Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jonne=20Ha=C3=9F?= <me@jhass.eu>
+Date: Sun, 9 Nov 2014 20:50:35 +0100
+Subject: [PATCH] append mime types
+
+---
+ mime-types.json | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/mime-types.json b/mime-types.json
+index ee2097f..a05946f 100644
+--- a/mime-types.json
++++ b/mime-types.json
+@@ -40,5 +40,8 @@
+ "image/x-rgb",
+ "image/x-xbitmap",
+ "image/x-xpixmap",
+- "image/x-xwindowdump"
++ "image/x-xwindowdump",
++ "application/octet-stream",
++ "binary/octet-stream",
++ ""
+ ]
+--
+2.1.3
+
diff --git a/camo.conf b/camo.conf
new file mode 100644
index 000000000000..45a27f394cfa
--- /dev/null
+++ b/camo.conf
@@ -0,0 +1,11 @@
+# For a list of all available configuration options see
+# https://github.com/atmos/camo#configuration
+
+# The port which camo should listen to (default=8081)
+PORT=8081
+
+# The shared secret key
+CAMO_KEY=
+
+# Enable debug logging (default=disabled)
+#CAMO_LOGGING_ENABLED=debug
diff --git a/camo.install b/camo.install
new file mode 100644
index 000000000000..5c65b1408227
--- /dev/null
+++ b/camo.install
@@ -0,0 +1,4 @@
+post_install() {
+ sed -i -e "s/CAMO_KEY=/CAMO_KEY=$(openssl rand -hex 64)/" /etc/camo
+}
+
diff --git a/camo.service b/camo.service
new file mode 100644
index 000000000000..455c4604dda6
--- /dev/null
+++ b/camo.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=a small http proxy to simplify routing images through an SSL host
+
+[Service]
+User=nobody
+EnvironmentFile=/etc/camo
+ExecStart=/usr/bin/node /usr/lib/camo/server.js
+
+[Install]
+WantedBy=multi-user.target