Skip to main content

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

davify-1.1.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

davify-1.1.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file davify-1.1.0.tar.gz.

File metadata

  • Download URL: davify-1.1.0.tar.gz
  • Upload date:
  • Size: 20.3 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

Hashes for davify-1.1.0.tar.gz
Algorithm Hash digest
SHA256 02073716ab869a77e7d5ab425283215a5bdeed963d1830c98ecf6e850dd2f7e2
MD5 56ae28274d6349d7ec8bd784633126e5
BLAKE2b-256 cd46bf15b2855615a219b2a0fc515fdade8cb8d00545c00ff1cdf2837b3f401e

See more details on using hashes here.

Provenance

File details

Details for the file davify-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: davify-1.1.0-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

Hashes for davify-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d06de875a1fd0a6d5fa1bebb9a209a95863a9f6937756ebab9647f0ee973c178
MD5 43a21c18148b7b16d00e4c25cc97e0fb
BLAKE2b-256 9b7db78abbc92979ae1a625a9aa9d9a10dfa1b7ab9301dfc25ae9cbfa6fce33e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page