David - Enhanced WebDAV Server
Executive Summary
David is an enhanced fork of the original Dave WebDAV server, extending its functionality while maintaining the simplicity that made the original project popular. This fork addresses evolving requirements for modern web-based file management systems, providing additional security, logging, and administrative capabilities.
Project Background
Motivation
The original Dave project was archived by its maintainers, leaving users without a path for ongoing development and support. This fork was created to:
- Preserve Development: Continue active development of a valuable open-source tool
- Enhance Functionality: Add features needed for production environments
- Learn from Quality Code: Study and extend well-structured Go implementations
Core Enhancements
| Feature | Original Dave | Enhanced David | Rationale |
|---|---|---|---|
| Advanced Logging | Limited | Comprehensive NDJSON/TEXT logging | Production debugging capabilities |
| Live Configuration Reload | Manual restart | Runtime configuration updates | Zero-downtime changes |
| CORS Support | Not included | Configurable CORS policies | Web application compatibility |
| Enhanced User Management | Basic | Directory jailing + admin hierarchy | Multi-tenant security |
| Proxy Support | Basic | Reverse proxy configuration | Enterprise deployment |
Architecture Overview
Technology Stack
- Language: Go 1.21+
- Key Libraries:
- Authentication: HTTP Basic Auth with bcrypt password hashing
- Security: Optional TLS encryption with custom certificates
- Deployment: Single binary deployment with Docker support
System Components
┌─────────────────┐
│ HTTP Server │
├─────────────────┤
│ Auth Layer │
├─────────────────┤
│ File System │
├─────────────────┤
│ Logging │
└─────────────────┘
Development Approach
Modern Development Practices
This project utilizes contemporary development methodologies including:
- AI-Assisted Development: Leveraging advanced AI tools for code comprehension and generation
- Structured Go Programming: Using established Go patterns and libraries for maintainable code
- Iterative Refactoring: Continuous improvement of code clarity and structure
Technology Integration
The implementation incorporates several production-ready technologies:
- CLI Framework: Cobra for command-line interface
- Configuration Management: Viper for YAML-based settings
- Context Management: Go context package for request lifecycle control
Code Quality Philosophy
The development follows these principles:
- Clarity over Brevity: Detailed commenting and self-documenting code
- Explicit Structure: Clear separation of concerns and modular design
- Maintainability: Code that remains understandable during future development cycles
Installation Guide
Prerequisites
- Go 1.21 or higher
- 2GB+ available RAM
- Network connectivity for updates
- TLS certificates (for HTTPS)
Quick Start
Clone the repository:
git clone https://github.com/audstanley/david cd davidBuild the application:
go build -o david ./cmd/davidCreate configuration file:
# Basic configuration cp examples/config.yaml config.yamlRun the server:
./david --config=config.yaml
Docker Deployment
# Build Docker image
docker build -t david .
# Run with Docker
docker run -dp 8080:8080 -v $(pwd)/config:/app/config david
Configuration Reference
Basic Configuration
address: "127.0.0.1"
port: 8080
dir: "/home/user/webdav"
prefix: "/webdav"
users:
user:
password: "$2a$10$yITzSSNJZAdDZs8iVBQzkuZCzZ49PyjTiPIrmBUKUpB0pwX7eySvW"
subdir: "/user"
permissions: "r"
admin:
password: "$2a$10$DaWhagZaxWnWAOXY0a55.eaYccgtMOL3lGlqI3spqIBGyM0MD.EN6"
permissions: "crud"
TLS Configuration
tls:
keyFile: "/path/to/private.key"
certFile: "/path/to/certificate.pem"
CORS Configuration
cors:
origin: "*" # All origins (configure for production)
credentials: true # Allow credentials
Advanced Logging
log:
production: true # NDJSON format for structured logging
debug: true
error: true
create: true
read: true
update: true
delete: true
Development Setup
Environment Requirements
- Go 1.21+
- Git for version control
- Docker for containerized development
Build Commands
# Development build
go build -race -o david ./cmd/david
# Cross-platform compilation
GOOS=linux GOARCH=amd64 go build -o david-linux-amd64 ./cmd/david
GOOS=windows GOARCH=amd64 go build -o david-windows-amd64.exe ./cmd/david
GOOS=darwin GOARCH=amd64 go build -o david-darwin-amd64 ./cmd/david
Password Management
Generate bcrypt hashes using the included CLI tool:
./bcpt passwd
Comparison with Original Dave
| Feature | Dave | David | Improvement |
|---|---|---|---|
| Project Status | Archived | Actively Maintained | Ongoing development |
| Logging | Basic file logging | Structured NDJSON/TEXT logging | Production-ready |
| Configuration | Static reload only | Live configuration reloads | Zero downtime |
| Security | Basic auth | Enhanced auth + TLS + CORS | Enterprise-ready |
| Deployment | Manual setup | Docker + proxy support | DevOps friendly |
Use Cases
Personal Cloud Storage
Mount personal files across devices, replace commercial cloud services with self-hosted solution, and maintain data privacy and control.
Enterprise File Server
Departmental file sharing with user permissions, integration with existing authentication systems, and audit logging for access control.
Development Environment
Local development server for web applications, testing environment for WebDAV clients, and educational platform for distributed systems.
Contributing
Contribution Areas
- Core Features: User management, logging, performance optimizations
- Security Enhancements: Advanced authentication, encryption options
- Platform Support: Additional architecture compatibility
- Documentation: Examples, tutorials, and use cases
- Testing: Unit tests, integration tests, benchmarks
Development Guidelines
- Fork the repository
- Create feature branch:
git checkout -b feature-name - Implement changes with comprehensive testing
- Submit pull request with clear description
- Follow Go coding standards and best practices
Roadmap
Planned Enhancements
- Database persistence layer (PostgreSQL, MongoDB)
- Advanced authentication methods (OAuth 2.0, LDAP)
- Performance metrics and monitoring
- Enhanced WebDAV protocol compliance
- Kubernetes deployment manifests
License
This project is licensed under the Apache 2.0 License.
Note: This is an enhanced fork of the original Dave project, maintained independently. For the original archived project, see micromata/dave.