This is a cheat sheet for the Gitea configuration file. It is helpful for more fully understanding how it powers Gitea.
This is a cheat sheet for the Gitea configuration file. It contains all settings that can configured.
Before getting started, make sure you know that any change to the configuration should be made in `custom/conf/app.ini` or any corresponding location.
Any changes to the Gitea configuration file should be made in `custom/conf/app.ini` or any corresponding location. When installing from a distribution, this will typically be found at `/etc/gitea/conf/app.ini`.
All default settings can be found in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) (replace master in URL with name of tag for released versions). If you see anything which looks like `%(X)s`, it is a feature powered by [ini](https://github.com/go-ini/ini/#recursive-values) for reading values recursively.
The defaults provided here are best-effort (not built automatically). They are accurately recorded in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) (s/master/<tag|release\>.Anystringintheformat`%(X)s`isafeaturepoweredby [ini](https://github.com/go-ini/ini/#recursive-values),forreadingvaluesrecursively.
Any configuration option that is marked by :exclamation: means that you should keep the default value unless you fully understand what you are doing.
Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
**Note** that you have to restart Gitea for changes to take effect.
**Note:** A full restart is required for Gitea configuration changes to take effect.
## Overall (`DEFAULT`)
## Overall (`DEFAULT`)
- `APP_NAME`: Application name, change to whatever you want.
- `APP_NAME`: **Gitea: Git with a cup of tea**: Application name, used in the page title.
- `RUN_USER`: The user to run Gitea as, we recommend it be `git`; however, change this to whatever your username is if you run Gitea on your personal computer. Gitea may crash if this value is not set properly.
- `RUN_USER`: **git**: The user Gitea will run as. This should be a dedicated service (non-user) account. Setting this incorrectly will cause Gitea to not start.
- `RUN_MODE`: For performance and other purposes, change this to `prod` when deployed to a production environment. The installation process will set this to `prod` automatically.
- `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment. The installation process will set this to `prod` automatically. \[prod, dev, test\]
## Repository (`repository`)
## Repository (`repository`)
- `ROOT`: Root path for storing all users' repository data. It must be an absolute path. The default is `~/<username>/gitea-repositories`.
- `ROOT`: **~/gitea-repositories/**: Root path for storing all repository data. It must be an absolute path.
- `SCRIPT_TYPE`: The script type your server supports, usually this is `bash`, but some customers report that they only have`sh`.
- `SCRIPT_TYPE`: **bash**: The script type your server supports, usually this is `bash`, but some users report that only `sh` is available.
- `ANSI_CHARSET`: The default charset for an unrecognized charset.
- `ANSI_CHARSET`: **\<empty\>**: The default charset for an unrecognized charset.
- `FORCE_PRIVATE`: Force every new repository to be private.
- `FORCE_PRIVATE`: **false**: Force every new repository to be private.
- `DEFAULT_PRIVATE`: Default private when create a new repository, could be: `last`, `private` and `public`. Default is last which means last user repo visiblity.
- `DEFAULT_PRIVATE`: **last**: Default private when create a new repository. \[last, private, public\]
- `MAX_CREATION_LIMIT`: Global maximum creation limit of repositories per user, `-1` means no limit.
- `MAX_CREATION_LIMIT`: **-1**: Global maximum creation limit of repositories per user, `-1` means no limit.
- `PULL_REQUEST_QUEUE_LENGTH`:exclamation:: Length of pull request patch test queue, make it as large as possible.
- `PULL_REQUEST_QUEUE_LENGTH`:**1000**: Length of pull request patch test queue, make it as large as possible. Use caution when editing this value.
- `MIRROR_QUEUE_LENGTH`: Patch test queue length, increase if pull request patch testing starts hanging. Defaults to 1000.
- `MIRROR_QUEUE_LENGTH`: **1000**: Patch test queue length, increase if pull request patch testing starts hanging.
- `PREFERRED_LICENSES`: Preferred Licenses to place at the top of the List. Name must match file name in conf/license or custom/conf/license. Defaults to 'Apache License 2.0,MIT License'
- `PREFERRED_LICENSES`: **Apache License 2.0,MIT License**: Preferred Licenses to place at the top of the List. Name must match file name in conf/license or custom/conf/license.
- `DISABLE_HTTP_GIT`: Disable ability to interact with repositories by HTTP protocol. Defaults to false
- `DISABLE_HTTP_GIT`: **false**: Disable the ability to interact with repositories over the HTTP protocol.
- `USE_COMPAT_SSH_URI`: Force ssh:// clone url instead of scp-style uri when default SSH port is used. Defaults to false.
- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when default SSH port is used.
## UI (`ui`)
## UI (`ui`)
- `EXPLORE_PAGING_NUM`: Number of repositories that are shown in one explore page.
- `EXPLORE_PAGING_NUM`: **20**: Number of repositories that are shown in one explore page.
- `ISSUE_PAGING_NUM`: Number of issues that are shown in one page (for all pages that list issues).
- `ISSUE_PAGING_NUM`: **10**: Number of issues that are shown in one page (for all pages that list issues).
- `FEED_MAX_COMMIT_NUM`: Number of maximum commits shown in one activity feed.
- `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed.
### UI - Admin (`ui.admin`)
### UI - Admin (`ui.admin`)
- `USER_PAGING_NUM`: Number of users that are shown in one page.
- `USER_PAGING_NUM`: **50**: Number of users that are shown in one page.
- `REPO_PAGING_NUM`: Number of repos that are shown in one page.
- `REPO_PAGING_NUM`: **50**: Number of repos that are shown in one page.
- `NOTICE_PAGING_NUM`: Number of notices that are shown in one page.
- `NOTICE_PAGING_NUM`: **25**: Number of notices that are shown in one page.
- `ORG_PAGING_NUM`: Number of organizations that are shown in one page.
- `ORG_PAGING_NUM`: **50**: Number of organizations that are shown in one page.
## Markdown (`markdown`)
## Markdown (`markdown`)
- `ENABLE_HARD_LINE_BREAK`: Whether or not to enable hard the line break extension.
- `ENABLE_HARD_LINE_BREAK`: **false**: Whether or not to enable hard the line break extension.
## Server (`server`)
## Server (`server`)
- `PROTOCOL`: Either `http`, `https`, `fcgi`, or `unix`.
- `PROTOCOL`: **http**: Either `http`, `https`, `fcgi`, or `unix`.
- `DOMAIN`: Domain name of your server.
- `DOMAIN`: **localhost**: Domain name of your server.
- `ROOT_URL`: Full public URL of Gitea server.
- `ROOT_URL`: **%(PROTOCOL)s://%(DOMAIN)s:%(HTTP\_PORT)s/**: Full public URL of Gitea server.
- `HTTP_ADDR`: HTTP listen address. If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. If `PROTOCOL` is set to `unix`, this should be the name of the Unix socket file to use.
- `HTTP_ADDR`: **0.0.0.0**: HTTP listen address.
- `HTTP_PORT`: HTTP listen port. If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
- If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
- `UNIX_SOCKET_PERMISSION`: Permisson mode for Unix socket, default is 666.
- If `PROTOCOL` is set to `unix`, this should be the name of the Unix socket file to use.
- `DISABLE_SSH`: Disables SSH feature when it's not available.
- `HTTP_PORT`: **3000**: HTTP listen port.
- `START_SSH_SERVER`: Starts built-in SSH server when enabled.
- If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
- `SSH_DOMAIN`: Domain name of your ssh server.
- `UNIX_SOCKET_PERMISSION`: **666**: Permisson mode for Unix socket.
- `SSH_PORT`: SSH port displayed in clone URL, in case yours is not `22`.
- `DISABLE_SSH`: **false**: Disables SSH feature when it's not available.
- `SSH_LISTEN_PORT`: Port for the built-in SSH server. Defaults to `SSH_PORT`.
- `START_SSH_SERVER`: **false**: When enabled, uses the built-in SSH server.
- `OFFLINE_MODE`: Disables use of CDN for static files and Gravatar for profile pictures.
- `SSH_DOMAIN`: **%(DOMAIN)s**: Domain name of your ssh server, used for displayed clone URL.
- `DISABLE_ROUTER_LOG`: Mutes printing of the router log.
- `SSH_PORT`: **22**: SSH port displayed in clone URL.
- `CERT_FILE`: Cert file path used for HTTPS.
- `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
- `KEY_FILE`: Key file path used for HTTPS.
- `OFFLINE_MODE`: **false**: Disables use of CDN for static files and Gravatar for profile pictures.
- `STATIC_ROOT_PATH`: Upper level of template and static files path, default is the path where Gitea is located.
- `DISABLE_ROUTER_LOG`: **false**: Mutes printing of the router log.
- `PORT_TO_REDIRECT`: Port used when `REDIRECT_OTHER_PORT` is true, default is `80`.
- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store lfs files.
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests on another (https) port.
- `PORT_TO_REDIRECT`: **80**: Port used when `REDIRECT_OTHER_PORT` is true.
## Database (`database`)
## Database (`database`)
- `DB_TYPE`: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`.
- `DB_TYPE`: **mysql**: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`.
- `HOST`: Database host address and port.
- `HOST`: **127.0.0.1:3306**: Database host address and port.
- `NAME`: Database name.
- `NAME`: **gitea**: Database name.
- `USER`: Database username.
- `USER`: **root**: Database username.
- `PASSWD`: Database user password.
- `PASSWD`: **\<empty\>**: Database user password.
- `SSL_MODE`: For PostgreSQL only.
- `SSL_MODE`: **disable**: For PostgreSQL only.
- `PATH`: For SQLite3 only, the database file path.
- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
## Security (`security`)
## Security (`security`)
- `INSTALL_LOCK`: Indicates whether to allow the open install page (setting admin account is involved, so it's a very important value).
- `INSTALL_LOCK`: **false**: Disable to allow accessing the install page.
- `SECRET_KEY`: Global secret key for your server security, **you'd better change it** (will generate a random string every time you install).
- `SECRET_KEY`: **random at every install**: Global secret key. This should be changed.
- `LOGIN_REMEMBER_DAYS`: Cookie lifetime, in days.
- `LOGIN_REMEMBER_DAYS`: **7**: Cookie lifetime, in days.
- `COOKIE_USERNAME`: Name of the cookie that saves username.
- `COOKIE_USERNAME`: **gitea\_awesome**: Name of the cookie used to store the current username.
- `COOKIE_REMEMBER_NAME`: Name of cookie that saves auto-login information.
- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication information.
- `REVERSE_PROXY_AUTHENTICATION_USER`: Header name for reverse proxy authentication username.
- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy authentication.
- `DISABLE_GIT_HOOKS`: Prevent all users (including admin) from creating custom git hooks (defaults to false)
- `DISABLE_GIT_HOOKS`: **false**: Prevent all users (including admin) from creating custom git hooks.
## OpenID (`openid`)
## OpenID (`openid`)
- `ENABLE_OPENID_SIGNIN`: Whether to allow signin in via OpenID (defaults to false).
- `ENABLE_OPENID_SIGNIN`: **false**: Allow authentication in via OpenID.
- `ENABLE_OPENID_SIGNUP`: Whether to allow registering via OpenID (defaults to `!DISABLE_REGISTRATION`).
- `ENABLE_OPENID_SIGNUP`: **! DISABLE\_REGISTRATION**: Allow registering via OpenID.
- `WHITELISTED_URIS`: Space separated list of POSIX regexp patterns. If non empty OpenID URIs should match any of these to be granted access.
- `WHITELISTED_URIS`: **\<empty\>**: If non-empty, list of POSIX regex patterns matching OpenID URI's to permit.
- `BLACKLISTED_URIS`: Space separated list of POSIX regexp pattenrs. OpenID URI matching any of these is refused access.
- `BLACKLISTED_URIS`: **\<empty\>**: If non-empty, list of POSIX regex patterns matching OpenID URI's to block.
## Service (`service`)
## Service (`service`)
- `ACTIVE_CODE_LIVE_MINUTES`: The minutes of active code life time.
- `ACTIVE_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm account/email registration.
- `RESET_PASSWD_CODE_LIVE_MINUTES`: The minutes of reset password code life time.
- `RESET_PASSWD_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm forgot password reset process.
- `REGISTER_EMAIL_CONFIRM`: Enable this to ask for mail confirmation of registration, requires `Mailer` to be enabled.
- `REGISTER_EMAIL_CONFIRM`: **false**: Enable this to ask for mail confirmation of registration. Requires `Mailer` to be enabled.
- `DISABLE_REGISTRATION`: Disable registration, after which only admin can create accounts for users.
- `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create accounts for users.
- `SHOW_REGISTRATION_BUTTON`: Indicate whether to show registration button or not.
- `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page.
- `REQUIRE_SIGNIN_VIEW`: Enable this to force users to log in to view any page.
- `ENABLE_NOTIFY_MAIL`: **false**: Enable this to send e-mail to watchers of a repository when something happens, like creating issues. Requires `Mailer` to be enabled.
- `ENABLE_CACHE_AVATAR`: Enable this to cache avatar from Gravatar.
- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication.
- `ENABLE_NOTIFY_MAIL`: Enable this to send e-mail to watchers of repository when something happens like creating issues, requires `Mailer` to be enabled.
- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration for reverse authentication.
- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: Enable this to allow reverse proxy authentication, more detail: https://github.com/gogits/gogs/issues/165
- `ENABLE_CAPTCHA`: **true**: Enable this to use captcha validation for registration.
- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: Enable this to allow auto-registration for reverse authentication.
- `DISABLE_MINIMUM_KEY_SIZE_CHECK`: Do not check minimum key size with corresponding type.
- `ENABLE_CAPTCHA`: Enable this to use captcha validation for registration.
- `HELO_HOSTNAME`: Custom hostname for HELO operation.
- `HELO_HOSTNAME`: **\<empty\>**: Custom hostname for HELO operation.
- `HOST`: SMTP mail host address and port (example: smtp.gitea.io:587).
- `HOST`: **\<empty\>**: SMTP mail host address and port (example: smtp.gitea.io:587).
- `FROM`: Mail from address, RFC 5322. This can be just an email address, or the "Name" \<email@example.com\> format.
- `FROM`: **\<empty\>**: Mail from address, RFC 5322. This can be just an email address, or the "Name" \<email@example.com\> format.
- `USER`: Username of mailer (usually just your e-mail address).
- `USER`: **\<empty\>**: Username of mailing user (usually the sender's e-mail address).
- `PASSWD`: Password of mailer.
- `PASSWD`: **\<empty\>**: Password of mailing user.
- `SKIP_VERIFY`: Do not verify the self-signed certificates.
- `SKIP_VERIFY`: **\<empty\>**: Do not verify the self-signed certificates.
- `USE_SENDMAIL`: Use the operating system's `sendmail` command instead of SMTP. This is common on linux systems. Valid values are `true` to use sendmail and `false` to use SMTP (default). Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM` and `SENDMAIL_PATH`.
- **Note:** Gitea only supports SMTP with STARTTLS.
- `SENDMAIL_PATH`: The location of sendmail on the operating system. This can be an absolute path (eg: `/usr/sbin/sendmail`) or just the name of the command (eg: `sendmail` - default) if it can be found in the `PATH` environment variable.
- `USE_SENDMAIL`: **false** Use the operating system's `sendmail` command instead of SMTP. This is common on linux systems.
- Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM` and `SENDMAIL_PATH`.
Note: Actually, Gitea supports only SMTP with STARTTLS.
- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system. (can be command or full path)
## Cache (`cache`)
## Cache (`cache`)
- `ADAPTER`: Cache engine adapter, either `memory`, `redis`, or `memcache`. If you want to use `redis` or `memcache`, be sure to rebuild everything with build tags `redis` or `memcache`: `go build -tags='redis'`.
- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, or `memcache`. If you want to use `redis` or `memcache`, be sure to rebuild everything with build tags `redis` or `memcache`: `go build -tags='redis'`.
- `INTERVAL`: for memory cache only, GC interval in seconds.