# EasyP - On-demand HTTPS Server

A lightweight, secure HTTPS server with automatic certificate management.

## Features

- **Domain-based file serving** with safety checks
- **Automatic HTTPS** with on-demand certificate generation
- **ACME support** for automatic certificate renewal
- **Security features** including path sanitization and user/group switching
- **Configurable crypto backends** for size optimization

## Building

### Default Build (Full Features)
```bash
cargo build --release
```
- **Size:** ~7.9MB
- **Features:** ACME, extensions, AWS crypto backend
- **Safari:** ✅ Compatible

### Lightweight Build (Ring Backend)
```bash
cargo build --release --features crypto-ring
```
- **Size:** ~4-5MB (estimated)
- **Features:** ECDSA certificates only, no ACME
- **Safari:** ✅ Compatible
- **Note:** ACME functionality requires AWS backend

### Minimal Build (No ACME)
```bash
cargo build --release --no-default-features --features crypto-ring
```
- **Size:** ~2-3MB (estimated)
- **Features:** Basic HTTPS serving only
- **Safari:** ✅ Compatible

## Feature Flags

| Feature | Description | Size Impact |
|---------|-------------|-------------|
| `acme` | Automatic certificate management | +3-4MB |
| `extensions` | Server extensions | +1-2MB |
| `crypto-ring` | Ring crypto backend (ECDSA only) | Base |
| `crypto-aws` | AWS-LC crypto backend (RSA + ECDSA) | +2-3MB |

## Usage

```bash
# Basic usage
./target/release/easyp --port 8080 --document-root /var/www/html

# With ACME (automatic certificates)
./target/release/easyp --port 443 --document-root /var/www/html --acme-email admin@example.com
```

## Safari Compatibility

Both crypto backends (`ring` and `aws-lc-rs`) generate Safari-compatible certificates:
- **ECDSA certificates** work in all modern browsers including Safari
- **RSA certificates** (AWS backend only) provide broader compatibility
- **ACME integration** requires AWS backend for RSA support

## Security

- Path sanitization prevents directory traversal
- User/group switching for privilege separation
- Domain-based document root isolation
- Secure file serving with MIME type detection
