Skip to content

Commit 5e0f409

Browse files
Merge branch 'master' into remote-internal-token
2 parents 20c7ac1 + 9dfdf80 commit 5e0f409

File tree

238 files changed

+39154
-562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+39154
-562
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ indent_size = 8
1515
indent_style = tab
1616
indent_size = 4
1717

18-
[*.{less}]
18+
[*.less]
1919
indent_style = space
2020
indent_size = 4
2121

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
###################################
33
#Build stage
4-
FROM golang:1.11-alpine3.8 AS build-env
4+
FROM golang:1.11-alpine3.9 AS build-env
55

66
ARG GITEA_VERSION
77
ARG TAGS="sqlite sqlite_unlock_notify"
@@ -18,7 +18,7 @@ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
1818
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
1919
&& make clean generate build
2020

21-
FROM alpine:3.8
21+
FROM alpine:3.9
2222
LABEL maintainer="[email protected]"
2323

2424
EXPOSE 22 3000

Gopkg.lock

Lines changed: 116 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/serv.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,19 +234,20 @@ func runServ(c *cli.Context) error {
234234

235235
// Check deploy key or user key.
236236
if key.Type == models.KeyTypeDeploy {
237-
if key.Mode < requestedMode {
238-
fail("Key permission denied", "Cannot push with deployment key: %d", key.ID)
239-
}
240-
241-
// Check if this deploy key belongs to current repository.
242-
has, err := private.HasDeployKey(key.ID, repo.ID)
237+
// Now we have to get the deploy key for this repo
238+
deployKey, err := private.GetDeployKey(key.ID, repo.ID)
243239
if err != nil {
244240
fail("Key access denied", "Failed to access internal api: [key_id: %d, repo_id: %d]", key.ID, repo.ID)
245241
}
246-
if !has {
242+
243+
if deployKey == nil {
247244
fail("Key access denied", "Deploy key access denied: [key_id: %d, repo_id: %d]", key.ID, repo.ID)
248245
}
249246

247+
if deployKey.Mode < requestedMode {
248+
fail("Key permission denied", "Cannot push with read-only deployment key: %d to repo_id: %d", key.ID, repo.ID)
249+
}
250+
250251
// Update deploy key activity.
251252
if err = private.UpdateDeployKeyUpdated(key.ID, repo.ID); err != nil {
252253
fail("Internal error", "UpdateDeployKey: %v", err)

custom/conf/app.ini.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ MODE = console
497497
BUFFER_LEN = 10000
498498
; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
499499
LEVEL = Trace
500+
REDIRECT_MACARON_LOG = false
500501

501502
; For "console" mode only
502503
[log.console]
@@ -628,6 +629,8 @@ ENABLE_SWAGGER = true
628629
MAX_RESPONSE_ITEMS = 50
629630
; Default paging number of api
630631
DEFAULT_PAGING_NUM = 30
632+
; Default and maximum number of items per page for git trees api
633+
DEFAULT_GIT_TREES_PER_PAGE = 1000
631634

632635
[i18n]
633636
LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
250250

251251
## Session (`session`)
252252

253-
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, mysql\].
253+
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, mysql, couchbase, memcache, nodb, postgres\].
254254
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for others, the connection string.
255255
- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
256256
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.
@@ -279,6 +279,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
279279
- `ROOT_PATH`: **\<empty\>**: Root path for log files.
280280
- `MODE`: **console**: Logging mode. For multiple modes, use a comma to separate values.
281281
- `LEVEL`: **Trace**: General log level. \[Trace, Debug, Info, Warn, Error, Critical\]
282+
- `REDIRECT_MACARON_LOG`: **false**: Redirects the Macaron log to the Gitea logger.
282283

283284
## Cron (`cron`)
284285

@@ -331,6 +332,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
331332
- `ENABLE_SWAGGER`: **true**: Enables /api/swagger, /api/v1/swagger etc. endpoints. True or false; default is true.
332333
- `MAX_RESPONSE_ITEMS`: **50**: Max number of items in a page.
333334
- `DEFAULT_PAGING_NUM`: **30**: Default paging number of api.
335+
- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: Default and maximum number of items per page for git trees api.
334336

335337
## i18n (`i18n`)
336338

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ menu:
199199
- `ENABLE_SWAGGER`: **true**: 是否启用swagger路由 /api/swagger, /api/v1/swagger etc. endpoints. True 或 false; 默认是 true.
200200
- `MAX_RESPONSE_ITEMS`: **50**: 一个页面最大的项目数。
201201
- `DEFAULT_PAGING_NUM`: **30**: API中默认分页条数。
202+
- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: GIT TREES API每页的默认和最大项数.
202203

203204
## Markup (`markup`)
204205

0 commit comments

Comments
 (0)