Download server.py from farid-inc/deeplx: direct link, hf CLI and curl.
- Browser
- Download file 824 Bytes
-
https://huggingface.co/spaces/farid-inc/deeplx/resolve/main/server.py
- Command line
-
hf download hf://spaces/farid-inc/deeplx/server.py
-
curl -L -o server.py https://huggingface.co/spaces/farid-inc/deeplx/resolve/main/server.py
824 Bytes
| import os | |
| from wsgidav.wsgidav_app import WsgiDAVApp | |
| from cheroot import wsgi | |
| # Конфиг берем из переменных среды (Environment Variables в настройках Space) | |
| USER = os.getenv("WEBDAV_USER", "admin") | |
| PASS = os.getenv("WEBDAV_PASS", "password") | |
| DATA_DIR = "/data" # Стандартный маунт бакета на HF | |
| config = { | |
| "host": "0.0.0.0", | |
| "port": 7860, | |
| "provider_mapping": {"/": DATA_DIR}, | |
| "simple_dc": { | |
| "user_mapping": { | |
| "*": { | |
| USER: {"password": PASS} | |
| } | |
| } | |
| }, | |
| "verbose": 1, | |
| } | |
| app = WsgiDAVApp(config) | |
| server = wsgi.Server(("0.0.0.0", 7860), app) | |
| if __name__ == "__main__": | |
| print(f"🚀 WebDAV сервер запущен в Docker-контейнере на 7860") | |
| server.start() | |