diff options
author | Thomas Sarboni | 2015-09-21 10:09:04 +0200 |
---|---|---|
committer | Thomas Sarboni | 2015-09-21 10:09:04 +0200 |
commit | 04311cb6ef22161b354c5690b58eca7d6e9f331b (patch) | |
tree | 9d4ca9965d3206a17159868a3ef791525dd6cc25 | |
download | aur-04311cb6ef22161b354c5690b58eca7d6e9f331b.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 44 | ||||
-rw-r--r-- | 5.2.5-6.0.0.mysql | 61 | ||||
-rw-r--r-- | 5.2.5-6.0.0.pgsql | 87 | ||||
-rw-r--r-- | 5.2.5-6.0.0.sqlite | 46 | ||||
-rw-r--r-- | PKGBUILD | 80 | ||||
-rw-r--r-- | bootstrap_context.php.patch | 11 | ||||
-rw-r--r-- | example_nginx_vhost.conf | 79 | ||||
-rw-r--r-- | example_nginx_vhost_ssl.conf | 93 | ||||
-rw-r--r-- | pydio.install | 60 |
9 files changed, 561 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e90b6e3e5081 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,44 @@ +pkgbase = pydio + pkgdesc = PHP file sharing platform, formerly AjaXplorer. + pkgver = 6.0.8 + pkgrel = 1 + url = http://pyd.io/ + install = pydio.install + arch = any + license = AGPL3 + depends = php>=5.3 + depends = php-mcrypt>=5.3 + depends = php-gd>=5.3 + optdepends = php-sqlite: Store your data in sqlite database + optdepends = libssh2: File management functionalities over SSH2 [access.sftp] + optdepends = smbclient: Browse a Samba Server [access.smb] + optdepends = imagemagick: View PDF and various images formats [editor.imagick] + optdepends = ghostscript: View PDF and various images formats [editor.imagick] + optdepends = subversion: Extract SVN informations from workspace + optdepends = php-libgit2-git: Keep tracks of modifications using a Git repo + optdepends = pear-http-oauth: Allows accessing a dropbox account + optdepends = php-ldap: Authentication datas are stored in an LDAP/AD directory + optdepends = pear-mail-mimedecode: Email reader wich supports eml format + optdepends = pear-http-webdavclient: Access a WebDAV server + optdepends = php-aws-sdk: Access an AWS server + optdepends = pecl-rsync: Use desktop sync client + options = !strip + source = http://sourceforge.net/projects/ajaxplorer/files/pydio/stable-channel/6.0.8/pydio-core-6.0.8.tar.gz + source = https://raw.githubusercontent.com/pydio/pydio-core/develop/dist/scripts/misc/5.2.5-6.0.0.mysql + source = https://raw.githubusercontent.com/pydio/pydio-core/develop/dist/scripts/misc/5.2.5-6.0.0.pgsql + source = https://raw.githubusercontent.com/pydio/pydio-core/develop/dist/scripts/misc/5.2.5-6.0.0.sqlite + source = bootstrap_context.php.patch + source = example_nginx_vhost.conf + source = example_nginx_vhost_ssl.conf + source = pydio.install + md5sums = e5372adc38d128a11d14cbb19be3983b + md5sums = b93ccc2869b485a3c7cd760e5435645c + md5sums = 85c19235373da52b97e0b6073ba45635 + md5sums = e3c4ea819d6790c61c9b81dc48a34e05 + md5sums = 4852094d1b423d62fee10bf5fde38b63 + md5sums = be74fee97c60b4ae7e8b194187b553ea + md5sums = 9303b6e1ea74a2fbcfc8652e78199a99 + md5sums = 837e3fc09a4fcfdc8a20c758083cfb99 + +pkgname = pydio + diff --git a/5.2.5-6.0.0.mysql b/5.2.5-6.0.0.mysql new file mode 100644 index 000000000000..66d1198f8abb --- /dev/null +++ b/5.2.5-6.0.0.mysql @@ -0,0 +1,61 @@ +ALTER TABLE ajxp_user_rights ADD INDEX (login), ADD INDEX (repo_uuid); +/* SEPARATOR */ +CREATE TABLE IF NOT EXISTS `ajxp_changes` ( + `seq` int(20) NOT NULL AUTO_INCREMENT, + `repository_identifier` TEXT NOT NULL, + `node_id` bigint(20) NOT NULL, + `type` enum('create','delete','path','content') NOT NULL, + `source` text NOT NULL, + `target` text NOT NULL, + PRIMARY KEY (`seq`), + KEY `node_id` (`node_id`,`type`) +); +/* SEPARATOR */ +CREATE TABLE IF NOT EXISTS `ajxp_index` ( + `node_id` int(20) NOT NULL AUTO_INCREMENT, + `node_path` text NOT NULL, + `bytesize` bigint(20) NOT NULL, + `md5` varchar(32) NOT NULL, + `mtime` int(11) NOT NULL, + `repository_identifier` text NOT NULL, + PRIMARY KEY (`node_id`) +); +/* SEPARATOR */ +DROP TRIGGER IF EXISTS `LOG_DELETE`; +/* SEPARATOR */ +CREATE TRIGGER `LOG_DELETE` AFTER DELETE ON `ajxp_index` +FOR EACH ROW INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) + VALUES (old.repository_identifier, old.node_id, old.node_path, 'NULL', 'delete'); +/* SEPARATOR */ +DROP TRIGGER IF EXISTS `LOG_INSERT`; +/* SEPARATOR */ +CREATE TRIGGER `LOG_INSERT` AFTER INSERT ON `ajxp_index` +FOR EACH ROW INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) + VALUES (new.repository_identifier, new.node_id, 'NULL', new.node_path, 'create'); +/* SEPARATOR */ +DROP TRIGGER IF EXISTS `LOG_UPDATE`; +/* SEPARATOR */ +CREATE TRIGGER `LOG_UPDATE` AFTER UPDATE ON `ajxp_index` +FOR EACH ROW INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) + VALUES (new.repository_identifier, new.node_id, old.node_path, new.node_path, CASE old.node_path = new.node_path WHEN true THEN 'content' ELSE 'path' END); +/* SEPARATOR */ +CREATE TABLE `ajxp_log.bak` LIKE `ajxp_log`; +/* SEPARATOR */ +INSERT `ajxp_log.bak` SELECT * FROM `ajxp_log`; +/* SEPARATOR */ +CREATE TABLE `ajxp_log2` LIKE `ajxp_log`; +/* SEPARATOR */ +INSERT `ajxp_log2` SELECT * FROM `ajxp_log`; +/* SEPARATOR */ +ALTER TABLE `ajxp_log2` ADD `source` VARCHAR( 255 ) NOT NULL AFTER `user` , ADD INDEX ( `source` ) ; +/* SEPARATOR */ +UPDATE `ajxp_log2` INNER JOIN ajxp_log ON ajxp_log2.id=ajxp_log.id SET ajxp_log2.source = ajxp_log.message, ajxp_log2.message = SUBSTRING_INDEX(SUBSTRING_INDEX(ajxp_log.params, '\t', 1), '\t', -1),ajxp_log2.params = SUBSTRING_INDEX(SUBSTRING_INDEX(ajxp_log.params, '\t', 2), '\t', -1); +/* SEPARATOR */ +DROP TABLE `ajxp_log`; +/* SEPARATOR */ +RENAME TABLE `ajxp_log2` TO `ajxp_log`; + +CREATE TABLE IF NOT EXISTS ajxp_version ( + db_build INT NOT NULL +); +INSERT INTO ajxp_version SET db_build=60;
\ No newline at end of file diff --git a/5.2.5-6.0.0.pgsql b/5.2.5-6.0.0.pgsql new file mode 100644 index 000000000000..ebeacd74dc94 --- /dev/null +++ b/5.2.5-6.0.0.pgsql @@ -0,0 +1,87 @@ +CREATE INDEX ajxp_user_rights_i ON ajxp_user_rights(repo_uuid); +/* SEPARATOR */ +CREATE INDEX ajxp_user_rights_k ON ajxp_user_rights(login); + +/* SEPARATOR */ +CREATE TYPE ajxp_change_type AS ENUM ('create','delete','path','content'); +/* SEPARATOR */ +CREATE TABLE ajxp_changes ( + seq BIGSERIAL, + repository_identifier TEXT NOT NULL, + node_id INTEGER NOT NULL, + type ajxp_change_type NOT NULL, + source text NOT NULL, + target text NOT NULL, + constraint pk primary key(seq) +); +/* SEPARATOR */ +CREATE INDEX ajxp_changes_node_id ON ajxp_changes (node_id); +/* SEPARATOR */ +CREATE INDEX ajxp_changes_repo_id ON ajxp_changes (repository_identifier); +/* SEPARATOR */ +CREATE INDEX ajxp_changes_type ON ajxp_changes (type); +/* SEPARATOR */ +CREATE TABLE ajxp_index ( + node_id BIGSERIAL , + node_path text NOT NULL, + bytesize INTEGER NOT NULL, + md5 varchar(32) NOT NULL, + mtime INTEGER NOT NULL, + repository_identifier text NOT NULL, + PRIMARY KEY (node_id) +); +/* SEPARATOR */ +CREATE INDEX ajxp_index_repo_id ON ajxp_index (repository_identifier); +/* SEPARATOR */ +CREATE INDEX ajxp_index_md5 ON ajxp_index (md5); + +/* SEPARATOR */ +CREATE TABLE ajxp_log2 AS TABLE ajxp_log; +/* SEPARATOR */ +ALTER TABLE ajxp_log2 ADD source VARCHAR( 255 ); +/* SEPARATOR */ +ALTER TABLE ajxp_log2 ADD PRIMARY KEY (id); +/* SEPARATOR */ +UPDATE ajxp_log2 SET source = ajxp_log.message, message = split_part(ajxp_log.params,'\t', 1), params = split_part(ajxp_log.params,'\t', 2) FROM ajxp_log WHERE ajxp_log2.id = ajxp_log.id; +/* SEPARATOR */ +DROP TABLE ajxp_log; +/* SEPARATOR */ +ALTER TABLE ajxp_log2 RENAME TO ajxp_log; + +CREATE FUNCTION ajxp_index_delete() RETURNS trigger AS $ajxp_index_delete$ +BEGIN + INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) + VALUES (OLD.repository_identifier, OLD.node_id, OLD.node_path, 'NULL', 'delete'); + RETURN NULL; +END; +$ajxp_index_delete$ LANGUAGE plpgsql; + +CREATE FUNCTION ajxp_index_insert() RETURNS trigger AS $ajxp_index_insert$ +BEGIN + INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) + VALUES (NEW.repository_identifier, NEW.node_id, 'NULL', NEW.node_path, 'create'); + RETURN NEW; +END; +$ajxp_index_insert$ LANGUAGE plpgsql; + +CREATE FUNCTION ajxp_index_update() RETURNS trigger AS $ajxp_index_update$ +BEGIN + IF OLD.node_path = NEW.node_path THEN + INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) + VALUES (NEW.repository_identifier, NEW.node_id, OLD.node_path, NEW.node_path, 'content'); + ELSE + INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) + VALUES (NEW.repository_identifier, NEW.node_id, OLD.node_path, NEW.node_path, 'path'); + END IF; + RETURN NEW; +END; +$ajxp_index_update$ LANGUAGE plpgsql; +CREATE TRIGGER LOG_DELETE AFTER DELETE ON ajxp_index FOR EACH ROW EXECUTE PROCEDURE ajxp_index_delete(); +CREATE TRIGGER LOG_INSERT AFTER INSERT ON ajxp_index FOR EACH ROW EXECUTE PROCEDURE ajxp_index_insert(); +CREATE TRIGGER LOG_UPDATE AFTER UPDATE ON ajxp_index FOR EACH ROW EXECUTE PROCEDURE ajxp_index_update(); + +CREATE TABLE ajxp_version ( + db_build INT NOT NULL +); + +INSERT INTO ajxp_version VALUES (60);
\ No newline at end of file diff --git a/5.2.5-6.0.0.sqlite b/5.2.5-6.0.0.sqlite new file mode 100644 index 000000000000..85109f26e564 --- /dev/null +++ b/5.2.5-6.0.0.sqlite @@ -0,0 +1,46 @@ +CREATE TABLE ajxp_changes ( + seq INTEGER PRIMARY KEY AUTOINCREMENT, + repository_identifier TEXT, + node_id NUMERIC, + type TEXT, + source TEXT, + target TEXT +); +/* SEPARATOR */ +CREATE TABLE ajxp_index ( + node_id INTEGER PRIMARY KEY AUTOINCREMENT, + repository_identifier TEXT, + node_path TEXT, + bytesize NUMERIC, + md5 TEXT, + mtime NUMERIC +); +/* SEPARATOR */ +CREATE TRIGGER LOG_DELETE AFTER DELETE ON ajxp_index +BEGIN + INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) VALUES (old.repository_identifier, old.node_id, old.node_path, "NULL", "delete"); +END; +/* SEPARATOR */ +CREATE TRIGGER LOG_INSERT AFTER INSERT ON ajxp_index +BEGIN + INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) VALUES (new.repository_identifier, new.node_id, "NULL", new.node_path, "create"); +END; +/* SEPARATOR */ +CREATE TRIGGER "LOG_UPDATE_CONTENT" AFTER UPDATE ON "ajxp_index" FOR EACH ROW WHEN old.node_path=new.node_path +BEGIN + INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) VALUES (new.repository_identifier, new.node_id, old.node_path, new.node_path, "content"); +END; +/* SEPARATOR */ +CREATE TRIGGER "LOG_UPDATE_PATH" AFTER UPDATE ON "ajxp_index" FOR EACH ROW WHEN old.node_path!=new.node_path +BEGIN + INSERT INTO ajxp_changes (repository_identifier, node_id,source,target,type) VALUES (new.repository_identifier, new.node_id, old.node_path, new.node_path, "path"); +END; + +/* SEPARATOR */ +ALTER TABLE "ajxp_log" ADD COLUMN "source" text; + +CREATE TABLE IF NOT EXISTS ajxp_version ( + db_build INT NOT NULL +); + +INSERT INTO ajxp_version VALUES (60);
\ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..89e03d4a5005 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,80 @@ +#Maintainer: max-k <max-k AT post DOT com> + +pkgname=pydio +pkgver=6.0.8 +pkgrel=1 +pkgdesc='PHP file sharing platform, formerly AjaXplorer.' +arch=('any') +url='http://pyd.io/' +license=('AGPL3') +depends=('php>=5.3' 'php-mcrypt>=5.3' 'php-gd>=5.3') +optdepends=('php-sqlite: Store your data in sqlite database' + 'libssh2: File management functionalities over SSH2 [access.sftp]' + 'smbclient: Browse a Samba Server [access.smb]' + 'imagemagick: View PDF and various images formats [editor.imagick]' + 'ghostscript: View PDF and various images formats [editor.imagick]' + 'subversion: Extract SVN informations from workspace' + 'php-libgit2-git: Keep tracks of modifications using a Git repo' + 'pear-http-oauth: Allows accessing a dropbox account' + 'php-ldap: Authentication datas are stored in an LDAP/AD directory' + 'pear-mail-mimedecode: Email reader wich supports eml format' + 'pear-http-webdavclient: Access a WebDAV server' + 'php-aws-sdk: Access an AWS server' + 'pecl-rsync: Use desktop sync client') +options=('!strip') +install="${pkgname}.install" + +_srcroot="http://sourceforge.net/projects/ajaxplorer/files" +_srcbase="${_srcroot}/${pkgname}/stable-channel" +_gitbase="https://raw.githubusercontent.com/pydio/pydio-core/develop/dist/scripts/misc" + +source=("${_srcbase}/${pkgver}/${pkgname}-core-${pkgver}.tar.gz" + "${_gitbase}/5.2.5-6.0.0.mysql" + "${_gitbase}/5.2.5-6.0.0.pgsql" + "${_gitbase}/5.2.5-6.0.0.sqlite" + "bootstrap_context.php.patch" + "example_nginx_vhost.conf" + "example_nginx_vhost_ssl.conf" + "${pkgname}.install") + +md5sums=('e5372adc38d128a11d14cbb19be3983b' + 'b93ccc2869b485a3c7cd760e5435645c' + '85c19235373da52b97e0b6073ba45635' + 'e3c4ea819d6790c61c9b81dc48a34e05' + '4852094d1b423d62fee10bf5fde38b63' + 'be74fee97c60b4ae7e8b194187b553ea' + '9303b6e1ea74a2fbcfc8652e78199a99' + '837e3fc09a4fcfdc8a20c758083cfb99') + +package() { + cd ${srcdir}/${pkgname}-core-${pkgver} + + patch -p0 -i ${srcdir}/bootstrap_context.php.patch conf/bootstrap_context.php + + local _INSTDIR="${pkgdir}/usr/share/webapps/${pkgname}" + install -d "${_INSTDIR}" + cp -r *.php core phpunit plugins "${_INSTDIR}/" + + local _CONFDIR="$pkgdir/etc/webapps/${pkgname}" + install -d "${_CONFDIR}" + cp -r conf/* "${_CONFDIR}/" + ln -s "/etc/webapps/${pkgname}" "${_INSTDIR}/conf" + + local _DATADIR="$pkgdir/var/lib/${pkgname}" + install -d "${_DATADIR}" + cp -r data/* "${_DATADIR}/" + ln -s "/var/lib/${pkgname}" "${_INSTDIR}/data" + chgrp -R 33 "${_DATADIR}" + chmod -R 770 "${_DATADIR}" + + local _DOCDIR="$pkgdir/usr/share/doc/${pkgname}" + install -d "${_DOCDIR}" + install -Dm644 ${srcdir}/example_nginx_vhost.conf "${_DOCDIR}/" + install -Dm644 ${srcdir}/example_nginx_vhost_ssl.conf "${_DOCDIR}/" + install -d "${_DOCDIR}/upgrade" + install -Dm644 ${srcdir}/5.2.5-6.0.0.mysql "${_DOCDIR}/upgrade/" + install -Dm644 ${srcdir}/5.2.5-6.0.0.pgsql "${_DOCDIR}/upgrade/" + install -Dm644 ${srcdir}/5.2.5-6.0.0.sqlite "${_DOCDIR}/upgrade/" + +} + diff --git a/bootstrap_context.php.patch b/bootstrap_context.php.patch new file mode 100644 index 000000000000..337e241a404d --- /dev/null +++ b/bootstrap_context.php.patch @@ -0,0 +1,11 @@ +--- conf/bootstrap_context.php 2013-10-14 21:17:55.000000000 +0200 ++++ conf/bootstrap_context.php.new 2013-12-15 13:57:12.202247622 +0100 +@@ -39,7 +39,7 @@ + define("AJXP_EXEC", true); + + // APPLICATION PATHES CONFIGURATION +-define("AJXP_DATA_PATH", AJXP_INSTALL_PATH."/data"); ++define("AJXP_DATA_PATH", "/var/lib/pydio"); + define("AJXP_CACHE_DIR", AJXP_DATA_PATH."/cache"); + define("AJXP_SHARED_CACHE_DIR", AJXP_INSTALL_PATH."/data/cache"); + define("AJXP_PLUGINS_CACHE_FILE", AJXP_CACHE_DIR."/plugins_cache.ser"); diff --git a/example_nginx_vhost.conf b/example_nginx_vhost.conf new file mode 100644 index 000000000000..f149c6393bfa --- /dev/null +++ b/example_nginx_vhost.conf @@ -0,0 +1,79 @@ +# Based on Grant Carthew work : http://pyd.io/nginx/ +# And also and vovan work here : https://pyd.io/f/topic/nginx-configuration-for-pydio-6-beta/ +# And now reworked for Pydio 6.x based on Pydio wiki + +server { + listen 80; + server_name pydio.local; + + root /usr/share/webapps/pydio; + index index.php; + + access_log /var/log/nginx/pydio6.access.log; + error_log /var/log/nginx/pydio6.error.log; + + client_max_body_size 20G; + client_body_buffer_size 128k; + + location ^~ (/dashboard|/settings|/welcome|/ws-) { + try_files /index.php =404; + } + + location ^~ /shares { + try_files /dav.php =404; + } + location ^~ /api { + try_files /rest.php =404; + } + location ^~ /user { + try_files ./index.php?get_action=user_access_point =404; + } + + location ~ ^/data/public/([a-zA-Z0-9_-]+)\.php$ { + try_files /data/public/share.php?hash=$1 =404; + } + + location ^~ ^/data/public/([a-zA-Z0-9_-]+)--([a-z]+)$ { + try_files /data/public/share.php?hash=$1&lang=$2 =404; + } + + location ^~ ^/data/public/([a-zA-Z0-9_-]+)$ { + try_files /data/public/share.php?hash=$1&lang=$2 =404; + } + + # Prevent Clickjacking + add_header X-Frame-Options "SAMEORIGIN"; + + # Do not accept DELETE, SEARCH and other methods + if ( $request_method !~ ^(GET|HEAD|POST|PROPFIND|OPTIONS)$ ) { + return 444; + } + + # Drop unauthorized access + location ~* ^/(?:\.|conf|data/(?:files|personal|logs|plugins|tmp|cache)|plugins/editor.zoho/agent/files) { + deny all; + } + location = /robots.txt { access_log off; log_not_found off; } + location = /favicon.ico { access_log off; log_not_found off; } + + # Enables PHP + location ~ \.php { + # for ^/(index|plugins) request_uri should be changed + set $request_url $request_uri; + if ( $uri ~ ^/(index|plugins) ) { + set $request_url /; + } + fastcgi_param PHP_ADMIN_VALUE "open_basedir=/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/var/lib/pydio/"; + fastcgi_param SCRIPT_FILENAME $request_filename; + include /etc/nginx/fastcgi_params; + fastcgi_pass unix:/run/php-fpm/php-fpm.sock; + } + + # Enables Caching + location ~* \.(ico|css|js)$ { + expires 7d; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + } +} + diff --git a/example_nginx_vhost_ssl.conf b/example_nginx_vhost_ssl.conf new file mode 100644 index 000000000000..a1aa0e87a166 --- /dev/null +++ b/example_nginx_vhost_ssl.conf @@ -0,0 +1,93 @@ +# Based on Grant Carthew work : http://pyd.io/nginx/ +# And also and vovan work here : https://pyd.io/f/topic/nginx-configuration-for-pydio-6-beta/ +# And now reworked for Pydio 6.x based on Pydio wiki +server { + listen 80; + server_name pydio.local; + rewrite ^ https://$server_name$request_uri? permanent; +} + +server { + listen 443 ssl; + server_name pydio.local; + + root /usr/share/webapps/pydio; + index index.php; + + access_log /var/log/nginx/pydio6.access.log; + error_log /var/log/nginx/pydio6.error.log; + + client_max_body_size 20G; + client_body_buffer_size 128k; + + ssl_certificate /etc/ssl/pydio.local.pem; + ssl_certificate_key /etc/ssl/pydio.local_key.pem; + ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers RC4:HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + keepalive_timeout 70; + ssl_session_cache shared:SSL:10m; + ssl_session_timeout 10m + + location ^~ (/dashboard|/settings|/welcome|/ws-) { + try_files /index.php =404; + } + + location ^~ /shares { + try_files /dav.php =404; + } + location ^~ /api { + try_files /rest.php =404; + } + location ^~ /user { + try_files ./index.php?get_action=user_access_point =404; + } + + location ~ ^/data/public/([a-zA-Z0-9_-]+)\.php$ { + try_files /data/public/share.php?hash=$1 =404; + } + + location ^~ ^/data/public/([a-zA-Z0-9_-]+)--([a-z]+)$ { + try_files /data/public/share.php?hash=$1&lang=$2 =404; + } + + location ^~ ^/data/public/([a-zA-Z0-9_-]+)$ { + try_files /data/public/share.php?hash=$1&lang=$2 =404; + } + + # Prevent Clickjacking + add_header X-Frame-Options "SAMEORIGIN"; + + # Do not accept DELETE, SEARCH and other methods + if ( $request_method !~ ^(GET|HEAD|POST|PROPFIND|OPTIONS)$ ) { + return 444; + } + + # Drop unauthorized access + location ~* ^/(?:\.|conf|data/(?:files|personal|logs|plugins|tmp|cache)|plugins/editor.zoho/agent/files) { + deny all; + } + location = /robots.txt { access_log off; log_not_found off; } + location = /favicon.ico { access_log off; log_not_found off; } + + # Enables PHP + location ~ \.php { + # for ^/(index|plugins) request_uri should be changed + set $request_url $request_uri; + if ( $uri ~ ^/(index|plugins) ) { + set $request_url /; + } + fastcgi_param PHP_ADMIN_VALUE "open_basedir=/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/var/lib/pydio/"; + fastcgi_param SCRIPT_FILENAME $request_filename; + include /etc/nginx/fastcgi_params; + fastcgi_pass unix:/run/php-fpm/php-fpm.sock; + } + + # Enables Caching + location ~* \.(ico|css|js)$ { + expires 7d; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + } +} + diff --git a/pydio.install b/pydio.install new file mode 100644 index 000000000000..ee32ae82dc7b --- /dev/null +++ b/pydio.install @@ -0,0 +1,60 @@ +post_install() { + echo + echo "Example vhosts for nginx are located in :" + echo " /usr/share/doc/pydio/" + echo + echo "Please set these parameters in php.ini :" + echo " file_uploads = On" + echo " post_max_size = 20G" + echo " upload_max_filesize = 20G" + echo " max_file_uploads = 20000" + echo " extension=gd.so" + echo " extension=curl.so" + echo " extension=exif.so" + echo " extension=iconv.so" + echo " extension=mcrypt.so" + echo + echo "It's advised to disable output buffering to increase performances :" + echo " output_buffering = Off" + echo + echo "To use background tasks, also add /var/lib/pydio to open_basedir :" + echo " open_basedir = /srv/http/:[...]:/var/lib/pydio/" + echo +} + +pre_upgrade() { + if [ $(vercmp $2 6.0.0) -lt 0 ]; then + echo + echo "Be carefull. Don't upgrade if you use files to store your config." + echo + echo "First, change your configuration to use SQL configuration storage." + echo + fi +} + +post_upgrade() { + if [ $(vercmp $2 6.0.0) -lt 0 ]; then + echo + echo "Don't forget to to upgrade your database using scripts provided" + echo "in /usr/share/doc/pydio/upgrade." + echo + echo "Also, please shutdown your webserver and run the following commands :" + echo + echo "# rm -rf /var/lib/pydio/cache/*.ser" + echo "# rm -rf /var/lib/pydio/cache/i18n/*.ser" + echo "# rm -rf /usr/share/webapps/pydio/plugins/downloader.http" + echo "# rm -rf /usr/share/webapps/pydio/plugins/auth.cas" + echo + echo "If you use nginx, you need to upgrade your vhost using the" + echo "examples provided in /usr/share/doc/pydio/" + echo + echo "If you use apache, you need to place new .htaccess files following" + echo "instructions here :" + echo "https://pyd.io/upgrade-pydio-5-2-5-to-6-0-0/#Modify_htaccess" + echo + echo "If you have problems after upgrade, please go to :" + echo "https://pyd.io/f/topic/troubleshooting-upgrade-to-v6/" + echo + fi +} + |