Skip to content

Commit 5b34aec

Browse files
authored
Merge branch 'main' into kd/fix-dont_show_new_PR
2 parents 6535da7 + 461915d commit 5b34aec

31 files changed

+97
-65
lines changed

custom/conf/app.example.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,8 +1145,8 @@ PATH =
11451145
;;
11461146
;; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the path where the queue will be saved.
11471147
;; This can be overridden by `ISSUE_INDEXER_QUEUE_CONN_STR`.
1148-
;; default is indexers/issues.queue
1149-
;ISSUE_INDEXER_QUEUE_DIR = indexers/issues.queue
1148+
;; default is queues/common
1149+
;ISSUE_INDEXER_QUEUE_DIR = queues/common
11501150
;;
11511151
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string.
11521152
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this is a directory or additional options of
@@ -1201,7 +1201,7 @@ PATH =
12011201
;; default to persistable-channel
12021202
;TYPE = persistable-channel
12031203
;;
1204-
;; data-dir for storing persistable queues and level queues, individual queues will be named by their type
1204+
;; data-dir for storing persistable queues and level queues, individual queues will default to `queues/common` meaning the queue is shared.
12051205
;DATADIR = queues/
12061206
;;
12071207
;; Default queue length before a channel queue will block
@@ -1231,7 +1231,7 @@ PATH =
12311231
;TIMEOUT = 15m30s
12321232
;;
12331233
;; Create a pool with this many workers
1234-
;WORKERS = 1
1234+
;WORKERS = 0
12351235
;;
12361236
;; Dynamically scale the worker pool to at this many workers
12371237
;MAX_WORKERS = 10
@@ -1243,7 +1243,7 @@ PATH =
12431243
;BOOST_TIMEOUT = 5m
12441244
;;
12451245
;; During a boost add BOOST_WORKERS
1246-
;BOOST_WORKERS = 5
1246+
;BOOST_WORKERS = 1
12471247

12481248
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12491249
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ relation to port exhaustion.
350350
- `ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search; available when ISSUE_INDEXER_TYPE is bleve and elasticsearch.
351351
- The next 4 configuration values are deprecated and should be set in `queue.issue_indexer` however are kept for backwards compatibility:
352352
- `ISSUE_INDEXER_QUEUE_TYPE`: **levelqueue**: Issue indexer queue, currently supports:`channel`, `levelqueue`, `redis`.
353-
- `ISSUE_INDEXER_QUEUE_DIR`: **indexers/issues.queue**: When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this will be the path where the queue will be saved.
353+
- `ISSUE_INDEXER_QUEUE_DIR`: **queues/common**: When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this will be the path where the queue will be saved. (Previously this was `indexers/issues.queue`.)
354354
- `ISSUE_INDEXER_QUEUE_CONN_STR`: **addrs=127.0.0.1:6379 db=0**: When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string. When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this is a directory or additional options of the form `leveldb://path/to/db?option=value&....`, and overrides `ISSUE_INDEXER_QUEUE_DIR`.
355355
- `ISSUE_INDEXER_QUEUE_BATCH_NUMBER`: **20**: Batch queue number.
356356

@@ -370,7 +370,7 @@ relation to port exhaustion.
370370
## Queue (`queue` and `queue.*`)
371371

