Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joelnb/example-caddy-build-server
A simple example Go server which enables the same endpoint as the Caddy download page
https://github.com/joelnb/example-caddy-build-server
Last synced: 2 months ago
JSON representation
A simple example Go server which enables the same endpoint as the Caddy download page
- Host: GitHub
- URL: https://github.com/joelnb/example-caddy-build-server
- Owner: joelnb
- License: mit
- Created: 2022-10-09T13:20:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T18:56:06.000Z (7 months ago)
- Last Synced: 2024-10-17T18:02:48.017Z (3 months ago)
- Language: Go
- Size: 32.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example Caddy Build Server
## Motivation
Currently the [caddy-ansible role](https://github.com/caddy-ansible/caddy-ansible) defaults to downloading builds from github. If the user requests plugins however these are not available on github & the role defaults to using the caddy download page to perform the download. This works fine but the service is provided for free by the caddy project maintainers & should not be relied on, especially by people managing many machines.
This repo aims to show how a simple server can be setup which supports the same download endpoint as the caddy download page. This can then be used with the ansible role to provide a location controlled by the user from which to download.
## Usage
I wouldn't really recommend using this code unless you have read and understand it fully. I definitely wouldn't call it 'production-ready'. I created it for my own simple usage & to show how simply a compatible server can be created.
If you have read that and still want to give it a try you can run a local instance with:
```bash
docker run -p 127.0.0.1:8080:8081 --rm -it joelnb/example-caddy-build-server
```And then download the caddy binary with this example `curl` command:
```bash
curl -v "localhost:8080/api/download?os=linux&arch=amd64&p=github.com/caddy-dns/lego-deprecated" --output caddy
```If you wanted to share this between multiple machines then adding a reverse proxy with TLS termination would be recommended.