Davify uploads files to webdav servers and provides a download link for accessing them.
Project description
davify
Uploads files to a WebDAV server for retrieval via https.
The problem davify solves
Sending document versions to collaborators is often quite cumbersome. Davify (i) uploads files to your WebDAV server (multiple files and directories are put into a .txz archive prior to uploading), (ii) provides a publicly available download link, and (iii) copies this information into the clipboard.
In addition it keeps track of a file's lifetime and provides scripts for automatically removing files once their lifetime has expired.
Setup and configuration files:
Installation
pip install davify
Client configuration:
Setup the WebDAV client with
python3 cli.py --setup
Davify's configuration resides in ~/.davify
and the WebDAV server credentials are stored in your system's keystore. Please find below an example configuration file.
[default]
filename_pattern = {random_prefix}{lifetime_str}-{fname}{version_suffix}{ext}
file_url_pattern = {protocol}://example.net/{random_prefix}{lifetime_str}-{fname_quoted}{version_suffix}{ext}
notification_message = {url}\n(Note the file will be available for {lifetime}.)`
Server configuration
Calling clean_directory.py
on the server removes expired files.
Example crontab entry:
# clean davify directory
15 00 * * * www-data python3 /usr/local/davify/clean_directory.py /var/www/davify
Command line parameters
usage: cli.py [-h] [--lifetime LIFETIME]
[--retrieval-url-pattern RETRIEVAL_URL_PATTERN]
[--webdav-file-pattern WEBDAV_FILE_PATTERN]
[--file-url-pattern FILE_URL_PATTERN]
[--archive-name ARCHIVE_NAME] [--setup]
[fname [fname ...]]
positional arguments:
fname File(s) to davify or directory to clean.
optional arguments:
-h, --help show this help message and exit
--lifetime LIFETIME Suggested file lifetime in hours (default: 1 week).
Zero suggests that the file is never deleted.
--retrieval-url-pattern RETRIEVAL_URL_PATTERN
Pattern to use for the retrieval URL.
--webdav-file-pattern WEBDAV_FILE_PATTERN
Pattern used to create the webdav file.
--file-url-pattern FILE_URL_PATTERN
Patterns used to retrieve the created file
--archive-name ARCHIVE_NAME, -n ARCHIVE_NAME
An optional file name for the created archive.
--setup Setup WebDAV connection.
Example call:
albert@myhost:~$ python3 dav.py transform.py
https://example.net/qOMvcO/transform-15dez-0201.py
(Note the file will be available for 1 week.)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file davify-1.1.1.tar.gz
.
File metadata
- Download URL: davify-1.1.1.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.6 Linux/6.5.0-26-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ac9b5950f1c7538965b00628a60d83bf479dd2629028dd95f3c2a468272b1a |
|
MD5 | fc96d7f30a0c6af0169b4beb4f0ec55f |
|
BLAKE2b-256 | 65cc3023b3f71b541a8eee44f678f09b5429f0d4fd4ca9ec8b7b6cb9f017ea2b |
File details
Details for the file davify-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: davify-1.1.1-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.6 Linux/6.5.0-26-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e14b74178974869b93a3a624ba53e73997b99a405355bfa10f3ec55e5a939d4e |
|
MD5 | 84bfea13b4567f6c3e157116de466ff6 |
|
BLAKE2b-256 | 06c3c6ed31218a69bb958e3c75e1d52fa7af9af075a9611fdbd95b773f5f42de |