Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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] Docker-Compose setup #1466

Closed
2 tasks done
alwinhb opened this issue Sep 10, 2024 · 14 comments
Closed
2 tasks done

[BUG] Docker-Compose setup #1466

alwinhb opened this issue Sep 10, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@alwinhb
Copy link

alwinhb commented Sep 10, 2024

What happened?

I am trying to setup the complete stack using docker-compose, I have added my compose.yaml

Kindly guide/suggest if my compose file is ok or needs to be updated.

How to reproduce?

docker-compose up

Configuration file(s) (yaml or .env)

version: "3.5"

services:
  bunkerweb:
    image: bunkerity/bunkerweb:1.5.9
    ports:
      - 80:8080
      - 443:8443
    labels:
      - "bunkerweb.INSTANCE=yes"
    environment:
      - SERVER_NAME=www.example.com
      - API_WHITELIST_IP=127.0.0.0/8 10.20.30.0/24
    networks:
      - bw-universe
      - bw-services

  bw-scheduler:
    image: bunkerity/bunkerweb-scheduler:1.5.9
    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

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

bunker_waf-bw-scheduler-1  | Traceback (most recent call last):
bunker_waf-bw-scheduler-1  |   File "/usr/local/lib/python3.12/pathlib.py", line 1311, in mkdir
bunker_waf-bw-scheduler-1  |     os.mkdir(self, mode)
bunker_waf-bw-scheduler-1  | FileExistsError: [Errno 17] File exists: '/var/cache/bunkerweb'
bunker_waf-bw-scheduler-1  | 
bunker_waf-bw-scheduler-1  | During handling of the above exception, another exception occurred:
bunker_waf-bw-scheduler-1  | 
bunker_waf-bw-scheduler-1  | Traceback (most recent call last):
bunker_waf-bw-scheduler-1  |   File "/usr/share/bunkerweb/scheduler/main.py", line 41, in <module>
bunker_waf-bw-scheduler-1  | 
bunker_waf-bw-scheduler-1  |     CACHE_PATH.mkdir(parents=True, exist_ok=True)
bunker_waf-bw-scheduler-1  |   File "/usr/local/lib/python3.12/pathlib.py", line 1320, in mkdir
bunker_waf-bw-scheduler-1  |     if not exist_ok or not self.is_dir():
bunker_waf-bw-scheduler-1  |                            ^^^^^^^^^^^^^
bunker_waf-bw-scheduler-1  |   File "/usr/local/lib/python3.12/pathlib.py", line 875, in is_dir
bunker_waf-bw-scheduler-1  |     return S_ISDIR(self.stat().st_mode)
bunker_waf-bw-scheduler-1  |                    ^^^^^^^^^^^
bunker_waf-bw-scheduler-1  |   File "/usr/local/lib/python3.12/pathlib.py", line 840, in stat
bunker_waf-bw-scheduler-1  |     return os.stat(self, follow_symlinks=follow_symlinks)
bunker_waf-bw-scheduler-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bunker_waf-bw-scheduler-1  | PermissionError: [Errno 13] Permission denied: '/var/cache/bunkerweb'
bunker_waf-bw-scheduler-1  | [2024-09-10 10:58:52] - ENTRYPOINT - ℹ️  - Scheduler stopped

BunkerWeb version

1.5.9

What integration are you using?

Docker

Linux distribution (if applicable)

No response

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
@alwinhb alwinhb added the bug Something isn't working label Sep 10, 2024
@cocoonkid
Copy link

cocoonkid commented Sep 10, 2024

I had the same issue.

just stop the services and delete the bunkerweb volume.

Then restart them.

It will regenerate all your certs and start from scratch but it will work.

@alwinhb
Copy link
Author

alwinhb commented Sep 11, 2024

I still get this error Access denied for user 'bunkerweb'@'{MY_IP_ADD}

Can you add your compose file?

@cocoonkid

@ff6347 @adren @FacundoAcevedo

@fl0ppy-d1sk
Copy link
Member

Hello @alwinhb,

Can you try docker compose down -v before starting the stack ? (-v is important)

@alwinhb
Copy link
Author

