Build Caddy with plugins
Find a file
Matthew Holt 362c34597d
Assume Caddy v2 if no semantic version is available
Useful if providing just a commit SHA
2020-03-21 16:27:26 -06:00
cmd/builder Initial commit 2020-03-21 14:31:29 -06:00
.gitignore Add gitignore 2020-03-21 16:26:52 -06:00
builder.go Assume Caddy v2 if no semantic version is available 2020-03-21 16:27:26 -06:00
environment.go Assume Caddy v2 if no semantic version is available 2020-03-21 16:27:26 -06:00
go.mod Initial commit 2020-03-21 14:31:29 -06:00
go.sum Initial commit 2020-03-21 14:31:29 -06:00
LICENSE Initial commit 2020-03-21 14:31:29 -06:00
README.md readme: ensure the example is valid Go (#1) 2020-03-21 16:13:31 -06:00

Custom Caddy Builder

This package and associated CLI tool make it easy to perform custom builds of the Caddy Web Server.

Supports Caddy 2 and up.

Requirements

  • Go installed
  • Go modules enabled

Library usage

caddyVersion := "v2.0.0-beta.19"
plugins := []builder.CaddyPlugin{
	builder.CaddyPlugin{
		ModulePath: "github.com/caddyserver/nginx-adapter",
		Version:    "6c484552e630ccac384d2d9c43c9d14c4e8d2e56",
	},
}
output := "./caddy"

err := builder.Build(caddyVersion, plugins, output)

Versions can be anything compatible with go get.

CLI usage

Syntax:

builder --version <version> [--output <file>] [<plugins...>]

Where:

  • --version is the core Caddy version to build (required).
  • --output changes the output file.
  • <plugins...> are extra plugins and their versions, in go get module syntax: module@version

For example:

$ builder --version v2.0.0-beta.19 \
	github.com/caddyserver/nginx-adapter@6c484552e630ccac384d2d9c43c9d14c4e8d2e56

© 2020 Matthew Holt