Unable to commit files to Gitea instance running on a Docker container

We have an instance of Gitea running on a Docker container within our cluster of services running on a CentOS 7 VM using Hyper-V on a Windows 10 Laptop. This Gitea server is listening on port 8443 on the Docker network (internally) and port 11002 (externally) which can be connected to via :11002 which is mapped to 8443 by the Docker Compose file, from my Windows box or any other box on my physical network.

I am able to connect to the repo and pull the repo down just fine, so the port forwarding is working correctly. Whenever I try to commit a file to :11002/.git, which is 192.168.2.56, I get the attached pre-receive hook declined error message with a dial tcp message. The here is my global public IP address. How does this know about my global public IP and why is it trying to connect to :8443?

I’ve talked to the Gitea Admin and he said they do not have any pre-receive hooks defined.

The funny thing is, if I connect my laptop via WiFi to a mobile hotspot, everything works great! Why am I getting this error when I plugged into ethernet only?

I’ve looked at all the gitea logs and container logs and I’m not seeing anything stick out other than…

[Macaron] 2020-09-02 13:18:22: Started GET /centralrepo.git/info/refs?service=git-receive-pack for 192.168.2.52
[Macaron] 2020-09-02 13:18:22: Completed GET /centralrepo.git/info/refs?service=git-receive-pack 401 Unauthorized in 3.428415ms
[Macaron] 2020-09-02 13:18:22: Started GET /centralrepo.git/info/refs?service=git-receive-pack for 192.168.2.52
[Macaron] 2020-09-02 13:18:22: Completed GET /centralrepo.git/info/refs?service=git-receive-pack 200 OK in 75.915127ms
[Macaron] 2020-09-02 13:18:23: Started POST /centralrepo.git/git-receive-pack for 192.168.2.52
[Macaron] 2020-09-02 13:18:23: Completed POST /centralrepo.git/git-receive-pack 200 OK in 350.232111ms
[root@noms ~]#

but I eventually get an OK 200.

Gitea uses git hooks internally to trigger events. This is happenening because gitea can’t validate the cert for localhost, you’ll need to use LOCAL_ROOT_URL setting and point to plaintext http port inside the container. More details here https://docs.gitea.io/en-us/config-cheat-sheet/#server-server

I added LOCAL_ROOT_URL = http://localhost:8443/ and I’m still seeing same error.

Config ini…

[server]
APP_DATA_PATH       = /home/git/data/gitea
# SSH_DOMAIN       = 172.18.36.37:8093
HTTP_PORT           = 8443
# ROOT_URL         = https://172.18.36.xx:xxxx
DISABLE_SSH         = true
SSH_PORT            = 22
LFS_START_SERVER    = false
OFFLINE_MODE        = false
PROTOCOL            = https
CERT_FILE           = /noms-certs/noms-server.pem
KEY_FILE            = /noms-certs/serverkey.pem
REDIRECT_OTHER_PORT = true
PORT_TO_REDIRECT    = 8080
LOCAL_ROOT_URL  = http://localhost:8443/