[solved] Proxy settings in gitea docker container

I’m running here into a weird issue with https proxy settings. Gitea is running as ca docker container defined via docker-compose in a docke swarm cluster.

After setting the environment up, I tried to migrate repositories from other gitea instances.
Unfortunately there is a corporate proxy between the new and old gitea instances.

So I tried to set the environment variables http_proxy, https_proxy and no_proxy. But gitea doesn’t seem to work with them. I always get the same error:

The container log shows:

2021/01/28 15:11:30 modules/task/task.go:51:handle() [E] Run task failed: migrate from 'gitea.YYYY.XXXX.com' is not allowed: unknown hostname

my docker-composer looks like this:

    image: gitea/gitea:1.13
      - "3000:3000"
      - "222:22"
      - db
    restart: unless-stopped
      - "http_proxy=http://user:passwd@proxy.XXX.YYY.net:3128"
      - "https_proxy=http://user:passwd@proxy.XXX.YYY.net:3128""
      - "no_proxy=.xxxx.net,.yyyy.net"
      - "APP_NAME=My Gitea"
      - "RUN_MODE=prod"
      - "DOMAIN=gitea.XXXXx.net"
      - "SSH_PORT=222"
      - "SSH_LISTEN_PORT=22"
      - "DISABLE_SSH=true"
      - "ROOT_URL=https://gitea.XXXXX.net"
      - "LFS_START_SERVER=true"
      - "DB_TYPE=mysql"
      - "DB_HOST=db:3306"
      - "DB_NAME=fooo"
      - "DB_USER=bar"
      - "REQUIRE_SIGIN_VIEW=true"
      replicas: 1
        - "traefik.enable=true"
        - "traefik.docker.network=traefik-public"
        - "traefik.http.routers.gitea.rule=Host(`gitea.XXXXX.net`)"
        - "traefik.http.routers.gitea.entrypoints=http"
        - "traefik.http.routers.gitea.entrypoints=https"
        - "traefik.http.routers.gitea.tls=true"
        - "traefik.http.services.gitea-srv.loadbalancer.server.port=3000"
      - gitea:/data
      - traefik-public
      - cicd

I also tried the environment vars in uppercase and with a tailing / in the url. Sill the same issue…

Do you have any idea?

Testing updates
  • Proxy settings seems to be fine. Started an interactive console of the running container and checked if the env vars are present. Also tested native curl, wget commands which responded the target correctl.

Although this shouldn’t change anything, I also tried to add the proxy settings into the image itself:

FROM go-gitea/gitea:1.13
ENV https_proxy <proxy>
ENV http_proxy <proxy>
ENV no_proxy <excludes>

Did anyone tried to use a transparent proxy in a docker overlay network?

Issue solved. The problem was caused by a faulty proxy ha config. rage

@techknowlogick: Could you please close this topic? Thanks :smiley: