/wd4d

WebDAV 4 Dropbox

Primary LanguagePHPBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

WebDAV 4 Dropbox is a SabreDAV PHP hook to provide Dropbox access using the standard webdav protocol. Basic HTTP authentication is used to provide multiuser access.

To improve the browsing experience of your Dropbox content this hook will cache the structure (files and directories) for a certain amount of time within a mysql database.

Donation

Since I'm developing in my free time I'd like to ask you to support my work. You can do it by contributing 5 EUR via paypal. This will give me motivation to keep on coding and fixing bugs.

Thanks in advance

DONATE NOW VIA PAYPAL

Installation

  • Clone this repository to a location where your PHP capable webserver has access to.
 git clone https://github.com/realriot/wd4d.git

  • Enter this directory and configure everything within the configuration file.
 includes/config.inc.php

    • 'logfile' is the file where status and debug messages are written to.
    • 'mysql_*' is used to allow mysql access for this script.
    • 'wd4d_users' array holds all users with their provided accesstoken. Needed to access the Dropbox API.
    • 'debug' will define the verbosity of all logmessages.
    • 'cachetime' is used to define how long the Dropbox file and directory structure is cached within the database.
    • 'wd4d_root' has to filled with the URL path to this script (f.e. '/wd4d').
  • Install data-structure into given mysql database.
 mysql -u<dbuser> -p<dbpassword> -h<host> <database> <wd4d.sql

  • Remove the database structure file after adding it to the database.
 rm -f wd4d.sql

  • Configure basic HTTP authentication for this directory. As an example I've added some lines to the .htaccess file.
  • Change the RewriteRule line within the .htaccess file to reflect the correct relative WD4D URL path:
 RewriteRule ^/*(.*)$ /wd4d/index.php/$1 

  • Create 'data' subdirectory with webserver write permission to allow webdav locks.
 chown www-data.www-data data/

Generate Dropbox access token

You can use the enclosed ./getDropboxAccessToken.py script to fetch the token. But remember for this case that you have to add an Dropbox application within the Dropbox Developer home by yourself, too.

Please secure your access token. NOBODY may know it! This token allows full access to your configured dropbox space.

Greets and have fun with this little goodie...

Sascha Schmidt