davical/testing/apache-site.conf.example
Andrew Ruthven e989e1cf97 Fix PROPFIND with Depth 1 if external bind is included
Previously something like this would be logged if debugging is enabled:

davical: LOG: Principal: Query: DBGQ: SELECT * FROM collection WHERE user_no= :user_no
davical: LOG: Principal: Query: DBGQ:  ":user_no" => ""
davical: BUG: :DAViCal Fatal Error: [42883] SQLSTATE[42883]: Undefined function: 7 ERROR:  operator does not exist: integer = boolean\nLINE 1: SELECT * FROM collection WHERE user_no= FALSE\n                                              ^\nHINT:  No operator matches the given name and argument types. You might need to add explicit type casts. at /home/puck/work/Calendar/awl/inc/AwlDatabase.php:94

And this would be returned as a response:

DAViCal Fatal Error

user_no doesn't get set when construction the Collection for the external
bind, so, just handle that instead of sending the empty string to the
database as a user_no.

Modify the tests from ccc7e182ba4cbfba66a4fe96e1c0620e46390b95 to tickle the
bug.

Closes #175.
2024-02-18 01:51:56 +13:00

35 lines
1.5 KiB
Plaintext

Listen 127.0.1.1:80
<VirtualHost 127.0.1.1:80>
ServerName regression
ServerAlias myempty mycaldav mycaldav_ldap
DocumentRoot /path/to/davical/htdocs
CustomLog ${APACHE_LOG_DIR}/regression-access.log combined
ErrorLog ${APACHE_LOG_DIR}/regression-error.log
Alias /davical /path/to/davical/htdocs
<Directory /path/to/davical/htdocs>
Require all granted
DirectoryIndex index.php index.html
php_value include_path /path/to/awl/inc:/path/to/davical/testing
# All content for our UI should be served locally.
<FilesMatch "(admin|help|iSchedule|index|metrics|public|setup|tools|upgrade).php">
Header set Content-Security-Policy "default-src 'none'; img-src 'self' data:; media-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' data:; font-src 'self' data:; object-src 'self'; base-uri 'self'; connect-src 'self'; form-action 'self'; frame-ancestors 'self'"
</FilesMatch>
</Directory>
RewriteEngine On
# Redirect /.well-known URLs
RewriteRule ^/\.well-known/(.*)$ /caldav.php/.well-known/$1 [NC,L]
# and other special URLs
RewriteRule ^/principals/users/(.*)$ /caldav.php/$1 [NC,L]
RewriteRule ^/principals/resources/(.*)$ /caldav.php/$1 [NC,L]
RewriteRule ^/calendars/__uids__/(.*)$ /caldav.php/$1 [NC,L]
RewriteRule ^/addressbooks/__uids__/(.*)$ /caldav.php/$1 [NC,L]
# let caldav.php handle "anything else"
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !\.(php|css|png|gif|js|jpg|ico)
RewriteCond %{REQUEST_URI} !/testfiles/.*$
RewriteRule ^(.*)$ /caldav.php$1 [NC,L]
</VirtualHost>