]> source.dussan.org Git - gitea.git/log
gitea.git
3 hours agoFix debian package clean up (#32351) (#32590) release/v1.22
wxiaoguang [Thu, 21 Nov 2024 06:27:02 +0000 (14:27 +0800)]
Fix debian package clean up (#32351) (#32590)

Partially backport #32351

4 hours agoFix GetInactiveUsers (#32540) (#32588)
Giteabot [Thu, 21 Nov 2024 05:25:36 +0000 (13:25 +0800)]
Fix GetInactiveUsers (#32540) (#32588)

Backport #32540 by @lunny

Fix #31480

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
6 hours agoallow the actions user to login via the jwt token (#32527) (#32580)
Rowan Bohde [Thu, 21 Nov 2024 03:18:00 +0000 (21:18 -0600)]
allow the actions user to login via the jwt token (#32527) (#32580)

Backport #32527

We have some actions that leverage the Gitea API that began receiving
401 errors, with a message that the user was not found. These actions
use the `ACTIONS_RUNTIME_TOKEN` env var in the actions job to
authenticate with the Gitea API. The format of this env var in actions
jobs changed with go-gitea/gitea/pull/28885 to be a JWT (with a
corresponding update to `act_runner`) Since it was a JWT, the OAuth
parsing logic attempted to parse it as an OAuth token, and would return
user not found, instead of falling back to look up the running task and
assigning it to the actions user.

Make ACTIONS_RUNTIME_TOKEN in action runners could be used, attempting
to parse Oauth JWTs. The code to parse potential old
`ACTION_RUNTIME_TOKEN` was kept in case someone is running an older
version of act_runner that doesn't support the Actions JWT.

7 hours agoFix submodule parsing (#32571) (#32577)
wxiaoguang [Thu, 21 Nov 2024 02:32:19 +0000 (10:32 +0800)]
Fix submodule parsing (#32571) (#32577)

A quick fix for #32568
Partially backport from #32571

38 hours agoRemove unnecessary code (#32560) (#32567)
Giteabot [Tue, 19 Nov 2024 18:55:59 +0000 (02:55 +0800)]
Remove unnecessary code (#32560) (#32567)

Backport #32560 by @lunny

PushMirrors only be used in the repository setting page. So it should
not be loaded on every repository page.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 days agoRefactor find forks and fix possible bugs that weak permissions check (#32528) (...
Lunny Xiao [Tue, 19 Nov 2024 04:08:32 +0000 (20:08 -0800)]
Refactor find forks and fix possible bugs that weak permissions check (#32528) (#32547)

Backport #32528

- Move models/GetForks to services/FindForks
- Add doer as a parameter of FindForks to check permissions
- Slight performance optimization for get forks API with batch loading
of repository units
- Add tests for forking repository to organizations

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 days agoFix some places which doesn't repsect org full name setting (#32243) (#32550)
Giteabot [Tue, 19 Nov 2024 02:49:29 +0000 (10:49 +0800)]
Fix some places which doesn't repsect org full name setting (#32243) (#32550)

Backport #32243 by @lunny

Partially fix #31345

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 days agoRefactor push mirror find and add check for updating push mirror (#32539) (#32549)
Lunny Xiao [Mon, 18 Nov 2024 15:55:27 +0000 (07:55 -0800)]
Refactor push mirror find and add check for updating push mirror (#32539) (#32549)

backport #32539

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 days agoImprove some sanitizer rules (#32534)
wxiaoguang [Mon, 18 Nov 2024 03:42:30 +0000 (11:42 +0800)]
Improve some sanitizer rules (#32534)

This is a backport-only fix for 1.22

1.23 has a proper fix #32533

4 days agoFix basic auth with webauthn (#32531) (#32536)
Giteabot [Sat, 16 Nov 2024 18:21:00 +0000 (02:21 +0800)]
Fix basic auth with webauthn (#32531) (#32536)

Backport #32531 by @lunny

WebAuthn should behave the same way as TOTP. When enabled, basic auth
with username/password should need to WebAuthn auth, otherwise returned
401.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 days agoFix artifact v4 upload above 8MB (#31664) (#32523)
Giteabot [Sat, 16 Nov 2024 17:15:33 +0000 (01:15 +0800)]
Fix artifact v4 upload above 8MB (#31664) (#32523)

6 days agoRemove transaction for archive download (#32186) (#32520)
Giteabot [Fri, 15 Nov 2024 09:27:38 +0000 (17:27 +0800)]
Remove transaction for archive download (#32186) (#32520)

Backport #32186 by @lunny

Since there is a status column in the database, the transaction is
unnecessary when downloading an archive. The transaction is blocking
database operations, especially with SQLite.

Replace #27563

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
6 days agoFix oauth2 error handle not return immediately (#32514) (#32516)
Giteabot [Fri, 15 Nov 2024 03:27:04 +0000 (11:27 +0800)]
Fix oauth2 error handle not return immediately (#32514) (#32516)

Backport #32514 by lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
6 days agoTrim title before insert/update to database to match the size requirements of databas...
Lunny Xiao [Fri, 15 Nov 2024 02:06:31 +0000 (18:06 -0800)]
Trim title before insert/update to database to match the size requirements of database (#32498) (#32507)

7 days agoFix nil panic if repo doesn't exist (#32501) (#32502)
Giteabot [Thu, 14 Nov 2024 04:47:04 +0000 (12:47 +0800)]
Fix nil panic if repo doesn't exist (#32501) (#32502)

Backport #32501 by wxiaoguang

fix  #32496

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 days agoAdd a doctor check to disable the "Actions" unit for mirrors (#32424) (#32497)
Giteabot [Wed, 13 Nov 2024 18:47:56 +0000 (02:47 +0800)]
Add a doctor check to disable the "Actions" unit for mirrors (#32424) (#32497)

Backport #32424 by @Zettat123

Resolve #32232

Users can disable the "Actions" unit for all mirror repos by running
```
gitea doctor check --run  disable-mirror-actions-unit --fix
```

Co-authored-by: Zettat123 <zettat123@gmail.com>
7 days agoUpdate nix development environment vor v1.22.x (#32495)
6543 [Wed, 13 Nov 2024 17:40:52 +0000 (18:40 +0100)]
Update nix development environment vor v1.22.x (#32495)

just bump:

 * golang:  v1.22.2 ->  v1.22.9
 * nodejs: v20.12.2 -> v20.18.0
 * python: v3.12.3 -> v3.12.7

8 days agoRefactor internal routers (partial backport, auth token const time comparing) (#32473...
wxiaoguang [Wed, 13 Nov 2024 02:26:37 +0000 (10:26 +0800)]
Refactor internal routers (partial backport, auth token const time comparing) (#32473) (#32479)

Partially backport #32473. LFS related changes are not in 1.22, so skip
them.

1. Ignore non-existing repos during migrations
2. Improve ReadBatchLine's comment
3. Use `X-Gitea-Internal-Auth` header for internal API calls and make
the comparing constant time (it wasn't a serous problem because in a
real world it's nearly impossible to timing-attack the token, but indeed
security related and good to fix and backport)
4. Fix route mock nil check

9 days agoDisable Oauth check if oauth disabled (#32368) (#32480)
wxiaoguang [Tue, 12 Nov 2024 06:09:47 +0000 (14:09 +0800)]
Disable Oauth check if oauth disabled (#32368) (#32480)

Partially backport Disable Oauth check if oauth disabled #32368

9 days agocargo registry - respect renamed dependencies (#32430) (#32478)
Giteabot [Tue, 12 Nov 2024 03:26:26 +0000 (11:26 +0800)]
cargo registry - respect renamed dependencies (#32430) (#32478)

Backport #32430 by usbalbin

Co-authored-by: Albin Hedman <albin9604@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 days agoFix broken releases when re-pushing tags (#32435) (#32449)
Giteabot [Sun, 10 Nov 2024 23:49:59 +0000 (07:49 +0800)]
Fix broken releases when re-pushing tags (#32435) (#32449)

Backport #32435 by @Zettat123

Fix #32427

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 days agoFix mermaid diagram height when initially hidden (#32457) (#32464)
Giteabot [Sun, 10 Nov 2024 20:05:42 +0000 (04:05 +0800)]
Fix mermaid diagram height when initially hidden (#32457) (#32464)

Backport #32457 by @silverwind

In a hidden iframe, `document.body.clientHeight` is not reliable. Use
`IntersectionObserver` to detect the visibility change and update the
height there.

Fixes: https://github.com/go-gitea/gitea/issues/32392
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/a95ef6aa-27e7-443f-9d06-400ef27919ae">

Co-authored-by: silverwind <me@silverwind.io>
13 days agoOnly provide the commit summary for Discord webhook push events (#32432) (#32447)
Giteabot [Fri, 8 Nov 2024 01:13:49 +0000 (09:13 +0800)]
Only provide the commit summary for Discord webhook push events (#32432) (#32447)

Backport #32432 by @kemzeb

Resolves #32371.

#31970 should have just showed the commit summary, but
`strings.SplitN()` was misused such that we did not perform any
splitting at all and just used the message. This was not caught in the
unit test made in that PR since the test commit summary was > 50 (which
truncated away the commit description).

This snapshot resolves this and adds another unit test to ensure that we
only show the commit summary.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
2 weeks agoOnly query team tables if repository is under org when getting assignees (#32414...
Lunny Xiao [Wed, 6 Nov 2024 03:22:11 +0000 (19:22 -0800)]
Only query team tables if repository is under org when getting assignees (#32414) (#32426)

backport #32414

It's unnecessary to query the team table if the repository is not under
organization when getting assignees.

2 weeks agoQuick fix milestone deadline 9999 for 1.22 (#32423)
wxiaoguang [Tue, 5 Nov 2024 06:13:19 +0000 (14:13 +0800)]
Quick fix milestone deadline 9999 for 1.22 (#32423)

2 weeks agoFix created_unix for mirroring (#32342) (#32406)
Lunny Xiao [Tue, 5 Nov 2024 03:43:30 +0000 (19:43 -0800)]
Fix created_unix for mirroring (#32342) (#32406)

Fix #32233
Backport #32342

2 weeks agoFix broken image when editing comment with non-image attachments (#32319) (#32345)
Lunny Xiao [Sat, 2 Nov 2024 05:34:09 +0000 (22:34 -0700)]
Fix broken image when editing comment with non-image attachments (#32319) (#32345)

Backport #32319

Fix #32316

---------

Co-authored-by: yp05327 <576951401@qq.com>
2 weeks agoFix `missing signature key` error when pulling Docker images with `SERVE_DIRECT`...
Zettat123 [Fri, 1 Nov 2024 03:53:59 +0000 (11:53 +0800)]
Fix `missing signature key` error when pulling Docker images with `SERVE_DIRECT` enabled (#32365) (#32397)

Backport #32365

Fix #28121

I did some tests and found that the `missing signature key` error is
caused by an incorrect `Content-Type` header. Gitea correctly sets the
`Content-Type` header when serving files.

https://github.com/go-gitea/gitea/blob/348d1d0f322ca57c459acd902f54821d687ca804/routers/api/packages/container/container.go#L712-L717
However, when `SERVE_DIRECT` is enabled, the `Content-Type` header may
be set to an incorrect value by the storage service. To fix this issue,
we can use query parameters to override response header values.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html <img
width="600px"

src="https://github.com/user-attachments/assets/f2ff90f0-f1df-46f9-9680-b8120222c555"
/>

In this PR, I introduced a new parameter to the `URL` method to support
additional parameters.

```
URL(path, name string, reqParams url.Values) (*url.URL, error)
```

3 weeks agoRespect UI.ExploreDefaultSort setting again (#32357) (#32385)
6543 [Thu, 31 Oct 2024 05:49:09 +0000 (06:49 +0100)]
Respect UI.ExploreDefaultSort setting again (#32357) (#32385)

Backport #32357

fix regression of https://github.com/go-gitea/gitea/pull/29430

---
*Sponsored by Kithara Software GmbH*

3 weeks agoFix disable 2fa bug (#32320) (#32330)
Lunny Xiao [Fri, 25 Oct 2024 09:54:56 +0000 (17:54 +0800)]
Fix disable 2fa bug (#32320) (#32330)

Backport #32320

4 weeks agoFix the permission check for user search API and limit the number of returned users...
Zettat123 [Wed, 23 Oct 2024 04:56:13 +0000 (12:56 +0800)]
Fix the permission check for user search API and limit the number of returned users for `/user/search` (#32310)

Partially backport #32288

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
4 weeks agoAdd warn log when deleting inactive users (#32318) (#32321)
Lunny Xiao [Wed, 23 Oct 2024 02:48:42 +0000 (10:48 +0800)]
Add warn log when deleting inactive users (#32318) (#32321)

Backport #32318

Add log for the problem #31480

4 weeks agoAPI: enhance SearchIssues swagger docs (#32208) (#32298)
6543 [Mon, 21 Oct 2024 00:32:34 +0000 (02:32 +0200)]
API: enhance SearchIssues swagger docs (#32208) (#32298)

Backport  #32208

This will result in better api clients generated out of the openapi docs for SearchIssues

---
*Sponsored by Kithara Software GmbH*

4 weeks agoUpdate github.com/go-enry/go-enry to v2.9.1 (#32295) (#32296)
YR Chen [Sun, 20 Oct 2024 18:12:51 +0000 (02:12 +0800)]
Update github.com/go-enry/go-enry to v2.9.1 (#32295) (#32296)

Backport #32295

`go-enry` v2.9.1 includes latest file patterns from Linguist, which can
identify more generated file type, eg. `pdm.lock`.

4 weeks agoAlways update expiration time when creating an artifact (#32281) (#32285)
Zettat123 [Fri, 18 Oct 2024 02:36:23 +0000 (10:36 +0800)]
Always update expiration time when creating an artifact (#32281) (#32285)

Backport #32281

Fix #32256

5 weeks agomake `show stats` work when only one file changed (#32244) (#32268)
a1012112796 [Thu, 17 Oct 2024 08:03:21 +0000 (16:03 +0800)]
make `show stats` work when only one file changed (#32244) (#32268)

Backport #32244

fix https://github.com/go-gitea/gitea/issues/32226

in https://github.com/go-gitea/gitea/pull/27775 , it do some changes to
only show diff file tree when more than one file changed. But looks it
also break the `diff-file-list` logic, which looks not expected change.
so try fix it.

/cc @silverwind

example view:

![image](https://github.com/user-attachments/assets/281e9c4f-a269-4d36-94eb-a132058aea87)

Signed-off-by: a1012112796 <1012112796@qq.com>
5 weeks ago[v1.22 backport] Fix null errors on conversation holder (#32258) (#32266) (#32282)
cloudchamb3r [Thu, 17 Oct 2024 05:34:39 +0000 (14:34 +0900)]
[v1.22 backport] Fix null errors on conversation holder (#32258) (#32266) (#32282)

Backport #32266

fix #32258

Errors in the issue was due to unhandled null check. so i fixed it.

### Detailed description for Issue & Fix
To reproduce that issue, the comment must be deleted on Conversation
tab.
#### Before Delete
<img width="1032" alt="image"

src="https://github.com/user-attachments/assets/72df61ba-7db6-44c9-bebc-ca1178dd27f1">

#### After Delete (AS-IS)
<img width="1010" alt="image"

src="https://github.com/user-attachments/assets/36fa537e-4f8e-4535-8d02-e538c50f0dd8">

gitea already have remove logic for `timeline-item-group`, but because
of null ref exception the later logic that removes `timeline-item-group`
could be not be called correctly.

5 weeks agoWarn users when they try to use a non-root-url to sign in/up (#32272) (#32273)
wxiaoguang [Thu, 17 Oct 2024 01:01:44 +0000 (09:01 +0800)]
Warn users when they try to use a non-root-url to sign in/up (#32272) (#32273)

5 weeks agoMake `owner/repo/pulls` handlers use "PR reader" permission (#32254) (#32265)
wxiaoguang [Tue, 15 Oct 2024 14:32:54 +0000 (22:32 +0800)]
Make `owner/repo/pulls` handlers use "PR reader" permission (#32254) (#32265)

Backport #32254 (no conflict)

5 weeks agoUpdate scheduled tasks even if changes are pushed by "ActionsUser" (#32246) (#32252)
Zettat123 [Mon, 14 Oct 2024 08:55:16 +0000 (16:55 +0800)]
Update scheduled tasks even if changes are pushed by "ActionsUser" (#32246) (#32252)

Backport #32246

Fix #32219

Co-authored-by: delvh <dev.lh@web.de>
5 weeks agoOnly rename a user when they should receive a different name (#32247) (#32249)
Giteabot [Sun, 13 Oct 2024 19:27:37 +0000 (03:27 +0800)]
Only rename a user when they should receive a different name (#32247) (#32249)

Backport #32247 by @lunny

Fix #31996

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
5 weeks agoFix dropdown content overflow (#31610) (#32250)
Giteabot [Sun, 13 Oct 2024 03:46:55 +0000 (11:46 +0800)]
Fix dropdown content overflow (#31610) (#32250)

Backport #31610 by charles7668

close #31602

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
5 weeks agoFix checkbox bug on private/archive filter (#32236) (#32240)
Giteabot [Fri, 11 Oct 2024 13:13:09 +0000 (21:13 +0800)]
Fix checkbox bug on private/archive filter (#32236) (#32240)

Backport #32236 by cloudchamb3r

fix #32235

Co-authored-by: cloudchamb3r <jizon0123@protonmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 weeks agoAdd release note for v1.22.3 (#32205) v1.22.3
Lunny Xiao [Wed, 9 Oct 2024 03:23:48 +0000 (11:23 +0800)]
Add release note for v1.22.3 (#32205)

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
6 weeks agoFix bug when a token is given public only (#32204) (#32218)
Lunny Xiao [Wed, 9 Oct 2024 02:16:37 +0000 (10:16 +0800)]
Fix bug when a token is given public only (#32204) (#32218)

Backport #32204

6 weeks agoAdd null check for responseData.invalidTopics (#32212) (#32217)
Giteabot [Wed, 9 Oct 2024 01:18:29 +0000 (09:18 +0800)]
Add null check for responseData.invalidTopics (#32212) (#32217)

Backport #32212 by @cloudchamb3r

<img width="553" alt="Screenshot 2024-10-08 at 10 49 10 AM"
src="https://github.com/user-attachments/assets/faeef64d-684a-4aba-b7fc-c7c6a0301abe">

`responseData.invalidTopics` can be null but it wasn't handled.

Co-authored-by: cloudchamb3r <jizon0123@protonmail.com>
6 weeks agoFix javascript error when an anonymous user visiting migration page (#32144) (#32179)
Lunny Xiao [Fri, 4 Oct 2024 17:58:04 +0000 (01:58 +0800)]
Fix javascript error when an anonymous user visiting migration page (#32144) (#32179)

backport #32144

This PR fixes javascript errors when an anonymous user visits the
migration page.
It also makes task view checking more restrictive.

The router moved from `/user/task/{id}/status` to
`/username/reponame/-/migrate/status` because it's a migrate status.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 weeks agoFixed race condition when deleting documents by repoId in ElasticSearch (#32185)...
Giteabot [Thu, 3 Oct 2024 16:33:26 +0000 (00:33 +0800)]
Fixed race condition when deleting documents by repoId in ElasticSearch (#32185) (#32188)

Backport #32185 by @bsofiato

Resolves #32184

Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com>
Co-authored-by: Bruno Sofiato <bruno.sofiato@gmail.com>
6 weeks agoDon't init singing keys if oauth2 provider disabled (#32177)
Lunny Xiao [Thu, 3 Oct 2024 15:34:56 +0000 (08:34 -0700)]
Don't init singing keys if oauth2 provider disabled (#32177)

Backport #32148

7 weeks agoUpgrade some dependencies include minio-go (#32166)
Lunny Xiao [Thu, 3 Oct 2024 02:08:06 +0000 (19:08 -0700)]
Upgrade some dependencies include minio-go (#32166)

backport #32156

Co-authored-by: Manuel Valls Fernández <manuel@valls.dev>
7 weeks agoEnsure `GetCSRF` doesn't return an empty token (#32130) (#32157)
Giteabot [Tue, 1 Oct 2024 05:27:37 +0000 (13:27 +0800)]
Ensure `GetCSRF` doesn't return an empty token (#32130) (#32157)

Backport #32130 by @wolfogre

Since page templates keep changing, some pages that contained forms with
CSRF token no longer have them.

It leads to some calls of `GetCSRF` returning an empty string, which
fails the tests. Like

https://github.com/go-gitea/gitea/blob/3269b04d61ffe6a7ce462cd05ee150e4491124e8/tests/integration/attachment_test.go#L62-L63

The test did try to get the CSRF token and provided it, but it was
empty.

Co-authored-by: Jason Song <i@wolfogre.com>
7 weeks agoFix the logic of finding the latest pull review commit ID (#32139) (#32165)
Giteabot [Tue, 1 Oct 2024 04:10:03 +0000 (12:10 +0800)]
Fix the logic of finding the latest pull review commit ID (#32139) (#32165)

Backport #32139 by @Zettat123

Fix #31423

Co-authored-by: Zettat123 <zettat123@gmail.com>
7 weeks agoDon't join repository when loading action table data (#32127) (#32143)
Lunny Xiao [Mon, 30 Sep 2024 03:04:08 +0000 (11:04 +0800)]
Don't join repository when loading action table data (#32127) (#32143)

backport #32127

8 weeks agoFix wrong status of `Set up Job` when first step is skipped (#32120) (#32125) 32164/head
Giteabot [Wed, 25 Sep 2024 02:19:35 +0000 (10:19 +0800)]
Fix wrong status of `Set up Job` when first step is skipped (#32120) (#32125)

Backport #32120 by @yp05327

Fix #32089

Co-authored-by: yp05327 <576951401@qq.com>
8 weeks agoFix bug in getting merged pull request by commit (#32079) (#32117)
Zettat123 [Tue, 24 Sep 2024 16:12:02 +0000 (00:12 +0800)]
Fix bug in getting merged pull request by commit (#32079) (#32117)

Backport #32079

Fix #32027

8 weeks agoFix bug when deleting a migrated branch (#32075) (#32123)
Giteabot [Tue, 24 Sep 2024 09:01:05 +0000 (17:01 +0800)]
Fix bug when deleting a migrated branch (#32075) (#32123)

Backport #32075 by @lunny

After migrating a repository with pull request, the branch is missed and
after the pull request merged, the branch cannot be deleted.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoInclude collaboration repositories on dashboard source/forks/mirrors list (#31946...
Giteabot [Tue, 24 Sep 2024 07:17:30 +0000 (15:17 +0800)]
Include collaboration repositories on dashboard source/forks/mirrors list (#31946) (#32122)

Backport #31946 by @lunny

Fix #13489

In the original implementation, only `All` will display your owned and
collaborated repositories. For other filters like `Source`, `Mirrors`
and etc. will only display your owned repositories.

This PR removed the limitations. Now except `collbrations`, other
filters will always display your owned and collaborated repositories.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoTruncate commit message during Discord webhook push events (#31970) (#32121)
Giteabot [Tue, 24 Sep 2024 05:28:01 +0000 (13:28 +0800)]
Truncate commit message during Discord webhook push events (#31970) (#32121)

Backport #31970 by @kemzeb

Resolves #31668.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
8 weeks agoAllow set branch protection in an empty repository (#32095) (#32119)
Giteabot [Tue, 24 Sep 2024 02:42:52 +0000 (10:42 +0800)]
Allow set branch protection in an empty repository (#32095) (#32119)

Backport #32095 by @lunny

Resolve #32093

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoFix panic when cloning with wrong ssh format. (#32076) (#32118)
Giteabot [Tue, 24 Sep 2024 01:58:58 +0000 (09:58 +0800)]
Fix panic when cloning with wrong ssh format. (#32076) (#32118)

Backport #32076 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoFix Bug in Issue/pulls list (#32081) (#32115)
Giteabot [Tue, 24 Sep 2024 01:26:10 +0000 (09:26 +0800)]
Fix Bug in Issue/pulls list (#32081) (#32115)

8 weeks agouse rebuilt mssql-2017 image (#32109) (#32114)
Giteabot [Mon, 23 Sep 2024 21:23:04 +0000 (05:23 +0800)]
use rebuilt mssql-2017 image (#32109) (#32114)

Backport #32109 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
8 weeks agoFix rename branch permission bug (#32066) (#32108)
Giteabot [Sun, 22 Sep 2024 19:43:13 +0000 (03:43 +0800)]
Fix rename branch permission bug (#32066) (#32108)

Backport #32066 by @lunny

The previous implementation requires admin permission to rename branches
which should be write permission.

Fix #31993

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoFix wrong last modify time (#32102) (#32104)
Giteabot [Sun, 22 Sep 2024 19:12:57 +0000 (03:12 +0800)]
Fix wrong last modify time (#32102) (#32104)

Backport #32102 by @lunny

Fix #31930 and more places which use `http.TimeFormat` wrongly.
`http.TimeFormat` requires a UTC time. refer to
https://pkg.go.dev/net/http#TimeFormat

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
8 weeks agoAdd bin to Composer Metadata (#32099) (#32106)
Giteabot [Sun, 22 Sep 2024 18:42:02 +0000 (02:42 +0800)]
Add bin to Composer Metadata (#32099) (#32106)

Backport #32099 by @maantje

This PR addresses the missing `bin` field in Composer metadata, which
currently causes vendor-provided binaries to not be symlinked to
`vendor/bin` during installation.

In the current implementation, running `composer install` does not
publish the binaries, leading to issues where expected binaries are not
available.

By properly declaring the `bin` field, this PR ensures that binaries are
correctly symlinked upon installation, as described in the [Composer
documentation](https://getcomposer.org/doc/articles/vendor-binaries.md).

Co-authored-by: Jamie Schouten <j4mie@hey.com>
8 weeks agoFix incorrect `/tokens` api (#32085) (#32092)
Giteabot [Sun, 22 Sep 2024 18:02:09 +0000 (02:02 +0800)]
Fix incorrect `/tokens` api (#32085) (#32092)

Backport #32085 by @KN4CK3R

Fixes #32078

- Add missing scopes output.
- Disallow empty scope.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
8 weeks agoFix mssql ci with a new mssql version on ci (#32094)
Lunny Xiao [Sun, 22 Sep 2024 17:32:26 +0000 (01:32 +0800)]
Fix mssql ci with a new mssql version on ci (#32094)

backport from https://github.com/go-gitea/gitea/pull/32060

2 months agoFix: database not update release when using `git push --tags --force` (#32040) (...
Giteabot [Wed, 18 Sep 2024 23:57:28 +0000 (07:57 +0800)]
Fix: database not update release when using `git push --tags --force` (#32040) (#32074)

Backport #32040 by @ExplodingDragon

link: https://codeberg.org/forgejo/forgejo/issues/4274
Co-authored-by: Exploding Dragon <explodingfkl@gmail.com>
2 months agoRefactor CSRF protector (#32057) (#32069)
wxiaoguang [Wed, 18 Sep 2024 17:02:45 +0000 (01:02 +0800)]
Refactor CSRF protector (#32057) (#32069)

#32057 improves the CSRF handling and is worth to backport

2 months agoAdd missing comment reply handling (#32050) (#32065)
Giteabot [Wed, 18 Sep 2024 09:23:28 +0000 (17:23 +0800)]
Add missing comment reply handling (#32050) (#32065)

Backport #32050 by @KN4CK3R

Fixes #31937

- Add missing comment reply handling
- Use `onGiteaRun` in the test because the fixtures are not present
otherwise (did this behaviour change?)

Compare without whitespaces.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2 months agoLazy load avatar images (#32051) (#32063)
Giteabot [Wed, 18 Sep 2024 08:52:44 +0000 (16:52 +0800)]
Lazy load avatar images (#32051) (#32063)

Backport #32051 by @hiifong

Before:

https://github.com/user-attachments/assets/7b1681ba-4781-432a-ae20-c07e94c1dbb6

After:

https://github.com/user-attachments/assets/5154e160-e22c-460e-b0d9-28768486c178

Co-authored-by: hiifong <i@hiif.ong>
2 months agoHandle invalid target when creating releases using API (#31841) (#32043)
Giteabot [Tue, 17 Sep 2024 02:23:40 +0000 (10:23 +0800)]
Handle invalid target when creating releases using API (#31841) (#32043)

Backport #31841 by @kemzeb

A 500 status code was thrown when passing a non-existent target to the
create release API. This snapshot handles this error and instead throws
a 404 status code.

Discovered while working on #31840.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
2 months agoDo not escape relative path in RPM primary index (#32038) (#32054)
Giteabot [Tue, 17 Sep 2024 00:19:35 +0000 (08:19 +0800)]
Do not escape relative path in RPM primary index (#32038) (#32054)

Backport #32038 by @KN4CK3R

Fixes #32021

Do not escape the relative path.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2 months agoCheck if the `due_date` is nil when editing issues (#32035) (#32042)
Giteabot [Sat, 14 Sep 2024 17:31:34 +0000 (01:31 +0800)]
Check if the `due_date` is nil when editing issues (#32035) (#32042)

Backport #32035 by @Zettat123

Fix #32030

Co-authored-by: Zettat123 <zettat123@gmail.com>
2 months agoFix container parallel upload bugs (#32022)
Lunny Xiao [Thu, 12 Sep 2024 03:11:03 +0000 (11:11 +0800)]
Fix container parallel upload bugs (#32022)

This PR should be replaced by #31860 in v1.23. The aim of creating this
PR is to fix it in 1.22 because globallock hasn't been introduced.

Fix #27640
Fix #29563
Fix #31215

2 months agoFix `/repos/{owner}/{repo}/pulls/{index}/files` endpoint not populating `previous_fil...
Giteabot [Wed, 11 Sep 2024 23:58:43 +0000 (07:58 +0800)]
Fix `/repos/{owner}/{repo}/pulls/{index}/files` endpoint not populating `previous_filename` (#32017) (#32028)

Backport #32017 by @charles-plutohealth

---
`status == "rename"` should have read `status == "renamed"`. The typo
means that file.PreviousFilename would never be populated, which e.g.
breaks usage of the Github Action at
https://github.com/dorny/paths-filter.

Co-authored-by: charles-plutohealth <143208583+charles-plutohealth@users.noreply.github.com>
2 months agoSupport allowed hosts for migrations to work with proxy (#32025) (#32026)
Giteabot [Wed, 11 Sep 2024 06:54:19 +0000 (14:54 +0800)]
Support allowed hosts for migrations to work with proxy (#32025) (#32026)

Backport #32025 by @wolfogre

Fix #32024. Follow #27655.

After this PR, all usage of "new dial context" needs to provide a proxy,
so I dropped the old `NewDialContext` and renamed
`NewDialContextWithProxy` to `NewDialContext`.

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoIncrease `cacheContextLifetime` to reduce false reports (#32011) (#32023)
Giteabot [Wed, 11 Sep 2024 03:14:40 +0000 (11:14 +0800)]
Increase `cacheContextLifetime` to reduce false reports (#32011) (#32023)

Backport #32011 by @wolfogre

Replace #32001.

To prevent the context cache from being misused for long-term work
(which would result in using invalid cache without awareness), the
context cache is designed to exist for a maximum of 10 seconds. This
leads to many false reports, especially in the case of slow SQL.

This PR increases it to 5 minutes to reduce false reports.

5 minutes is not a very safe value, as a lot of changes may have
occurred within that time frame. However, as far as I know, there has
not been a case of misuse of context cache discovered so far, so I think
5 minutes should be OK.

Please note that after this PR, if warning logs are found again, it
should get attention, at that time it can be almost 100% certain that it
is a misuse.

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoUpgrade cache to v0.2.1 (#32003) (#32009)
Lunny Xiao [Sat, 7 Sep 2024 21:44:28 +0000 (05:44 +0800)]
Upgrade cache to v0.2.1 (#32003) (#32009)

Fix #31757
Backport #32003

2 months agoUse forum.gitea.com instead of old URL (#31989) (#31992)
Giteabot [Fri, 6 Sep 2024 19:47:23 +0000 (03:47 +0800)]
Use forum.gitea.com instead of old URL (#31989) (#31992)

Backport #31989 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 months agoAdd changelog for 1.22.2 (#31935) v1.22.2
Lunny Xiao [Thu, 5 Sep 2024 16:16:54 +0000 (00:16 +0800)]
Add changelog for 1.22.2 (#31935)

2 months agoFix nuget/conan/container packages upload bugs (#31967) (#31982)
Giteabot [Thu, 5 Sep 2024 07:34:41 +0000 (15:34 +0800)]
Fix nuget/conan/container packages upload bugs (#31967) (#31982)

Backport #31967 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 months agoReplace v-html with v-text in search inputbox (#31966) (#31973) (#31975)
Lunny Xiao [Thu, 5 Sep 2024 01:59:57 +0000 (09:59 +0800)]
Replace v-html with v-text in search inputbox (#31966) (#31973) (#31975)

Backport #31966, #31973
Cherry-pick 30da734f37f0bd60d13044374c1d5af54f2eb416,
74b1c589c6c1a4261556e1a1a868bbcb2964a5d3
Replace #31972

---------

Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com>
2 months agoAdd lock for parallel maven upload (#31954)
Lunny Xiao [Tue, 3 Sep 2024 06:33:28 +0000 (14:33 +0800)]
Add lock for parallel maven upload (#31954)

Backport #31851
Fix #30171

2 months agoFix index too many file names bug (#31903) (#31953)
Lunny Xiao [Tue, 3 Sep 2024 01:15:30 +0000 (09:15 +0800)]
Fix index too many file names bug (#31903) (#31953)

Try to fix #31884
Fix #28584
Backport #31903

2 months agoPrevent update pull refs manually and will not affect other refs update (#31931)...
Giteabot [Mon, 2 Sep 2024 10:28:00 +0000 (18:28 +0800)]
Prevent update pull refs manually and will not affect other refs update (#31931) (#31955)

Backport #31931 by @lunny

All refs under `refs/pull` should only be changed from Gitea inside but
not by pushing from outside of Gitea.
This PR will prevent the pull refs update but allow other refs to be
updated on the same pushing with `--mirror` operations.

The main changes are to add checks on `update` hook but not
`pre-receive` because `update` will be invoked by every ref but
`pre-receive` will revert all changes once one ref update fails.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 months agoFix sort order for organization home and user profile page (#31921) (#31922)
yp05327 [Mon, 2 Sep 2024 07:58:18 +0000 (16:58 +0900)]
Fix sort order for organization home and user profile page (#31921) (#31922)

Backport #31921

2 months agoFix 500 error when `state` params is set when editing issue/PR by API (#31880) (...
Giteabot [Sun, 1 Sep 2024 18:38:10 +0000 (02:38 +0800)]
Fix 500 error when `state` params is set when editing issue/PR by API (#31880) (#31952)

Backport #31880 by @yp05327

A quick fix for #31871

Co-authored-by: yp05327 <576951401@qq.com>
2 months agoUpgrade micromatch to 4.0.8 (#31944)
Lunny Xiao [Fri, 30 Aug 2024 02:36:49 +0000 (10:36 +0800)]
Upgrade micromatch to 4.0.8 (#31944)

backport #31939

2 months agoUpdate webpack to 5.94.0 (#31941)
silverwind [Thu, 29 Aug 2024 16:10:25 +0000 (18:10 +0200)]
Update webpack to 5.94.0 (#31941)

Update webpack on v1.22 branch because of
https://github.com/go-gitea/gitea/security/dependabot/70.

2 months agoFix search team (#31923) (#31942)
Giteabot [Thu, 29 Aug 2024 16:05:21 +0000 (00:05 +0800)]
Fix search team (#31923) (#31942)

Backport #31923 by @lunny

Fix #20658

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 months agoRemove "dsa-1024" testcases from Test_SSHParsePublicKey and Test_calcFingerprint...
Giteabot [Sun, 25 Aug 2024 12:39:00 +0000 (20:39 +0800)]
Remove "dsa-1024" testcases from Test_SSHParsePublicKey and Test_calcFingerprint (#31905) (#31914)

Backport #31905 by @s4uliu5

DSA is considered inherently insecure and is already disabled/removed in
OpenSSH 9.8.

Therefore "dsa-1024" tescases are failing.

```
--- FAIL: Test_calcFingerprint (0.02s)
    --- FAIL: Test_calcFingerprint/dsa-1024 (0.00s)
        --- FAIL: Test_calcFingerprint/dsa-1024/SSHKeygen (0.00s)
            ssh_key_test.go:196:
                        Error Trace:    /src/gitea/models/asymkey/ssh_key_test.go:196
                        Error:          Received unexpected error:
                                        Unable to verify key content [result: /tmp/gitea_keytest1239408114 is not a public key file.
                                        ]
                        Test:           Test_calcFingerprint/dsa-1024/SSHKeygen
            ssh_key_test.go:197:
                        Error Trace:    /src/gitea/models/asymkey/ssh_key_test.go:197
                        Error:          Not equal:
                                        expected: "SHA256:fSIHQlpKMDsGPVAXI8BPYfRp+e2sfvSt1sMrPsFiXrc"
                                        actual  : ""

                                        Diff:
                                        --- Expected
                                        +++ Actual
                                        @@ -1 +1 @@
                                        -SHA256:fSIHQlpKMDsGPVAXI8BPYfRp+e2sfvSt1sMrPsFiXrc
                                        +
                        Test:           Test_calcFingerprint/dsa-1024/SSHKeygen
FAIL
```

Fix #31624

Co-authored-by: Saulius Gurklys <s4uliu5@gmail.com>
3 months agoDon't return 500 if mirror url contains special chars (#31859) (#31895)
Lunny Xiao [Wed, 21 Aug 2024 16:10:50 +0000 (00:10 +0800)]
Don't return 500 if mirror url contains special chars (#31859) (#31895)

Backport #31859

3 months agoUpgrade bleve to 2.4.2 (#31894)
Lunny Xiao [Wed, 21 Aug 2024 05:13:59 +0000 (13:13 +0800)]
Upgrade bleve to 2.4.2 (#31894)

backport #31762

3 months agobug fix for translation in ru (#31892)
Lunny Xiao [Wed, 21 Aug 2024 02:01:36 +0000 (10:01 +0800)]
bug fix for translation in ru (#31892)

Fix #31891

3 months agoRefactor the usage of batch catfile (#31754) (#31889)
Giteabot [Tue, 20 Aug 2024 17:55:14 +0000 (01:55 +0800)]
Refactor the usage of batch catfile (#31754) (#31889)

Backport #31754 by @lunny

When opening a repository, it will call `ensureValidRepository` and also
`CatFileBatch`. But sometimes these will not be used until repository
closed. So it's a waste of CPU to invoke 3 times git command for every
open repository.

This PR removed all of these from `OpenRepository` but only kept
checking whether the folder exists. When a batch is necessary, the
necessary functions will be invoked.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 months agoFix agit automerge (#31207) (#31881)
Giteabot [Tue, 20 Aug 2024 16:20:58 +0000 (00:20 +0800)]
Fix agit automerge (#31207) (#31881)

Backport #31207 by @lunny

Fix #31134

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 months agoadd CfTurnstileSitekey context data to all captcha templates (#31874) (#31876)
Giteabot [Tue, 20 Aug 2024 14:45:08 +0000 (22:45 +0800)]
add CfTurnstileSitekey context data to all captcha templates (#31874) (#31876)

Backport #31874 by @bohde

In the OpenID flows, the "CfTurnstileSitekey" wasn't populated, which
caused those flows to fail if using Turnstile as the Captcha
implementation.

This adds the missing context variables, allowing Turnstile to be used
in the OpenID flows.

Co-authored-by: Rowan Bohde <rowan.bohde@gmail.com>
3 months agoFix actions notify bug (#31866) (#31875)
Giteabot [Mon, 19 Aug 2024 18:14:29 +0000 (02:14 +0800)]
Fix actions notify bug (#31866) (#31875)

Backport #31866 by @lunny

Try to fix
https://github.com/go-gitea/gitea/issues/31757#issuecomment-2295131062

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 months agofix the component of access token list not mounted (#31824) (#31868)
sillyguodong [Mon, 19 Aug 2024 16:56:17 +0000 (00:56 +0800)]
fix the component of access token list not mounted (#31824) (#31868)