Gogs Configuration Overview¶
Gogs keeps default configuration in conf/app.ini. You normally do not edit that file directly, because the default configuration has been embedded into the binary since v0.6.0.
Custom configuration¶
Create custom/conf/app.ini and override only the options you need.
Example repository root:
Example database password:
This approach protects custom configuration during binary replacement or source updates.
Running Gogs¶
Development mode:
Deployment mode:
- Start normally with
./gogs web. - Use scripts from the
scriptsdirectory when running as a service. - Visit
/installto complete first-run configuration.
Key configuration sections¶
server: protocol, domain, root URL, HTTP listen address, SSH options, static file path, and gzip.repository: repository root, script type, forced private repositories, raw file rendering, and migration settings.database: database type, host, name, user, password, and SQLite path.security: install lock, secret key, login cookies, and reverse proxy authentication.service: registration, captcha, mail notification, and cache avatar settings.webhook: webhook type, queue length, delivery timeout, and TLS verification.mailer: SMTP host, sender, username, password, and STARTTLS behavior.log: log root path, output mode, level, and rotation settings.git: diff display limits and Git operation timeouts.
REF¶
[1]. https://www.cnblogs.com/sanduzxcvbnm/p/11351991.html
[2]. Build-Git-Server-Using-Gogs-with-Docker-and-Employ-Frp-with-Caddy-Reverse-Proxy