Merge remote-tracking branch 'origin/master'

This commit is contained in:
Andrew Ruthven 2021-02-04 22:09:18 +13:00
commit b00fc5d5e6
31 changed files with 189 additions and 57 deletions

View File

@ -1,11 +1,15 @@
image: php:apache-buster
stages:
- build
- test
- testall
build:
stage: build
image: debian:unstable
script:
- apt-get -y update
- bash -c 'mkdir -p /usr/share/man/man{0..10}'
- apt-get -y install build-essential devscripts fakeroot dh-exec jdupes rst2pdf doxygen graphviz # todo build-dep instead, change this task's image to plain debian
- apt-get -y install build-essential devscripts fakeroot dh-exec jdupes doxygen graphviz php-cli
- mv debian/changelog debian/changelog.old
- >
cat
@ -26,6 +30,128 @@ build:
test:
stage: test
image: debian:unstable
artifacts:
paths:
- testing/report.xml
- apache2_log/*
reports:
junit: testing/report.xml
when:
always
script:
- apt-get -y update
- bash -c 'mkdir -p /usr/share/man/man{0..10}'
- apt-get -y install locales
- echo "en_NZ.UTF-8 UTF-8" >> /etc/locale.gen
- locale-gen
- echo "LANG=en_NZ.UTF-8" > /etc/default/locale
- apt-get -y install libdbd-pg-perl libyaml-perl php php-cli php-pgsql php-xml postgresql-client postgresql libapache2-mod-php curl xmlstarlet
- curl 'https://gitlab.com/davical-project/awl/-/archive/master/awl-master.tar.gz' | tar zxf -
- mv awl-master /usr/share/awl/
- chown -R www-data /usr/share/awl/
- dpkg --ignore-depends=libawl-php -i *.deb
- echo '127.0.1.1 regression mycaldav myempty' >> /etc/hosts
- rm /etc/apache2/ports.conf /etc/apache2/sites-enabled/000-default.conf && touch /etc/apache2/ports.conf
- cp testing/apache-site.conf.example /etc/apache2/sites-enabled/davical-regression.conf
- sed -i 's/\/path\/to/\/usr\/share/g' /etc/apache2/sites-enabled/davical-regression.conf
- mkdir /usr/share/davical/testing/
- cp testing/*.php /usr/share/davical/testing/
- rm /etc/davical/config.php
- cp testing/regression-conf.php.example /etc/davical/regression-conf.php
- ln -s /etc/davical/regression-conf.php /etc/davical/mycaldav-conf.php
- ln -s /etc/davical/regression-conf.php /etc/davical/myempty-conf.php
- sed -i '/peer/d' /etc/postgresql/13/main/pg_hba.conf
- echo 'local all all trust' >> /etc/postgresql/13/main/pg_hba.conf
- pg_ctlcluster 13 main start
- su postgres -c 'createuser davical_dba --createdb --createrole --superuser'
- su postgres -c 'createuser davical_app --superuser'
- su postgres -c 'createuser testrunner --superuser'
- pg_ctlcluster 13 main restart
- a2enmod rewrite
- apache2ctl start
- useradd testrunner
- cd testing && su testrunner -c 'IS_CI=yes ALLSUITES="regression-suite binding carddav scheduling" ./run_regressions.sh all x'
after_script:
- cp -r /var/log/apache2 apache2_log
test_bullseye:
stage: testall
image: debian:bullseye
artifacts:
paths:
- testing/report.xml
- apache2_log/*
reports:
junit: testing/report.xml
when:
always
script:
- apt-get -y update
- bash -c 'mkdir -p /usr/share/man/man{0..10}'
- apt-get -y install locales
- echo "en_NZ.UTF-8 UTF-8" >> /etc/locale.gen
- locale-gen
- echo "LANG=en_NZ.UTF-8" > /etc/default/locale
- apt-get -y install libdbd-pg-perl libyaml-perl php php-cli php-pgsql php-xml postgresql-client postgresql libapache2-mod-php curl xmlstarlet
- curl 'https://gitlab.com/davical-project/awl/-/archive/master/awl-master.tar.gz' | tar zxf -
- mv awl-master /usr/share/awl/
- chown -R www-data /usr/share/awl/
- dpkg --ignore-depends=libawl-php -i *.deb
- echo '127.0.1.1 regression mycaldav myempty' >> /etc/hosts
- rm /etc/apache2/ports.conf /etc/apache2/sites-enabled/000-default.conf && touch /etc/apache2/ports.conf
- cp testing/apache-site.conf.example /etc/apache2/sites-enabled/davical-regression.conf
- sed -i 's/\/path\/to/\/usr\/share/g' /etc/apache2/sites-enabled/davical-regression.conf
- mkdir /usr/share/davical/testing/
- cp testing/*.php /usr/share/davical/testing/
- rm /etc/davical/config.php
- cp testing/regression-conf.php.example /etc/davical/regression-conf.php
- ln -s /etc/davical/regression-conf.php /etc/davical/mycaldav-conf.php
- ln -s /etc/davical/regression-conf.php /etc/davical/myempty-conf.php
- sed -i '/peer/d' /etc/postgresql/13/main/pg_hba.conf
- echo 'local all all trust' >> /etc/postgresql/13/main/pg_hba.conf
- pg_ctlcluster 13 main start
- su postgres -c 'createuser davical_dba --createdb --createrole --superuser'
- su postgres -c 'createuser davical_app --superuser'
- su postgres -c 'createuser testrunner --superuser'
- pg_ctlcluster 13 main restart
- a2enmod rewrite
- apache2ctl start
- useradd testrunner
- cd testing && su testrunner -c 'IS_CI=yes ALLSUITES="regression-suite binding carddav scheduling" ./run_regressions.sh all x'
after_script:
- cp -r /var/log/apache2 apache2_log
build_buster_latestphp:
stage: testall
image: php:apache-buster
script:
- apt-get -y update
- bash -c 'mkdir -p /usr/share/man/man{0..10}'
- apt-get -y install build-essential devscripts fakeroot dh-exec jdupes doxygen graphviz
- mv debian/changelog debian/changelog.old
- >
cat
<(echo "davical ($(cat VERSION)-99~git$(date +"%Y%m%d")-$(git rev-parse --short $CI_COMMIT_SHA)) unstable; urgency=medium")
<(echo "")
<(echo " * Build on CI")
<(echo "")
<(echo " -- ${GITLAB_USER_NAME} <${GITLAB_USER_EMAIL}> $(date -R)")
<(echo "")
debian/changelog.old
>debian/changelog
- rm debian/changelog.old
- debuild --prepend-path=/usr/local/bin -us -uc -b -d
- 'mv ../davical_*_all.deb ./davical.deb'
artifacts:
paths:
- '*.deb'
test_buster:
stage: testall
image: php:apache-buster
artifacts:
paths:
- testing/report.xml
@ -72,3 +198,53 @@ test:
- cd testing && su testrunner -c 'IS_CI=yes ALLSUITES="regression-suite binding carddav scheduling" ./run_regressions.sh all x'
after_script:
- cp -r /var/log/apache2 apache2_log
test_stretch:
stage: testall
image: php:apache-stretch
artifacts:
paths:
- testing/report.xml
- apache2_log/*
reports:
junit: testing/report.xml
when:
always
script:
- apt-get -y update
- bash -c 'mkdir -p /usr/share/man/man{0..10}'
- apt-get -y install locales
- echo "en_NZ.UTF-8 UTF-8" >> /etc/locale.gen
- locale-gen
- echo "LANG=en_NZ.UTF-8" > /etc/default/locale
- apt-get -y install libdbd-pg-perl libyaml-perl perl postgresql postgresql-client libpq-dev xmlstarlet
- curl 'https://gitlab.com/davical-project/awl/-/archive/master/awl-master.tar.gz' | tar zxf -
- mv awl-master /usr/share/awl/
- chown -R www-data /usr/share/awl/
- dpkg --ignore-depends=php,php-pgsql,php-xml,libawl-php,php-cli -i *.deb
- docker-php-ext-install -j$(nproc) pgsql
- docker-php-ext-install -j$(nproc) pdo_pgsql
- docker-php-ext-install -j$(nproc) calendar
- echo '127.0.1.1 regression mycaldav myempty' >> /etc/hosts
- cp testing/apache-site.conf.example /etc/apache2/sites-enabled/davical-regression.conf
- sed -i 's/\/path\/to/\/usr\/share/g' /etc/apache2/sites-enabled/davical-regression.conf
- mkdir /usr/share/davical/testing/
- cp testing/*.php /usr/share/davical/testing/
- rm /etc/davical/config.php
- cp testing/regression-conf.php.example /etc/davical/regression-conf.php
- ln -s /etc/davical/regression-conf.php /etc/davical/mycaldav-conf.php
- ln -s /etc/davical/regression-conf.php /etc/davical/myempty-conf.php
- sed -i '/peer/d' /etc/postgresql/9.6/main/pg_hba.conf
- echo 'local all all trust' >> /etc/postgresql/9.6/main/pg_hba.conf
- pg_ctlcluster 9.6 main start
- su postgres -c 'createuser davical_dba --createdb --createrole --superuser'
- su postgres -c 'createuser davical_app --superuser'
- su postgres -c 'createuser testrunner --superuser'
- pg_ctlcluster 9.6 main restart
- a2enmod rewrite
- apache2ctl start
- useradd testrunner
- cd testing && su testrunner -c 'IS_CI=yes ALLSUITES="regression-suite binding carddav scheduling" ./run_regressions.sh all x'
after_script:
- cp -r /var/log/apache2 apache2_log

View File

@ -13,7 +13,7 @@ function log_setup_error($errno , $errstr , $errfile , $errline) {
error_log('DAViCal setup.php: Informational: '.$errfile.'('.$errline.'): ['.$errno.'] '.$errstr);
}
function catch_setup_errors($errno , $errstr , $errfile , $errline , $errcontext ) {
function catch_setup_errors($errno , $errstr , $errfile , $errline , $errcontext = null ) {
if ( $errno == 2 ) {
// A working installation will regularly fail to include_once() for several files as it searches for the location
log_setup_error($errno , $errstr , $errfile , $errline);

View File

@ -67,7 +67,7 @@ function utf8ToUnicode(&$str)
$len = strlen($str);
for($i = 0; $i < $len; $i++) {
$in = ord($str{$i});
$in = ord($str[$i]);
if (0 == $mState) {
// When mState is zero we expect either a US-ASCII character or a
// multi-octet sequence.

View File

@ -180,14 +180,16 @@ class ldapDriver
}
/**
* Returns the result of the LDAP query
* Actually look up a user in the LDAP directory
* (this is the LDAP part of LDAP_check() below)
*
* @param string $filter The filter used to search entries
* @param array $attributes Attributes to be returned
* @param string $username username to check
* @param string $passwd password to check
* @return array Contains selected attributes from all entries corresponding to the given filter
*/
function requestUser( $filter, $attributes=NULL, $username, $passwd) {
function requestUser( $filter, $attributes, $username, $passwd) {
global $c;
$entry=NULL;

View File

@ -39,7 +39,7 @@ function create_external ( $path,$is_calendar,$is_addressbook )
}
}
function fetch_external ( $bind_id, $min_age = '1 hour', $ua_string )
function fetch_external ( $bind_id, $min_age, $ua_string )
{
if ( ! function_exists ( "curl_init" ) ) {
dbg_error_log("external", "external resource cannot be fetched without curl, please install curl");

View File

@ -57,6 +57,10 @@ while( <STDIN> ) {
/^Content-Type: / && $no_content && do {
$_ = "";
};
/^HTTP\/1\.1 100 Continue/ && do {
my $swallow_next_line_as_well = <STDIN>;
next;
};
print;
}

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
ETag: "2f9bb75f51266683f713f8d382a67bff"

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
ETag: "2f9bb75f51266683f713f8d382a67bff"

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule

View File

@ -1,5 +1,3 @@
HTTP/1.1 100 Continue
HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule