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

fix self-host documents script generated docker-compose.yaml file content. #35

Open
1 task
fs8vsx59h opened this issue Dec 9, 2023 · 1 comment
Open
1 task
Labels
bug Something isn't working

Comments

@fs8vsx59h
Copy link

Official Instance

Describe the bug

After running configure-instance.sh, the docker-compose file generated via traefik labels has some problems:

  1. The nginx container label for traefik "traefik.http.services.piped.loadbalancer.server.port=8080" uses wrong port. it should be 80.
  2. should clearly explain in documents, if user want to use an existing reverse proxy, the current compose file is correct, the user can just edit his configuration, reverse the localhost:8080. but traefik label only work when in the same docker network with nginx, and if user want to append a traefik container at the end of the compose file, the nginx container should not map ports.
  3. current:
    nginx:
        image: nginx:mainline-alpine
        restart: unless-stopped
        ports:
            - "8080:80"
        volumes:
            - ./config/nginx.conf:/etc/nginx/nginx.conf:ro
            - ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro
            - ./config/pipedproxy.conf:/etc/nginx/conf.d/pipedproxy.conf:ro
            - ./config/pipedfrontend.conf:/etc/nginx/conf.d/pipedfrontend.conf:ro
            - ./config/ytproxy.conf:/etc/nginx/snippets/ytproxy.conf:ro
            - piped-proxy:/var/run/ytproxy
        container_name: nginx
        depends_on:
            - piped
            - piped-proxy
            - pipedfrontend
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.piped.rule=Host(``)"
            - "traefik.http.routers.piped.entrypoints="
            - "traefik.http.services.piped.loadbalancer.server.port=8080"

changed:

    nginx:
        image: nginx:mainline-alpine
        restart: unless-stopped
        # ports:
        #     - "8080:80"
        volumes:
            - ./config/nginx.conf:/etc/nginx/nginx.conf:ro
            - ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro
            - ./config/pipedproxy.conf:/etc/nginx/conf.d/pipedproxy.conf:ro
            - ./config/pipedfrontend.conf:/etc/nginx/conf.d/pipedfrontend.conf:ro
            - ./config/ytproxy.conf:/etc/nginx/snippets/ytproxy.conf:ro
            - piped-proxy:/var/run/ytproxy
        container_name: nginx
        depends_on:
            - piped
            - piped-proxy
            - pipedfrontend
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.piped.rule=Host(``)"
            - "traefik.http.routers.piped.entrypoints="
            - "traefik.http.services.piped.loadbalancer.server.port=80"
            - "traefik.http.routers.piped.tls.certresolver="

To Reproduce

  1. First, install git, docker, and the compose plugin for docker.

  2. Run git clone https://github.com/TeamPiped/Piped-Docker.

  3. Then, run cd Piped-Docker.

  4. Then, run ./configure-instance.sh and fill in the hostnames when asked. Choose nginx as the reverse proxy when asked.

  5. Now, create A (and AAAA) records to your server’s public IP with the hostnames you had filled in above.

  6. Append a traefik container at last of compose file like this one:

    traefik:
        image: traefik:latest
        ports:
            - "80:80"
            - "443:443"
        volumes:
        - ./traefik/:/etc/traefik/
        - /var/run/docker.sock:/var/run/docker.sock:ro
  1. Run docker compose up -d.
  2. And the traefik logs start appear ‘502 bad gatewat' , nginx:8080 refuse connect. because traefik labels use wrong port.

Expected behavior

the traefik should connect nginx correctly , and start reverse proxy traffic

Logs/Errors

piped-docker-traefik-1  | time="2023-12-09T09:35:51Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.20.0.8:8080: connect: connection refused"
piped-docker-traefik-1  | time="2023-12-09T09:35:52Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.20.0.8:8080: connect: connection refused"
piped-docker-traefik-1  | time="2023-12-09T09:38:03Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.20.0.8:8080: connect: connection refused"
piped-docker-traefik-1  | time="2023-12-09T09:38:04Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.20.0.8:8080: connect: connection refused"

Browser, and OS with Version.

chrome:latest
windows10 workstation:latest
docker-ce:latest

Additional context

No response

@fs8vsx59h fs8vsx59h added the bug Something isn't working label Dec 9, 2023
@Bnyro Bnyro transferred this issue from TeamPiped/Piped Dec 9, 2023
@Bnyro
Copy link
Member

Bnyro commented May 23, 2024

Sounds reasonable, please create a pull request here at this repository!

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