app.ini 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. # !!! NEVER EVER MODIFY THIS FILE !!!
  2. # !!! PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE !!!
  3. # !!! IF YOU ARE PACKAGING PROVIDER, PLEASE MAKE OWN COPY OF IT !!!
  4. ; App name that shows on every page title
  5. APP_NAME = Gogs
  6. ; The name of the system user that runs Gogs
  7. RUN_USER = git
  8. ; Either "dev", "prod" or "test"
  9. RUN_MODE = dev
  10. [server]
  11. PROTOCOL = http
  12. DOMAIN = localhost
  13. ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
  14. HTTP_ADDR = 0.0.0.0
  15. HTTP_PORT = 3000
  16. ; Permission for unix socket
  17. UNIX_SOCKET_PERMISSION = 666
  18. ; Local (DMZ) URL for Gogs workers (such as SSH update) accessing web service.
  19. ; In most cases you do not need to change the default value.
  20. ; Alter it only if your SSH server node is not the same as HTTP node.
  21. LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
  22. ; Disable SSH feature when not available
  23. DISABLE_SSH = false
  24. ; Whether use builtin SSH server or not.
  25. START_SSH_SERVER = false
  26. ; Domain name to be exposed in SSH clone URL
  27. SSH_DOMAIN = %(DOMAIN)s
  28. ; Port number to be exposed in SSH clone URL
  29. SSH_PORT = 22
  30. ; Network interface builtin SSH server listens on
  31. SSH_LISTEN_HOST = 0.0.0.0
  32. ; Port number builtin SSH server listens on
  33. SSH_LISTEN_PORT = %(SSH_PORT)s
  34. ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
  35. SSH_ROOT_PATH =
  36. ; Choose the ciphers to support for SSH connections
  37. SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128
  38. ; Directory to create temporary files when test publick key using ssh-keygen,
  39. ; default is system temporary directory.
  40. SSH_KEY_TEST_PATH =
  41. ; Path to ssh-keygen, default is 'ssh-keygen' and let shell find out which one to call.
  42. SSH_KEYGEN_PATH = ssh-keygen
  43. ; Indicate whether to check minimum key size with corresponding type
  44. MINIMUM_KEY_SIZE_CHECK = false
  45. ; Disable CDN even in "prod" mode
  46. OFFLINE_MODE = false
  47. DISABLE_ROUTER_LOG = false
  48. ; Generate steps:
  49. ; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com
  50. ;
  51. ; Or from a .pfx file exported from the Windows certificate store (do
  52. ; not forget to export the private key):
  53. ; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
  54. ; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
  55. CERT_FILE = custom/https/cert.pem
  56. KEY_FILE = custom/https/key.pem
  57. ; Upper level of template and static file path
  58. ; default is the path where Gogs is executed
  59. STATIC_ROOT_PATH =
  60. ; Default path for App data
  61. APP_DATA_PATH = data
  62. ; Application level GZIP support
  63. ENABLE_GZIP = false
  64. ; Landing page for non-logged users, can be "home" or "explore"
  65. LANDING_PAGE = home
  66. [repository]
  67. ; Root path for storing repositories's data, default is "~/<username>/gogs-repositories"
  68. ROOT =
  69. ; The script type server supports, sometimes could be "sh"
  70. SCRIPT_TYPE = bash
  71. ; Default ANSI charset for an unrecognized charset
  72. ANSI_CHARSET =
  73. ; Force every new repository to be private
  74. FORCE_PRIVATE = false
  75. ; Global maximum creation limit of repository per user, -1 means no limit
  76. MAX_CREATION_LIMIT = -1
  77. ; Mirror sync queue length, increase if mirror syncing starts hanging
  78. MIRROR_QUEUE_LENGTH = 1000
  79. ; Patch test queue length, increase if pull request patch testing starts hanging
  80. PULL_REQUEST_QUEUE_LENGTH = 1000
  81. ; Preferred Licenses to place at the top of the list
  82. ; Name must match file name in conf/license or custom/conf/license
  83. PREFERRED_LICENSES = Apache License 2.0,MIT License
  84. ; Disable ability to interact with repositories by HTTP protocol
  85. DISABLE_HTTP_GIT = false
  86. ; Enable ability to migrate repository by local path
  87. ENABLE_LOCAL_PATH_MIGRATION = false
  88. ; Concurrency is used to retrieve commits information. This variable define
  89. ; the maximum number of tasks that can be run at the same time. Usually, the
  90. ; value depend of how many CPUs (cores) you have. If the value is set to zero
  91. ; or under, GOGS will automatically detect the number of CPUs your system have
  92. COMMITS_FETCH_CONCURRENCY = 0
  93. [repository.editor]
  94. ; List of file extensions that should have line wraps in the CodeMirror editor.
  95. ; Separate extensions with a comma. To line wrap files without extension, just put a comma
  96. LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd,
  97. ; Valid file modes that have a preview API associated with them, such as api/v1/markdown.
  98. ; Separate values by commas. Preview tab in edit mode won't show if the file extension doesn't match
  99. PREVIEWABLE_FILE_MODES = markdown
  100. [repository.upload]
  101. ; Enable repository file uploads.
  102. ENABLED = true
  103. ; Path to temporarily store uploads (default path gets cleaned by Gogs in every start)
  104. TEMP_PATH = data/tmp/uploads
  105. ; File types that are allowed to be uploaded, e.g. image/jpeg|image/png. Leave empty means allow any file type
  106. ALLOWED_TYPES =
  107. ; Maximum size of each file in MB
  108. FILE_MAX_SIZE = 3
  109. ; Maximum number of files per upload
  110. MAX_FILES = 5
  111. [markdown]
  112. ; Enable hard line break extension
  113. ENABLE_HARD_LINE_BREAK = false
  114. ; List of custom URL-Schemes that are allowed as links when rendering Markdown
  115. ; for example git,magnet
  116. CUSTOM_URL_SCHEMES =
  117. ; List of file extensions that should be rendered/edited as Markdown
  118. ; Separate extensions with a comma. To render files w/o extension as markdown, just put a comma
  119. FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd
  120. [http]
  121. ; Value for Access-Control-Allow-Origin header, default is not to present
  122. ACCESS_CONTROL_ALLOW_ORIGIN =
  123. ; Define allowed algorithms and their minimum key length (use -1 to disable a type)
  124. [ssh.minimum_key_sizes]
  125. ED25519 = 256
  126. ECDSA = 256
  127. RSA = 2048
  128. DSA = 1024
  129. [database]
  130. ; Either "mysql", "postgres" or "sqlite3", you can connect to TiDB with MySQL protocol
  131. DB_TYPE = mysql
  132. HOST = 127.0.0.1:3306
  133. NAME = gogs
  134. USER = root
  135. PASSWD =
  136. ; For "postgres" only, either "disable", "require" or "verify-full"
  137. SSL_MODE = disable
  138. ; For "sqlite3" and "tidb", use absolute path when you start as service
  139. PATH = data/gogs.db
  140. [admin]
  141. ; Disable regular (non-admin) users to create organizations
  142. DISABLE_REGULAR_ORG_CREATION = false
  143. [security]
  144. INSTALL_LOCK = false
  145. ; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!!
  146. SECRET_KEY = !#@FDEWREWR&*(
  147. ; Auto-login remember days
  148. LOGIN_REMEMBER_DAYS = 7
  149. COOKIE_USERNAME = gogs_awesome
  150. COOKIE_REMEMBER_NAME = gogs_incredible
  151. COOKIE_SECURE = false
  152. ; Reverse proxy authentication header name of user name
  153. REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER
  154. [service]
  155. ACTIVE_CODE_LIVE_MINUTES = 180
  156. RESET_PASSWD_CODE_LIVE_MINUTES = 180
  157. ; User need to confirm e-mail for registration
  158. REGISTER_EMAIL_CONFIRM = false
  159. ; Does not allow register and admin create account only
  160. DISABLE_REGISTRATION = false
  161. ; User must sign in to view anything.
  162. REQUIRE_SIGNIN_VIEW = false
  163. ; Mail notification
  164. ENABLE_NOTIFY_MAIL = false
  165. ; More detail: https://github.com/gogits/gogs/issues/165
  166. ENABLE_REVERSE_PROXY_AUTHENTICATION = false
  167. ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
  168. ; Enable captcha validation for registration
  169. ENABLE_CAPTCHA = true
  170. [webhook]
  171. ; Types are enabled for users to use, can be "gogs", "slack", "discord"
  172. TYPES = gogs, slack, discord
  173. ; Hook task queue length, increase if webhook shooting starts hanging
  174. QUEUE_LENGTH = 1000
  175. ; Deliver timeout in seconds
  176. DELIVER_TIMEOUT = 5
  177. ; Allow insecure certification
  178. SKIP_TLS_VERIFY = false
  179. ; Number of history information in each page
  180. PAGING_NUM = 10
  181. [mailer]
  182. ENABLED = false
  183. ; Buffer length of channel, keep it as it is if you don't know what it is.
  184. SEND_BUFFER_LEN = 100
  185. ; Name displayed in mail title
  186. SUBJECT = %(APP_NAME)s
  187. ; Mail server
  188. ; Gmail: smtp.gmail.com:587
  189. ; QQ: smtp.qq.com:465
  190. ; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
  191. HOST =
  192. ; Disable HELO operation when hostname are different.
  193. DISABLE_HELO =
  194. ; Custom hostname for HELO operation, default is from system.
  195. HELO_HOSTNAME =
  196. ; Do not verify the certificate of the server. Only use this for self-signed certificates
  197. SKIP_VERIFY =
  198. ; Use client certificate
  199. USE_CERTIFICATE = false
  200. CERT_FILE = custom/mailer/cert.pem
  201. KEY_FILE = custom/mailer/key.pem
  202. ; Mail from address, RFC 5322. This can be just an email address, or the `"Name" <email@example.com>` format
  203. FROM =
  204. ; Mailer user name and password
  205. USER =
  206. PASSWD =
  207. ; Use text/plain as format of content
  208. USE_PLAIN_TEXT = false
  209. [cache]
  210. ; Either "memory", "redis", or "memcache", default is "memory"
  211. ADAPTER = memory
  212. ; For "memory" only, GC interval in seconds, default is 60
  213. INTERVAL = 60
  214. ; For "redis" and "memcache", connection host address
  215. ; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
  216. ; memcache: `127.0.0.1:11211`
  217. HOST =
  218. [session]
  219. ; Either "memory", "file", or "redis", default is "memory"
  220. PROVIDER = memory
  221. ; Provider config options
  222. ; memory: not have any config yet
  223. ; file: session file path, e.g. `data/sessions`
  224. ; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
  225. ; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
  226. PROVIDER_CONFIG = data/sessions
  227. ; Session cookie name
  228. COOKIE_NAME = i_like_gogits
  229. ; If you use session in https only, default is false
  230. COOKIE_SECURE = false
  231. ; Enable set cookie, default is true
  232. ENABLE_SET_COOKIE = true
  233. ; Session GC time interval, default is 86400
  234. GC_INTERVAL_TIME = 86400
  235. ; Session life time, default is 86400
  236. SESSION_LIFE_TIME = 86400
  237. ; Cookie name for CSRF
  238. CSRF_COOKIE_NAME = _csrf
  239. [picture]
  240. ; Path to store user uploaded avatars
  241. AVATAR_UPLOAD_PATH = data/avatars
  242. ; Chinese users can choose "duoshuo"
  243. ; or a custom avatar source, like: http://cn.gravatar.com/avatar/
  244. GRAVATAR_SOURCE = gravatar
  245. ; This value will be forced to be true in offline mode.
  246. DISABLE_GRAVATAR = false
  247. ; Federated avatar lookup uses DNS to discover avatar associated
  248. ; with emails, see https://www.libravatar.org
  249. ; This value will be forced to be false in offline mode or Gravatar is disbaled.
  250. ENABLE_FEDERATED_AVATAR = true
  251. [attachment]
  252. ; Whether attachments are enabled. Defaults to `true`
  253. ENABLE = true
  254. ; Path for attachments. Defaults to `data/attachments`
  255. PATH = data/attachments
  256. ; One or more allowed types, e.g. image/jpeg|image/png
  257. ALLOWED_TYPES = image/jpeg|image/png
  258. ; Max size of each file. Defaults to 32MB
  259. MAX_SIZE = 4
  260. ; Max number of files per upload. Defaults to 10
  261. MAX_FILES = 5
  262. [time]
  263. ; Specifies the format for fully outputed dates. Defaults to RFC1123
  264. ; Special supported values are ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro and StampNano
  265. ; For more information about the format see http://golang.org/pkg/time/#pkg-constants
  266. FORMAT =
  267. ; General settings of loggers
  268. [log]
  269. ROOT_PATH =
  270. ; Can be "console" and "file", default is "console"
  271. ; Use comma to separate multiple modes, e.g. "console, file"
  272. MODE = console
  273. ; Buffer length of channel, keep it as it is if you don't know what it is.
  274. BUFFER_LEN = 100
  275. ; Either "Trace", "Info", "Warn", "Error", "Fatal", default is "Trace"
  276. LEVEL = Trace
  277. ; For "console" mode only
  278. [log.console]
  279. ; leave empty to inherit
  280. LEVEL =
  281. ; For "file" mode only
  282. [log.file]
  283. ; leave empty to inherit
  284. LEVEL =
  285. ; This enables automated log rotate (switch of following options)
  286. LOG_ROTATE = true
  287. ; Segment log daily
  288. DAILY_ROTATE = true
  289. ; Max size shift of single file, default is 28 means 1 << 28, 256MB
  290. MAX_SIZE_SHIFT = 28
  291. ; Max line number of single file
  292. MAX_LINES = 1000000
  293. ; Expired days of log file (delete after max days)
  294. MAX_DAYS = 7
  295. ; For "slack" mode only
  296. [log.slack]
  297. ; leave empty to inherit
  298. LEVEL =
  299. ; Webhook URL
  300. URL =
  301. [cron]
  302. ; Enable running cron tasks periodically.
  303. ENABLED = true
  304. ; Run cron tasks when Gogs starts.
  305. RUN_AT_START = false
  306. ; Update mirrors
  307. [cron.update_mirrors]
  308. SCHEDULE = @every 10m
  309. ; Repository health check
  310. [cron.repo_health_check]
  311. SCHEDULE = @every 24h
  312. TIMEOUT = 60s
  313. ; Arguments for command 'git fsck', e.g. "--unreachable --tags"
  314. ; see more on http://git-scm.com/docs/git-fsck/1.7.5
  315. ARGS =
  316. ; Check repository statistics
  317. [cron.check_repo_stats]
  318. RUN_AT_START = true
  319. SCHEDULE = @every 24h
  320. ; Cleanup repository archives
  321. [cron.repo_archive_cleanup]
  322. RUN_AT_START = false
  323. SCHEDULE = @every 24h
  324. ; Time duration to check if archive should be cleaned
  325. OLDER_THAN = 24h
  326. [git]
  327. ; Disables highlight of added and removed changes
  328. DISABLE_DIFF_HIGHLIGHT = false
  329. ; Max number of lines allowed of a single file in diff view
  330. MAX_GIT_DIFF_LINES = 1000
  331. ; Max number of characters of a line allowed in diff view
  332. MAX_GIT_DIFF_LINE_CHARACTERS = 500
  333. ; Max number of files shown in diff view
  334. MAX_GIT_DIFF_FILES = 100
  335. ; Arguments for command 'git gc', e.g. "--aggressive --auto"
  336. ; see more on http://git-scm.com/docs/git-gc/1.7.5
  337. GC_ARGS =
  338. ; Operation timeout in seconds
  339. [git.timeout]
  340. MIGRATE = 600
  341. MIRROR = 300
  342. CLONE = 300
  343. PULL = 300
  344. GC = 60
  345. [mirror]
  346. ; Default interval in hours between each check
  347. DEFAULT_INTERVAL = 8
  348. [api]
  349. ; Max number of items will response in a page
  350. MAX_RESPONSE_ITEMS = 50
  351. [ui]
  352. ; Number of repositories that are showed in one explore page
  353. EXPLORE_PAGING_NUM = 20
  354. ; Number of issues that are showed in one page
  355. ISSUE_PAGING_NUM = 10
  356. ; Number of maximum commits showed in one activity feed
  357. FEED_MAX_COMMIT_NUM = 5
  358. ; Value of "theme-color" meta tag, used by Android >= 5.0
  359. ; An invalid color like "none" or "disable" will have the default style
  360. ; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
  361. THEME_COLOR_META_TAG = `#ff5343`
  362. ; Max size in bytes of files to be displayed (default is 8MB)
  363. MAX_DISPLAY_FILE_SIZE = 8388608
  364. [ui.admin]
  365. ; Number of users that are showed in one page
  366. USER_PAGING_NUM = 50
  367. ; Number of repos that are showed in one page
  368. REPO_PAGING_NUM = 50
  369. ; Number of notices that are showed in one page
  370. NOTICE_PAGING_NUM = 25
  371. ; Number of organization that are showed in one page
  372. ORG_PAGING_NUM = 50
  373. [ui.user]
  374. ; Number of repos that are showed in one page
  375. REPO_PAGING_NUM = 15
  376. [i18n]
  377. LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR,gl-ES,uk-UA
  378. NAMES = English,简体中文,繁體中文(香港),繁體中文(台湾),Deutsch,Français,Nederlands,Latviešu,Русский,日本語,Español,Português do Brasil,Polski,български,Italiano,Suomalainen,Türkçe,čeština,Српски,Svenska,한국어,Galego,Українська
  379. ; Used for datetimepicker
  380. [i18n.datelang]
  381. en-US = en
  382. zh-CN = zh
  383. zh-HK = zh-TW
  384. zh-TW = zh-TW
  385. de-DE = de
  386. fr-FR = fr
  387. nl-NL = nl
  388. lv-LV = lv
  389. ru-RU = ru
  390. ja-JP = ja
  391. es-ES = es
  392. pt-BR = pt-BR
  393. pl-PL = pl
  394. bg-BG = bg
  395. it-IT = it
  396. fi-FI = fi
  397. tr-TR = tr
  398. cs-CZ = cs-CZ
  399. sr-SP = sr
  400. sv-SE = sv
  401. ko-KR = ko
  402. gl-ES = gl
  403. uk-UA = uk
  404. ; Extension mapping to highlight class
  405. ; e.g. .toml=ini
  406. [highlight.mapping]
  407. [other]
  408. SHOW_FOOTER_BRANDING = false
  409. ; Show version information about Gogs and Go in the footer
  410. SHOW_FOOTER_VERSION = true
  411. ; Show time of template execution in the footer
  412. SHOW_FOOTER_TEMPLATE_LOAD_TIME = true