Initial commit
This commit is contained in:
commit
2cf3c0bdaa
3 changed files with 85 additions and 0 deletions
44
.github/workflows/docker-image.yml
vendored
Normal file
44
.github/workflows/docker-image.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
name: Publish Docker image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: main
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
push_to_registry:
|
||||||
|
name: Push Docker image to GitHub Packages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/wbrawner/caddy-porkbun
|
||||||
|
tags: |
|
||||||
|
type=schedule
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
7
Dockerfile
Normal file
7
Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
FROM caddy:2-builder-alpine AS builder
|
||||||
|
|
||||||
|
RUN xcaddy build --with github.com/caddy-dns/porkbun@v0.1.4
|
||||||
|
|
||||||
|
FROM caddy:2-alpine
|
||||||
|
|
||||||
|
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
34
README.md
Normal file
34
README.md
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# Caddy with Porkbun DNS Plugin
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Make sure to set the `PORKBUN_API_KEY` and `PORKBUN_API_SECRET_KEY` environment
|
||||||
|
variables to the corresponding values.
|
||||||
|
|
||||||
|
Then add the appropriate Caddy json config:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"module": "acme",
|
||||||
|
"challenges": {
|
||||||
|
"dns": {
|
||||||
|
"provider": {
|
||||||
|
"name": "porkbun",
|
||||||
|
"api_key": "{env.PORKBUN_API_KEY}",
|
||||||
|
"api_secret_key": "{env.PORKBUN_API_SECRET_KEY}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
or Caddyfile equivalent:
|
||||||
|
|
||||||
|
```
|
||||||
|
tls {
|
||||||
|
dns porkbun {
|
||||||
|
api_key {env.PORKBUN_API_KEY}
|
||||||
|
api_secret_key {env.PORKBUN_API_SECRET_KEY}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
Loading…
Reference in a new issue