[GH-ISSUE #13] Docker Container auth file creation failure #9

Closed
opened 2026-02-27 16:46:45 +03:00 by kerem · 4 comments
Owner

Originally created by @DevGuyRash on GitHub (Oct 26, 2025).
Original GitHub issue: https://github.com/router-for-me/EasyCLI/issues/13

Describe the bug
#144 - Bringing this back up because even using https://github.com/router-for-me/EasyCLI does not allow someone to create new auth files if the remotely managed server is being hosted by Docker.

I've tried creating an auth file for:

  • Codex
  • iflow
  • Google's Gemini

It always returns 404 error no matter what. I've tried using self-hosted and also running it on my server, etc.

I've tried creating the auth files using the docker container itself and running the command and using EasyCLI to connect to it and create it that way, but it's still the same thing.

The actual login is always fine, but it cannot create the auth files because it always produces 404 page not found on callback.

This is only when the server is running in a docker container, and that's it. It works outside of a docker container.


Image
Image
Originally created by @DevGuyRash on GitHub (Oct 26, 2025). Original GitHub issue: https://github.com/router-for-me/EasyCLI/issues/13 **Describe the bug** #144 - Bringing this back up because even using https://github.com/router-for-me/EasyCLI does not allow someone to create new auth files if the remotely managed server is being hosted by Docker. I've tried creating an auth file for: - Codex - iflow - Google's Gemini It always returns 404 error no matter what. I've tried using self-hosted and also running it on my server, etc. I've tried creating the auth files using the docker container itself and running the command and using EasyCLI to connect to it and create it that way, but it's still the same thing. The actual login is always fine, but it cannot create the auth files because it always produces `404 page not found` on callback. This is **only** when the server is running in a docker container, and that's it. It works outside of a docker container. --- <img width="507" height="348" alt="Image" src="https://github.com/user-attachments/assets/ed5fb6d9-f76c-45ed-8fbd-a2364c2a7337" /> --- <img width="578" height="191" alt="Image" src="https://github.com/user-attachments/assets/17572812-ce7e-4f08-b318-a2023daa9631" />
kerem closed this issue 2026-02-27 16:46:45 +03:00
Author
Owner

@luispater commented on GitHub (Oct 26, 2025):

Which CLIProxyAPI version?

<!-- gh-comment-id:3448990145 --> @luispater commented on GitHub (Oct 26, 2025): Which CLIProxyAPI version?
Author
Owner

@luispater commented on GitHub (Oct 26, 2025):

You can always visit the "/google/callback" URL. Are you sure the domain is correct?

<!-- gh-comment-id:3448994105 --> @luispater commented on GitHub (Oct 26, 2025): You can always visit the "/google/callback" URL. Are you sure the domain is correct?
Author
Owner

@DevGuyRash commented on GitHub (Oct 27, 2025):

I actually ended up fixing it!

There are two versions I had to fix:

  1. Running it locally on my PC in the docker container
  2. Running it on my server using Traefik

Local Fix

This was easy. I just removed all the ports/networks and changed it to run in network_mode: host

Server Fix

I added some routers and services in the dynamic config for Traefik which made it start working, alongside enabling a few things in the traefik docker compose:

Traefik

# Traefik dynamic config (file provider)
http:
  routers:
    # One router per provider (adjust host name and entrypoint)
    cliproxy-cb-google:
      rule: "Host(`<my-subdomain>.<my-domain>.com`) && (Path(`/google/callback`) || PathPrefix(`/google/callback/`))"
      entryPoints: ["websecure"]   # ← replace with your HTTPS entrypoint name
      service: cliproxy-callback-google

    cliproxy-cb-openai:
      rule: "Host(`<my-subdomain>.<my-domain>.com`) && (Path(`/openai/callback`) || PathPrefix(`/openai/callback/`))"
      entryPoints: ["websecure"]
      service: cliproxy-callback-openai

    cliproxy-cb-claude:
      rule: "Host(`<my-subdomain>.<my-domain>.com`) && (Path(`/claude/callback`) || PathPrefix(`/claude/callback/`))"
      entryPoints: ["websecure"]
      service: cliproxy-callback-claude

    cliproxy-cb-iflow:
      rule: "Host(`<my-subdomain>.<my-domain>.com`) && (Path(`/iflow/callback`) || PathPrefix(`/iflow/callback/`))"
      entryPoints: ["websecure"]
      service: cliproxy-callback-iflow

  services:
    # Each service points at the local loopback listener port used during login
    cliproxy-callback-google:
      loadBalancer:
        servers:
          - url: "http://host.docker.internal:8085"

    cliproxy-callback-openai:
      loadBalancer:
        servers:
          - url: "http://host.docker.internal:1455"

    cliproxy-callback-claude:
      loadBalancer:
        servers:
          - url: "http://host.docker.internal:54545"

    cliproxy-callback-iflow:
      loadBalancer:
        servers:
          - url: "http://host.docker.internal:11451"

Then in my traefik service inside docker compose file I added:

# in traefik service (docker-compose)
extra_hosts:
  - "host.docker.internal:host-gateway"

CLI Proxy API

Modified ports to:

# in the CLIProxy compose (server)
ports:
  - "127.0.0.1:8085:8085"     # Google/Gemini
  - "127.0.0.1:1455:1455"     # OpenAI/Codex
  - "127.0.0.1:54545:54545"   # Claude
  - "127.0.0.1:11451:11451"   # iFlow
<!-- gh-comment-id:3449292342 --> @DevGuyRash commented on GitHub (Oct 27, 2025): I actually ended up fixing it! There are two versions I had to fix: 1. Running it locally on my PC in the docker container 2. Running it on my server using Traefik ### Local Fix This was easy. I just removed all the ports/networks and changed it to run in `network_mode: host` ### Server Fix I added some routers and services in the dynamic config for Traefik which made it start working, alongside enabling a few things in the traefik docker compose: #### Traefik ```yaml # Traefik dynamic config (file provider) http: routers: # One router per provider (adjust host name and entrypoint) cliproxy-cb-google: rule: "Host(`<my-subdomain>.<my-domain>.com`) && (Path(`/google/callback`) || PathPrefix(`/google/callback/`))" entryPoints: ["websecure"] # ← replace with your HTTPS entrypoint name service: cliproxy-callback-google cliproxy-cb-openai: rule: "Host(`<my-subdomain>.<my-domain>.com`) && (Path(`/openai/callback`) || PathPrefix(`/openai/callback/`))" entryPoints: ["websecure"] service: cliproxy-callback-openai cliproxy-cb-claude: rule: "Host(`<my-subdomain>.<my-domain>.com`) && (Path(`/claude/callback`) || PathPrefix(`/claude/callback/`))" entryPoints: ["websecure"] service: cliproxy-callback-claude cliproxy-cb-iflow: rule: "Host(`<my-subdomain>.<my-domain>.com`) && (Path(`/iflow/callback`) || PathPrefix(`/iflow/callback/`))" entryPoints: ["websecure"] service: cliproxy-callback-iflow services: # Each service points at the local loopback listener port used during login cliproxy-callback-google: loadBalancer: servers: - url: "http://host.docker.internal:8085" cliproxy-callback-openai: loadBalancer: servers: - url: "http://host.docker.internal:1455" cliproxy-callback-claude: loadBalancer: servers: - url: "http://host.docker.internal:54545" cliproxy-callback-iflow: loadBalancer: servers: - url: "http://host.docker.internal:11451" ``` Then in my traefik service inside docker compose file I added: ```yaml # in traefik service (docker-compose) extra_hosts: - "host.docker.internal:host-gateway" ``` #### CLI Proxy API Modified ports to: ```yaml # in the CLIProxy compose (server) ports: - "127.0.0.1:8085:8085" # Google/Gemini - "127.0.0.1:1455:1455" # OpenAI/Codex - "127.0.0.1:54545:54545" # Claude - "127.0.0.1:11451:11451" # iFlow ```
Author
Owner

@luispater commented on GitHub (Oct 27, 2025):

When using EasyCLI's remote mode to connect to a local docker instance.

You need to disable these docker port forwards.

This is because EasyCLI enables the same ports for simple port forwarding.

If docker has these ports open, the ports will be occupied, preventing EasyCLI from functioning correctly.

<!-- gh-comment-id:3449310706 --> @luispater commented on GitHub (Oct 27, 2025): When using EasyCLI's remote mode to connect to a local docker instance. You need to disable these docker port forwards. This is because EasyCLI enables the same ports for simple port forwarding. If docker has these ports open, the ports will be occupied, preventing EasyCLI from functioning correctly.
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/EasyCLI#9
No description provided.