Gogs个人仓库搭建

/ 工具插件

Gogs个人仓库搭建

Git环境搭建

yum安装

yum -y install git

go环境搭建

下载安装包

wget https://studygolang.com/dl/golang/go1.10.1.linux-amd64.tar.gz

设置环境变量

vim /etc/profile
添加
export GOROOT=/data/work/go
export GOPATH=/data/work/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
环境变量生效
source /etc/profile

安装Gogs

此安装包进行过页面定制和简单功能修改,

需要此安装包加QQ:892366102@qq.com

下载地址

http://lsyzx.top/git/zhuxiang/Gogs_Install_Doc/archive/gogs_0.11.86_linux_amd64.zip

解压

unzip gogs.zip

修改配置文件

vi /root/gogs/custom/conf/app.ini

配置文件说明

APP_NAME = Gogs
RUN_USER = root
RUN_MODE = prod

[database]
DB_TYPE  = mysql
HOST     = 127.0.0.1:3306
NAME     = gogs
USER     = root
PASSWD   = 123456
SSL_MODE = disable
PATH     = data/gogs.db

[repository]
ROOT = /root/tools/gogs-repositories
[repository.upload]
ALLOWED_TYPES =
FILE_MAX_SIZE = 100
MAX_FILES = 99999

[server]
DOMAIN           = 127.0.0.1
HTTP_PORT        = 3000
ROOT_URL         = https://test.com/git
DISABLE_SSH      = false
SSH_PORT         = 22
START_SSH_SERVER = false
OFFLINE_MODE     = false

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL     = false
DISABLE_REGISTRATION   = true
ENABLE_CAPTCHA         = true
REQUIRE_SIGNIN_VIEW    = true

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = false

[session]
PROVIDER = file

[log]
MODE      = file
LEVEL     = Info
ROOT_PATH = /root/tools/gogs/log

[security]
INSTALL_LOCK = true
SECRET_KEY   = mB3F304EHwucjo6

启动

nohup ./gogs web &

停止

ps -ef|grep gogs
kill -9 进程号