Skip to content

Commit 793a96b

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: [skip ci] Updated translations via Crowdin Add some more labels to labeler (go-gitea#26987) Fix INI parsing for value with trailing slash (go-gitea#26995) Correct the database.LOG_SQL default value in config cheat sheet (go-gitea#26997) Improve "language stats" UI (go-gitea#26968) [skip ci] Updated translations via Crowdin Update chroma to v2.9.1 (go-gitea#26990) Improve issue list layout (go-gitea#26983)
2 parents 98866a3 + 148c9c4 commit 793a96b

File tree

16 files changed

+596
-390
lines changed

16 files changed

+596
-390
lines changed

.github/labeler.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
kind/docs:
22
- "**/*.md"
3-
- "docs/**/*"
3+
- "docs/**"
44

55
kind/ui:
66
- "web_src/**/*"
7-
- all: ["templates/**/*", "!templates/swagger/v1_json.tmpl"]
7+
- all: ["templates/**", "!templates/swagger/v1_json.tmpl"]
88

99
kind/api:
1010
- "templates/swagger/v1_json.tmpl"
11+
- "routers/api/**"
1112

1213
kind/build:
1314
- "Makefile"
@@ -16,6 +17,12 @@ kind/build:
1617
- "docker/**"
1718
- "webpack.config.js"
1819

20+
theme/package-registry:
21+
- "modules/packages/**"
22+
23+
kind/cli:
24+
- "cmd/**"
25+
1926
kind/lint:
2027
- ".eslintrc.yaml"
2128
- ".golangci.yml"

docs/content/administration/config-cheat-sheet.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
446446
- `SQLITE_JOURNAL_MODE`: **""**: Change journal mode for SQlite3. Can be used to enable [WAL mode](https://www.sqlite.org/wal.html) when high load causes write congestion. See [SQlite3 docs](https://www.sqlite.org/pragma.html#pragma_journal_mode) for possible values. Defaults to the default for the database file, often DELETE.
447447
- `ITERATE_BUFFER_SIZE`: **50**: Internal buffer size for iterating.
448448
- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
449-
- `LOG_SQL`: **true**: Log the executed SQL.
449+
- `LOG_SQL`: **false**: Log the executed SQL.
450450
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.
451451
- `DB_RETRY_BACKOFF`: **3s**: time.Duration to wait before trying another ORM init / DB connect attempt, if failure occurred.
452452
- `MAX_OPEN_CONNS` **0**: Database maximum open connections - default is 0, meaning there is no limit.

docs/content/administration/config-cheat-sheet.zh-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ menu:
436436
- `SQLITE_JOURNAL_MODE`**""**:更改 SQlite3 的日志模式。可以用于在高负载导致写入拥塞时启用 [WAL 模式](https://www.sqlite.org/wal.html)。有关可能的值,请参阅 [SQlite3 文档](https://www.sqlite.org/pragma.html#pragma_journal_mode)。默认为数据库文件的默认值,通常为 DELETE。
437437
- `ITERATE_BUFFER_SIZE`**50**:用于迭代的内部缓冲区大小。
438438
- `PATH`**data/gitea.db**:仅适用于 SQLite3 的数据库文件路径。
439-
- `LOG_SQL`**true**:记录已执行的 SQL。
439+
- `LOG_SQL`**false**:记录已执行的 SQL。
440440
- `DB_RETRIES`**10**:允许多少次 ORM 初始化 / DB 连接尝试。
441441
- `DB_RETRY_BACKOFF`**3s**:如果发生故障,等待另一个 ORM 初始化 / DB 连接尝试的 time.Duration。
442442
- `MAX_OPEN_CONNS`**0**:数据库最大打开连接数 - 默认为 0,表示没有限制。

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
1818
github.com/NYTimes/gziphandler v1.1.1
1919
github.com/PuerkitoBio/goquery v1.8.1
20-
github.com/alecthomas/chroma/v2 v2.8.0
20+
github.com/alecthomas/chroma/v2 v2.9.1
2121
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
2222
github.com/blevesearch/bleve/v2 v2.3.9
2323
github.com/bufbuild/connect-go v1.10.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ
119119
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
120120
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
121121
github.com/alecthomas/chroma/v2 v2.2.0/go.mod h1:vf4zrexSH54oEjJ7EdB65tGNHmH3pGZmVkgTP5RHvAs=
122-
github.com/alecthomas/chroma/v2 v2.8.0 h1:w9WJUjFFmHHB2e8mRpL9jjy3alYDlU0QLDezj1xE264=
123-
github.com/alecthomas/chroma/v2 v2.8.0/go.mod h1:yrkMI9807G1ROx13fhe1v6PN2DDeaR73L3d+1nmYQtw=
122+
github.com/alecthomas/chroma/v2 v2.9.1 h1:0O3lTQh9FxazJ4BYE/MOi/vDGuHn7B+6Bu902N2UZvU=
123+
github.com/alecthomas/chroma/v2 v2.9.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
124124
github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
125125
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
126126
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=

modules/setting/config_provider.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,16 @@ func (s *iniConfigSection) ChildSections() (sections []ConfigSection) {
174174
return sections
175175
}
176176

177+
func configProviderLoadOptions() ini.LoadOptions {
178+
return ini.LoadOptions{
179+
KeyValueDelimiterOnWrite: " = ",
180+
IgnoreContinuation: true,
181+
}
182+
}
183+
177184
// NewConfigProviderFromData this function is mainly for testing purpose
178185
func NewConfigProviderFromData(configContent string) (ConfigProvider, error) {
179-
cfg, err := ini.Load(strings.NewReader(configContent))
186+
cfg, err := ini.LoadSources(configProviderLoadOptions(), strings.NewReader(configContent))
180187
if err != nil {
181188
return nil, err
182189
}
@@ -190,7 +197,7 @@ func NewConfigProviderFromData(configContent string) (ConfigProvider, error) {
190197
// NewConfigProviderFromFile load configuration from file.
191198
// NOTE: do not print any log except error.
192199
func NewConfigProviderFromFile(file string, extraConfigs ...string) (ConfigProvider, error) {
193-
cfg := ini.Empty(ini.LoadOptions{KeyValueDelimiterOnWrite: " = "})
200+
cfg := ini.Empty(configProviderLoadOptions())
194201
loadedFromEmpty := true
195202

196203
if file != "" {
@@ -339,6 +346,7 @@ func NewConfigProviderForLocale(source any, others ...any) (ConfigProvider, erro
339346
iniFile, err := ini.LoadSources(ini.LoadOptions{
340347
IgnoreInlineComment: true,
341348
UnescapeValueCommentSymbols: true,
349+
IgnoreContinuation: true,
342350
}, source, others...)
343351
if err != nil {
344352
return nil, fmt.Errorf("unable to load locale ini: %w", err)

modules/setting/config_provider_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ key = 123
3030
secSub := cfg.Section("foo.bar.xxx")
3131
assert.Equal(t, "123", secSub.Key("key").String())
3232
})
33+
t.Run("TrailingSlash", func(t *testing.T) {
34+
cfg, _ := NewConfigProviderFromData(`
35+
[foo]
36+
key = E:\
37+
xxx = yyy
38+
`)
39+
sec := cfg.Section("foo")
40+
assert.Equal(t, "E:\\", sec.Key("key").String())
41+
assert.Equal(t, "yyy", sec.Key("xxx").String())
42+
})
3343
}
3444

3545
func TestConfigProviderHelper(t *testing.T) {

0 commit comments

Comments
 (0)