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] UI setup does not work correctly using a Cloudflare tunnel #1673

Open
2 tasks done
richardfrost2 opened this issue Nov 8, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@richardfrost2
Copy link

richardfrost2 commented Nov 8, 2024

What happened?

When setting up the UI using a Cloudflare tunnel, the setup does not complete. It gives the error "Error
The hostname <bunkerweb.example.net> is already in use.", even if the hostname correctly points to the UI container. The expected behavior is that the setup continues.

How to reproduce?

Have a host with cloudflared installed, and set up a tunnel, "bunkerweb.example.com" (names are examples), resolving to localhost:80. Set up bunkerweb in the yaml file you provide docker-compose so that bunkerweb.example.com goes to the UI container "bw-ui". Launch your container group, and connect to bunkerweb.example.com. Fill out the UI for first time signin, setting REVERSE_PROXY_HOST to what is specified in the docker-config.yml file, REVERSE_PROXY_URL to any value, and server name to bunkerweb.example.com.

Configuration file(s) (yaml or .env)

#docker-compose.yml
version: "3.5"

services:
  bunkerweb:
    image: bunkerity/bunkerweb:1.5.10
    ports:
      - 80:8080
      - 443:8443
    labels:
      - "bunkerweb.INSTANCE=yes"
    environment:
      - SERVER_NAME=bunkerweb.example.net
      - MULTISITE=yes
      - API_WHITELIST_IP=127.0.0.0/8 10.20.30.0/24
      - USE_REVERSE_PROXY=yes
      - REVERSE_PROXY_URL=/
	# other services here...
      - bunkerweb.example.net_REVERSE_PROXY_HOST=http://bunkerweb-bw-ui-1:7000
    networks:
      - bw-universe
      - bw-services

  bw-scheduler:
    image: bunkerity/bunkerweb-scheduler:1.5.10
    depends_on:
      - bunkerweb
      - bw-docker
    environment:
      - DATABASE_URI=mariadb+pymysql://bunkerweb:password@bunkerweb-bw-db-1:3306/db # Remember to set a stronger password for the database
      - DOCKER_HOST=tcp://bunkerweb-bw-docker-1: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.10
    depends_on:
      - bw-docker
    environment:
      - DATABASE_URI=mariadb+pymysql://bunkerweb:password@bunkerweb-bw-db-1:3306/db # Remember to set a stronger password for the database
      - DOCKER_HOST=tcp://bunkerweb-bw-docker-1:2375
    networks:
      - bw-universe
      - bw-docker

  bw-db:
    image: mariadb:10.10
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=yes
      - MYSQL_DATABASE=db
      - MYSQL_USER=bunkerweb
      - MYSQL_PASSWORD=password
    volumes:
      - bw-data:/var/lib/mysql
    networks:
      - bw-docker

volumes:
  bw-data:

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

Relevant log output

10.45.1.45 - - [08/Nov/2024:01:37:32 +0000] "GET / HTTP/1.0" 302 199 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0"
10.45.1.45 - - [08/Nov/2024:01:37:32 +0000] "GET /setup HTTP/1.0" 200 943003 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0"
10.45.1.45 - - [08/Nov/2024:01:38:03 +0000] "GET /setup/check?server_name=bunkerweb.example.net HTTP/1.0" 404 207 "http://bunkerweb.example.net/setup" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0"
[2024-11-08 01:38:12 +0000] [flask_wtf.csrf] [27] [ℹ️ ] - The CSRF session token is missing.
10.45.1.45 - - [08/Nov/2024:01:38:13 +0000] "POST /setup HTTP/1.0" 403 12593 "http://bunkerweb.example.com/setup" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0"

BunkerWeb version

1.5.10

What integration are you using?

Docker

Linux distribution (if applicable)

Ubuntu 24.04.1 LTS x86_64

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
@richardfrost2 richardfrost2 added the bug Something isn't working label Nov 8, 2024
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

1 participant