Skip to content

Configuration

bmwl edited this page Nov 20, 2025 · 1 revision

Configuration Reference

This page documents all configuration options for the Soft Data Diode Tools. For basic setup examples, see the main README.

Sender Configuration

Sender configuration can be provided via command line arguments or a JSON config file.

Command Line Options

Web Page Capture:

python sender/ddsender.py \
  --mode web \
  --source "https://webpage.example.com" \
  --cloud-ip YOUR_CLOUD_IP \
  --cloud-port 5005 \
  --key "your-base64-key-here" \
  --interval 5

RTSP Stream Capture:

python sender/ddsender.py \
  --mode rtsp \
  --source "rtsp://camera.example.com/stream" \
  --cloud-ip YOUR_CLOUD_IP \
  --cloud-port 5006 \
  --key "your-base64-key-here" \
  --interval 0.1

VNC Capture:

python sender/ddsender.py \
  --mode vnc \
  --source "vnc.example.com" \
  --cloud-ip YOUR_CLOUD_IP \
  --cloud-port 5006 \
  --password ~/.vnc/passwd \
  --key "your-base64-key-here" \
  --interval 10

File Sync:

python sender/ddsender.py \
  --mode filesync \
  --sync-path /home/user/documents \
  --cloud-ip YOUR_CLOUD_IP \
  --cloud-port 5010 \
  --key "your-base64-key-here" \
  --sync-interval 60 \
  --max-file-age 1 

Using a Config File:

python sender/ddsender.py --config /path/to/sender_config.json

See the sender folder for JSON config examples.

Running the Receiver

Single image stream receiver usage

python receiver/ddreceiver.py \
  -udp-host 1.2.3.4 \
  --udp-port 5005 \
  --http-host 127.0.0.1 \
  --http-port 8000 \
  --key "your-base64-key-here"

Multi-receiver usage

python sender/ddsender.py --config /path/to/sender_config.json

The multi-receiver configuration file uses JSON format:

{
  "server": {
    "http_host": "127.0.0.1",
    "http_port": 8000,
    "html_title": "Data Diode Streams",
    "debug": false
  },
  "streams": {
    "dashboard": {
      "name": "Main Dashboard",
      "description": "Primary monitoring dashboard",
      "udp_host": "0.0.0.0",
      "udp_port": 5005,
      "key": "your-generated-key-here",
      "buffer_size": 2
    },
    "camera1": {
      "name": "Security Camera 1",
      "description": "Front entrance camera",
      "udp_host": "0.0.0.0",
      "udp_port": 5006,
      "key": "your-generated-key-here",
      "buffer_size": 2,
      "display_resolution": "1280x720"
    },
    "desktop1": {
      "name": "Desktop 1",
      "description": "Information Kiosk desktop",
      "udp_host": "0.0.0.0",
      "udp_port": 5007,
      "key": "your-generated-key-here",
      "buffer_size": 2
    }
  }
}

Server Configuration Options

  • http_host: HTTP server bind address (default: 127.0.0.1)
  • http_port: HTTP server port (default: 8000)
  • html_title: Title displayed on the web interface
  • debug: Enable debug logging (true/false)

Stream Configuration Options

  • name: Display name for the stream
  • description: Human-readable description
  • udp_host: UDP bind address (0.0.0.0 for all interfaces)
  • udp_port: UDP port to listen on
  • key: Base64-encoded encryption key (must match sender)
  • buffer_size: Number of frames to buffer
  • display_resolution: Optional resolution to resize images to (format: "WIDTHxHEIGHT")

Web Frontend Configuration

Caddy Configuration Example

Caddy is shown here for simplicity, but any web server (Apache, Nginx, Traefik) will work.

Generate a hashed password:

caddy hash-password --plaintext "mysecret"

Edit /etc/caddy/Caddyfile:

yourserverfqdn {
    tls internal
    basic_auth {
        user output-of-caddy-hash-password
    }
    handle {
        reverse_proxy 127.0.0.1:8000
    }
}

Configuration Notes:

  • Remove tls internal for public domains to get automatic Let's Encrypt certificates
  • Remove the basic_auth section to allow unauthenticated access
  • The basicauth directive was renamed to basic_auth in Caddy v2.8

Next Steps

Clone this wiki locally