Files
dashcaddy/dashcaddy-installer
Hermes 933606ce3f fix(caddy-admin): IPv6 loopback origin allowlist + bracket-strip helper (DC-069) [glm-grade=A]
Two coupled bugs that, together, cause the live 'admin.api received request
from ::1 → 403 client is not allowed to access from origin' noise on DNS2:

  (1) Caddyfile 'origins' allowlist (admin 0.0.0.0:2019 block on DNS2) had
      4 IPv4 entries (localhost/127.0.0.1/172.17.0.1/0.0.0.0) but no IPv6
      entry. Per glibc RFC 3484 + /etc/hosts '::1 localhost', Node's
      dns.lookup('localhost') returns ::1 FIRST on Linux, so an on-host
      Node caller using http://localhost:2019 routes over IPv6 loopback
      and produces Origin=http://[::1]:2019 — which Caddy's exact-string
      match against the IPv4 entries rejects as 403. Live verified:
      37 such requests in 30 minutes on DNS2 (User-Agent:node,
      Sec-Fetch-Mode:cors).

  (2) _httpFetch (src/utils/http.js) was broken for IPv6 literal URLs:
      on Node 22, new URL('http://[::1]:2019/x').hostname === '[::1]'
      (brackets preserved), but http.request({hostname}) needs the
      BRACKETLESS form for actual TCP connect. Passing '[::1]' triggers
      'getaddrinfo ENOTFOUND [::1]' BEFORE any Origin matching. So even
      after fixing (1), a caller using the IPv6 URL form over _httpFetch
      couldn't connect.

Fixes:

  (1) _httpFetch computes transportHostname by stripping leading [ and
      trailing ] when parsed.hostname is bracket-wrapped. transports via
      bracketless form. defaultOrigin keeps bracket form so Caddy's
      allowlist exact-matches. Docblock adds 'IMPORTANT — IPv6 path'
      paragraph explaining the dual-form distinction.

  (2) dashcaddy-installer/templates/Caddyfile.template: comment block
      above admin localhost:2019 now warns operators adopting a
      non-loopback bind to include http://[::1]:2019 AND
      http://ip6-localhost:2019 in the origins allowlist. Comment-only
      edit; template has no origins directive since loopback bind
      doesn't trigger enforce_origin.

Tests (NEW utils-http-caddy-admin-ipv6-origin.test.js, 4 cases):
  - template comment mentions IPv6 ([::1]/ip6-localhost/IPv6 substring)
  - stripComments helper preserves template literals with // inside
    (eslint no-control-regex forces non-regex split)
  - end-to-end: real http server on [::1]:20191, fetchT succeeds 200,
    Origin header is exactly 'http://[::1]:20191'
  - end-to-end bug repro: same setup with IPv4-only allowlist returns
    403 (proves the mock allowlist check actually runs)

DC-051's utils-http-caddy-admin-origin.test.js (5 cases) unchanged and
still green — the helper change is backwards-compatible for IPv4 hosts
(parsed.hostname.startsWith('[') is false for 127.0.0.1/localhost/
172.17.0.1).

Full suite: 2281/2281 (98 suites, +4 net new). ESLint clean on touched
files.

GLM-5.3 judge round 1 (35s, 3 tool calls): GRADE=A. 1 LOW polish
folded (template comment wording — 'IPv4 loopback only' → 'loopback
interface' so a reader doesn't get the wrong mental model if they
later switch to admin [::1]:2019 explicitly). No blocking issues.
2026-08-18 13:34:51 -07:00
..
2026-03-05 02:26:12 -08:00
2026-03-05 02:26:12 -08:00
2026-03-05 02:26:12 -08:00
2026-03-05 02:26:12 -08:00

DashCaddy Installer

A cross-platform Electron application that provides a guided installation wizard for DashCaddy - the unified management platform for Docker containers and Caddy reverse proxy.

Features

  • 🎯 Guided 5-Step Wizard - Simple, intuitive installation process
  • 🔍 Automatic Dependency Detection - Checks for Docker and Caddy
  • 📦 One-Click Dependency Installation - Installs missing requirements
  • 🖥️ Cross-Platform Support - Windows, macOS, and Linux
  • 📁 Smart File Deployment - Copies and configures all necessary files
  • ⚙️ Auto-Configuration - Generates Caddyfile and docker-compose.yml
  • 🚀 Service Management - Starts services and opens dashboard
  • 💾 Configuration Persistence - Saves settings for upgrades
  • 🎨 Modern UI - Clean, responsive interface with progress tracking

🚀 Quick Start

For End Users

  1. Download the installer for your platform
  2. Run the executable (portable, no installation needed)
  3. Follow the wizard steps
  4. Access your dashboard at http://localhost:8080

See QUICK_START.md for detailed user instructions.

For Developers

# Install dependencies
npm install

# Run in development mode with DevTools
npm run dev

# Build for Windows
npm run build:win

See BUILD_GUIDE.md for comprehensive build instructions.

📋 System Requirements

  • Operating System: Windows 10/11, macOS 10.15+, or Linux
  • RAM: 4GB minimum, 8GB recommended
  • Disk Space: 2GB free space
  • Dependencies: Docker and Caddy (installer can install these)

🏗️ Project Structure

dashcaddy-installer/
├── src/
│   ├── main/                      # Electron main process
│   │   ├── index.js              # Main entry & IPC handlers
│   │   ├── dependency-checker.js # Docker/Caddy detection
│   │   ├── config-manager.js     # Configuration management
│   │   ├── file-deployer.js      # File copying & deployment
│   │   ├── caddyfile-generator.js # Config generation
│   │   ├── browser-launcher.js   # Browser integration
│   │   └── service-manager.js    # Service control
│   ├── renderer/                  # UI layer
│   │   ├── index.html            # Main HTML
│   │   ├── wizard.js             # Wizard logic
│   │   └── styles.css            # Styling
│   ├── preload/                   # IPC bridge
│   │   └── index.js              # Secure IPC exposure
│   └── shared/                    # Shared utilities
│       ├── constants.js          # App constants
│       └── platform-utils.js     # Platform detection
├── templates/                     # Configuration templates
│   ├── Caddyfile.template        # Caddyfile template
│   ├── docker-compose.template.yml
│   └── README.md
├── assets/                        # Images & icons
│   ├── icon.png                  # App icon
│   └── dashcaddy-logo.png
├── dist/                          # Build output (generated)
├── BUILD_GUIDE.md                 # Comprehensive build guide
├── QUICK_START.md                 # User quick start guide
└── package.json                   # Dependencies & config

🛠️ Development

Setup

# Clone the repository
git clone <repository-url>
cd dashcaddy-installer

# Install dependencies
npm install

Running

# Development mode with DevTools
npm run dev

# Production mode
npm start

Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run property-based tests
npm test -- --testNamePattern="property"

Building

# Build for current platform
npm run build

# Build for specific platforms
npm run build:win    # Windows
npm run build:mac    # macOS
npm run build:linux  # Linux

Build Output:

  • Windows: dist/win-unpacked/DashCaddy Installer.exe (168MB portable)
  • macOS: dist/DashCaddy Installer.dmg
  • Linux: dist/DashCaddy Installer.AppImage

📖 Documentation

🎯 Installation Wizard Steps

1. Welcome

  • Introduction to DashCaddy
  • Platform detection
  • Feature overview

2. Choose Folders

  • Select installation directory
  • Configure Docker data path
  • Set Caddy config location

3. Check Dependencies

  • Detect Docker installation
  • Detect Caddy installation
  • Install missing dependencies

4. Installation

  • Deploy dashboard files
  • Deploy API server
  • Install npm dependencies
  • Generate configurations
  • Start services

5. Complete

  • Installation summary
  • Dashboard URL
  • Quick access button

🔧 Configuration

Source Directories

The installer copies files from:

  • Dashboard: ../status/{install}/dashboard/
  • API Server: ../dashcaddy-api/{install}/api/

Generated Files

The installer creates:

  • Caddyfile - Reverse proxy configuration
  • docker-compose.yml - Container orchestration
  • .dashcaddy-config.json - Installation settings

Default Ports

  • Dashboard: 8080
  • API Server: 3001
  • Caddy Admin: 2019

🐛 Troubleshooting

Build Issues

  • Ensure Node.js 18+ is installed
  • Delete node_modules and run npm install
  • Check that source directories exist

Runtime Issues

  • Run with npm run dev to see console errors
  • Check that Docker daemon is running
  • Verify Caddy is installed and accessible
  • Ensure ports 8080, 3001, 2021 are available

Deployment Issues

  • Verify source paths in file-deployer.js
  • Check write permissions on installation directory
  • Ensure sufficient disk space

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📝 License

MIT

🙏 Acknowledgments

Built with: