You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

config-cheat-sheet.en-us.md 14 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. ---
  2. date: "2016-12-26T16:00:00+02:00"
  3. title: "Config Cheat Sheet"
  4. slug: "config-cheat-sheet"
  5. weight: 20
  6. toc: false
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "advanced"
  11. name: "Config Cheat Sheet"
  12. weight: 20
  13. identifier: "config-cheat-sheet"
  14. ---
  15. # Configuration Cheat Sheet
  16. This is a cheat sheet for the Gitea configuration file. It contains all settings that can configured.
  17. 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`.
  18. 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\>. Any string in the format `%(X)s` is a feature powered by [ini](https://github.com/go-ini/ini/#recursive-values), for reading values recursively.
  19. Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
  20. **Note:** A full restart is required for Gitea configuration changes to take effect.
  21. ## Overall (`DEFAULT`)
  22. - `APP_NAME`: **Gitea: Git with a cup of tea**: Application name, used in the page title.
  23. - `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.
  24. - `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\]
  25. ## Repository (`repository`)
  26. - `ROOT`: **~/gitea-repositories/**: Root path for storing all repository data. It must be an absolute path.
  27. - `SCRIPT_TYPE`: **bash**: The script type your server supports, usually this is `bash`, but some users report that only `sh` is available.
  28. - `ANSI_CHARSET`: **\<empty\>**: The default charset for an unrecognized charset.
  29. - `FORCE_PRIVATE`: **false**: Force every new repository to be private.
  30. - `DEFAULT_PRIVATE`: **last**: Default private when create a new repository. \[last, private, public\]
  31. - `MAX_CREATION_LIMIT`: **-1**: Global maximum creation limit of repositories per user, `-1` means no limit.
  32. - `PULL_REQUEST_QUEUE_LENGTH`: **1000**: Length of pull request patch test queue, make it as large as possible. Use caution when editing this value.
  33. - `MIRROR_QUEUE_LENGTH`: **1000**: Patch test queue length, increase if pull request patch testing starts hanging.
  34. - `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.
  35. - `DISABLE_HTTP_GIT`: **false**: Disable the ability to interact with repositories over the HTTP protocol.
  36. - `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when default SSH port is used.
  37. ## UI (`ui`)
  38. - `EXPLORE_PAGING_NUM`: **20**: Number of repositories that are shown in one explore page.
  39. - `ISSUE_PAGING_NUM`: **10**: Number of issues that are shown in one page (for all pages that list issues).
  40. - `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed.
  41. ### UI - Admin (`ui.admin`)
  42. - `USER_PAGING_NUM`: **50**: Number of users that are shown in one page.
  43. - `REPO_PAGING_NUM`: **50**: Number of repos that are shown in one page.
  44. - `NOTICE_PAGING_NUM`: **25**: Number of notices that are shown in one page.
  45. - `ORG_PAGING_NUM`: **50**: Number of organizations that are shown in one page.
  46. ## Markdown (`markdown`)
  47. - `ENABLE_HARD_LINE_BREAK`: **false**: Whether or not to enable hard the line break extension.
  48. ## Server (`server`)
  49. - `PROTOCOL`: **http**: Either `http`, `https`, `fcgi`, or `unix`.
  50. - `DOMAIN`: **localhost**: Domain name of your server.
  51. - `ROOT_URL`: **%(PROTOCOL)s://%(DOMAIN)s:%(HTTP\_PORT)s/**: Full public URL of Gitea server.
  52. - `HTTP_ADDR`: **0.0.0.0**: HTTP listen address.
  53. - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
  54. - If `PROTOCOL` is set to `unix`, this should be the name of the Unix socket file to use.
  55. - `HTTP_PORT`: **3000**: HTTP listen port.
  56. - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
  57. - `UNIX_SOCKET_PERMISSION`: **666**: Permisson mode for Unix socket.
  58. - `DISABLE_SSH`: **false**: Disables SSH feature when it's not available.
  59. - `START_SSH_SERVER`: **false**: When enabled, uses the built-in SSH server.
  60. - `SSH_DOMAIN`: **%(DOMAIN)s**: Domain name of your ssh server, used for displayed clone URL.
  61. - `SSH_PORT`: **22**: SSH port displayed in clone URL.
  62. - `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
  63. - `OFFLINE_MODE`: **false**: Disables use of CDN for static files and Gravatar for profile pictures.
  64. - `DISABLE_ROUTER_LOG`: **false**: Mutes printing of the router log.
  65. - `CERT_FILE`: **custom/https/cert.pem**: Cert file path used for HTTPS.
  66. - `KEY_FILE`: **custom/https/key.pem**: Key file path used for HTTPS.
  67. - `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path.
  68. - `ENABLE_GZIP`: **false**: Enables application-level GZIP support.
  69. - `LANDING_PAGE`: **home**: Landing page for unauthenticated users, either `home` or `explore`.
  70. - `LFS_START_SERVER`: **false**: Enables git-lfs support.
  71. - `LFS_CONTENT_PATH`: **./data/lfs**: Where to store lfs files.
  72. - `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
  73. - `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests on another (https) port.
  74. - `PORT_TO_REDIRECT`: **80**: Port used when `REDIRECT_OTHER_PORT` is true.
  75. ## Database (`database`)
  76. - `DB_TYPE`: **mysql**: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`.
  77. - `HOST`: **127.0.0.1:3306**: Database host address and port.
  78. - `NAME`: **gitea**: Database name.
  79. - `USER`: **root**: Database username.
  80. - `PASSWD`: **\<empty\>**: Database user password.
  81. - `SSL_MODE`: **disable**: For PostgreSQL only.
  82. - `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
  83. ## Security (`security`)
  84. - `INSTALL_LOCK`: **false**: Disable to allow accessing the install page.
  85. - `SECRET_KEY`: **random at every install**: Global secret key. This should be changed.
  86. - `LOGIN_REMEMBER_DAYS`: **7**: Cookie lifetime, in days.
  87. - `COOKIE_USERNAME`: **gitea\_awesome**: Name of the cookie used to store the current username.
  88. - `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication information.
  89. - `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy authentication.
  90. - `DISABLE_GIT_HOOKS`: **false**: Prevent all users (including admin) from creating custom git hooks.
  91. ## OpenID (`openid`)
  92. - `ENABLE_OPENID_SIGNIN`: **false**: Allow authentication in via OpenID.
  93. - `ENABLE_OPENID_SIGNUP`: **! DISABLE\_REGISTRATION**: Allow registering via OpenID.
  94. - `WHITELISTED_URIS`: **\<empty\>**: If non-empty, list of POSIX regex patterns matching OpenID URI's to permit.
  95. - `BLACKLISTED_URIS`: **\<empty\>**: If non-empty, list of POSIX regex patterns matching OpenID URI's to block.
  96. ## Service (`service`)
  97. - `ACTIVE_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm account/email registration.
  98. - `RESET_PASSWD_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm forgot password reset process.
  99. - `REGISTER_EMAIL_CONFIRM`: **false**: Enable this to ask for mail confirmation of registration. Requires `Mailer` to be enabled.
  100. - `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create accounts for users.
  101. - `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page.
  102. - `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.
  103. - `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication.
  104. - `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration for reverse authentication.
  105. - `ENABLE_CAPTCHA`: **true**: Enable this to use captcha validation for registration.
  106. ## Webhook (`webhook`)
  107. - `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value.
  108. - `DELIVER_TIMEOUT`: **5**: Delivery timeout (sec) for shooting webhooks.
  109. - `SKIP_TLS_VERIFY`: **false**: Allow insecure certification.
  110. - `PAGING_NUM`: **10**: Number of webhook history events that are shown in one page.
  111. ## Mailer (`mailer`)
  112. - `ENABLED`: **false**: Enable to use a mail service.
  113. - `DISABLE_HELO`: **\<empty\>**: Disable HELO operation.
  114. - `HELO_HOSTNAME`: **\<empty\>**: Custom hostname for HELO operation.
  115. - `HOST`: **\<empty\>**: SMTP mail host address and port (example: smtp.gitea.io:587).
  116. - `FROM`: **\<empty\>**: Mail from address, RFC 5322. This can be just an email address, or the "Name" \<email@example.com\> format.
  117. - `USER`: **\<empty\>**: Username of mailing user (usually the sender's e-mail address).
  118. - `PASSWD`: **\<empty\>**: Password of mailing user.
  119. - `SKIP_VERIFY`: **\<empty\>**: Do not verify the self-signed certificates.
  120. - **Note:** Gitea only supports SMTP with STARTTLS.
  121. - `USE_SENDMAIL`: **false** Use the operating system's `sendmail` command instead of SMTP. This is common on linux systems.
  122. - Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM` and `SENDMAIL_PATH`.
  123. - `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system. (can be command or full path)
  124. ## Cache (`cache`)
  125. - `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'`.
  126. - `INTERVAL`: **60**: Garbage Collection interval (sec), for memory cache only.
  127. - `HOST`: **\<empty\>**: Connection string for `redis` and `memcache`.
  128. - Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180`
  129. - Memache: `127.0.0.1:9090;127.0.0.1:9091`
  130. ## Session (`session`)
  131. - `PROVIDER`: **memory**: Session engine provider, either `memory`, `file`, `redis`, or `mysql`.
  132. - `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for others, the connection string.
  133. - `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
  134. - `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID, defaults to `i_like_gitea`.
  135. - `GC_INTERVAL_TIME`: **86400**: GC interval in seconds.
  136. ## Picture (`picture`)
  137. - `GRAVATAR_SOURCE`: **gravatar**: Can be `gravatar`, `duoshuo` or anything like `http://cn.gravatar.com/avatar/`.
  138. - `DISABLE_GRAVATAR`: **false**: Enable this to use local avatars only.
  139. - `ENABLE_FEDERATED_AVATAR`: **false**: Enable support for federated avatars (see http://www.libravatar.org)
  140. - `AVATAR_UPLOAD_PATH`: **data/avatars**: Path to store local and cached files.
  141. ## Attachment (`attachment`)
  142. - `ENABLED`: **true**: Enable this to allow uploading attachments.
  143. - `PATH`: **data/attachments**: Path to store attachments.
  144. - `ALLOWED_TYPES`: **see app.ini.sample**: Allowed MIME types, e.g. `image/jpeg|image/png`, use `*/*` for all types.
  145. - `MAX_SIZE`: **4**: Maximum size (MB).
  146. - `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
  147. ## Log (`log`)
  148. - `ROOT_PATH`: **\<empty\>**: Root path for log files.
  149. - `MODE`: **console**: Logging mode. For multiple modes, use a comma to separate values.
  150. - `LEVEL`: **Trace**: General log level. \[Trace, Debug, Info, Warn, Error, Critical\]
  151. ## Cron (`cron`)
  152. - `ENABLED`: **true**: Run cron tasks periodically.
  153. - `RUN_AT_START`: **false**: Run cron tasks at application start-up.
  154. ### Cron - Cleanup old repository archives (`cron.archive_cleanup`)
  155. - `ENABLED`: **true**: Enable service.
  156. - `RUN_AT_START`: **true**: Run tasks at start up time (if ENABLED).
  157. - `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`.
  158. - `OLDER_THAN`: **24h**: Archives created more than `OLDER_THAN` ago are subject to deletion, e.g. `12h`.
  159. ### Cron - Update Mirrors (`cron.update_mirrors`)
  160. - `SCHEDULE`: **@every 10m**: Cron syntax for scheduling update mirrors, e.g. `@every 3h`.
  161. ### Cron - Repository Health Check (`cron.repo_health_check`)
  162. - `SCHEDULE`: **every 24h**: Cron syntax for scheduling repository health check.
  163. - `TIMEOUT`: **60s**: Time duration syntax for health check execution timeout.
  164. - `ARGS`: **\<empty\>**: Arguments for command `git fsck`, e.g. `--unreachable --tags`.
  165. ### Cron - Repository Statistics Check (`cron.check_repo_stats`)
  166. - `RUN_AT_START`: **true**: Run repository statistics check at start time.
  167. - `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository statistics check.
  168. ## Git (`git`)
  169. - `MAX_GIT_DIFF_LINES`: **100**: Max number of lines allowed of a single file in diff view.
  170. - `MAX_GIT_DIFF_LINE_CHARACTERS`: **5000**: Max character count per line highlighted in diff view.
  171. - `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view.
  172. - `GC_ARGS`: **\<empty\>**: Arguments for command `git gc`, e.g. `--aggressive --auto`.
  173. ## markup (`markup`)
  174. Gitea supports external markup support, you can integrate all your favorite tool. For example,
  175. below will add a markup named `asciidoc` which is followed `markup.` ini section. And there are some config items below.
  176. ```ini
  177. [markup.asciidoc]
  178. ENABLED = false
  179. FILE_EXTENSIONS = .adoc,.asciidoc
  180. RENDER_COMMAND = "asciidoc --out-file=- -"
  181. IS_INPUT_FILE = false
  182. ```
  183. - ENABLED: Whether enable this tool. default is false.
  184. - FILE_EXTENSIONS: List of file extensions that should be rendered by an external command. Multiple extentions needs a comma as splitter.
  185. - RENDER_COMMAND: External command to render all matching extensions.
  186. - IS_INPUT_FILE: Input is not a standard input but a file param followed `RENDER_COMMAND`, default is false.
  187. ## Other (`other`)
  188. - `SHOW_FOOTER_BRANDING`: **false**: Show Gitea branding in the footer.
  189. - `SHOW_FOOTER_VERSION`: **true**: Show Gitea version information in the footer.
  190. - `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: Show time of template execution in the footer.