linuxserver / docker-swag

Nginx webserver and reverse proxy with php support and a built-in Certbot (Let's Encrypt) client. It also contains fail2ban for intrusion prevention.
https://docs.linuxserver.io/general/swag
GNU General Public License v3.0
2.66k stars 231 forks source link

[BUG] Certbot can not create multiple sub-domains #484

Closed ariadi closed 1 month ago

ariadi commented 1 month ago

Is there an existing issue for this?

Current Behavior

Here my docker-compose.yaml


services:
###### External Nginx for Gitlab Instance ######
  swag:
    image: lscr.io/linuxserver/swag:latest
    container_name: swag
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    ports:
      - 443:443
      - 80:80
    volumes:
      - ./swag/config:/config
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Jakarta
      - URL=example.com
      - SUBDOMAINS=gitlab,registry
      - ONLY_SUBDOMAINS=true
      - VALIDATION=http
      - EMAIL=me@example.com
      - STAGING=false

I run docker compose up -d swag and

docker logs -f swag to get logs as below

Screenshot 2024-05-31

The log says that Certbot will create two subdomains namely: gitlab.example.com and registry.example.com

but actually it created only one sub-domain, the first one (gitlab.example.com) with no subdomain registry.example.com

Then, to prove it, I check into container:

docker exec -it swag /bin/bash

Screenshot 2024-05-31 - 2

Expected Behavior

It should create two certificates.

gitlab.example.com

and

registry.example.com

Steps To Reproduce

Already mentioned above

Environment

- OS:Ubuntu 20.04 (LTS)
- How docker service was installed: yes, from its distro PM

CPU architecture

x86-64

Docker creation

already mentioned above

Container logs

already given screenshot above.

Thankyou.
github-actions[bot] commented 1 month ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 1 month ago

Certbot creates one cert with multiple SANs