372372
- `TYPE`: **persistable-channel**: General queue type, currently support: `persistable-channel` (uses a LevelDB internally), `channel`, `level`, `redis`, `dummy`
373-
- `DATADIR`: **queues/**: Base DataDir for storing persistent and level queues. `DATADIR` for individual queues can be set in `queue.name` sections but will default to `DATADIR/`**`name`**.
373+
- `DATADIR`: **queues/**: Base DataDir for storing persistent and level queues. `DATADIR` for individual queues can be set in `queue.name` sections but will default to `DATADIR/`**`common`**. (Previously each queue would default to `DATADIR/`**`name`**.)
374374
- `LENGTH`: **20**: Maximal queue size before channel queues block
375375
- `BATCH_LENGTH`: **20**: Batch data before passing to the handler
376376
- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. Options can be set using query params. Similarly LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR`
@@ -381,11 +381,11 @@ relation to port exhaustion.
381381
- `MAX_ATTEMPTS`: **10**: Maximum number of attempts to create the wrapped queue
382382
- `TIMEOUT`: **GRACEFUL_HAMMER_TIME + 30s**: Timeout the creation of the wrapped queue if it takes longer than this to create.
383383
- Queues by default come with a dynamically scaling worker pool. The following settings configure this:
384-
- `WORKERS`: **1**: Number of initial workers for the queue.
384+
- `WORKERS`: **0** (v1.14 and before: **1**): Number of initial workers for the queue.
385385
- `MAX_WORKERS`: **10**: Maximum number of worker go-routines for the queue.
386386
- `BLOCK_TIMEOUT`: **1s**: If the queue blocks for this time, boost the number of workers - the `BLOCK_TIMEOUT` will then be doubled before boosting again whilst the boost is ongoing.
387387
- `BOOST_TIMEOUT`: **5m**: Boost workers will timeout after this long.
388-
- `BOOST_WORKERS`: **5**: This many workers will be added to the worker pool if there is a boost.
388+
- `BOOST_WORKERS`: **1** (v1.14 and before: **5**): This many workers will be added to the worker pool if there is a boost.
389389

390390
## Admin (`admin`)
391391

integrations/pull_merge_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,8 @@ func TestCantMergeWorkInProgress(t *testing.T) {
197197
text := strings.TrimSpace(htmlDoc.doc.Find(".merge-section > .item").Last().Text())
198198
assert.NotEmpty(t, text, "Can't find WIP text")
199199

200-
// remove <strong /> from lang
201-
expected := i18n.Tr("en", "repo.pulls.cannot_merge_work_in_progress", "[wip]")
202-
replacer := strings.NewReplacer("<strong>", "", "</strong>", "")
203-
assert.Equal(t, replacer.Replace(expected), text, "Unable to find WIP text")
200+
assert.Contains(t, text, i18n.Tr("en", "repo.pulls.cannot_merge_work_in_progress"), "Unable to find WIP text")
201+
assert.Contains(t, text, "[wip]", "Unable to find WIP text")
204202
})
205203
}
206204

modules/auth/sso/basic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (b *Basic) IsEnabled() bool {
5151
func (b *Basic) VerifyAuthData(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) *models.User {
5252

5353
// Basic authentication should only fire on API, Download or on Git or LFSPaths
54-
if middleware.IsInternalPath(req) || !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitOrLFSPath(req) {
54+
if middleware.IsInternalPath(req) || !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitRawOrLFSPath(req) {
5555
return nil
5656
}
5757

modules/auth/sso/reverseproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (r *ReverseProxy) VerifyAuthData(req *http.Request, w http.ResponseWriter,
7878
}
7979

8080
// Make sure requests to API paths, attachment downloads, git and LFS do not create a new session
81-
if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitOrLFSPath(req) {
81+
if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitRawOrLFSPath(req) {
8282
if sess.Get("uid").(int64) != user.ID {
8383
handleSignIn(w, req, sess, user)
8484
}

modules/auth/sso/sso.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ func isAttachmentDownload(req *http.Request) bool {
104104
return strings.HasPrefix(req.URL.Path, "/attachments/") && req.Method == "GET"
105105
}
106106

107-
var gitPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/))`)
107+
var gitRawPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/)|raw/)`)
108108
var lfsPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/info/lfs/`)
109109

110-
func isGitOrLFSPath(req *http.Request) bool {
111-
if gitPathRe.MatchString(req.URL.Path) {
110+
func isGitRawOrLFSPath(req *http.Request) bool {
111+
if gitRawPathRe.MatchString(req.URL.Path) {
112112
return true
113113
}
114114
if setting.LFS.StartServer {

modules/auth/sso/sso_test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"code.gitea.io/gitea/modules/setting"
1313
)
1414

15-
func Test_isGitOrLFSPath(t *testing.T) {
15+
func Test_isGitRawOrLFSPath(t *testing.T) {
1616

1717
tests := []struct {
1818
path string
@@ -63,6 +63,10 @@ func Test_isGitOrLFSPath(t *testing.T) {
6363
"/owner/repo/objects/pack/pack-0123456789abcdef0123456789abcdef0123456.idx",
6464
true,
6565
},
66+
{
67+
"/owner/repo/raw/branch/foo/fanaso",
68+
true,
69+
},
6670
{
6771
"/owner/repo/stars",
6872
false,
@@ -98,11 +102,11 @@ func Test_isGitOrLFSPath(t *testing.T) {
98102
t.Run(tt.path, func(t *testing.T) {
99103
req, _ := http.NewRequest("POST", "http://localhost"+tt.path, nil)
100104
setting.LFS.StartServer = false
101-
if got := isGitOrLFSPath(req); got != tt.want {
105+
if got := isGitRawOrLFSPath(req); got != tt.want {
102106
t.Errorf("isGitOrLFSPath() = %v, want %v", got, tt.want)
103107
}
104108
setting.LFS.StartServer = true
105-
if got := isGitOrLFSPath(req); got != tt.want {
109+
if got := isGitRawOrLFSPath(req); got != tt.want {
106110
t.Errorf("isGitOrLFSPath() = %v, want %v", got, tt.want)
107111
}
108112
})
@@ -111,11 +115,11 @@ func Test_isGitOrLFSPath(t *testing.T) {
111115
t.Run(tt, func(t *testing.T) {
112116
req, _ := http.NewRequest("POST", tt, nil)
113117
setting.LFS.StartServer = false
114-
if got := isGitOrLFSPath(req); got != setting.LFS.StartServer {
115-
t.Errorf("isGitOrLFSPath(%q) = %v, want %v, %v", tt, got, setting.LFS.StartServer, gitPathRe.MatchString(tt))
118+
if got := isGitRawOrLFSPath(req); got != setting.LFS.StartServer {
119+
t.Errorf("isGitOrLFSPath(%q) = %v, want %v, %v", tt, got, setting.LFS.StartServer, gitRawPathRe.MatchString(tt))
116120
}
117121
setting.LFS.StartServer = true
118-
if got := isGitOrLFSPath(req); got != setting.LFS.StartServer {
122+
if got := isGitRawOrLFSPath(req); got != setting.LFS.StartServer {
119123
t.Errorf("isGitOrLFSPath(%q) = %v, want %v", tt, got, setting.LFS.StartServer)
120124
}
121125
})

options/locale/locale_bg-BG.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,6 @@ pulls.merged_as=Тази заявка за сливане е била обеди
772772
pulls.is_closed=Тази заявка за сливане е затворена.
773773
pulls.has_merged=Тази заявка за сливане е обединена.
774774
pulls.title_wip_desc=`<a href="#">Започнете заглавието с <strong>%s</strong></a>, за да предотвратите случайно обединяване на заявката за сливане.`
775-
pulls.cannot_merge_work_in_progress=Тази завка за сливане е отбелязане като работа в прогрес. Премахнете <strong>%s</strong> представката от заглавието, когато е готова
776775
pulls.can_auto_merge_desc=Може да се извърши обединяване на тази заявка за сливане.
777776
pulls.num_conflicting_files_1=%d конфликтен файл
778777
pulls.num_conflicting_files_n=%d конфликтни файлове

options/locale/locale_cs-CZ.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,6 @@ pulls.manually_merged=Sloučeno ručně
12751275
pulls.is_closed=Požadavek na natažení byl uzavřen.
12761276
pulls.has_merged=Požadavek na natažení byl sloučen.
12771277
pulls.title_wip_desc=`<a href="#">Začněte název s <strong>%s</strong></a> a zamezíte tak nechtěnému sloučení požadavku na natažení.`
1278-
pulls.cannot_merge_work_in_progress=Požadavek na natažení je označen jako ve vývoji. Odstraňte <strong>%s</strong> prefix z titulku, až bude hotový
12791278
pulls.data_broken=Tento požadavek na natažení je rozbitý kvůli chybějícím informacím o rozštěpení.
12801279
pulls.files_conflicted=Tento požadavek na natažení obsahuje změny, které kolidují s cílovou větví.
12811280
pulls.is_checking=Právě probíhá kontrola konfliktů při sloučení. Zkuste to za chvíli.

options/locale/locale_de-DE.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,6 @@ pulls.manually_merged_as=Dieser Pull Request wurde manuell als <a rel="nofollow"
13151315
pulls.is_closed=Der Pull-Request wurde geschlossen.
13161316
pulls.has_merged=Der Pull-Request wurde gemergt.
13171317
pulls.title_wip_desc=`<a href="#">Beginne den Titel mit <strong>%s</strong></a> um zu verhindern, dass der Pull Request versehentlich gemergt wird.`
1318-
pulls.cannot_merge_work_in_progress=Dieser Pull Request wurde als Work In Progress markiert. Entferne den <strong>%s</strong>-Präfix vom Titel, wenn dieser fertig ist.
13191318
pulls.data_broken=Dieser Pull-Requests ist kaputt, da Fork-Informationen gelöscht wurden.
13201319
pulls.files_conflicted=Dieser Pull-Request hat Änderungen, die im Widerspruch zum Ziel-Branch stehen.
13211320
pulls.is_checking=Die Konfliktprüfung läuft noch. Bitte aktualisiere die Seite in wenigen Augenblicken.

0 commit comments

Comments
 (0)