summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartina Pietruschka2015-06-08 22:27:03 +0000
committerMartina Pietruschka2015-06-08 22:27:03 +0000
commita3f9695e498917be0d558b8fc59308472a9efc7f (patch)
tree1734dedaa822d8b002c47189b1cd8fe732e1619e
downloadaur-a3f9695e498917be0d558b8fc59308472a9efc7f.tar.gz
Initial import
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD99
-rw-r--r--install6
-rw-r--r--nginx-location.conf42
-rw-r--r--nginx-ssl.example.conf56
-rw-r--r--php-fpm.example.conf3
-rw-r--r--zarafa-webapp.conf33
-rw-r--r--zarafa-webapp.ini3
8 files changed, 273 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..47fdb950ee43
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+# Generated by makepkg 4.2.1
+# Wed May 13 01:19:20 UTC 2015
+pkgbase = zarafa-webapp
+ pkgdesc = WebApp for Zarafa
+ pkgver = 2.0.2.48619
+ pkgrel = 3
+ url = http://www.zarafa.com/
+ install = install
+ arch = any
+ license = AGPL3
+ makedepends = apache-ant
+ makedepends = gettext
+ depends = php
+ backup = etc/webapps/zarafa-webapp/config.php
+ source = webapp-2.0.2.48619.tar.gz::http://download.zarafa.com/community/final/WebApp/2.0.2/webapp-2.0.2.48619.tar.gz
+ source = nginx-location.conf
+ source = nginx-ssl.example.conf
+ source = php-fpm.example.conf
+ source = zarafa-webapp.conf
+ source = zarafa-webapp.ini
+ md5sums = 0d384708bd97d52fc2f9eb651f6f6f1e
+ md5sums = eac81900679ed0fc111fcaa1171bbd32
+ md5sums = 73451bc5c35072b22b0b2925c5920978
+ md5sums = 7adcf5e023718421a5e8e07e5e9a2480
+ md5sums = cc8143c1fa12911a17578c1e775225fe
+ md5sums = daedd4114b213e9279806ee720eeb1ef
+
+pkgname = zarafa-webapp
+
+pkgname = zarafa-webapp-plugins
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..594447cbac90
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,99 @@
+# Maintainer: MartiMcFly info@pietma.com
+# Contributor: Archist archist@die-optimisten.net
+# Contributor: C Anthony Risinger
+
+pkgname=('zarafa-webapp'
+ 'zarafa-webapp-plugins')
+pkgver=2.0.2.48619
+_pkgrel=2.0.2
+pkgrel=3
+pkgdesc=('WebApp for Zarafa')
+arch=('any')
+url=('http://www.zarafa.com/')
+license=('AGPL3')
+install=('install')
+backup=("etc/webapps/zarafa-webapp/config.php")
+depends=('php')
+makedepends=('apache-ant'
+ 'gettext')
+
+source=("webapp-${pkgver}.tar.gz::http://download.zarafa.com/community/final/WebApp/${_pkgrel}/webapp-${pkgver}.tar.gz"
+ "nginx-location.conf"
+ "nginx-ssl.example.conf"
+ "php-fpm.example.conf"
+ "zarafa-webapp.conf"
+ "zarafa-webapp.ini")
+
+md5sums=('0d384708bd97d52fc2f9eb651f6f6f1e'
+ 'eac81900679ed0fc111fcaa1171bbd32'
+ '73451bc5c35072b22b0b2925c5920978'
+ '7adcf5e023718421a5e8e07e5e9a2480'
+ 'cc8143c1fa12911a17578c1e775225fe'
+ 'daedd4114b213e9279806ee720eeb1ef')
+
+package_zarafa-webapp() {
+ # create translations, compress javascript-files
+ cd ${srcdir}/webapp-${pkgver}
+ ant deploy
+
+ # according to https://wiki.archlinux.org/index.php/Web_application_package_guidelines
+ cd ${srcdir}/webapp-${pkgver}/deploy
+
+ # create folders
+ mkdir -p ${pkgdir}/usr/share/webapps/${pkgname}/
+ cp -r * ${pkgdir}/usr/share/webapps/${pkgname}/
+ cp ${srcdir}/webapp-${pkgver}/.htaccess ${pkgdir}/usr/share/webapps/${pkgname}/
+ rm ${pkgdir}/usr/share/webapps/${pkgname}/zarafa-webapp.conf
+ rm ${pkgdir}/usr/share/webapps/${pkgname}/config.php.dist
+ rm ${pkgdir}/usr/share/webapps/${pkgname}/debug.php.dist
+
+ mkdir -p ${pkgdir}/etc/webapps/${pkgname}
+ cp ${srcdir}/php-fpm.example.conf ${pkgdir}/etc/webapps/${pkgname}/
+ cp ${srcdir}/nginx-ssl.example.conf ${pkgdir}/etc/webapps/${pkgname}/
+ cp ${srcdir}/nginx-location.conf ${pkgdir}/etc/webapps/${pkgname}/
+ cp zarafa-webapp.conf ${pkgdir}/etc/webapps/${pkgname}/apache.example.conf
+ cp config.php.dist ${pkgdir}/etc/webapps/${pkgname}/config.example.php
+ cp debug.php.dist ${pkgdir}/etc/webapps/${pkgname}/debug.example.php
+ ln -s /etc/webapps/${pkgname}/config.php ${pkgdir}/usr/share/webapps/${pkgname}/config.php
+
+ mkdir -p ${pkgdir}/etc/php/conf.d
+ cp ${srcdir}/${pkgname}.ini ${pkgdir}/etc/php/conf.d
+
+ mkdir -p ${pkgdir}/etc/php/fpm.d
+ cp ${srcdir}/${pkgname}.conf ${pkgdir}/etc/php/fpm.d
+
+ mkdir -p ${pkgdir}/var/lib/${pkgname}
+
+ mkdir -p ${pkgdir}/var/log/${pkgname}
+ touch ${pkgdir}/var/log/${pkgname}/debug.txt
+ ln -s /var/log/${pkgname}/debug.txt ${pkgdir}/usr/share/webapps/${pkgname}/debug.txt
+}
+
+package_zarafa-webapp-plugins() {
+ # create translations, compress javascript-files
+ cd ${srcdir}/webapp-${pkgver}
+ ant deploy-plugins
+
+ cd ${srcdir}/webapp-${pkgver}/deploy/plugins
+
+ # create folders
+ mkdir -p ${pkgdir}/usr/share/webapps/${pkgname//-plugins/}/plugins/
+ cp -R * ${pkgdir}/usr/share/webapps/${pkgname//-plugins/}/plugins/
+
+ # delete for privacy reasons and making sense
+ cd ${pkgdir}/usr/share/webapps/${pkgname//-plugins/}/plugins/
+ rm -R dropboxattachment
+ rm -R example
+ rm -R facebook
+ rm -R facebookwidget
+ rm -R gmaps
+ rm -R salesforce
+ rm -R spreed
+ rm -R zperformance
+ rm -R zdeveloper
+ rm -R sugarcrm
+ rm -R twidget
+ rm -R feedback
+ rm -R browsercompatibility
+ rm -R statslogging
+}
diff --git a/install b/install
new file mode 100644
index 000000000000..708102eb1e09
--- /dev/null
+++ b/install
@@ -0,0 +1,6 @@
+post_install() {
+ cp -n /etc/webapps/zarafa-webapp/config.example.php /etc/webapps/zarafa-webapp/config.php
+ cp -n /etc/webapps/zarafa-webapp/debug.example.php /etc/webapps/zarafa-webapp/debug.php
+ chown -R http:http /var/log/zarafa-webapp
+ chown -R http:http /var/lib/zarafa-webapp
+} \ No newline at end of file
diff --git a/nginx-location.conf b/nginx-location.conf
new file mode 100644
index 000000000000..6ad85c9915d4
--- /dev/null
+++ b/nginx-location.conf
@@ -0,0 +1,42 @@
+ ###
+ ## In order to run this component you need to define a server-context in.
+ ## /etc/nginx/nginx.conf:
+ ##
+ ## http {
+ ## server {
+ ## listen 80;
+ ## include ${PATH_TO_THIS_LOCATION_FILE};
+ ## }
+ ## }
+ ##
+ ## Or include this file in your existing server-context.
+ ##
+ location /zarafa-webapp {
+ root /usr/share/webapps;
+ index index.php;
+
+ ## [WARNING] The following header states that the browser should only communicate
+ ## with your server over a secure connection for the next 24 months.
+ add_header Strict-Transport-Security max-age=63072000;
+ add_header X-Frame-Options DENY;
+ add_header X-Content-Type-Options nosniff;
+
+ # HIDDEN FILES AND FOLDERS
+ rewrite ^(.*)\/\.(.*)$ @404 break;
+
+ ## Increase this if you want to upload large attachments
+ client_max_body_size 20m;
+
+ # Pass PHP scripts to PHP-FPM
+ location ~* \.php$ {
+ if (!-f $request_filename) {
+ return 404;
+ }
+
+ fastcgi_index index.php;
+ fastcgi_pass unix:/run/php-fpm/zarafa-webapp.sock;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param SCRIPT_NAME $fastcgi_script_name;
+ }
+ } \ No newline at end of file
diff --git a/nginx-ssl.example.conf b/nginx-ssl.example.conf
new file mode 100644
index 000000000000..a37c2447634a
--- /dev/null
+++ b/nginx-ssl.example.conf
@@ -0,0 +1,56 @@
+
+ server {
+ # server_name YOUR_SERVER_FQDN; ## uncomment replace this with something like www.example.com
+ listen 443;
+
+ server_tokens off; ## Don't show the nginx version number, a security best practice
+ root /var/lib/nginx/http
+
+ ## Strong SSL Security
+ ## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html & https://cipherli.st/
+ ##
+ ## Generate a strong SSL-Certificate and DHE parameter:
+ ## openssl genrsa -out /etc/ssl/private/zarafa.key 4096
+ ## openssl req -new -sha512 -key /etc/ssl/private/zarafa.key -out /tmp/zarafa.csr
+ ## openssl x509 -req -days 3650 -in /tmp/zarafa.csr -signkey /etc/ssl/private/zarafa.key -out /etc/ssl/private/zarafa.crt
+ ## openssl dhparam -out /etc/ssl/private/zarafa.dh 4096
+ ## chmod go-rwx /etc/ssl/private/zarafa.*;
+ ## chmod u+rw /etc/ssl/private/zarafa.*
+ ## chown root:root /etc/ssl/private/zarafa.*
+ ##
+ ssl on;
+ ssl_certificate_key /etc/ssl/private/zarafa.key;
+ ssl_certificate /etc/ssl/private/zarafa.crt;
+ ssl_dhparam /etc/ssl/private/zarafa.dh;
+
+ ## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
+ ## The recommended cipher suite for backwards compatibility (IE6/WinXP):
+ ssl_ciphers 'AES256+EECDH:AES256+EDH:!aNULL';
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+ ssl_prefer_server_ciphers on;
+ ssl_session_cache shared:SSL:50m;
+ ssl_session_timeout 5m;
+
+ ## [Optional] If your certficate has OCSP, enable OCSP stapling to reduce the overhead and latency of running SSL.
+ ## Replace with your ssl_trusted_certificate. For more info see:
+ ## - https://medium.com/devops-programming/4445f4862461
+ ## - https://www.ruby-forum.com/topic/4419319
+ ## - https://www.digitalocean.com/community/tutorials/how-to-configure-ocsp-stapling-on-apache-and-nginx
+ ## - https://raymii.org/s/tutorials/OCSP_Stapling_on_nginx.html
+ ## - http://freiburg79.de/ocsp-stapling-mit-nginx/
+ # ssl_stapling on;
+ # ssl_stapling_verify on;
+ # ssl_stapling_file /etc/ssl/private/de-autorisation-m.ocsp;
+ # resolver 208.67.222.222 208.67.222.220 valid=300s; # Can change to your DNS resolver if desired
+ # resolver_timeout 5s;
+
+ # HIDDEN FILES AND FOLDERS
+ rewrite ^(.*)\/\.(.*)$ @404 break;
+
+ location = @404 {
+ return 404;
+ }
+
+ include ${PATH_TO_ATTACHED_LOCATION_FILE};
+ include ${PATH_TO_ANOTHER_LOCATION_FILE};
+ } \ No newline at end of file
diff --git a/php-fpm.example.conf b/php-fpm.example.conf
new file mode 100644
index 000000000000..9c70c26482fd
--- /dev/null
+++ b/php-fpm.example.conf
@@ -0,0 +1,3 @@
+[global]
+pid = /run/php-fpm/php-fpm.pid
+include = /etc/php/fpm.d/*.conf \ No newline at end of file
diff --git a/zarafa-webapp.conf b/zarafa-webapp.conf
new file mode 100644
index 000000000000..0fab6b4c4a31
--- /dev/null
+++ b/zarafa-webapp.conf
@@ -0,0 +1,33 @@
+[zarafa-webapp]
+listen = /run/php-fpm/zarafa-webapp.sock
+listen.owner = http
+listen.group = http
+listen.mode = 0666
+
+
+user = http
+group = http
+
+# 5 zarafa-webapp users
+pm = ondemand
+pm.max_children = 15
+pm.max_requests = 500
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
+env[HOME] = /home
+
+php_flag[short_open_tag] = on
+php_flag[register_globals] = off
+php_flag[magic_quotes_gpc] = off
+php_flag[magic_quotes_runtime] = off
+
+# The maximum POST limit. To upload large files, this value must be larger than upload_max_filesize.
+php_admin_value[upload_max_filesize] = 30M
+php_admin_value[post_max_size] = 31M
+
+php_admin_value[open_basedir] = ${open_basedir}:/usr/share/webapps/zarafa-webapp:/etc/webapps/zarafa-webapp:/var/lib/zarafa-webapp:/var/log/zarafa-webapp:/usr/share/php/mapi
+php_admin_value[date.timezone] = Europe/Berlin
diff --git a/zarafa-webapp.ini b/zarafa-webapp.ini
new file mode 100644
index 000000000000..c1c160a62184
--- /dev/null
+++ b/zarafa-webapp.ini
@@ -0,0 +1,3 @@
+extension=mapi.so
+extension=iconv.so
+extension=gettext.so