我刚在Docker里安装了一个ubuntu服务器
gogs
在上面。
一切似乎都很顺利:
我可以通过firefox访问gogs,没有任何问题
,创建repo或添加文件,但当我尝试
git clone
回购,或
git push
从本地计算机中,我收到一个超时错误:
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服务的用户可以通过rw访问gogs_repository目录
形态:ubuntu 18.04.1 LTS,gogs 0.11.66
更新
以下内容:
-
我将apache2配置为一个代理,可以通过服务器的名称访问gogs,而无需指定端口(通过将请求重定向到端口8001)。问题仍然存在。
-
我克隆了一个回购协议
通过ssh使用repo的完整路径:
git clone ssh://user@myserver/home/user/gogs-repositories/gogs-user/test.git
,多亏了
this post
但当我尝试使用http进行克隆时,问题仍然存在。知道吗?
更新2
以下内容:
下面是我从本地计算机运行的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