                     ======================================
                          htdavlock installation notes
                        version 0.1 released 2018-04-06
                     ======================================

                       Emmanuel Dreyfus <manu@netbsd.org>


 Table of contents:
 1 Why htdavlock
 2 Building and installing mod_auth_ofba
 3 Apache configuration
 6 License

Run this command to regenerate a table of contents:
 sed '/^.====/{g;p;};h;d' README


 1 Why htdavlock
 ===============

Sometimes a program crashes, leaving stale a lock on a WebDAV-based file.
This tool can inspect the lock database, and remove a stale lock.

The alternative is to wait for lock expiration.


 2 Building and installing htdavlock
 ===================================

Just run usual configure && make && make install

You may need to provide
- apxs path using --with-apxs
- APR compilation options using APR_CFLAGS and APR_LIBS.
- CURL compilation options using CURL_CFLAGS and CURL_LIBS

For instance:
./configure --with-apxs=/weird/bin/apxs APR_CFLAGS=-I/weird/bin/include/apr-1 \
            APR_LIBS="-L/weird/lib -lapr-1"


 3 Apache configuration
 ======================

Here is how to configure an Apache virtualhost on localhost so that htdavlock
can unlock files.

This enable a local user to impersonate anyone for UNLOCK operations. Note
that in order to succeed the UNLOCK, one should know the lock token, which
is normally only known by the client and the serveur.

<VirtualHost 127.0.0.1:80>
    ServerName localhost

    DocumentRoot /

    <Directory "/">
        Require all denied
    </Directory>

    <Directory "/davroot">
        Options +FollowSymLinks
        AllowOverride None
        
	DirectoryIndex disabled

        AuthType Basic
        AuthName "Partages ESPCI"
        AuthBasicProvider anon
        Anonymous *
        Anonymous_NoUserID off
        Anonymous_MustGiveEmail off

        <RequireAll>
            Require method UNLOCK
            Require valid-user
        </RequireAll>

        Dav filesystem
    </Directory>
</VirtualHost>

 4 License
 =========

   Copyright (c) 2017 Emmanuel Dreyfus
   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
   2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
   3. All advertising materials mentioning features or use of this software
      must display the following acknowledgement:
          This product includes software developed by Emmanuel Dreyfus

   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   OF THE POSSIBILITY OF SUCH DAMAGE.

