Skip to content

fs1n/Caddy-Builder

Repository files navigation

Caddy-Builder

Automated build system for Caddy web server with custom plugins using GitHub Actions.

Quick Start

1. Configure Plugins

Edit the plugins.txt file to add your desired Caddy plugins. Add one plugin per line:

github.com/caddy-dns/cloudflare
github.com/mholt/caddy-l4
github.com/greenpau/caddy-security

Lines starting with # are treated as comments and ignored.

2. Trigger a Build

Builds are triggered automatically in the following scenarios:

  • Push to main/master branch: When plugins.txt or workflow files are modified
  • Weekly schedule: Every Monday at 00:00 UTC
  • Manual trigger: Via GitHub Actions "Run workflow" button
  • Automatic updates: When new Caddy version is detected (checked daily)

3. Download Binaries

After a successful build:

  1. Go to the Actions tab in GitHub
  2. Click on the latest successful workflow run
  3. Download the artifacts for your platform
  4. Or check the Releases page for versioned releases

The Workflow currently builds Binaries for the following plattforms:

  • Linux amd64 (x86_64)
  • Linux arm64 (aarch64)
  • Linux armv7 (32-bit ARM)
  • Linux armv6 (Raspberry Pi, etc.)
  • Linux 386 (32-bit x86)

Workflows

Build Workflow (build-caddy.yml)

Builds Caddy with specified plugins for all Linux platforms.

  • Reads plugins from plugins.txt
  • Builds binaries using xcaddy
  • Tests binary integrity
  • Uploads artifacts
  • Creates releases on push to main/master

Update Checker (check-updates.yml)

Automatically checks for Caddy and plugin updates.

  • Runs daily at 06:00 UTC
  • Checks GitHub for latest Caddy release
  • Monitors plugin repositories for updates
  • Triggers builds when updates are detected
  • Maintains version tracking

Plugin Configuration

Adding Plugins

To add a plugin, edit plugins.txt and add the plugin's import path:

# DNS providers
github.com/caddy-dns/cloudflare

# Layer 4 support
github.com/mholt/caddy-l4

# Security features
github.com/greenpau/caddy-security

Testing

Each build includes automated tests:

  1. Binary verification: Confirms binary format and architecture
  2. Execution test: Runs caddy version and caddy list-modules
  3. Module validation: Ensures custom plugins are loaded

Local Testing

You can validate your configuration locally before pushing:

# Test plugin configuration parsing
./test-config.sh

# Run full integration tests
./test-integration.sh

These scripts verify:

  • Workflow file syntax
  • Plugin configuration format
  • Required build matrix components
  • Documentation completeness

Configuration

Customizing Build Frequency

Edit the cron schedule in .github/workflows/check-updates.yml:

schedule:
  - cron: '0 6 * * *'  # Daily at 06:00 UTC

Adding More Platforms

To add Windows or macOS support, edit the matrix in .github/workflows/build-caddy.yml:

matrix:
  os: [linux, darwin, windows]
  arch: [amd64, arm64]

You may need to add platform specific tests.

Troubleshooting

Build Fails

  1. Check the Actions log for specific error messages
  2. Verify plugin paths in plugins.txt are correct
  3. Ensure plugins are compatible with the latest Caddy version

Plugin Not Loading

  1. Verify the plugin path in plugins.txt
  2. Check if the plugin is compatible with current Caddy version
  3. Review the build logs for compilation errors

Contributing

Feel free to open issues or submit pull requests for improvements.

License

See LICENSE file for details.

Related Projects

About

Builds and updates Caddy binaries

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •