diff options
author | Marius Lindvall | 2019-12-29 20:16:22 +0100 |
---|---|---|
committer | Marius Lindvall | 2019-12-29 20:16:22 +0100 |
commit | 308426e866659a678fdf8f75d5c4fa42a9ed6890 (patch) | |
tree | 44d6948639a60483ad81bdbe5691efd915fb19ae | |
download | aur-308426e866659a678fdf8f75d5c4fa42a9ed6890.tar.gz |
Version 1.6, initial AUR submission
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 33 | ||||
-rw-r--r-- | apache-example.conf | 13 | ||||
-rw-r--r-- | hauk-server.install | 16 | ||||
-rw-r--r-- | nginx-example.conf | 50 |
5 files changed, 135 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..a35c25bfff56 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = hauk-server + pkgdesc = PHP backend for Hauk, a self-hosted real-time location sharing app + pkgver = 1.6 + pkgrel = 1 + url = https://github.com/bilde2910/Hauk + install = hauk-server.install + arch = any + license = Apache + depends = php>=7 + optdepends = php-memcached: memcached storage support + optdepends = php-redis: Redis storage support + optdepends = php-ldap: user authentication against LDAP + options = !strip + backup = etc/hauk/config.php + source = https://github.com/bilde2910/Hauk/archive/v1.6.tar.gz + source = apache-example.conf + source = nginx-example.conf + sha256sums = 5d8bc17bf2b51d6745fd1234a6a3ce9d1937eae23c575875dbe804741a463c81 + sha256sums = 44eb91f5c8f5b20bcb6105b06c0f6b7a7b7a2b54a91a2dc9abbc993a6d410bca + sha256sums = b48e1dc0519d0359936da330d8478cb4102f53553d7825844196fe0962df61bd + +pkgname = hauk-server + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..771ba897d4b3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: Marius Lindvall <marius {cat} varden {dog} info> +pkgname=hauk-server +pkgver=1.6 +pkgrel=1 +pkgdesc="PHP backend for Hauk, a self-hosted real-time location sharing app" +arch=('any') +url="https://github.com/bilde2910/Hauk" +license=('Apache') +depends=('php>=7') +optdepends=('php-memcached: memcached storage support' + 'php-redis: Redis storage support' + 'php-ldap: user authentication against LDAP') +conflicts=() +install="${pkgname}.install" +source=("https://github.com/bilde2910/Hauk/archive/v${pkgver}.tar.gz" + "apache-example.conf" + "nginx-example.conf") +sha256sums=('5d8bc17bf2b51d6745fd1234a6a3ce9d1937eae23c575875dbe804741a463c81' + '44eb91f5c8f5b20bcb6105b06c0f6b7a7b7a2b54a91a2dc9abbc993a6d410bca' + 'b48e1dc0519d0359936da330d8478cb4102f53553d7825844196fe0962df61bd') +options=(!strip) +backup=("etc/hauk/config.php") + +package() { + mkdir -p "${pkgdir}/etc/hauk" + mkdir -p "${pkgdir}/usr/share/webapps/${pkgname}" + mkdir -p "${pkgdir}/usr/share/doc/${pkgname}" + cp -r ./Hauk-${pkgver}/backend-php/* "${pkgdir}/usr/share/webapps/${pkgname}" + cp -r ./Hauk-${pkgver}/frontend/* "${pkgdir}/usr/share/webapps/${pkgname}" + install -Dm644 ./Hauk-${pkgver}/backend-php/include/config-sample.php "${pkgdir}/etc/hauk/config.php" + install -Dm644 ./apache-example.conf "${pkgdir}/usr/share/doc/${pkgname}" + install -Dm644 ./nginx-example.conf "${pkgdir}/usr/share/doc/${pkgname}" +} diff --git a/apache-example.conf b/apache-example.conf new file mode 100644 index 000000000000..5f99f41dea23 --- /dev/null +++ b/apache-example.conf @@ -0,0 +1,13 @@ +NameVirtualHost *:443 + +<VirtualHost *:443> + ServerName hauk.example.com + DocumentRoot /usr/share/webapps/hauk-backend + + ErrorLog /var/log/httpd/hauk.error.log + CustomLog /var/log/httpd/hauk.access.log combined + + SSLEngine on + SSLCertificateFile /etc/letsencrypt/live/hauk.example.com/fullchain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/hauk.example.com/privkey.pem +</VirtualHost> diff --git a/hauk-server.install b/hauk-server.install new file mode 100644 index 000000000000..2f954f256916 --- /dev/null +++ b/hauk-server.install @@ -0,0 +1,16 @@ +post_install() { + cat << EOF +==> You have to install one of the php-memcached or php-redis packages specfied + in optdepends depending on which storage backend you wish to use with Hauk. +==> Make sure that the relevant extensions are enabled in php.ini. +==> Example vhosts for Apache and nginx are provided in + /usr/share/doc/hauk-backend. To use them, make sure they are included in + Apache/nginx's configuration using include statements. Hauk is installed + similarly to phpMyAdmin, so you may use its instructions from Arch Wiki as + a base when setting up Apache or nginx: + https://wiki.archlinux.org/index.php/PhpMyAdmin#Apache +==> Hauk requires configuration before first use. Please make sure you read and + modify /etc/hauk/config.php to fit your needs. +EOF + /bin/true +} diff --git a/nginx-example.conf b/nginx-example.conf new file mode 100644 index 000000000000..135b9c040f0f --- /dev/null +++ b/nginx-example.conf @@ -0,0 +1,50 @@ +server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name hauk.example.com; + + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305'; + ssl_session_cache shared:SSL:10m; + ssl_stapling on; + ssl_stapling_verify on; + + ssl_ecdh_curve 'secp521r1:secp384r1'; + ssl_prefer_server_ciphers on; + ssl_session_timeout 10m; + ssl_session_tickets off; + + ssl_certificate /etc/letsencrypt/live/hauk.example.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/hauk.example.com/privkey.pem; + + access_log /var/log/nginx/hauk.access.log; + error_log /var/log/nginx/hauk.error.log; + + add_header Referrer-Policy same-origin always; + add_header X-Frame-Options DENY always; + add_header X-Content-Type-Options nosniff always; + add_header X-XSS-Protection "1; mode=block" always; + add_header X-Robots-Tag "noindex, nofollow" always; + + root /usr/share/webapps/hauk-backend; + index index.html index.htm index.php; + + location / { + try_files $uri $uri/ =404; + } + + location ~ ^/include/ { + return 403; + } + + location ~ \.php$ { + try_files $uri $document_root$fastcgi_script_name =404; + + fastcgi_split_path_info ^(.+\.php)(/.*)$; + fastcgi_pass unix:/run/php-fpm/php-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +} |