我刚刚在 docker 中设置了一个 ubuntu 服务器,并在其上安装了gogs。
一切似乎都运行良好:我可以毫无问题地通过 firefox 访问 gogs,创建 repos 或添加文件,但是当我尝试git clone
从它或git push
从我的本地计算机进行 repo 时,我收到一个超时错误:
fatal: unable to access 'http://xx.x.xxx.xx:8001/username/test.git/': Recv failure: Connection was reset
一些信息:
- 如您所见,我没有正确的 dns,我通过原始 ip 和端口访问它。
- iptables 配置为允许在端口 8001 上输入/输出 tcp
- gogs 作为 init.d 服务运行
- gogs 服务的用户对 gogs_repository 目录具有 rw 访问权限
会议:Ubuntu 18.04.1 LTS,Gogs 0.11.66
更新:
- 我将 apache2 配置为代理,以便能够通过服务器名称访问 gogs,而无需指定端口(通过将请求重定向到端口 8001)。问题仍然存在。
- 我设法通过使用 repo 的完整路径通过 SSH 克隆了一个 repo:
git clone ssh://user@myserver/home/user/gogs-repositories/gogs-user/test.git
,感谢这篇文章
但是当我尝试使用http克隆时问题仍然存在。任何想法?
UPDATE2:这是我从本地计算机运行的 git 命令的详细跟踪:
$ git clone http://xx.x.xxx.xx:8001/user/test
14:50:09.131427 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files (x86)/Git/mingw32/bin
14:50:09.132424 git.c:415 trace: built-in: git clone http://10.5.255.28:8001/user/test
Cloning into 'test'...
14:50:09.179300 run-command.c:637 trace: run_command: git remote-http origin http://10.5.255.28:8001/user/test
14:50:09.224179 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files (x86)/Git/mingw32/libexec/git-core
14:50:09.228170 git.c:671 trace: exec: git-remote-http origin http://10.5.255.28:8001/user/test
14:50:09.228170 run-command.c:637 trace: run_command: git-remote-http origin http://10.5.255.28:8001/user/test
14:50:09.280032 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files (x86)/Git/mingw32/libexec/git-core
* Couldn't find host 10.5.255.28 in the _netrc file; using defaults
* Trying 10.5.255.28...
* TCP_NODELAY set
* Connected to 10.5.255.28 (10.5.255.28) port 8001 (#0)
> GET /user/test/info/refs?service=git-upload-pack HTTP/1.1
Host: 10.5.255.28:8001
User-Agent: git/2.19.1.windows.1
Accept: */*
Accept-Encoding: deflate, gzip
Pragma: no-cache
* Recv failure: Connection was reset
* Closing connection 0
fatal: unable to access 'http://xx.x.xxx.xx:8001/user/test/': Recv failure: Connection was reset