先按照 官網(wǎng) 的步驟來下載解壓押搪。
然后在gogs文件夾目錄下新建一個(gè)custom文件夾盒使,用來存放配置文件和https證書
https文件夾下放你申請(qǐng)到的證書文件(一般有兩個(gè)险耀,一個(gè)是crt和key,如果證書格式是jks的話需要自己轉(zhuǎn)換。)(這里在插入一句煤禽,如果你的https證書是從騰訊云那里申請(qǐng)的話,騰訊云已經(jīng)為你打包好了各個(gè)平臺(tái)所需要的https證書岖赋,例如IIS檬果,Tomcat,Nginx, Apache等唐断,這里gogs可以使用Nginx里的證書)
最后在conf文件夾里放一個(gè)app.ini配置文件
app.ini配置文件內(nèi)容如下(請(qǐng)一定要根據(jù)自己的實(shí)際情況進(jìn)行修改选脊,否則肯定不能正常運(yùn)行)
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