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

[BUG] Certs for non-autoconf sites are not applied #1202

Closed
2 tasks done
LeVraiRoiDHyrule opened this issue May 22, 2024 · 2 comments
Closed
2 tasks done

[BUG] Certs for non-autoconf sites are not applied #1202

LeVraiRoiDHyrule opened this issue May 22, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@LeVraiRoiDHyrule
Copy link

What happened?

Hi,
Since the latest updates, I am having the following problem.
I am using autoconf. I have sites set from autoconf and other set from normal configuration on the bw-main container.
Certs for autoconf sites work fine.
But certs for non-autoconf don't. I have the following letsencrypt config:

      # LETSENCRYPT
      - AUTO_LETS_ENCRYPT=yes
      - USE_LETS_ENCRYPT_STAGING=no
      - LETS_ENCRYPT_CLEAR_OLD_CERTS=no

According to the scheduler logs, the certs for the problematic sites are correctly generated (there is no error). Letsencrypt challenge succeed. I can find the certs in /bunkerweb/scheduler/cache/letsencrypt/etc/live.

But it is like the certs are not applied to the sites. Browsers see no cert at all. It is not SSL cache as this happens on all browsers.

I have the following error in my main bw container:

2024/05/22 12:11:07 [warn] 62#62: conflicting server name "openmediavault.REDACTED.com" on [::]:8443, ignored
2024/05/22 12:11:07 [warn] 62#62: conflicting server name "openmediavault.REDACTED.com" on 0.0.0.0:8443, ignored
2024/05/22 12:11:07 [warn] 62#62: conflicting server name "openmediavault.REDACTED.com" on [::]:8080, ignored
2024/05/22 12:11:07 [warn] 98#98: conflicting server name "openmediavault.REDACTED.com" on [::]:8443, ignored
nginx: [warn] conflicting server name "openmediavault.REDACTED.com" on [::]:8443, ignored
nginx: [warn] conflicting server name "openmediavault.REDACTED.com" on 0.0.0.0:8443, ignored
2024/05/22 12:11:07 [warn] 98#98: conflicting server name "openmediavault.REDACTED.com" on 0.0.0.0:8443, ignored
2024/05/22 12:11:07 [warn] 98#98: conflicting server name "openmediavault.REDACTED.com" on [::]:8080, ignored
nginx: [warn] conflicting server name "openmediavault.REDACTED.com" on [::]:8080, ignored

Would you have an idea of what could cause this ? Thanks in advance.

How to reproduce?

  • Set up a config with both autoconf and non-autoconf sites (unsure if the presence of autoconf sites has a role or not)
  • Use the same settings as me
  • Add flour and sugar
  • You should have the similar error

Configuration file(s) (yaml or .env)

- PUID=${PUID}
          - PGID=${PGID}
          - TZ=${TZ}
          
          # BASE
          - API_WHITELIST_IP=${BUNKERWEB_UNIVERSE_IP}.0/24
          - AUTOCONF_MODE=yes
          - USE_IPV6=yes
          - MULTISITE=yes
          - USE_API=yes
          - USE_REDIS=yes
          - USE_UI=yes
          - REDIS_HOST=bunkerweb-redis
          - UI_HOST=http:https://bunkerweb-ui:7000
     
          # LETSENCRYPT
          - AUTO_LETS_ENCRYPT=yes
          - USE_LETS_ENCRYPT_STAGING=no
          - LETS_ENCRYPT_CLEAR_OLD_CERTS=no
     
          # SECURITY
          - SERVE_FILES=no
          - USE_GZIP=no
          - USE_BROTLI=yes
     
          - DISABLE_DEFAULT_SERVER=yes
          - USE_CLIENT_CACHE=yes
          - LISTEN_HTTP=no
          - REDIRECT_HTTP_TO_HTTPS=yes
          - DENY_HTTP_STATUS=444
          - USE_ANTIBOT=turnstile
          - ANTIBOT_TURNSTILE_SITEKEY=${BUNKERWEB_TURNSTILE_SITEKEY}
          - ANTIBOT_TURNSTILE_SECRET=${BUNKERWEB_TURNSTILE_SECRETKEY}
          - USE_REVERSE_SCAN=no
          - WHITELIST_COUNTRY=FR CH
          - MODSECURITY_CRS_VERSION=4
     
          # PLUGINS
          - EXTERNAL_PLUGIN_URLS=https://github.com/bunkerity/bunkerweb-plugins/archive/refs/tags/v1.5.zip 
          - USE_CROWDSEC=yes
          - CROWDSEC_API=http:https://crowdsec:8080
          - CROWDSEC_API_KEY=${BUNKERWEB_CROWDSEC_KEY}
     
          - USE_CLAMAV=yes
          - CLAMAV_HOST=clamav
     
          #- USE_WEBHOOK=yes
          #- WEBHOOK_URL=https://api.example.com/bw
          # A ajouter avec apprise
     
          # SITES
          - SERVER_NAME=openmediavault.${DOMAIN}
          
          - openmediavault.${DOMAIN}_USE_REVERSE_PROXY=yes
          - openmediavault.${DOMAIN}_REVERSE_PROXY_URL=/
          - openmediavault.${DOMAIN}_REVERSE_PROXY_HOST=http:https://192.168.1.27:10997
          - openmediavault.${DOMAIN}_LIMIT_REQ_RATE=10r/s
          - |
            openmediavault.${DOMAIN}_CUSTOM_CONF_MODSEC_openmediavault=
            SecRule REQUEST_URI "/rpc.php" "id:1,ctl:ruleRemoveById=920420"
            SecRule REQUEST_URI "/rpc.php" "id:2,ctl:ruleRemoveById=953120"

Relevant log output

2024/05/22 12:11:07 [warn] 62#62: conflicting server name "openmediavault.REDACTED.com" on [::]:8443, ignored
2024/05/22 12:11:07 [warn] 62#62: conflicting server name "openmediavault.REDACTED.com" on 0.0.0.0:8443, ignored
2024/05/22 12:11:07 [warn] 62#62: conflicting server name "openmediavault.REDACTED.com" on [::]:8080, ignored
2024/05/22 12:11:07 [warn] 98#98: conflicting server name "openmediavault.REDACTED.com" on [::]:8443, ignored
nginx: [warn] conflicting server name "openmediavault.REDACTED.com" on [::]:8443, ignored
nginx: [warn] conflicting server name "openmediavault.REDACTED.com" on 0.0.0.0:8443, ignored
2024/05/22 12:11:07 [warn] 98#98: conflicting server name "openmediavault.REDACTED.com" on 0.0.0.0:8443, ignored
2024/05/22 12:11:07 [warn] 98#98: conflicting server name "openmediavault.REDACTED.com" on [::]:8080, ignored
nginx: [warn] conflicting server name "openmediavault.REDACTED.com" on [::]:8080, ignored

BunkerWeb version

1.5.7

What integration are you using?

Autoconf

Linux distribution (if applicable)

OpenMediaVault (Debian Bookworm)

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct
@LeVraiRoiDHyrule LeVraiRoiDHyrule added the bug Something isn't working label May 22, 2024
@TheophileDiot TheophileDiot self-assigned this May 23, 2024
@TheophileDiot
Copy link
Member

Hi @LeVraiRoiDHyrule, thank you for opening this issue. I'll have a look into it and let you know.

TheophileDiot added a commit that referenced this issue May 23, 2024
…ains changed

This commit adds a new optional parameter, `force`, to the `certbot_new` function in the `certbot-new.py` file. The `force` parameter allows for forcing the renewal of certificates even if they are not due for renewal. This can be useful in certain scenarios where certificate updates are required regardless of their expiration date.
@TheophileDiot
Copy link
Member

@LeVraiRoiDHyrule, update on this. The subdomains' certificates were indeed not updated.
I just tested it with the commit that references this issue and it should all be fixed !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants