gogs同一个坑进去两次...

浪子huang 2019-06-27

第一次用gogs,选了最新的这个0.11.43,linux 386版。
有坑,其他版本没测试,不知道有没有。

无论你有没有把git加到PATH中,gogs始终在/bin下面找git...然后提示你:Fail to test 'git' command: exec: "git": executable file not found in $PATH (forgotten install?)

做软连接:

ln -s /usr/local/git/bin/git /bin/git

填坑之后启动成功。然后其他挺顺,创建仓库、创建用户、http方式clone,都没问题,但到了ssh方式,就又卡住了。。

Cloning into 'test2'...
Gogs: Internal error
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

一度以为是ssh配置或者ssh-key的权限问题,各种百度谷歌无效。。。

甚至去服务器查gogs.log的日志也只能看到不太明确的错误:

#gogs.log
2018/05/28 00:40:39 [TRACE] SSH: Arguments: [serv key-1 --config=/storage/tools/gogs/gogs/custom/conf/app.ini]
2018/05/28 00:40:39 [ERROR] [...rc/runtime/asm_386.s:1665 goexit()] SSH: Wait: exit status 1

就在准备放弃ssh的时候,突然发现在log目录下除了gogs.log,还有一个serv.log:

Fail to execute git command: exec: "git-upload-pack": executable file not found in $PATH

尼玛,好熟悉吧,几个小时前刚进去的坑,以为填完了,原来只填了一半。。。

ln -s /usr/local/git/bin/git-upload-pack /bin/git-upload-pack

同样的,还有

ln -s /usr/local/git/bin/git-cvsserver /bin/git-cvsserver
ln -s /usr/local/git/bin/gitk /bin/gitk
ln -s /usr/local/git/bin/git-receive-pack /bin/git-receive-pack
ln -s /usr/local/git/bin/git-shell /bin/git-shell
ln -s /usr/local/git/bin/git-upload-archive /bin/git-upload-archive

相关推荐