0

我正在尝试在我的树莓派 4 8gb 上运行一个 traefik docker 实例。我已经完成了所有设置,但我无法让我们加密认证工作。(我的名字注册商是Porkbun)

这是我的 docker-compose :

Version: '3.4'
services:
  traefik:
    image: 'traefik:2.3'
    restart: 'unless-stopped'
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - '/var/run/docker/sock:/var/run/docker.sock'
      - './config_files/traefik.toml:/traefik.toml'
      - './config_files/traefik_dynamic.toml:/traefik_dynamic.toml'
      - './config_files/acme.json:/acme.json'
    networks:
      - pi
  whoami:
    image: 'traefik/whoami'
    restart: 'unless-stopped'
    labels:
      - 'traefik.enable=true'
      - 'traefik.http.routers.whoami.rule=PathPrefix(`/whoami{regex:$$|/.*}`)'
      - 'traefik.http.services.whoami.loadbalancer.server.port=80'

networks:
  pi:
    external: true

这是我的 traefik.toml :

[entryPoints]
  [entryPoints.web]
     address = ":80"
     [entryPoints.web.http.redirections.entryPoint]  
       to = "websecure"
       scheme = "https"

   [entryPoints.websecure]
     address = ":443"

     [entryPoints.websecure.http.tls]
       certResolver = "lets-encrypt"

 [api]
   dashboard = true

 [certificatesResolvers.lets-encrypt.acme]
   email = "lucien.astie@gmail.com"
   storage = "acme.json"
   [certificatesResolvers.lets-encrypt.acme.tlsChallenge]


 [providers.docker]
   watch = true
   network = "web"
   exposedByDefault = false

 [providers.file]
   filename = "traefik_dynamic.toml"

最后是我的 traefik_dynamic.toml :

 [http.middlewares.simpleAuth.basicAuth]
   users = [
     "uberfluff:$apr1$qAWpnRq5$W94tcAy9JCKE6TN.Zy/Kp1"
   ]

 [http.routers.api]
   rule = "Host(`lulusworld.art`)"
   entrypoints = ["web"]
   middlewares = ["simpleAuth"]
   service = "api@internal"
   [http.routers.api.tls]
     certResolver = "lets-encrypt"

但是有了这一切,我得到了这个错误:

无法获得域“lulusworld.art”的 ACME 证书:无法为域 [lulusworld.art] 生成证书:错误:一个或多个域有问题:\n[lulusworld.art] acme:错误:400: : urn:ietf:params:acme:error:dns :: no valid A records found for lulusworld.art; 没有为 lulusworld.art 找到有效的 AAAA 记录,url:\n" routerName=api@file rule="Host( lulusworld.art)" providerName=lets-encrypt.acme

这是我尝试解决此问题的方法:

  • 我做了一条 A 记录(该记录有效但 SSL 无效)
  • 根据通配符证书的文档,您需要 DNS 挑战,但我无法让 pigbun 使用 DNS 挑战

如果您知道如何解决我的问题,将不胜感激。

4

0 回答 0