使用 gogs 搭建 git 服务器


#Git#


源代码: https://github.com/gogs/gogs

使用文档:https://gogs.io/docs

运行

下载后解压,进入解压目录,执行下面的命令:

./gogs web

访问 http://localhost:3000/install 进行配置。

修改 Http Server 监听的 IP 和端口

默认是监听 0.0.0.0 的 3000 端口。

找到配置文件 custom/conf/app.ini,在[Server] 下增加配置:

HTTP_ADDR        = 127.0.0.1
HTTP_PORT        = 3000

修改内置 SSH Server 监听的 IP 和端口

找到配置文件 custom/conf/app.ini ,在 [Server] 下增加配置:

SSH_LISTEN_HOST  = 127.0.0.1
SSH_LISTEN_PORT  = 2222

禁止获取 Gravatar 头像

找到配置文件 custom/conf/app.ini ,在 [picture] 中,将 DISABLE_GRAVATAR 配置为 true 。即:

[picture]
DISABLE_GRAVATAR        = true

相关讨论:https://github.com/gogs/gogs/issues/2201


( 本文完 )