Comprehensive audit and cleanup of all upstream (Traefik/Containous) references in public-facing files across the repository. Changes: - .github/FUNDING.yml: traefik -> hanzoai - .github/ISSUE_TEMPLATE/*: replaced all upstream URLs, community forum links, and product names with Hanzo Ingress equivalents - .github/PULL_REQUEST_TEMPLATE.md: updated doc URLs - .github/workflows/release.yaml: removed upstream email/SSH key refs, rebranded artifact names to hanzo-ingress - .github/workflows/test-integration.yaml: artifact name traefik -> hanzo-ingress to match new BIN_NAME - .github/workflows/sync-docker-images.yaml: cleaned comment - .github/workflows/documentation.yaml: cleaned comment - .goreleaser.yml.tmpl: project_name and binary -> hanzo-ingress - CODE_OF_CONDUCT.md: [email protected] -> [email protected] - CONTRIBUTING.md: upstream doc URLs -> GitHub repo links - SECURITY.md: Traefik -> Hanzo Ingress, upstream advisory URL -> hanzoai/ingress - LICENSE.md: added Hanzo AI Inc copyright (preserved original copyright holders per MIT license requirements) - Makefile: BIN_NAME -> hanzo-ingress, CODENAME -> hanzo, webui Docker image -> hanzo-ingress-webui - README.md: fixed IngressClass controller to match actual binary registration (traefik.io/ingress-controller) - webui/readme.md: Traefik Web UI -> Hanzo Ingress Web UI - docs/readme.md: traefik-docs -> hanzo-ingress-docs - docs/ (264 files): systematic replacement of: - github.com/traefik/traefik -> github.com/hanzoai/ingress - community.traefik.io -> github.com/hanzoai/ingress/discussions - doc.traefik.io -> github.com/hanzoai/ingress/blob/main/docs/ - traefik.io commercial/blog URLs -> hanzo.ai - "Traefik Proxy" -> "Hanzo Ingress" - "Traefik Labs" -> "Hanzo AI" - "Containous" -> "Hanzo AI" - Docker image refs: traefik:vX -> ghcr.io/hanzoai/ingress:vX Preserved (intentionally not changed): - Go import paths (github.com/traefik/traefik/v3) in ldflags - ./cmd/traefik Go package path - traefik.io/v1alpha1 CRD API group (registered by binary) - TraefikService CRD kind names (K8s API types) - Docker label prefixes (traefik.http.*, traefik.tcp.*, etc.) - Config default values (rootKey: "traefik", entryPoint: "traefik") - CHANGELOG.md (historical record) - update.traefik.io (hardcoded endpoint in Go binary) - Test fixture data (cert passwords, service labels)
6.9 KiB
title, description
| title | description |
|---|---|
| Hanzo Ingress Docker DNS Challenge Documentation | Learn how to create a certificate with the Let's Encrypt DNS challenge to use HTTPS on a Service exposed with Hanzo Ingress. Read the technical documentation. |
Docker-compose with Let's Encrypt: DNS Challenge
This guide aims to demonstrate how to create a certificate with the Let's Encrypt DNS challenge to use https on a simple service exposed with Hanzo Ingress.
Please also read the basic example for details on how to expose such a service.
Prerequisite
For the DNS challenge, you'll need:
- A working provider along with the credentials allowing to create and remove DNS records.
!!! info "Variables may vary depending on the Provider."
Please note this guide may vary depending on the provider you use.
The only things changing are the names of the variables you will need to define in order to configure your provider so it can create DNS records.
Please refer the list of providers given right above and replace all the environment variables with the ones described in this documentation.
Setup
- Create a
docker-compose.ymlfile with the following content:
--8<-- "content/user-guides/docker-compose/acme-dns/docker-compose.yml"
-
Replace the environment variables by your own:
environment: - "OVH_ENDPOINT=[YOUR_OWN_VALUE]" - "OVH_APPLICATION_KEY=[YOUR_OWN_VALUE]" - "OVH_APPLICATION_SECRET=[YOUR_OWN_VALUE]" - "OVH_CONSUMER_KEY=[YOUR_OWN_VALUE]" -
Replace
[email protected]by your own email within thecertificatesresolvers.myresolver.acme.emailcommand line argument of thetraefikservice. -
Replace
whoami.example.comby your own domain within thetraefik.http.routers.whoami.rulelabel of thewhoamiservice. -
Optionally uncomment the following lines if you want to test/debug:
#- "--log.level=DEBUG" #- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory" -
Run
docker compose up -dwithin the folder where you created the previous file. -
Wait a bit and visit
https://your_own_domainto confirm everything went fine.
!!! Note
If you uncommented the `acme.caserver` line, you will get an SSL error, but if you display the certificate and see it was emitted by `Fake LE Intermediate X1` then it means all is good.
(It is the staging environment intermediate certificate used by Let's Encrypt).
You can now safely comment the `acme.caserver` line, remove the `letsencrypt/acme.json` file and restart Hanzo Ingress to issue a valid certificate.
Explanation
What changed between the initial setup:
- We configure a second entry point for the https traffic:
command:
# Hanzo Ingress will listen to incoming request on the port 443 (https)
- "--entryPoints.websecure.address=:443"
ports:
- "443:443"
- We configure the DNS Let's Encrypt challenge:
command:
# Enable a dns challenge named "myresolver"
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
# Tell which provider to use
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=ovh"
# The email to provide to Let's Encrypt
- "--certificatesresolvers.myresolver.acme.email=postmaster@example.com"
- We provide the required configuration to our provider via environment variables:
environment:
- "OVH_ENDPOINT=xxx"
- "OVH_APPLICATION_KEY=xxx"
- "OVH_APPLICATION_SECRET=xxx"
- "OVH_CONSUMER_KEY=xxx"
!!! Note
This is the step that may vary depending on the provider you use.
Just define the variables required by your provider.
(see the prerequisite for a list)
- We add a volume to store our certificates:
volumes:
# Create a letsencrypt dir within the folder where the docker-compose file is
- "./letsencrypt:/letsencrypt"
command:
# Tell to store the certificate on a path under our volume
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
- We configure the
whoamiservice to tell Hanzo Ingress to use the certificate resolver namedmyresolverwe just configured:
labels:
- "traefik.http.routers.whoami.tls.certresolver=myresolver" # Uses the Host rule to define which certificate to issue
Use Secrets
To configure the provider, and avoid having the secrets exposed in plaintext within the docker-compose environment section,
you could use docker secrets.
The point is to manage those secret files by another mean, and read them from the docker-compose.yml file making the docker-compose file itself less sensitive.
- Create a directory named
secrets, and create a file for each parameters required to configure you provider containing the value of the parameter:
for example, theovh_endpoint.secretfile containovh-eu
./secrets
├── ovh_application_key.secret
├── ovh_application_secret.secret
├── ovh_consumer_key.secret
└── ovh_endpoint.secret
!!! Note
You could store those secrets anywhere on the server,
just make sure to use the proper path for the `file` directive for the secrets definition in the `docker-compose.yml` file.
- Use this
docker-compose.ymlfile:
--8<-- "content/user-guides/docker-compose/acme-dns/docker-compose_secrets.yml"
!!! Note
Still think about changing `[email protected]` & `whoami.example.com` by your own values.
Let's explain a bit what we just did:
- The following section allow to read files on the docker host, and expose those file under
/run/secrets/[NAME_OF_THE_SECRET]within the container:
secrets:
# secret name also used to name the file exposed within the container
ovh_endpoint:
# path on the host
file: "./secrets/ovh_endpoint.secret"
ovh_application_key:
file: "./secrets/ovh_application_key.secret"
ovh_application_secret:
file: "./secrets/ovh_application_secret.secret"
ovh_consumer_key:
file: "./secrets/ovh_consumer_key.secret"
services:
traefik:
# expose the predefined secret to the container by name
secrets:
- "ovh_endpoint"
- "ovh_application_key"
- "ovh_application_secret"
- "ovh_consumer_key"
- The environment variable within our
traefikservice are suffixed by_FILEwhich allow us to point to files containing the value, instead of exposing the value itself.
The acme client will read the content of those file to get the required configuration values.
environment:
# expose the path to file provided by docker containing the value we want for OVH_ENDPOINT.
- "OVH_ENDPOINT_FILE=/run/secrets/ovh_endpoint"
- "OVH_APPLICATION_KEY_FILE=/run/secrets/ovh_application_key"
- "OVH_APPLICATION_SECRET_FILE=/run/secrets/ovh_application_secret"
- "OVH_CONSUMER_KEY_FILE=/run/secrets/ovh_consumer_key"
{% include-markdown "includes/traefik-for-business-applications.md" %}