https://github.com/abiosoft/caddyplug
Experimental Caddy plugin manager using Go plugins
https://github.com/abiosoft/caddyplug
caddy go plugin plugin-manager
Last synced: 11 months ago
JSON representation
Experimental Caddy plugin manager using Go plugins
- Host: GitHub
- URL: https://github.com/abiosoft/caddyplug
- Owner: abiosoft
- License: apache-2.0
- Created: 2017-06-18T22:36:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-09T08:43:45.000Z (over 6 years ago)
- Last Synced: 2025-03-18T06:51:34.722Z (12 months ago)
- Topics: caddy, go, plugin, plugin-manager
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 40
- Watchers: 6
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# caddyplug
caddyplug is an experimental [Caddy](https://caddyserver.com) plugin manager using Go plugins.
[Demonstration Video](https://youtu.be/uKSgHhh6-rA)
## Requirements
- Go 1.8
- Linux/macOS
- Caddy with hook.pluginloader plugin. Installable with `caddyplug install-caddy`.
## Install
```
go get github.com/abiosoft/caddyplug/caddyplug
```
## Usage
```
Usage:
caddyplug [plugins...]
Commands:
install install plugins
uninstall uninstall plugins
list list plugins
install-caddy install caddy
package get plugin package
```
Example
```sh
$ caddyplug install git linode
✓ git
✓ linode
```
## Goal
### Building
#### Current:
- Edit source and add import line for plugin
- Rebuild Caddy
- Or select plugins and download on caddyserver.com/download
- Repeat
#### Desired:
- Install plugins
### Docker
#### Current:
Option 1
- Search for Docker image with desired plugins
- Give up and clone abiosoft/caddy (or similar) image
- Modify plugins arg in Dockerfile
- Worry about keeping track of upgrades to parent git/docker repo.
Option 2
- Use [abiosoft/caddy:builder](https://github.com/abiosoft/caddy-docker/blob/master/BUILDER.md)
- Requires `docker build` and/or pushing custom image to own registry
#### Desired:
Add plugins as required
```Dockerfile
FROM abiosoft/caddy:plugin # Hopefully this changes to 'FROM caddy'
RUN caddyplug install git hugo digitalocean
```
## Caveats
- Only works on Linux/macOS.
- Due to limitations of Go plugins, Caddy and plugins must be built with same Go version. Installing Caddy with caddyplug is recommended to ensure this.
- Not compatible with caddyserver.com/download yet. Requires [`CGO_ENABLED=1`](https://github.com/golang/go/issues/19569).
- Large Docker images. Multi-stage builds may help.
- Fetches `master` of plugin repositories.
- `go build --buildmode=plugin` is slow. Stop building on-demand, maybe.
- This is experimental and reliant on the [stability of Go plugins](https://github.com/golang/go/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20plugins).
## Note
- This is not an official Caddy product.