diff --git a/content/post/notes/mailcow/index.md b/content/post/notes/mailcow/index.md index e6cb2f6..48f19a4 100644 --- a/content/post/notes/mailcow/index.md +++ b/content/post/notes/mailcow/index.md @@ -8,4 +8,58 @@ author: "Colmaris" categories: - notes toc: true ---- \ No newline at end of file +--- +## Mailcow derrière Traefik + +Modifier le fichier de configuration `mailcow.conf`afin que nginx écoute sur les `8080` et `8443` + +```shell +HTTP_PORT=8080 +HTTP_BIND=127.0.0.1 + +HTTPS_PORT=8443 +HTTPS_BIND=127.0.0.1 +``` + +Dans l'arborescence de mailcow créer un fichier `docker-compose.override.yml` et placer les lignes suivantes. + +```yaml +services: + nginx-mailcow: + expose: + - 8080 + labels: + - traefik.enable=true + - traefik.http.routers.nginx-mailcow.rule=HostRegexp(`{host:(autodiscover|autoconfig|webmail|mail|email).+}`) + - traefik.http.routers.nginx-mailcow.entrypoints=https + - traefik.http.routers.nginx-mailcow.rule=Host(`${MAILCOW_HOSTNAME}`) + - traefik.http.routers.nginx-mailcow.tls=true + - traefik.http.routers.nginx-mailcow.tls.certresolver=le + # Uncomment to use wildcard cert: + # - traefik.http.routers.nginx-mailcow.tls.domains[0].main=example.com + # - traefik.http.routers.nginx-mailcow.tls.domains[0].sans=*.example.com + - traefik.http.routers.nginx-mailcow.service=nginx-mailcow + - traefik.http.services.nginx-mailcow.loadbalancer.server.port=8080 + - traefik.docker.network=traefik + networks: + - traefik + + certdumper: + image: humenius/traefik-certs-dumper + network_mode: none + command: --restart-containers mailcow_postfix-mailcow_1,mailcow_dovecot-mailcow_1,mailcow_nginx-mailcow_1 + volumes: + - /home/draconis/traefik/certificates:/traefik:ro + - /var/run/docker.sock:/var/run/docker.sock:ro + - ./data/assets/ssl:/output:rw + environment: + - DOMAIN=${MAILCOW_HOSTNAME} + # If using wildcard certs instead of an explicit host cert, + # use following line instead with just the TLD so certdumper + # is able to find the cert. + # - DOMAIN=YourDomain.com + +networks: + traefik: + external: true +``` diff --git a/hugo.toml b/hugo.toml index 88bf1c3..18054b9 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1,5 +1,5 @@ title = "Colmaris's blog" -baseURL = 'https://colmaris.fr' +baseURL = 'https://blog.colmaris.fr' # This is what goes in languageCode = 'fr-fr' @@ -141,7 +141,7 @@ url = "https://git.colmaris.fr/colmaris" [[params.socialIcons]] name = "mastodon" -url = "https://gts.colmaris.fr" +url = "https://mstdn.io/@draconis" [[params.socialIcons]] name = "Rss"