在 GOGS 下载并安装后,在程序目录下建立一个custom/conf/app.ini
的配置文件,内容如下:文章来源:https://www.toymoban.com/news/detail-582121.html
APP_NAME = Gogs # APP名字
RUN_USER = git # 启动用户,设置后只能以此账号启动gogs
RUN_MODE = prod
[database]
DB_TYPE = mysql
HOST = 127.0.0.1:3306 # 数据库地址
NAME = gogs # schema
USER = git # DB用户
PASSWD = 123456 # DB密码
SSL_MODE = disable
PATH = data/gogs.db
[repository]
ROOT = /home/gogs/gogs-repositories # 仓库目录
[server]
DOMAIN = gogs.gg.com # 自定义的域名,对应Web路径
HTTP_PORT = 3000 # 端口,对应80端口的转发参考下面的配置
ROOT_URL = http://gogs.gg.com
DISABLE_SSH = true
SSH_PORT = 22
START_SSH_SERVER = false
OFFLINE_MODE = false
[mailer]
ENABLED = true
[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 = false
[session]
PROVIDER = file
[log]
MODE = file
LEVEL = Info
ROOT_PATH = /home/gogs/log # 日志位置
[security]
INSTALL_LOCK = true
SECRET_KEY = qqvjujC4DTWjCi7320
[http]
ACCESS_CONTROL_ALLOW_ORIGIN = * # 跨域配置
nginx的转发配置文章来源地址https://www.toymoban.com/news/detail-582121.html
server {
server_name gogs.gg2.com gogs.gg.com;
listen 80;
#ssl on;
location /{
proxy_pass http://gogs.gg.com:3000; # 此处转发到3000端口
proxy_redirect default;
}
}
到了这里,关于gogs的自定义配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!