Compare commits

...

4 Commits
sme9 ... master

Author SHA1 Message Date
Daniel Berteaud 468792e48e Spec file update 8 years ago
Daniel Berteaud b8c748a281 Update Pydio session path 8 years ago
Daniel Berteaud d86b691fe1 escapeshellargs and shell_exec are needed for Pydio 8 years ago
Daniel Berteaud 2b37f09ca2 Switch to php56 using FPM+FastCGI 8 years ago
  1. 2
      root/etc/cron.daily/pydio-indexer
  2. 2
      root/etc/e-smith/events/actions/pydio-user-rights
  3. 9
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/68FastCGIConfig25Pydio
  4. 49
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98Pydio
  5. 55
      root/etc/e-smith/templates/etc/php-fpm.d/www.conf/25Pydio
  6. 4
      root/etc/e-smith/templates/var/lib/pydio/plugins/conf.serial/plugins_configs.ser/10All
  7. 19
      smeserver-pydio.spec

@ -31,7 +31,7 @@ foreach my $share ($a->get_all_by_prop(type => 'share')){
unlink </var/cache/pydio/indexes/.ajxp_lock-$name>
if (time() - $mtime > 18000);
}
system('/usr/bin/sudo -u www /usr/bin/php -d max_execution_time=3600 /usr/share/pydio/cmd.php ' .
system('/usr/bin/sudo -u www /usr/bin/php__PHP_VERSION__ -d max_execution_time=3600 /usr/share/pydio/cmd.php ' .
'-u=RDiin175M40T0cYvXLARpAi+1TsSVkbksEDZ4KvwBuY= '.
'-t=e71479ebc4365176d9f09fe957780024 -a=index '.
'-r='.$name.' --secure_token='.$id.' --dir=/ --_method=put >/dev/null 2>&1');

@ -32,7 +32,7 @@ my $a = esmith::AccountsDB->open_ro;
my $domain = $c->get('DomainName')->value;
# Remove active sessions
unlink(</var/lib/pydio/tmp/sess_*>);
unlink(</var/lib/php/pydio/session/sess_*>);
# Remove plugin cache
unlink(</var/cache/pydio/plugin*.ser>);

@ -0,0 +1,9 @@
{
if ($fastcgi_mod eq 'mod_fastcgi'){
$OUT .=<<_EOF;
Action phppydio-fastcgi /php-cgi-bin/phppydio-wrapper
Alias /php-cgi-bin/phppydio-wrapper /var/www/php-cgi-bin/phppydio-wrapper
FastCgiExternalServer /var/www/php-cgi-bin/phppydio-wrapper -socket /var/run/php-fpm/php__PHP_VERSION__-pydio.sock -pass-header Authorization -idle-timeout 120
_EOF
}
}

@ -10,10 +10,44 @@ if (($pydio{'status'} || 'disabled') eq 'enabled'){
" AuthBasicProvider external\n" .
" AuthExternal pwauth\n" .
" Require valid-user\n" : '';
my $maxsize = $pydio{'MaxUploadSize'} || '200M';
my $maxsize = $pydio{'MaxUploadSize'} || '2048M';
my $homedir = $pydio{'HomeDir'} || 'none';
$homedir = (($homedir eq 'enabled') || ($homedir eq 'users')) ? ":/home/e-smith/files/users":"";
my $php =<<_EOF;
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/pydio:/var/lib/pydio:/var/log/pydio:/etc/pydio:/var/cache/pydio:/usr/share/pear/:/usr/share/php/:/home/e-smith/files/shares$homedir
php_admin_value memory_limit 100M
php_admin_value upload_max_filesize $maxsize
php_admin_value post_max_size $maxsize
php_admin_value max_execution_time 900
php_admin_value upload_tmp_dir /var/lib/pydio/tmp
php_admin_value session.save_path /var/lib/pydio/tmp
php_admin_flag output_buffering off
_EOF
my $pubphp=<<_EOF;
AddType application/x-httpd-php .php
_EOF
if ($fastcgi_mod eq 'mod_fastcgi'){
$php = "AddHandler phppydio-fastcgi .php\n";
$pubphp = $php;
}
elsif ($fastcgi_mod eq 'mod_proxy_fcgi'){
$php =<<_EOF;
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php-fpm/php__PHP_VERSION__-pydio.sock|fcgi://localhost"
</FilesMatch>
_EOF
$pubphp = $php;
}
my $shares = '';
my $public = $pydio{'PublicShares'} || 'enabled';
@ -22,8 +56,7 @@ if (($pydio{'status'} || 'disabled') eq 'enabled'){
Alias /ajxppub /var/lib/pydio/public
<Directory /var/lib/pydio/public>
Options None
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/pydio:/var/lib/pydio:/var/log/pydio:/etc/pydio:/var/cache/pydio:/usr/share/pear/:/usr/share/php/:/home/e-smith/files/shares$homedir
$pubphp
Order deny,allow
Allow from all
<Files ".ajxp_*">
@ -44,16 +77,8 @@ EOF
$alias
<Directory /usr/share/pydio>
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/pydio:/var/lib/pydio:/var/log/pydio:/etc/pydio:/var/cache/pydio:/usr/share/pear/:/usr/share/php/:/home/e-smith/files/shares$homedir
php_admin_value memory_limit 100M
php_admin_value upload_max_filesize $maxsize
php_admin_value post_max_size $maxsize
php_admin_value max_execution_time 900
php_admin_value upload_tmp_dir /var/lib/pydio/tmp
php_admin_value session.save_path /var/lib/pydio/tmp
php_admin_flag output_buffering off
SSLRequireSSL on
$php
Order deny,allow
Deny from all
Allow from $allow

@ -0,0 +1,55 @@
{
if ($PHP_VERSION eq '__PHP_VERSION__'){
if (($dl{'status'} || 'disabled') eq 'enabled'){
my $max_upload_size = $pydio{MaxUploadSize} || '4096';
$max_upload_size .= 'M' unless ($max_upload_size =~ m/[MG]$/);
my $id = 'pydio';
my $homedir = $pydio{'HomeDir'} || 'none';
$homedir = (($homedir eq 'enabled') || ($homedir eq 'users')) ? ':/home/e-smith/files/users':'';
$OUT .=<<_EOF;
[php$PHP_VERSION-$id]
user = www
group = www
listen.owner = root
listen.group = www
listen.mode = 0660
listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock
pm = dynamic
pm.max_children = 15
pm.start_servers = 3
pm.min_spare_servers = 3
pm.max_spare_servers = 4
pm.max_requests = 1000
php_admin_value[session.save_path] = /var/lib/php/$id/session
php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache
php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp
php_admin_value[error_log] = /var/log/php/$id/error.log
slowlog = /var/log/php/dl/slow.log
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
php_admin_flag[display_errors] = off
php_admin_flag[log_errors] = on
php_admin_value[error_log] = syslog
php_admin_value[memory_limit] = 128M
php_admin_value[max_execution_time] = 0
php_admin_value[post_max_size] = $max_upload_size
php_admin_value[upload_max_filesize] = $max_upload_size
php_admin_value[disable_functions] = system, show_source, symlink, dl, passthru, phpinfo, escapeshellcmd
php_admin_value[open_basedir] = /usr/share/pydio:/var/lib/pydio:/var/log/pydio:/etc/pydio:/var/cache/pydio:/usr/share/pear/:/usr/share/php/:/home/e-smith/files/shares$homedir
php_admin_flag[allow_url_fopen] = off
php_admin_flag[file_upload] = on
php_admin_flag[session.cookie_httponly] = on
php_admin_flag[allow_url_include] = off
php_admin_value[session.save_handler] = files
php_admin_value[output_buffering] = off
_EOF
}
else{
$OUT .= '; Pydio is disabled';
}
}
}

@ -16,7 +16,7 @@ $data->{'core.ajaxplorer'}->{'AJXP_TMP_DIR'} ||= '/var/lib/pydio/tmp';
$data->{'core.ajaxplorer'}->{'DEFAULT_LANGUAGE'} ||= $pydio{'DefaultLanguage'} || 'en';
$data->{'core.ajaxplorer'}->{'APPLICATION_TITLE'} ||= $pydio{'Title'} || 'Pydio';
$data->{'core.ajaxplorer'}->{'CMDLINE_ACTIVE'} ||= '__true__';
$data->{'core.ajaxplorer'}->{'CLI_PHP'} ||= '/usr/bin/php';
$data->{'core.ajaxplorer'}->{'CLI_PHP'} ||= '/usr/bin/php__PHP_VERSION__';
if (($pydio{'PublicShares'} || 'enabled') eq 'enabled'){
$data->{'core.ajaxplorer'}->{'PUBLIC_DOWNLOAD_FOLDER'} ||= '/var/lib/pydio/public';
@ -78,4 +78,4 @@ $data = serialize($data);
# manually
$data =~ s/s:8:"__true__";/b:1;/g;
$OUT = $data;
}
}

@ -2,8 +2,9 @@
# Name: Daniel Berteaud
%define name smeserver-pydio
%define version 0.2.11
%define version 0.3.0
%define release 1
%define phpversion 56
Summary: SME server integration of pydio
Name: %{name}
Version: %{version}
@ -26,9 +27,9 @@ Requires: perl(File::Path)
Requires: perl(JSON)
Requires: ghostscript
Requires: poppler-utils
Requires: php-pecl(xattr)
Requires: php-pear(VersionControl_Git)
Requires: git
Requires: php%{phpversion}-php-pecl-xattr
#Requires: mod_xsendfile
Obsoletes: smeserver-ajaxplorer
@ -40,6 +41,10 @@ Pydio is a rich-client browser for managing files on a web server
This contrib works with the smeserver-shared-folders addon
%changelog
* Tue Jul 18 2017 Daniel Berteaud <daniel@firewall-services.com> 0.3.0-1
- Switch to php56 using FPM+FastCGI
- Set default max upload size to 2048M
* Tue May 23 2017 Daniel Berteaud <daniel@firewall-services.com> 0.2.11-1
- Add /usr/share/php in open_basedir
@ -177,6 +182,9 @@ This contrib works with the smeserver-shared-folders addon
%build
perl ./createlinks
find root/ -type f | xargs grep -l __PHP_VERSION__ | xargs sed -i -e "s/__PHP_VERSION__/%{phpversion}/g"
%{__mkdir_p} root/var/log/php/pydio
%{__mkdir_p} root/var/lib/php/pydio/{tmp,opcache,session}
%install
rm -rf $RPM_BUILD_ROOT
@ -186,7 +194,12 @@ rm -f %{name}-%{version}-filelist
--file /etc/cron.daily/pydio-tmpwatch 'attr(0755,root,root)' \
--file /etc/cron.daily/pydio-indexer 'attr(0700,root,root)' \
--file /usr/bin/pydiopdftotext 'attr(0755,root,root)' \
> %{name}-%{version}-filelist
--dir /var/log/php/pydio 'attr(0770,root,www)' \
--dir /var/lib/php/pydio 'attr(0770,root,www)' \
--dir /var/lib/php/pydio/tmp 'attr(0770,root,www)' \
--dir /var/lib/php/pydio/opcache 'attr(0770,root,www)' \
--dir /var/lib/php/pydio/session 'attr(0770,root,www)' \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)

Loading…
Cancel
Save