summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2026-11-01 20:33:36 +0100
committerJesper Jensen <jesper@jnsn.dev>2026-11-01 21:34:19 +0100
commita265ee04af9b21379c4f33cf8838e579f71d99d6 (patch)
tree8511a085e413d813f660b0a4efa122959b27b93e /README.md
parentf4475b5f9e2e5e0cbf86e756c0e6a1bebcf1efdd (diff)
downloadcert-manager-webhook-hostinger-a265ee04af9b21379c4f33cf8838e579f71d99d6.tar.gz
cert-manager-webhook-hostinger-a265ee04af9b21379c4f33cf8838e579f71d99d6.zip
Implement Hostinger DNS webhook
Diffstat (limited to 'README.md')
-rw-r--r--README.md75
1 files changed, 69 insertions, 6 deletions
diff --git a/README.md b/README.md
index 24ec32c..b0e8712 100644
--- a/README.md
+++ b/README.md
@@ -27,6 +27,50 @@ expected.
## Creating your own webhook
+### Using Hostinger DNS
+
+The webhook implements the [Hostinger DNS zone API](https://docs.hostinger.com/api-reference/endpoints/dns/zone).
+Build and publish the image, then install the chart with a group name under a
+domain you own:
+
+```sh
+make build IMAGE_NAME=your-registry/webhook IMAGE_TAG=latest
+docker push your-registry/webhook:latest
+helm upgrade --install hostinger-webhook ./deploy/example-webhook \
+ --namespace cert-manager \
+ --set image.repository=your-registry/webhook \
+ --set image.tag=latest \
+ --set groupName=acme.example.com
+```
+
+Create a Hostinger API token in hPanel and store it in a Secret in cert-manager's
+cluster resource namespace (normally `cert-manager` for a ClusterIssuer):
+
+```sh
+kubectl -n cert-manager create secret generic hostinger-api-token \
+ --from-literal=api-token=YOUR_HOSTINGER_API_TOKEN
+```
+
+Use this solver in your Issuer or ClusterIssuer's `spec.acme.solvers`:
+
+```yaml
+- dns01:
+ webhook:
+ groupName: acme.example.com # Must match the Helm groupName.
+ solverName: hostinger
+ config:
+ apiKeySecretRef:
+ name: hostinger-api-token
+ key: api-token
+```
+
+The Secret is read from the challenge's resource namespace. For a namespaced
+Issuer, put the Secret in the Issuer's namespace and grant the webhook's service
+account `get` access there. The chart grants access to `apiKeySecretName` (default
+`hostinger-api-token`) in `certManager.namespace`; adjust these values if needed.
+Run a single webhook replica so record cleanup and presentation are serialized.
+Presentation appends the TXT value; cleanup preserves other values at that name.
+
Webhook's themselves are deployed as Kubernetes API services, in order to allow
administrators to restrict access to webhooks with Kubernetes RBAC.
@@ -51,13 +95,32 @@ else they will have undetermined behaviour when used with cert-manager.
**It is essential that you configure and run the test suite when creating a
DNS01 webhook.**
-An example Go test file has been provided in [main_test.go](https://github.com/cert-manager/webhook-example/blob/master/main_test.go).
+```sh
+export TEST_ZONE_NAME=example.com.
+export HOSTINGER_API_TOKEN # Populate this variable from your secret store.
+make test
+```
+
+`make test` runs the unit tests and cert-manager's actual `RunConformance` suite
+against `customDNSProviderSolver`, with strict mode enabled. This includes checking that
+deleting one TXT value preserves another at the same name. Missing configuration
+fails the command; conformance tests are never silently skipped. Test results
+are not cached.
+
+The suite creates and removes real TXT records under a unique
+`_acme-challenge.cert-manager-conformance-<random>.<zone>` name and checks public
+authoritative DNS. It downloads local Kubernetes test binaries and starts a
+temporary API server; no existing cluster is needed. The token is written to a
+temporary Secret fixture, applied in each test namespace, and removed afterward.
-You can run the test suite with:
+Run only the mock API and credential tests without live credentials or local
+Kubernetes binaries using:
-```bash
-$ TEST_ZONE_NAME=example.com. make test
+```sh
+make test-unit
```
-The example file has a number of areas you must fill in and replace with your
-own options in order for tests to pass.
+The conformance test is selected with the `conformance` build tag. If running Go
+directly, use `go test -tags=conformance -count=1 -timeout=30m ./...` and provide
+`TEST_ASSET_ETCD`, `TEST_ASSET_KUBE_APISERVER`, and `TEST_ASSET_KUBECTL` paths as
+well as the zone and token. Plain `go test ./...` runs only the unit tests.