先按照 官网 的步骤来下载解压。
然后在gogs文件夹目录下新建一个custom文件夹,用来存放配置文件和https证书
image.png
https文件夹下放你申请到的证书文件(一般有两个,一个是crt和key,如果证书格式是jks的话需要自己转换。)(这里在插入一句,如果你的https证书是从腾讯云那里申请的话,腾讯云已经为你打包好了各个平台所需要的https证书,例如IIS,Tomcat,Nginx, Apache等,这里gogs可以使用Nginx里的证书)
image.png
最后在conf文件夹里放一个app.ini配置文件
image.png
app.ini配置文件内容如下(请一定要根据自己的实际情况进行修改,否则肯定不能正常运行)
APP_NAME = Git Service
RUN_USER = Threshold
RUN_MODE = prod
[repository]
ROOT = D:/GogsRepositories
[database]
PASSWD =
DB_TYPE = sqlite3
HOST = 127.0.0.1:5432
NAME = gogs
USER = root
SSL_MODE = disable
PATH = D:/Program Files/gogs/data/gogs.db
[server]
DOMAIN = xxx.dummy.com
HTTP_PORT = 3000
PROTOCOL = https
ROOT_URL = https://xxx.dummy.com:3000/
CERT_FILE = custom/https/xxx.dummy.com.crt
KEY_FILE = custom/https/xxx.dummy.com.key
DISABLE_SSH = false
SSH_PORT = 2222
OFFLINE_MODE = false
START_SSH_SERVER = false
[mailer]
ENABLED = true
HOST = smtp.126.com:25
FROM = "Git" <youremail@126.com>
USER = youremail@126.com
PASSWD = DummyPassword
[service]
REGISTER_EMAIL_CONFIRM = true
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = false
ENABLE_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = false
[picture]
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = true
[session]
PROVIDER = file
[log]
MODE = file
LEVEL = Info
ROOT_PATH = D:/Program Files/gogs/log
[security]
INSTALL_LOCK = true
SECRET_KEY = YOuA16Osxfty0Hj
网友评论