alwinhb commented Sep 16, 2024

@fl0ppy-d1sk Thanks it worked

Now as i go to http://localhost:7000

As i add the admin username and password, I see this error Wrong CSRF token !

Also I tried using http://localhost:7000/setup but it routes again to http://localhost:7000/login

Can you guide on this error

@ff6347 @adren @FacundoAcevedo

@TheophileDiot
Copy link
Member

Hi @alwinhb, sorry for the late response. Did you have a look at this ?
https://docs.bunkerweb.io/latest/web-ui/#advanced-installation

@alwinhb
Copy link
Author

alwinhb commented Oct 22, 2024

@TheophileDiot
I am unable to see login page using the compose yaml available at this link.

I get 403 error using below yaml

version: "3.5"

services:
  bunkerweb:
    image: bunkerity/bunkerweb:1.5.10
    ports:
      - 80:8080
      - 443:8443
    labels:
      - "bunkerweb.INSTANCE=yes"
    environment:
      - SERVER_NAME=www.example.com
      - MULTISITE=yes
      - DATABASE_URI=mariadb+pymysql://bunkerweb:changeme@bw-db:3306/db # Remember to set a stronger password for the database
      - API_WHITELIST_IP=127.0.0.0/8 10.20.30.0/24
      - DISABLE_DEFAULT_SERVER=yes
      - USE_CLIENT_CACHE=yes
      - USE_GZIP=yes
      - www.example.com_USE_UI=yes
      - www.example.com_USE_REVERSE_PROXY=yes
      - www.example.com_REVERSE_PROXY_URL=/changeme
      - www.example.com_REVERSE_PROXY_HOST=http://bw-ui:7000
      - www.example.com_INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504
      - www.example.com_MAX_CLIENT_SIZE=50m
    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:changeme@bw-db:3306/db # Remember to set a stronger password for the database
      - 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.10
    depends_on:
      - bw-docker
    environment:
      - DATABASE_URI=mariadb+pymysql://bunkerweb:changeme@bw-db:3306/db # Remember to set a stronger password for the database
      - DOCKER_HOST=tcp://bw-docker:2375
      - ADMIN_USERNAME=changeme
      - ADMIN_PASSWORD=changeme # Remember to set a stronger password for the changeme user
    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=changeme # Remember to set a stronger password for the database
    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-services:
    name: bw-services
  bw-docker:
    name: bw-docker
    

@TheophileDiot
Copy link
Member

@alwinhb how do you access the web UI ?

@alwinhb
Copy link
Author

alwinhb commented Oct 22, 2024

@TheophileDiot localhost:8080

Little change in my docker compose

   ports:
      - 8080:8080
      - 443:8443
      
      ```

@TheophileDiot
Copy link
Member

TheophileDiot commented Oct 22, 2024

Do you try to access it via https://your-ip-address-or-fqdn/changeme ?

@alwinhb
Copy link
Author

alwinhb commented Oct 22, 2024

Yeah and I get - Access is forbidden to the requested page

@TheophileDiot

@TheophileDiot
Copy link
Member

@alwinhb Did you edit your hosts file by adding this entry ?

127.0.0.1 www.example.com

If not that's the issue, you should be able to access the web UI via https://www.example.com/changeme afterward

@alwinhb
Copy link
Author

alwinhb commented Oct 24, 2024

@TheophileDiot - This issue is resolved - "Access is forbidden now",

But now I get a blank page with text - "Nothing to see here"

I want to setup and add my configurations but I don't see setup page with /setup.

@TheophileDiot
Copy link
Member

@alwinhb if you want to use the setup wizard, you have to follow this tutorial : https://docs.bunkerweb.io/latest/web-ui/#setup-wizard

@alwinhb
Copy link
Author

alwinhb commented Oct 25, 2024

@TheophileDiot Thanks for the link, I tried using the docker compose yaml present at this link but Still I get - "Nothing to see here"

Can you guide me with the right docker compose.yaml that I can use for my local setup?

@bunkerity bunkerity locked and limited conversation to collaborators Oct 25, 2024
@TheophileDiot TheophileDiot converted this issue into discussion #1619 Oct 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants