Adds scripts/build-dmg-linux.sh + 'npm run build:dmg': - virt-make-fs creates an HFS+ volume inside a plain 400M image file (guestfs appliance; never touches block devices) - libdmg-hfsplus converts it to compressed UDZO .dmg (real koly/UDIF) - app + /Applications drag-install symlink; secret scan on extracted contents - BUILD_GUIDE documents the route + Gatekeeper first-run note Verified end-to-end: rc=0, 121MB DMG with valid koly trailer, extractall round-trip reproduced the full 264MB app, secrets scan clean.
8.3 KiB
DashCaddy Installer - Build Guide
Overview
The DashCaddy Installer is a cross-platform Electron application that guides users through installing and configuring DashCaddy on their system.
Prerequisites
- Node.js 18+ and npm
- Git
- Windows: No additional requirements
- macOS: Xcode Command Line Tools
- Linux: Standard build tools (gcc, make)
Installation
# Clone the repository
cd dashcaddy-installer
# Install dependencies
npm install
Development
Run in Development Mode
# Start the installer with DevTools
npm run dev
# Or start normally
npm start
Run Tests
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
Building
Build for Current Platform
npm run build
Build for Specific Platforms
# Windows (creates portable .exe and installer)
npm run build:win
# macOS zip (from any host; electron-builder's native target)
npm run build:mac
# macOS real drag-install .dmg — built ON LINUX, no Mac needed
# (one-time toolchain: see scripts/build-dmg-linux.sh header)
npm run build:dmg
# Linux (creates AppImage and .deb)
npm run build:linux
Build Output
Built applications are placed in the build-output/ directory:
- Windows:
build-output/DashCaddy Installer <version>.exe(portable) andbuild-output/DashCaddy Installer Setup <version>.exe(NSIS installer) — filenames embed the currentversionfrom package.json - macOS:
build-output/DashCaddy Installer-<version>-mac.zip— the configured mac target iszip(unsigned; signed builds require a Mac with signing credentials).npm run build:dmgadditionally produces a real drag-installbuild-output/DashCaddy Installer-<version>.dmgbuilt entirely on Linux (libguestfs HFS+ volume + libdmg-hfsplus UDZO compression; unsigned — macOS Gatekeeper will show the standard right-click→Open dialog on first launch) - Linux:
build-output/DashCaddy Installer-<version>.AppImageandbuild-output/dashcaddy-installer_<version>_amd64.deb
Cross-platform build requirements (verified 2026-09-01)
Building Windows installers from Linux requires wine with both 64-bit and 32-bit support — NSIS's 32-bit post-processing runs under wine:
# Ubuntu 24.04 (Debian/Ubuntu package names; other distros vary).
# Requires root / sudo for the dpkg and apt steps.
dpkg --add-architecture i386
# add i386 mirror entries if the main sources are amd64-only pinned
apt-get update && apt-get install -y wine64 wine32:i386
# initialize a prefix once (avoids kernel32.dll load failures in CI)
export WINEPREFIX=~/.wine-dashcaddy && wineboot --init
Without wine32, the NSIS setup exe is built but ends up as a ~211KB stub (payload not appended) and the build appears to pass (exit 0). Check the result — the size (~90MB+) is a quick heuristic, but the authoritative check is listing/extracting the payload:
7z l "build-output/DashCaddy Installer Setup <version>.exe" # should list a large app-64.7z
# or extract and scan: 7z x <setup.exe> && 7z x '$PLUGINSDIR/app-64.7z'
After every build, run the secrets scanner to verify no private key material was bundled into the shipped resources:
npm run build:scan
Project Structure
dashcaddy-installer/
├── src/
│ ├── main/ # Electron main process
│ │ ├── index.js # Main entry point & IPC handlers
│ │ ├── dependency-checker.js # Check/install Docker & Caddy
│ │ ├── config-manager.js # Configuration persistence
│ │ ├── file-deployer.js # Copy dashboard & API files
│ │ ├── caddyfile-generator.js # Generate Caddyfile
│ │ ├── browser-launcher.js # Open URLs in browser
│ │ └── service-manager.js # Start/stop services
│ ├── renderer/ # UI layer
│ │ ├── index.html # Main HTML
│ │ ├── wizard.js # Wizard logic & state
│ │ └── 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
├── assets/ # Images & icons
│ └── icon.png # App icon
└── package.json # Dependencies & build config
Key Features
1. Platform Detection
Automatically detects Windows, macOS, or Linux and adjusts paths and commands accordingly.
2. Dependency Management
- Checks for Docker and Caddy installation
- Provides installation instructions/automation
- Validates versions
3. Guided Installation
5-step wizard:
- Welcome - Introduction and platform detection
- Folders - Select installation directories
- Dependencies - Check and install requirements
- Install - Deploy files and configure
- Complete - Success screen with dashboard link
4. File Deployment
- Copies dashboard files from
status/directory - Copies API server from
dashcaddy-api/directory - Installs npm dependencies for API
- Skips unnecessary files (node_modules, .git)
5. Configuration Generation
- Creates Caddyfile for reverse proxy
- Generates docker-compose.yml for API container
- Saves installation configuration for upgrades
6. Service Management
- Starts Caddy web server
- Launches Docker containers
- Opens dashboard in browser when ready
Configuration
Build Configuration
Edit package.json under the build section:
{
"build": {
"appId": "com.dashcaddy.installer",
"productName": "DashCaddy Installer",
"icon": "assets/icon.png",
"win": {
"target": ["portable", "dir"]
}
}
}
Source Paths
The installer copies files from these source directories (relative to project root):
- Dashboard:
../status/ - API Server:
../dashcaddy-api/
These paths are configured in src/main/file-deployer.js.
Troubleshooting
Build Fails
- Missing dependencies: Run
npm install - Electron download fails: Check internet connection or use
npm config set electron_mirror https://npmmirror.com/mirrors/electron/ - Icon errors: Ensure
assets/icon.pngexists and is valid
Installer Doesn't Start
- Check Node version: Must be 18+
- Reinstall dependencies:
rm -rf node_modules && npm install - Check console: Run with
npm run devto see errors
Files Not Deploying
- Check source paths: Verify
status/anddashcaddy-api/directories exist - Check permissions: Ensure write access to installation directory
- Check disk space: Ensure sufficient space for installation
Testing
Unit Tests
Tests are located in src/main/*.test.js:
npm test
Property-Based Tests
Some modules include property-based tests using fast-check:
npm test -- --testNamePattern="property"
Manual Testing
- Run installer:
npm start - Go through all wizard steps
- Verify files are copied correctly
- Check that services start
- Confirm dashboard opens in browser
Deployment
Creating a Release
- Update version in
package.json - Build for all platforms:
npm run build:win npm run build:mac npm run build:linux - Test each build on target platform
- Create GitHub release with built artifacts
Distribution
- Windows: Distribute
.exefile (portable, no installation required) - macOS: Distribute
.dmgfile - Linux: Distribute
.AppImage(universal) or.deb(Debian/Ubuntu)
Advanced
Custom Branding
Replace assets/icon.png with your custom icon (512x512 PNG recommended).
Custom Templates
Edit templates in templates/ directory to customize generated configurations.
Adding New Steps
- Add step definition to
wizard.jssteps array - Create render function (e.g.,
renderMyStep()) - Add case to
renderCurrentStep()switch - Update navigation logic if needed
Support
For issues or questions:
- Check existing documentation
- Review console logs with
npm run dev - Check GitHub issues
License
MIT