Compare commits

...

10 Commits

Author SHA1 Message Date
Daniel Berteaud bc1bafac87 Automatic commit of package [smeserver-dokuwiki] release [0.2.2-1].
Created by command:

/usr/bin/tito tag
2018-01-22 12:15:44 +01:00
Daniel Berteaud a8f0dffe0e Fix permissions on plugin dir 2018-01-22 12:15:31 +01:00
Daniel Berteaud 86fdefbde6 Automatic commit of package [smeserver-dokuwiki] release [0.2.1-1].
Created by command:

/usr/bin/tito tag
2017-11-19 11:08:55 +01:00
Daniel Berteaud 2eac50ae7c Prepare spec file for tito 2017-11-19 11:08:43 +01:00
Daniel Berteaud 31e24819fd Configure tito 2017-11-19 11:08:07 +01:00
Daniel Berteaud 56a73d9c17 Initialized to use tito. 2017-11-19 11:07:27 +01:00
Daniel Berteaud 6c42871330 Spec file update 2017-07-26 17:52:15 +02:00
Daniel Berteaud 70018ad822 Spacing issues 2017-07-18 11:21:04 +02:00
Daniel Berteaud 643b19194d Dont put PHP version in the code
Instead, replace it at build time so it's easy to change
2017-07-18 10:08:14 +02:00
Daniel Berteaud d4a869809e Switch to php71 using fastcgi/fpm if available 2017-07-17 14:14:55 +02:00
10 changed files with 126 additions and 18 deletions

3
.tito/packages/.readme Normal file
View File

@ -0,0 +1,3 @@
the .tito/packages directory contains metadata files
named after their packages. Each file has the latest tagged
version and the project's relative directory.

View File

@ -0,0 +1 @@
0.2.2-1 ./

1
.tito/releasers.conf Symbolic link
View File

@ -0,0 +1 @@
../../tito_libs/releasers.conf

6
.tito/tito.props Normal file
View File

@ -0,0 +1,6 @@
[buildconfig]
builder = tito.builder.Builder
tagger = tito.tagger.VersionTagger
changelog_do_not_remove_cherrypick = 0
changelog_format = %s (%ae)
lib_dir = ../tito_libs

View File

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

View File

@ -11,6 +11,28 @@ if (($dokuwiki{'status'} || 'disabled') eq 'enabled'){
'SSLRequireSSL on':'# SSL is not encforced';
my $maxsize = $dokuwiki{'MaxUploadSize'} || '200';
$maxsize .= 'M' unless ($maxsize =~ m/M$/);
my $php =<<_EOF;
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/dokuwiki:/var/lib/dokuwiki:/etc/dokuwiki:/dev/urandom
php_admin_value memory_limit 128M
php_admin_value upload_max_filesize $maxsize
php_admin_value post_max_size $maxsize
php_admin_value upload_tmp_dir /var/lib/dokuwiki/data/tmp
php_admin_value session.save_path /var/lib/dokuwiki/data/tmp
_EOF
if ($fastcgi_mod eq 'mod_fastcgi'){
$php = "AddHandler phpdokuwiki-fastcgi .php\n";
}
elsif ($fastcgi_mod eq 'mod_proxy_fcgi'){
$php =<<_EOF;
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php-fpm/php__PHP_VERSION__-dokuwiki.sock|fcgi://localhost"
</FilesMatch>
_EOF
}
$OUT .=<<"EOF";
@ -19,17 +41,11 @@ $alias
<Directory /usr/share/dokuwiki>
AllowOverride None
Options +FollowSymlinks
AddType application/x-httpd-php .php
Order Allow,Deny
Allow from $allow
$ssl
$auth
php_admin_value open_basedir /usr/share/dokuwiki:/var/lib/dokuwiki:/etc/dokuwiki:/dev/urandom
php_admin_value memory_limit 128M
php_admin_value upload_max_filesize $maxsize
php_admin_value post_max_size $maxsize
php_admin_value upload_tmp_dir /var/lib/dokuwiki/data/tmp
php_admin_value session.save_path /var/lib/dokuwiki/data/tmp
$php
</Directory>
<Directory /usr/share/dokuwiki/inc>

View File

@ -0,0 +1,50 @@
{
if ($PHP_VERSION eq '__PHP_VERSION__'){
if (($dokuwiki{'status'} || 'disabled') eq 'enabled'){
my $max_upload_size = ($dokuwiki{MaxUploadSize} || '20') . 'M';
my $id = 'dokuwiki';
$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] = 60
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, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd
php_admin_value[open_basedir] = /usr/share/dokuwiki:/var/lib/dokuwiki:/etc/dokuwiki:/dev/urandom
php_admin_flag[allow_url_fopen] = on
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
_EOF
}
else{
$OUT .= '; Dl is disabled';
}
}
}

View File

@ -47,8 +47,16 @@ class auth_plugin_authhttpldap extends auth_plugin_authldap {
function trustExternal($user,$pass,$sticky=false){
global $USERINFO;
$success = false;
if (!isset($_SERVER['REMOTE_USER'])) return false;
$username = $_SERVER['REMOTE_USER'];
if (isset($_SERVER['REMOTE_USER'])){
$username = $_SERVER['REMOTE_USER'];
}
elseif (isset($_SERVER['REDIRECT_REMOTE_USER'])){
$username = $_SERVER['REDIRECT_REMOTE_USER'];
$_SERVER['REMOTE_USER'] = $username;
}
else{
return false;
}
$this->_debug('LemonLDAP::NG Login Name: '.htmlspecialchars($username),0,__LINE__,__FILE__);
if (!empty($username)){
$USERINFO = $this->getUserData($username,true);

View File

@ -1,7 +1,7 @@
base authhttpldap
author Daniel Berteaud
email daniel@firewall-services.com
date 2014-05-06
date 2017-07-17
name HTTP+LDAP auth plugin
desc This plugin uses a basic HTTP authentication, but LDAP to get info and authorization
url https://www.firewall-services.com

View File

@ -1,13 +1,9 @@
# Authority: vip-ire
# Name: Daniel Berteaud
%define phpversion 71
%define name smeserver-dokuwiki
%define version 0.1.7
%define release 1
Summary: sme server integration of dokuwiki
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Name: smeserver-dokuwiki
Version: 0.2.2
Release: 1%{?dist}
License: GNU GPL
URL: http://www.splitbrain.org/projects/dokuwiki
Group: SMEserver/addon
@ -26,6 +22,15 @@ smserver integration of dokuwiki
DokuWiki is a simple to use Wiki aimed at the documentation needs of a small company
%changelog
* Mon Jan 22 2018 Daniel Berteaud <daniel@firewall-services.com> 0.2.2-1
- Fix permissions on plugin dir (daniel@firewall-services.com)
* Sun Nov 19 2017 Daniel Berteaud <daniel@firewall-services.com> 0.2.1-1
- new package built with tito
* Fri Jul 14 2017 Daniel Berteaud <daniel@firewall-services.com> 0.2.0-1
- Switch to php 71 using FastCGI and FPM is available
* Wed Mar 15 2017 Daniel Berteaud <daniel@firewall-services.com> 0.1.7-1
- Add /dev/urandom to open_basedir, needed since 2017-02-19
@ -61,12 +66,21 @@ DokuWiki is a simple to use Wiki aimed at the documentation needs of a small com
%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/dokuwiki
%{__mkdir_p} root/var/lib/php/dokuwiki/{tmp,session,opcache}
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--dir /var/log/php/dokuwiki 'attr(0770,root,www)' \
--dir /var/lib/php/dokuwiki 'attr(0770,root,www)' \
--dir /var/lib/php/dokuwiki/tmp 'attr(0770,root,www)' \
--dir /var/lib/php/dokuwiki/opcache 'attr(0770,root,www)' \
--dir /var/lib/php/dokuwiki/session 'attr(0770,root,www)' \
--dir /usr/share/dokuwiki/lib/plugins 'attr(0755,www,www)' \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist