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] Disable rewrite lets encrypt validation ? #1896

Open
2 tasks done
LiloBzH opened this issue Jan 12, 2025 · 6 comments
Open
2 tasks done

[BUG] Disable rewrite lets encrypt validation ? #1896

LiloBzH opened this issue Jan 12, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@LiloBzH
Copy link

LiloBzH commented Jan 12, 2025

What happened?

Hi

l want to valid certif on my synology
I created a reverse proxy mynas.internet.com to 192.168.1.100:80

It's work with every URL instead for certif

How to reproduce?

When a want to create a certif on synology, lets encrypt server go to :

http://mynas.internet.com/.well-known/acme-challenge/lR6RUsdfdsdqKP-rN7wzKsdqsdqsduVKDpYHszxQ

and Bunkerwek rewrite to open :

open() "/var/tmp/bunkerweb/lets-encrypt/.well-known/acme-challenge/lR6RUsdfdsdqKP-rN7wzKsdqsdqsduVKDpYHszxQ" failed (2: No such file or directory)

letsencrypt.lua rewrite every time.

Is it possible to bypass the rewrite ?

Thank's

Configuration file(s) (yaml or .env)

version: '3.5'

services:
  bunkerweb:
    image: bunkerity/bunkerweb:1.5.12
    ports:
      - 80:8080
      - 443:8443
    labels:
      - "bunkerweb.INSTANCE=yes"
    environment:
      - SERVER_NAME=mynas.internet.com
      - MULTISITE=yes
      - API_WHITELIST_IP=127.0.0.0/8 10.20.30.0/24 62.210.138.175
      - USE_BUNKERNET=no
      - mynas.internet.com_USE_UI=yes
      - mynas.internet.com_USE_REVERSE_PROXY=yes
      - mynas.internet.com_REVERSE_PROXY_URL=/admin
      - mynas.internet.com_REVERSE_PROXY_HOST=http://bw-ui:7000
      - mynas.internet.com_INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504
    networks:
      - bw-universe
      - bw-services

  bw-scheduler:
    image: bunkerity/bunkerweb-scheduler:1.5.12
    depends_on:
      - bunkerweb
      - bw-docker
    volumes:
      - bw-data:/data
    environment:
      - DOCKER_HOST=tcp://bw-docker:2375
    networks:
      - bw-universe
      - bw-docker

  bw-docker:
    image: tecnativa/docker-socket-proxy:nightly
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - CONTAINERS=1
      - LOG_LEVEL=warning
    networks:
      - bw-docker

  bw-ui:
    image: bunkerity/bunkerweb-ui:1.5.12
    depends_on:
      - bw-docker
    volumes:
      - bw-data:/data
    environment:
      - DOCKER_HOST=tcp://bw-docker:2375
      - ADMIN_USERNAME=admin
      - ADMIN_PASSWORD=adminadminadminadmin
    networks:
      - bw-universe
      - bw-docker

volumes:
  bw-data:

networks:
  bw-universe:
    name: bw-universe
    ipam:
      driver: default
      config:
        - subnet: 10.20.30.0/24
  bw-services:
    name: bw-services
  bw-docker:
    name: bw-docker

Relevant log output

2025/01/12 17:52:10 [notice] 3162#3162: *1842 [LETSENCRYPT] got a visit from Let's Encrypt, let's whitelist it, client: xxx.xxx.xxx.xxx, server: mynas.internet.com, request: "GET /.well-known/acme-challenge/lR6RsdqdqsdkwaKP-rN7wzK6odqsdqsdpYHszxQ HTTP/1.1", host: "mynas.internet.com"

2025/01/12 17:52:10 [notice] 3162#3162: *1842 [ACCESS] letsencrypt returned status 0 : visit from LE, client: xxx.xxx.xxx.xxx, server: mynas.internet.com, request: "GET /.well-known/acme-challenge/lR6RsdqdqsdkwaKP-rN7wzK6odqsdqsdpYHszxQ HTTP/1.1", host: "mynas.internet.com"

2025/01/12 17:52:10 [error] 3162#3162: *1842 open() "/var/tmp/bunkerweb/lets-encrypt/.well-known/acme-challenge/lR6RsdqdqsdkwaKP-rN7wzK6odqsdqsdpYHszxQ " failed (2: No such file or directory), client: xxx.xxx.xxx.xxx, server: mynas.internet.com, request: "GET /.well-known/acme-challenge/lR6RUcDwfnXZkwaKP-rN7wzK6oORfKu1uVKDpYHszxQ HTTP/1.1", host: "mynas.internet.com"

BunkerWeb version

1.5.12

What integration are you using?

Docker

Linux distribution (if applicable)

Proxmox - LXC

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
@LiloBzH LiloBzH added the bug Something isn't working label Jan 12, 2025
@TheophileDiot
Copy link
Member

Hi @LiloBzH, thank you for opening this issue. Did you try to use the Customcert plugin instead so BunkerWeb doesn't touch your certificates ?
https://docs.bunkerweb.io/latest/security-tuning/#custom-certificate

@LiloBzH
Copy link
Author

LiloBzH commented Jan 13, 2025

yes. the problem is that Bunkerweb analyzes the URL and as soon as it sees the string "/.well-known/acme-challenge/", it uses the /TMP/ directory.

For the moment, my only track is to modify the SERVER.CONF in /ETC/NGINX/website/server.conf

@TheophileDiot
Copy link
Member

Ah, I see. The certificates are moved afterward to allow for caching.
It’s possible there was an issue during the certificate creation process by the scheduler. I recommend checking the logs for any errors or warnings during that step to pinpoint the problem.

@LiloBzH
Copy link
Author

LiloBzH commented Jan 13, 2025

except that I do not want to create a certificate for this equipment via BunjerWeb.
Synology creates its certificate autonomously.
Bunkerweb would just have to redirect port 80 of this tomorrow to port 80 of the equipment without using your local /tmp/

@TheophileDiot
Copy link
Member

Oh I see, then what you're looking for is the Custom Certificate plugin and not Let's Encrypt.

@TheophileDiot
Copy link
Member

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