Giter VIP home page Giter VIP logo

asgi-webdav's Introduction

ASGI WebDAV Server

Coverage Status Code style: black

An asynchronous WebDAV server implementation, support multi-provider.

Requirement

  • Python3.9+

Features

  • ASGI standard
  • WebDAV standard: RFC4918
  • Support multi-provider: FileProvider, MemoryProvider
  • Full asyncio file IO
  • Passed all litmus(0.13) test, except 2 warning.
  • Compatible macOS finder

DAVProvider

DAVProvider URI
FileProvider file://... data is stored in the file system
MemoryProvider memory:/// data is stored in the memory

Docker

Install

docker push ray1ex/asgi-webdav:latest

Start server

docker run --restart always -p 0.0.0.0:80:80 -v /your/path:/data --name asgi-webdav ray1ex/asgi-webdav

Environment variables

Name Defaule Value
LOGGING_LEVEL INFO support: DEBUG, INFO...
USERNAME username
PASSWORD password

Configuration

Config Value Priority

Environment Variable > Config File > Default Value

Config File

When the file /data/webdav.json does not exist, http://127.0.0.1/ will map to the /data directory.

logging output:

WARNING: load config[/data] value from file failed, [Errno 2] No such file or directory: '/data/webdav.json'
2021-03-10 08:53:08,763 INFO: [asgi_webdav.distributor] Mapping: / => file:///data
2021-03-10 08:53:08,765 INFO: [uvicorn] Started server process [7]
2021-03-10 08:53:08,765 INFO: [uvicorn] Waiting for application startup.
2021-03-10 08:53:08,766 INFO: [uvicorn] ASGI 'lifespan' protocol appears unsupported.
2021-03-10 08:53:08,766 INFO: [uvicorn] Application startup complete.
2021-03-10 08:53:08,767 INFO: [uvicorn] Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)

When the file exists, the mapping relationship is defined by the file content.

webdav.json example:

{
    "provider_mapping": [
        {
            "prefix": "/",
            "uri": "file:///data/root"
        },
        {
            "prefix": "/joplin/",
            "uri": "file:///mnt/joplin"
        },
        {
            "prefix": "/joplin/locks",
            "uri": "memory:///"
        }
    ]
}

logging output:

2021-03-14 12:35:39,609 INFO: [asgi_webdav.distributor] Mapping: / => file:///data/root
2021-03-14 12:35:39,610 INFO: [asgi_webdav.distributor] Mapping: /joplin => file:///mnt/joplin
2021-03-14 12:35:39,610 INFO: [asgi_webdav.distributor] Mapping: /joplin/locks => memory:///
2021-03-14 12:35:39,764 INFO: [uvicorn] Started server process [7]
2021-03-14 12:35:39,765 INFO: [uvicorn] Waiting for application startup.
2021-03-14 12:35:39,967 INFO: [uvicorn] ASGI 'lifespan' protocol appears unsupported.
2021-03-14 12:35:39,969 INFO: [uvicorn] Application startup complete.
2021-03-14 12:35:39,973 INFO: [uvicorn] Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)

TODO

  • digest auth support
  • sql provider
  • PROPFIND support DAVDepth.infinity
  • can not open DMG file int macOS finder
  • web file browser

asgi-webdav's People

Contributors

rexzhang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.