Skip to Content

failed attempt to build Gogs


Though I get a stable IP by ssh reverse tunnel on Xie’s workstation and can use Git through LAN instead of GitHub, I still feel dissatisfy. So I turned to self-hosted Git service, Gogs.

After wasting a afternoon, I failed, mainly due to non-default port, especially ssh.

There is no space to specify custom port in Git protocol (maybe due to scp), so I switch to ssh protocol. Then I get ssh://, which obviously doesn’t work. I was not only asked to type password for Git (although I have add SSH key for my account), but also told /user/repo.git doesn’t seem like a Git repository even after I did.

Finally, I figured out the url should be ssh://, and managed to push (still need to type password of Git). But, Gogs tells me that the repository is empty.

Desperated, I want to go VPS for a demo. But GFW seems to have detected my proxy, maybe I should change for another VPS. The alternative hopenthesis is either Nankai’s or DO’s network is too slow, I would rather believe it’s the former.

Following is the code I used:

sudo useradd git -m -s /bin/bash
sudo apt install mysql-server -y

mysql -u root -ppasswprd

mkdir -p custom/conf

custom/conf/app.ini, note password for mysql.