第一次用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