main
CI / build-linux (clang) (push) Failing after 18s
CI / build-linux (gcc) (push) Failing after 18s
CI / integration-test (push) Has been skipped
CI / static-analysis (push) Failing after 34s
CI / build-macos (push) Has been cancelled
CI / release (push) Has been cancelled
nwedav
A high-performance WebDAV server implementation in pure C.
Features
- WebDAV Class 2 compliance (RFC 4918)
- HTTP/1.1 with keep-alive support
- Basic and Digest authentication
- Resource locking (exclusive and shared)
- Property management (dead properties)
- User quota management
- Cross-platform (Linux, macOS, Windows)
- Event-driven I/O (epoll, kqueue, poll, select)
- Thread pool for request processing
- Connection pooling
- SQLite-based metadata storage
Requirements
Build Dependencies
- GCC or Clang (C11 support)
- CMake 3.10+
- SQLite3 development libraries
- OpenSSL development libraries
- UUID library (Linux)
Debian/Ubuntu
apt-get install build-essential cmake libsqlite3-dev libssl-dev uuid-dev
RHEL/CentOS/Fedora
dnf install gcc cmake make sqlite-devel openssl-devel libuuid-devel
macOS
brew install cmake sqlite openssl
Building
mkdir build && cd build
cmake ..
make
Build Output
nwedav- WebDAV server binarywebdavctl- Administration CLI tool
Testing
mkdir build && cd build
cmake ..
make run_tests
./tests/run_tests
Test Categories
run_tests- Unit testsrun_integration_tests- Integration tests (WebDAV methods, HTTP, auth flows)run_management_tests- User/quota/CGI management testsrun_all_tests- All tests
ctest -L unit # Run unit tests
ctest -L integration # Run integration tests
ctest -L all # Run all tests
Installation
cmake --install . --prefix /usr/local
Configuration
Initialize Database
./webdavctl init -d /var/lib/nwedav
Add User
./webdavctl user add <username> -d /var/lib/nwedav
Set User Quota
./webdavctl quota set <username> <bytes> -d /var/lib/nwedav
Start Server
./nwedav -d /var/lib/nwedav -p 8080
Command Line Options
nwedav
| Option | Description |
|---|---|
-c, --config <path> |
Configuration file path |
-p, --port <port> |
Listen port (default: 8080) |
-b, --bind <addr> |
Bind address (default: 0.0.0.0) |
-d, --data <path> |
Data directory path |
-f, --foreground |
Run in foreground |
-v, --verbose |
Enable debug logging |
-V, --version |
Show version |
-h, --help |
Show help |
webdavctl
webdavctl init [-d <data_dir>]
webdavctl user add <username> [-d <data_dir>]
webdavctl user delete <username> [-d <data_dir>]
webdavctl user list [-d <data_dir>]
webdavctl quota set <username> <bytes> [-d <data_dir>]
webdavctl quota get <username> [-d <data_dir>]
Configuration File
[server]
port = 8080
bind_address = 0.0.0.0
worker_threads = 4
max_connections = 1000
[storage]
root_path = /var/lib/nwedav/files
database_path = /var/lib/nwedav/nwedav.db
[auth]
method = basic
realm = nwedav
[logging]
level = info
file = /var/log/nwedav/access.log
WebDAV Client Access
Linux (cadaver)
cadaver http://localhost:8080/
Windows
Map network drive to \\localhost@8080\DavWWWRoot
macOS
Finder > Go > Connect to Server > http://localhost:8080/
Architecture
src/
├── core/ # Server core, configuration, logging
├── http/ # HTTP parser and response builder
├── webdav/ # WebDAV method handlers
├── storage/ # File system backend, properties, locks
├── auth/ # Authentication (Basic, Digest)
├── user/ # User management
├── concurrency/ # Thread pool, event loop, connection pool
├── platform/ # Platform abstraction layer
└── cli/ # webdavctl tool
tests/
├── unit/ # Unit tests
├── integration/ # Integration tests
├── management/ # Management tests
└── fixtures/ # Test fixtures and helpers
Supported Methods
| Method | Description |
|---|---|
| OPTIONS | Server capabilities |
| GET | Retrieve resource |
| HEAD | Retrieve resource metadata |
| PUT | Create/update resource |
| DELETE | Delete resource |
| MKCOL | Create collection |
| COPY | Copy resource |
| MOVE | Move resource |
| PROPFIND | Retrieve properties |
| PROPPATCH | Modify properties |
| LOCK | Lock resource |
| UNLOCK | Unlock resource |
Performance
- Event-driven I/O with epoll (Linux), kqueue (BSD/macOS)
- Thread pool for parallel request processing
- Connection pooling with keep-alive support
- Zero-copy response building where possible
- Memory pool for frequent allocations
Security
- Path traversal protection
- PBKDF2-SHA256 password hashing
- Digest authentication with nonce validation
- Resource locking with owner verification
- User-based access control
License
MIT License
Description
EDS stands for Enterprise DAV server because of it's high quality. It has user management and quota management. It is made for performance and concurrency and implements the whole RFC 4918. This server is made for production usage for my cloud storage provider.
2.3 MiB
Languages
C
98.4%
CMake
1.3%
Makefile
0.3%