Skip to content

Commit 32fe9d0

Browse files
committed
Merge branch 'main' into lunny/move_more_model
2 parents ad13de5 + a4a6a59 commit 32fe9d0

File tree

32 files changed

+1475
-1362
lines changed

32 files changed

+1475
-1362
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,45 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.17.1](https://github.com/go-gitea/gitea/releases/tag/1.17.1) - 2022-08-17
8+
9+
* SECURITY
10+
* Correctly escape within tribute.js (#20831) (#20832)
11+
* ENHANCEMENTS
12+
* Add support for NuGet API keys (#20721) (#20734)
13+
* Display project in issue list (#20583)
14+
* Add disable download source configuration (#20548) (#20579)
15+
* Add username check to doctor (#20140) (#20671)
16+
* Enable Wire 2 for Internal SSH Server (#20616) (#20617)
17+
* BUGFIXES
18+
* Use the total issue count for UI (#20785) (#20827)
19+
* Add proxy host into allow list (#20798) (#20819)
20+
* Add missing translation for queue flush workers (#20791) (#20792)
21+
* Improve comment header for mobile (#20781) (#20789)
22+
* Fix git.Init for doctor sub-command (#20782) (#20783)
23+
* Check webhooks slice length before calling xorm (#20642) (#20768)
24+
* Remove manual rollback for failed generated repositories (#20639) (#20762)
25+
* Use correct field name in npm template (#20675) (#20760)
26+
* Keep download count on Container tag overwrite (#20728) (#20735)
27+
* Fix v220 migration to be compatible for MSSQL 2008 r2 (#20702) (#20707)
28+
* Use request timeout for git service rpc (#20689) (#20693)
29+
* Send correct NuGet status codes (#20647) (#20677)
30+
* Use correct context to get package content (#20673) (#20676)
31+
* Fix the JS error "EventSource is not defined" caused by some non-standard browsers (#20584) (#20663)
32+
* Add default commit messages to PR for squash merge (#20618) (#20645)
33+
* Fix package upload for files >32mb (#20622) (#20635)
34+
* Fix the new-line copy-paste for rendered code (#20612)
35+
* Clean up and fix clone button script (#20415 & #20600) (#20599)
36+
* Fix default merge style (#20564) (#20565)
37+
* Add repository condition for issue count (#20454) (#20496)
38+
* Make branch icon stand out more (#20726) (#20774)
39+
* Fix loading button with invalid form (#20754) (#20759)
40+
* Fix SecToTime edge-cases (#20610) (#20611)
41+
* Executable check always returns true for windows (#20637) (#20835)
42+
* Check issue labels slice length before calling xorm Insert (#20655) (#20836)
43+
* Fix owners cannot create organization repos bug (#20841) (#20854)
44+
* Prevent 500 is head repo does not have PullRequest unit in IsUserAllowedToUpdate (#20839) (#20848)
45+
746
## [1.17.0](https://github.com/go-gitea/gitea/releases/tag/v1.17.0) - 2022-07-30
847

948
* BREAKING

docs/content/doc/features/comparison.en-us.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ _Symbols used in table:_
3535

3636
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
3737
| ----------------------------------- | ---------------------------------------------------| ---- | --------- | --------- | --------- | -------------- | ------------ |
38-
| Open source and free ||||||||
39-
| Low resource usage (RAM/CPU) ||||||||
40-
| Multiple database support ||||||||
41-
| Multiple OS support ||||||||
42-
| Easy upgrade process ||||||||
43-
| Markdown support ||||||||
44-
| Orgmode support ||||||| ? |
45-
| CSV support ||||||| ? |
46-
| Third-party render tool support ||||||| ? |
47-
| Static Git-powered pages | [](https://github.com/go-gitea/gitea/issues/302) |||||||
48-
| Integrated Git-powered wiki |||||| ✓ (cloud only) ||
49-
| Deploy Tokens ||||||||
50-
| Repository Tokens with write rights ||||||||
51-
| Built-in Package/Container Registry ||||||||
52-
| External git mirroring ||||||||
53-
| WebAuthn (2FA) ||||||| ? |
54-
| Built-in CI/CD ||||||||
55-
| Subgroups: groups within groups | |||||||
38+
| Open source and free | |||||||
39+
| Low resource usage (RAM/CPU) | |||||||
40+
| Multiple database support | |||||||
41+
| Multiple OS support | |||||||
42+
| Easy upgrade process | |||||||
43+
| Markdown support | |||||||
44+
| Orgmode support | |||||| ? |
45+
| CSV support | |||||| ? |
46+
| Third-party render tool support | |||||| ? |
47+
| Static Git-powered pages | [](https://github.com/go-gitea/gitea/issues/302) |||||||
48+
| Integrated Git-powered wiki | ||||| ✓ (cloud only) ||
49+
| Deploy Tokens | |||||||
50+
| Repository Tokens with write rights | |||||||
51+
| Built-in Package/Container Registry | |||||||
52+
| External git mirroring | |||||||
53+
| WebAuthn (2FA) | |||||| ? |
54+
| Built-in CI/CD | |||||||
55+
| Subgroups: groups within groups | [](https://github.com/go-gitea/gitea/issues/1872) |||||||
5656

5757
## Code management
5858

docs/content/doc/usage/backup-and-restore.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The SQL dump created by `gitea dump` uses XORM and Gitea admins may prefer to us
6262
# mysql
6363
mysqldump -u$USER -p$PASS --database $DATABASE > gitea-db.sql
6464
# postgres
65-
pgdump -U $USER $DATABASE > gitea-db.sql
65+
pg_dump -U $USER $DATABASE > gitea-db.sql
6666
```
6767

6868
### Using Docker (`dump`)

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
rootDir: 'web_src',
33
setupFilesAfterEnv: ['jest-extended/all'],
4-
testEnvironment: '@happy-dom/jest-environment',
4+
testEnvironment: 'jest-environment-jsdom',
55
testMatch: ['<rootDir>/**/*.test.js'],
66
testTimeout: 20000,
77
transform: {

models/asymkey/gpg_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type GPGKey struct {
3333
OwnerID int64 `xorm:"INDEX NOT NULL"`
3434
KeyID string `xorm:"INDEX CHAR(16) NOT NULL"`
3535
PrimaryKeyID string `xorm:"CHAR(16)"`
36-
Content string `xorm:"TEXT NOT NULL"`
36+
Content string `xorm:"MEDIUMTEXT NOT NULL"`
3737
CreatedUnix timeutil.TimeStamp `xorm:"created"`
3838
ExpiredUnix timeutil.TimeStamp
3939
AddedUnix timeutil.TimeStamp

models/asymkey/ssh_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type PublicKey struct {
4141
OwnerID int64 `xorm:"INDEX NOT NULL"`
4242
Name string `xorm:"NOT NULL"`
4343
Fingerprint string `xorm:"INDEX NOT NULL"`
44-
Content string `xorm:"TEXT NOT NULL"`
44+
Content string `xorm:"MEDIUMTEXT NOT NULL"`
4545
Mode perm.AccessMode `xorm:"NOT NULL DEFAULT 2"`
4646
Type KeyType `xorm:"NOT NULL DEFAULT 1"`
4747
LoginSourceID int64 `xorm:"NOT NULL DEFAULT 0"`

models/migrations/migrations.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,13 @@ var migrations = []Migration{
406406
NewMigration("Drop old CredentialID column", dropOldCredentialIDColumn),
407407
// v223 -> v224
408408
NewMigration("Rename CredentialIDBytes column to CredentialID", renameCredentialIDBytes),
409+
410+
// Gitea 1.17.0 ends at v224
411+
409412
// v224 -> v225
410-
NewMigration("Add badges to users", creatUserBadgesTable),
413+
NewMigration("Add badges to users", createUserBadgesTable),
414+
// v225 -> v226
415+
NewMigration("Alter gpg_key/public_key content TEXT fields to MEDIUMTEXT", alterPublicGPGKeyContentFieldsToMediumText),
411416
}
412417

413418
// GetCurrentDBVersion returns the current db version

models/migrations/v224.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"xorm.io/xorm"
99
)
1010

11-
func creatUserBadgesTable(x *xorm.Engine) error {
11+
func createUserBadgesTable(x *xorm.Engine) error {
1212
type Badge struct {
1313
ID int64 `xorm:"pk autoincr"`
1414
Description string

models/migrations/v225.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2022 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package migrations
6+
7+
import (
8+
"code.gitea.io/gitea/modules/setting"
9+
10+
"xorm.io/xorm"
11+
)
12+
13+
func alterPublicGPGKeyContentFieldsToMediumText(x *xorm.Engine) error {
14+
sess := x.NewSession()
15+
defer sess.Close()
16+
if err := sess.Begin(); err != nil {
17+
return err
18+
}
19+
20+
if setting.Database.UseMySQL {
21+
if _, err := sess.Exec("ALTER TABLE `gpg_key` CHANGE `content` `content` MEDIUMTEXT"); err != nil {
22+
return err
23+
}
24+
if _, err := sess.Exec("ALTER TABLE `public_key` CHANGE `content` `content` MEDIUMTEXT"); err != nil {
25+
return err
26+
}
27+
}
28+
return sess.Commit()
29+
}

modules/charset/escape_stream.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func (e *escapeStreamer) Text(data string) error {
5050
_, _ = sb.WriteString(data[:len(UTF8BOM)])
5151
pos = len(UTF8BOM)
5252
}
53+
dataBytes := []byte(data)
5354
for pos < len(data) {
5455
nextIdxs := defaultWordRegexp.FindStringIndex(data[pos:])
5556
if nextIdxs == nil {
@@ -64,30 +65,30 @@ func (e *escapeStreamer) Text(data string) error {
6465
positions := make([]int, 0, next-until+1)
6566

6667
for pos < until {
67-
r, sz := utf8.DecodeRune([]byte(data)[pos:])
68+
r, sz := utf8.DecodeRune(dataBytes[pos:])
6869
positions = positions[:0]
6970
positions = append(positions, pos, pos+sz)
7071
types, confusables, _ := e.runeTypes(r)
71-
if err := e.handleRunes(data, []rune{r}, positions, types, confusables, sb); err != nil {
72+
if err := e.handleRunes(dataBytes, []rune{r}, positions, types, confusables, sb); err != nil {
7273
return err
7374
}
7475
pos += sz
7576
}
7677

7778
for i := pos; i < next; {
78-
r, sz := utf8.DecodeRune([]byte(data)[i:])
79+
r, sz := utf8.DecodeRune(dataBytes[i:])
7980
runes = append(runes, r)
8081
positions = append(positions, i)
8182
i += sz
8283
}
8384
positions = append(positions, next)
8485
types, confusables, runeCounts := e.runeTypes(runes...)
8586
if runeCounts.needsEscape() {
86-
if err := e.handleRunes(data, runes, positions, types, confusables, sb); err != nil {
87+
if err := e.handleRunes(dataBytes, runes, positions, types, confusables, sb); err != nil {
8788
return err
8889
}
8990
} else {
90-
_, _ = sb.Write([]byte(data)[pos:next])
91+
_, _ = sb.Write(dataBytes[pos:next])
9192
}
9293
pos = next
9394
}
@@ -99,7 +100,7 @@ func (e *escapeStreamer) Text(data string) error {
99100
return nil
100101
}
101102

102-
func (e *escapeStreamer) handleRunes(data string, runes []rune, positions []int, types []runeType, confusables []rune, sb *strings.Builder) error {
103+
func (e *escapeStreamer) handleRunes(data []byte, runes []rune, positions []int, types []runeType, confusables []rune, sb *strings.Builder) error {
103104
for i, r := range runes {
104105
switch types[i] {
105106
case brokenRuneType:
@@ -111,7 +112,7 @@ func (e *escapeStreamer) handleRunes(data string, runes []rune, positions []int,
111112
}
112113
end := positions[i+1]
113114
start := positions[i]
114-
if err := e.brokenRune([]byte(data)[start:end]); err != nil {
115+
if err := e.brokenRune(data[start:end]); err != nil {
115116
return err
116117
}
117118
case ambiguousRuneType:

modules/git/repo_compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (repo *Repository) GetMergeBase(tmpRemote, base, head string) (string, stri
4040
if tmpRemote != "origin" {
4141
tmpBaseName := RemotePrefix + tmpRemote + "/tmp_" + base
4242
// Fetch commit into a temporary branch in order to be able to handle commits and tags
43-
_, _, err := NewCommand(repo.Ctx, "fetch", tmpRemote, base+":"+tmpBaseName).RunStdString(&RunOpts{Dir: repo.Path})
43+
_, _, err := NewCommand(repo.Ctx, "fetch", "--no-tags", tmpRemote, "--", base+":"+tmpBaseName).RunStdString(&RunOpts{Dir: repo.Path})
4444
if err == nil {
4545
base = tmpBaseName
4646
}

modules/setting/setting.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ var (
9292
// LocalURL is the url for locally running applications to contact Gitea. It always has a '/' suffix
9393
// It maps to ini:"LOCAL_ROOT_URL"
9494
LocalURL string
95+
// AssetVersion holds a opaque value that is used for cache-busting assets
96+
AssetVersion string
9597

9698
// Server settings
9799
Protocol Scheme
@@ -759,6 +761,7 @@ func loadFromConf(allowEmpty bool, extraConfig string) {
759761
}
760762

761763
AbsoluteAssetURL = MakeAbsoluteAssetURL(AppURL, StaticURLPrefix)
764+
AssetVersion = strings.ReplaceAll(AppVer, "+", "~") // make sure the version string is clear (no real escaping is needed)
762765

763766
manifestBytes := MakeManifestData(AppName, AppURL, AbsoluteAssetURL)
764767
ManifestData = `application/json;base64,` + base64.StdEncoding.EncodeToString(manifestBytes)

modules/templates/helper.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ func NewFuncMap() []template.FuncMap {
8181
"AppDomain": func() string {
8282
return setting.Domain
8383
},
84+
"AssetVersion": func() string {
85+
return setting.AssetVersion
86+
},
8487
"DisableGravatar": func() bool {
8588
return setting.DisableGravatar
8689
},
@@ -150,7 +153,6 @@ func NewFuncMap() []template.FuncMap {
150153
"DiffTypeToStr": DiffTypeToStr,
151154
"DiffLineTypeToStr": DiffLineTypeToStr,
152155
"ShortSha": base.ShortSha,
153-
"MD5": base.EncodeMD5,
154156
"ActionContent2Commits": ActionContent2Commits,
155157
"PathEscape": url.PathEscape,
156158
"PathEscapeSegments": util.PathEscapeSegments,

options/locale/locale_fr-FR.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,8 @@ issues.filter_milestone=Jalon
12091209
issues.filter_milestone_no_select=Tous les jalons
12101210
issues.filter_assignee=Assigné
12111211
issues.filter_assginee_no_select=Toutes les affectations
1212+
issues.filter_poster=Auteur
1213+
issues.filter_poster_no_select=Tous les auteurs
12121214
issues.filter_type=Type
12131215
issues.filter_type.all_issues=Tous les tickets
12141216
issues.filter_type.assigned_to_you=Qui vous sont assignés
@@ -1267,7 +1269,7 @@ issues.ref_reopening_from=`<a href="%[3]s">a référencé une pull request %[4]s
12671269
issues.ref_closed_from=`<a href="%[3]s">a fermé ce ticket %[4]s</a> <a id="%[1]s" href="#%[1]s">%[2]s</a>`
12681270
issues.ref_reopened_from=`<a href="%[3]s">a réouvert ce ticket %[4]s</a> <a id="%[1]s" href="#%[1]s">%[2]s</a>`
12691271
issues.ref_from=`de %[1]s`
1270-
issues.poster=Publier
1272+
issues.poster=Éditeur
12711273
issues.collaborator=Collaborateur
12721274
issues.owner=Propriétaire
12731275
issues.re_request_review=Redemander la revue

0 commit comments

Comments
 (0)