Skip to content

Commit bafab25

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Add `must-change-password` cli parameter (go-gitea#27626) Include username in email headers (go-gitea#28981) Update tool dependencies (go-gitea#29030) Add artifacts v4 jwt to job message and accept it (go-gitea#28885) Pass es2020 to esbuild-loader as well (go-gitea#29027) Fix default avatar image size in PR diff page (go-gitea#28971) Update JS and PY dependencies, build for `es2020` browsers (go-gitea#28977)
2 parents 098f110 + 9bea276 commit bafab25

File tree

238 files changed

+1682
-1718
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

+1682
-1718
lines changed

.eslintrc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ rules:
723723
unicorn/no-this-assignment: [2]
724724
unicorn/no-typeof-undefined: [2]
725725
unicorn/no-unnecessary-await: [2]
726+
unicorn/no-unnecessary-polyfills: [2]
726727
unicorn/no-unreadable-array-destructuring: [0]
727728
unicorn/no-unreadable-iife: [2]
728729
unicorn/no-unused-properties: [2]

.stylelintrc.yaml

+77-77
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins:
22
- stylelint-declaration-strict-value
33
- stylelint-declaration-block-no-ignored-properties
4-
- stylelint-stylistic
4+
- "@stylistic/stylelint-plugin"
55

66
ignoreFiles:
77
- "**/*.go"
@@ -17,6 +17,82 @@ overrides:
1717
customSyntax: postcss-html
1818

1919
rules:
20+
"@stylistic/at-rule-name-case": null
21+
"@stylistic/at-rule-name-newline-after": null
22+
"@stylistic/at-rule-name-space-after": null
23+
"@stylistic/at-rule-semicolon-newline-after": null
24+
"@stylistic/at-rule-semicolon-space-before": null
25+
"@stylistic/block-closing-brace-empty-line-before": null
26+
"@stylistic/block-closing-brace-newline-after": null
27+
"@stylistic/block-closing-brace-newline-before": null
28+
"@stylistic/block-closing-brace-space-after": null
29+
"@stylistic/block-closing-brace-space-before": null
30+
"@stylistic/block-opening-brace-newline-after": null
31+
"@stylistic/block-opening-brace-newline-before": null
32+
"@stylistic/block-opening-brace-space-after": null
33+
"@stylistic/block-opening-brace-space-before": null
34+
"@stylistic/color-hex-case": lower
35+
"@stylistic/declaration-bang-space-after": never
36+
"@stylistic/declaration-bang-space-before": null
37+
"@stylistic/declaration-block-semicolon-newline-after": null
38+
"@stylistic/declaration-block-semicolon-newline-before": null
39+
"@stylistic/declaration-block-semicolon-space-after": null
40+
"@stylistic/declaration-block-semicolon-space-before": never
41+
"@stylistic/declaration-block-trailing-semicolon": null
42+
"@stylistic/declaration-colon-newline-after": null
43+
"@stylistic/declaration-colon-space-after": null
44+
"@stylistic/declaration-colon-space-before": never
45+
"@stylistic/function-comma-newline-after": null
46+
"@stylistic/function-comma-newline-before": null
47+
"@stylistic/function-comma-space-after": null
48+
"@stylistic/function-comma-space-before": null
49+
"@stylistic/function-max-empty-lines": 0
50+
"@stylistic/function-parentheses-newline-inside": never-multi-line
51+
"@stylistic/function-parentheses-space-inside": null
52+
"@stylistic/function-whitespace-after": null
53+
"@stylistic/indentation": 2
54+
"@stylistic/linebreaks": null
55+
"@stylistic/max-empty-lines": 1
56+
"@stylistic/max-line-length": null
57+
"@stylistic/media-feature-colon-space-after": null
58+
"@stylistic/media-feature-colon-space-before": never
59+
"@stylistic/media-feature-name-case": null
60+
"@stylistic/media-feature-parentheses-space-inside": null
61+
"@stylistic/media-feature-range-operator-space-after": always
62+
"@stylistic/media-feature-range-operator-space-before": always
63+
"@stylistic/media-query-list-comma-newline-after": null
64+
"@stylistic/media-query-list-comma-newline-before": null
65+
"@stylistic/media-query-list-comma-space-after": null
66+
"@stylistic/media-query-list-comma-space-before": null
67+
"@stylistic/no-empty-first-line": null
68+
"@stylistic/no-eol-whitespace": true
69+
"@stylistic/no-extra-semicolons": true
70+
"@stylistic/no-missing-end-of-source-newline": null
71+
"@stylistic/number-leading-zero": null
72+
"@stylistic/number-no-trailing-zeros": null
73+
"@stylistic/property-case": lower
74+
"@stylistic/selector-attribute-brackets-space-inside": null
75+
"@stylistic/selector-attribute-operator-space-after": null
76+
"@stylistic/selector-attribute-operator-space-before": null
77+
"@stylistic/selector-combinator-space-after": null
78+
"@stylistic/selector-combinator-space-before": null
79+
"@stylistic/selector-descendant-combinator-no-non-space": null
80+
"@stylistic/selector-list-comma-newline-after": null
81+
"@stylistic/selector-list-comma-newline-before": null
82+
"@stylistic/selector-list-comma-space-after": always-single-line
83+
"@stylistic/selector-list-comma-space-before": never-single-line
84+
"@stylistic/selector-max-empty-lines": 0
85+
"@stylistic/selector-pseudo-class-case": lower
86+
"@stylistic/selector-pseudo-class-parentheses-space-inside": never
87+
"@stylistic/selector-pseudo-element-case": lower
88+
"@stylistic/string-quotes": double
89+
"@stylistic/unicode-bom": null
90+
"@stylistic/unit-case": lower
91+
"@stylistic/value-list-comma-newline-after": null
92+
"@stylistic/value-list-comma-newline-before": null
93+
"@stylistic/value-list-comma-space-after": null
94+
"@stylistic/value-list-comma-space-before": null
95+
"@stylistic/value-list-max-empty-lines": 0
2096
alpha-value-notation: null
2197
annotation-no-unknown: true
2298
at-rule-allowed-list: null
@@ -137,82 +213,6 @@ rules:
137213
selector-type-no-unknown: [true, {ignore: [custom-elements]}]
138214
shorthand-property-no-redundant-values: true
139215
string-no-newline: true
140-
stylistic/at-rule-name-case: null
141-
stylistic/at-rule-name-newline-after: null
142-
stylistic/at-rule-name-space-after: null
143-
stylistic/at-rule-semicolon-newline-after: null
144-
stylistic/at-rule-semicolon-space-before: null
145-
stylistic/block-closing-brace-empty-line-before: null
146-
stylistic/block-closing-brace-newline-after: null
147-
stylistic/block-closing-brace-newline-before: null
148-
stylistic/block-closing-brace-space-after: null
149-
stylistic/block-closing-brace-space-before: null
150-
stylistic/block-opening-brace-newline-after: null
151-
stylistic/block-opening-brace-newline-before: null
152-
stylistic/block-opening-brace-space-after: null
153-
stylistic/block-opening-brace-space-before: null
154-
stylistic/color-hex-case: lower
155-
stylistic/declaration-bang-space-after: never
156-
stylistic/declaration-bang-space-before: null
157-
stylistic/declaration-block-semicolon-newline-after: null
158-
stylistic/declaration-block-semicolon-newline-before: null
159-
stylistic/declaration-block-semicolon-space-after: null
160-
stylistic/declaration-block-semicolon-space-before: never
161-
stylistic/declaration-block-trailing-semicolon: null
162-
stylistic/declaration-colon-newline-after: null
163-
stylistic/declaration-colon-space-after: null
164-
stylistic/declaration-colon-space-before: never
165-
stylistic/function-comma-newline-after: null
166-
stylistic/function-comma-newline-before: null
167-
stylistic/function-comma-space-after: null
168-
stylistic/function-comma-space-before: null
169-
stylistic/function-max-empty-lines: 0
170-
stylistic/function-parentheses-newline-inside: never-multi-line
171-
stylistic/function-parentheses-space-inside: null
172-
stylistic/function-whitespace-after: null
173-
stylistic/indentation: 2
174-
stylistic/linebreaks: null
175-
stylistic/max-empty-lines: 1
176-
stylistic/max-line-length: null
177-
stylistic/media-feature-colon-space-after: null
178-
stylistic/media-feature-colon-space-before: never
179-
stylistic/media-feature-name-case: null
180-
stylistic/media-feature-parentheses-space-inside: null
181-
stylistic/media-feature-range-operator-space-after: always
182-
stylistic/media-feature-range-operator-space-before: always
183-
stylistic/media-query-list-comma-newline-after: null
184-
stylistic/media-query-list-comma-newline-before: null
185-
stylistic/media-query-list-comma-space-after: null
186-
stylistic/media-query-list-comma-space-before: null
187-
stylistic/no-empty-first-line: null
188-
stylistic/no-eol-whitespace: true
189-
stylistic/no-extra-semicolons: true
190-
stylistic/no-missing-end-of-source-newline: null
191-
stylistic/number-leading-zero: null
192-
stylistic/number-no-trailing-zeros: null
193-
stylistic/property-case: lower
194-
stylistic/selector-attribute-brackets-space-inside: null
195-
stylistic/selector-attribute-operator-space-after: null
196-
stylistic/selector-attribute-operator-space-before: null
197-
stylistic/selector-combinator-space-after: null
198-
stylistic/selector-combinator-space-before: null
199-
stylistic/selector-descendant-combinator-no-non-space: null
200-
stylistic/selector-list-comma-newline-after: null
201-
stylistic/selector-list-comma-newline-before: null
202-
stylistic/selector-list-comma-space-after: always-single-line
203-
stylistic/selector-list-comma-space-before: never-single-line
204-
stylistic/selector-max-empty-lines: 0
205-
stylistic/selector-pseudo-class-case: lower
206-
stylistic/selector-pseudo-class-parentheses-space-inside: never
207-
stylistic/selector-pseudo-element-case: lower
208-
stylistic/string-quotes: double
209-
stylistic/unicode-bom: null
210-
stylistic/unit-case: lower
211-
stylistic/value-list-comma-newline-after: null
212-
stylistic/value-list-comma-newline-before: null
213-
stylistic/value-list-comma-space-after: null
214-
stylistic/value-list-comma-space-before: null
215-
stylistic/value-list-max-empty-lines: 0
216216
time-min-milliseconds: null
217217
unit-allowed-list: null
218218
unit-disallowed-list: null

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Here's how to run the test suite:
167167

168168
| Command | Action | |
169169
| :------------------------------------- | :----------------------------------------------- | ------------ |
170-
|``make test[\#SpecificTestName]`` | run unit test(s) |
170+
|``make test[\#SpecificTestName]`` | run unit test(s) | |
171171
|``make test-sqlite[\#SpecificTestName]``| run [integration](tests/integration) test(s) for SQLite |[More details](tests/integration/README.md) |
172172
|``make test-e2e-sqlite[\#SpecificTestName]``| run [end-to-end](tests/e2e) test(s) for SQLite |[More details](tests/e2e/README.md) |
173173

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ COMMA := ,
2525

2626
XGO_VERSION := go-1.21.x
2727

28-
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.44.0
28+
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.49.0
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
30-
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.5.0
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected].0
30+
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.6.0
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected].2
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]
3535
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3636
GO_LICENSES_PACKAGE ?= github.com/google/[email protected]
37-
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/[email protected].1
38-
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/[email protected].25
37+
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/[email protected].3
38+
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/[email protected].26
3939

4040
DOCKER_IMAGE ?= gitea/gitea
4141
DOCKER_TAG ?= latest

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,5 @@ Looking for an overview of the interface? Check it out!
178178
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
179179
|:---:|:---:|:---:|
180180
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
181-
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
182-
![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|
181+
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
182+
|![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|

README_ZH.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ Fork -> Patch -> Push -> Pull Request
9898
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
9999
|:---:|:---:|:---:|
100100
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
101-
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
102-
![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|
101+
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
102+
|![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|

cmd/admin_user_change_password.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ var microcmdUserChangePassword = &cli.Command{
3232
Value: "",
3333
Usage: "New password to set for user",
3434
},
35+
&cli.BoolFlag{
36+
Name: "must-change-password",
37+
Usage: "User must change password",
38+
},
3539
},
3640
}
3741

@@ -69,7 +73,11 @@ func runChangePassword(c *cli.Context) error {
6973
return err
7074
}
7175

72-
if err = user_model.UpdateUserCols(ctx, user, "passwd", "passwd_hash_algo", "salt"); err != nil {
76+
if c.IsSet("must-change-password") {
77+
user.MustChangePassword = c.Bool("must-change-password")
78+
}
79+
80+
if err = user_model.UpdateUserCols(ctx, user, "must_change_password", "passwd", "passwd_hash_algo", "salt"); err != nil {
7381
return err
7482
}
7583

docs/content/administration/command-line.en-us.md

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Admin operations:
9595
- Options:
9696
- `--username value`, `-u value`: Username. Required.
9797
- `--password value`, `-p value`: New password. Required.
98+
- `--must-change-password`: If provided, the user is required to choose a new password after the login. Optional.
9899
- Examples:
99100
- `gitea admin user change-password --username myname --password asecurepassword`
100101
- `must-change-password`:

docs/content/usage/packages/alpine.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ DELETE https://gitea.example.com/api/packages/{owner}/alpine/{branch}/{repositor
102102
| `branch` | The branch to use. |
103103
| `repository` | The repository to use. |
104104
| `architecture` | The package architecture. |
105-
| `filename` | The file to delete.
105+
| `filename` | The file to delete. |
106106

107107
Example request using HTTP Basic authentication:
108108

models/asymkey/gpg_key_verify.go

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ func VerifyGPGKey(ctx context.Context, ownerID int64, keyID, token, signature st
6363
}
6464
if signer == nil {
6565
signer, err = hashAndVerifyWithSubKeys(sig, token+"\n", key)
66-
6766
if err != nil {
6867
return "", ErrGPGInvalidTokenSignature{
6968
ID: key.KeyID,

models/user/user.go

+11
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,17 @@ func (u *User) GetDisplayName() string {
443443
return u.Name
444444
}
445445

446+
// GetCompleteName returns the the full name and username in the form of
447+
// "Full Name (@username)" if full name is not empty, otherwise it returns
448+
// "@username".
449+
func (u *User) GetCompleteName() string {
450+
trimmedFullName := strings.TrimSpace(u.FullName)
451+
if len(trimmedFullName) > 0 {
452+
return fmt.Sprintf("%s (@%s)", trimmedFullName, u.Name)
453+
}
454+
return fmt.Sprintf("@%s", u.Name)
455+
}
456+
446457
func gitSafeName(name string) string {
447458
return strings.TrimSpace(strings.NewReplacer("\n", "", "<", "", ">", "").Replace(name))
448459
}

modules/lfs/http_client.go

-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ func (c *HTTPClient) performOperation(ctx context.Context, objects []Pointer, dc
168168
}
169169

170170
err = transferAdapter.Upload(ctx, link, object.Pointer, content)
171-
172171
if err != nil {
173172
return err
174173
}

modules/markup/markdown/goldmark.go

-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,6 @@ func (r *HTMLRenderer) renderIcon(w util.BufWriter, source []byte, node ast.Node
440440

441441
var err error
442442
_, err = w.WriteString(fmt.Sprintf(`<i class="icon %s"></i>`, name))
443-
444443
if err != nil {
445444
return ast.WalkStop, err
446445
}

modules/templates/util_avatar.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (au *AvatarUtils) Avatar(item any, others ...any) template.HTML {
5959
}
6060
}
6161

62-
return ""
62+
return AvatarHTML(avatars.DefaultAvatarLink(), size, class, "")
6363
}
6464

6565
// AvatarByAction renders user avatars from action. args: action, size (int), class (string)

0 commit comments

Comments
 (0)