Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Despite generation of new /etc/caddy/Caddyfile, cert for new container is not generated #13

Open
noisy opened this issue Sep 14, 2018 · 1 comment
Labels

Comments

@noisy
Copy link

noisy commented Sep 14, 2018

So I added this entry to docker compose

  sslwykop2:
    image: "katacoda/docker-http-server:v2"
    labels:
      - "virtual.host=test2.ssl-wykop.pl"  # your domains separated with a space
      - "virtual.port=80"  # exposed port of this container
      - "[email protected]"  # ssl is now on
      - "virtual.websockets" # enable websocket passthrough

It works, but not without restarting caddy-gen container. Logs without restarting caddy:

caddy-gen    | caddy.1    | https://ssl-wykop.pl
caddy-gen    | caddy.1    | 2018/09/14 01:49:11 https://ssl-wykop.pl
caddy-gen    | caddy.1    | https://test.ssl-wykop.pl
caddy-gen    | caddy.1    | 2018/09/14 01:49:11 https://test.ssl-wykop.pl
caddy-gen    | caddy.1    | http://ssl-wykop.pl
caddy-gen    | caddy.1    | 2018/09/14 01:49:11 http://ssl-wykop.pl
caddy-gen    | caddy.1    | http://test.ssl-wykop.pl
caddy-gen    | caddy.1    | 2018/09/14 01:49:11 http://test.ssl-wykop.pl
caddy-gen    | caddy.1    | 188.121.0.11 - - [14/Sep/2018:01:49:15 +0000] "GET / HTTP/2.0" 200 103
caddy-gen    | caddy.1    | 188.121.0.11 - - [14/Sep/2018:01:49:16 +0000] "GET /favicon.ico HTTP/2.0" 200 79
caddy-gen    | dockergen.1 | 2018/09/14 01:51:33 Received event start for container 135aedd5d062
caddy-gen    | dockergen.1 | 2018/09/14 01:51:33 Debounce minTimer fired
caddy-gen    | dockergen.1 | 2018/09/14 01:51:33 Generated '/etc/caddy/Caddyfile' from 10 containers
caddy-gen    | caddy.1    | 2018/09/14 01:51:53 http: TLS handshake error from 188.121.0.11:41824: no certificate available for test2.ssl-wykop.pl
caddy-gen    | caddy.1    | 2018/09/14 01:51:53 http: TLS handshake error from 188.121.0.11:41826: no certificate available for test2.ssl-wykop.pl

@titpetric
Copy link

titpetric commented Feb 13, 2020

This seems to be an old issue but it's still active today. In order to generate certs for new sites/containers, docker-gen container needs to be restarted. Seeon on caddy-gen:latest.

It also seems to ignore changes to the labels (virtual.port), requiring a restart of caddy-gen. I don't know where it goes wrong but the logs when adding a new container are like this:

caddy-gen    | dockergen.1 | 2020/02/13 11:35:05 Received event die for container fd7cfcbec073
caddy-gen    | dockergen.1 | 2020/02/13 11:35:05 Received event stop for container fd7cfcbec073
caddy-gen    | dockergen.1 | 2020/02/13 11:35:06 Debounce minTimer fired
caddy-gen    | dockergen.1 | 2020/02/13 11:35:06 Received event start for container 8bdb018644bc
caddy-gen    | dockergen.1 | 2020/02/13 11:35:06 Generated '/etc/caddy/Caddyfile' from 15 containers
caddy-gen    | dockergen.1 | 2020/02/13 11:35:07 Debounce minTimer fired
caddy-gen    | dockergen.1 | 2020/02/13 11:35:07 Contents of /etc/caddy/Caddyfile did not change. Skipping notification ''

@sobolevn sobolevn added the bug label Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants