1
1
mirror of https://github.com/go-gitea/gitea synced 2025-01-19 06:04:26 +00:00

16874 Commits

Author SHA1 Message Date
Giteabot
c758a8afba
Ignore empty repo for CreateRepository in action notifier () ()
Backport  by @yp05327

Fix 

Co-authored-by: yp05327 <576951401@qq.com>
2024-02-26 09:59:12 +00:00
Giteabot
83327e043a
Fix incorrect tree path value for patch editor () ()
Backport  by wxiaoguang

Regression of . When submitting the form,
EditRepoFileForm.TreePath is marked as "Required", so the value can't be
empty. The value is not used by backend, so use a meaningful dummy value
for it.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-26 09:26:23 +00:00
Lunny Xiao
78cb09deda
Change log for 1.21.7 ()
This is an emergency release to fix the bug .

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
v1.21.7
2024-02-26 15:39:21 +08:00
Giteabot
0f35cb5a2a
Add missing space () ()
Backport  by @KN4CK3R

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-26 00:08:44 +08:00
Giteabot
0b3d6c399c
enforce maxlength in frontend () ()
Backport  by @zokkis

Set maxlength attribute in frontend

to long file-name

![image](https://github.com/go-gitea/gitea/assets/72873130/15111614-55ab-4583-acb2-15c25997601d)

![image](https://github.com/go-gitea/gitea/assets/72873130/4105ddd8-4973-4da8-b3ab-4cfae1b45554)
(same for branch-name and commit-summary)

Co-authored-by: Tim-Niclas Oelschläger <72873130+zokkis@users.noreply.github.com>
2024-02-25 14:56:44 +00:00
Giteabot
f98a1b851c
Users with read permission of pull requests can be assigned too () ()
Backport  by @lunny

This PR will also keep the consistent between list assigned users and
check assigned users.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-02-24 17:42:33 +01:00
Giteabot
e75594f7a6
Do not double close reader () ()
Backport  by @KN4CK3R

Fixes 

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-24 12:08:06 +00:00
Lunny Xiao
a1c0b3a02e
Display friendly error message () ()
Backport  

`ctx.Error` only displays the text but `ctx.ServerError` renders the
usual error page.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-24 11:01:18 +00:00
Lunny Xiao
6624f257d3
Docker Tag Information in Docs () ()
Backport  

Add more details for the docker tag when using container registry.

Co-authored-by: wienans <40465543+wienans@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-24 10:41:10 +00:00
Giteabot
35db5a373b
Fix validity of the FROM email address not being checked () ()
Backport  by @carlosfelgueiras

Fixes .
Introduces a check on the installation that tries to parse the FROM
address. If it fails, shows a new error message to the user.

Co-authored-by: Carlos Felgueiras <carlosfelgueiras@tecnico.ulisboa.pt>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-24 08:23:21 +00:00
Lunny Xiao
5043ad54c7
Fix project counter in organization/individual profile () ()
Fix 
Backport  
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/5f299983-4b38-4d68-ac0e-4be3c62c0558)

![image](https://github.com/go-gitea/gitea/assets/18380374/f0e12afd-483b-4882-80e9-0261beb3fe0c)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/47cccb7b-bb35-4a7d-9c5b-83133be0323a)

![image](https://github.com/go-gitea/gitea/assets/18380374/77825c0c-4bf2-4762-83a2-1a5a173cc22d)

Co-authored-by: yp05327 <576951401@qq.com>
2024-02-24 07:58:43 +00:00
wxiaoguang
727435743a
Fix incorrect tests in 1.21 ()
The submitted tests in the patch for the XSS fix is not right.

To test, it should test "what should happen", but not "what doesn't
exist" or "what is processed/decoded".
2024-02-24 15:27:47 +08:00
Giteabot
829b807a91
Fix tarball/zipball download bug () ()
Backport  by @Zettat123

Fix 

~~Use the `/repos/{owner}/{repo}/archive/{archive}` API to download.~~

Apply  to archive download URLs.

Co-authored-by: Zettat123 <zettat123@gmail.com>
2024-02-23 23:47:11 +01:00
Lunny Xiao
874cdcc974
Adjust changelog for v1.21.6 to move prs to correct labels ()
When releasing, the releaser should read all the pull requests carefully
and do some adjustments because some of pull requests' labels are not
right when it's merged.

And the changelog tool needs to be adjusted. If one pull request has
both `bug` and `API`, it should mark it as `bug` but not `API`.
2024-02-23 15:46:56 +08:00
6543
e20023af58
Add Changelog v1.21.6 () v1.21.6 2024-02-22 23:42:29 +01:00
6543
4435d8a4b6
Fix XSS vulnerabilities ()
- The Wiki page did not sanitize author name
- the reviewer name on a "dismiss review" comment is also affected
- the migration page has some spots

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
2024-02-22 23:37:21 +01:00
Giteabot
6ca8cb590d
Don't show third-party JS errors in production builds () ()
Backport  by @silverwind

So we don't get issues like
https://github.com/go-gitea/gitea/issues/29080 and
https://github.com/go-gitea/gitea/issues/29273 any more. Only active in
[production
builds](https://webpack.js.org/guides/production/#specify-the-mode), in
non-production the errors will still show.

Co-authored-by: silverwind <me@silverwind.io>
2024-02-22 22:49:07 +01:00
6543
65e2811859
Remove SSH workaround () ()
Backport 

- Update github.com/gliderlabs/ssh to include
02f9d57300.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1230

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
2024-02-22 21:45:31 +01:00
Giteabot
b78f5fc60f
Only log error when tag sync fails () ()
Backport  by @lunny

Fix 

This PR will bypass the pushUpdateTag to database failure when
syncAllTags. An error log will be recorded.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-22 20:52:54 +01:00
wxiaoguang
511298e452
Use general token signing secret () ()
Backport  (including )

Use a clearly defined "signing secret" for token signing.
2024-02-22 17:07:41 +00:00
Lunny Xiao
7ea2ffaf16
Fix SSPI user creation () ()
Fixes 
Backport 

Setting the avatar is wrong and creating a random password is equal to
leave it empty.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-22 17:42:14 +01:00
Giteabot
fdb0d03083
Improve the issue_comment workflow trigger event () ()
Backport  by @Zettat123

Fix 
Replace 

This PR makes some improvements to the `issue_comment` workflow trigger
event.

1. Fix the bug that pull requests cannot trigger `issue_comment`
workflows
2. Previously the `issue_comment` event only supported the `created`
activity type. This PR adds support for the missing `edited` and
`deleted` activity types.
3. Some events (including `issue_comment`, `issues`, etc. ) only trigger
workflows that belong to the workflow file on the default branch. This
PR introduces the `IsDefaultBranchWorkflow` function to check for these
events.

Co-authored-by: Zettat123 <zettat123@gmail.com>
2024-02-22 17:19:48 +01:00
Giteabot
ed5e0c8c27
Discard unread data of git cat-file () ()
Backport  by @KN4CK3R

Fixes 
Related 

Discard all read data to prevent misinterpreting existing data. Some
discard calls were missing in error cases.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: yp05327 <576951401@qq.com>
2024-02-22 04:23:38 +00:00
yp05327
0870e0bc9b
Implement some action notifier functions () ()
Backport 

Fix 

Add support for the following activity types of `pull_request`
- assigned
- unassigned
- review_requested
- review_request_removed
- milestoned
- demilestoned
2024-02-22 03:55:03 +00:00
KN4CK3R
c0b97d0485
Prevent double use of git cat-file session. () ()
Backport 
Fixes the reason why  is hard to replicate.
Related 

Create a repo with a file with minimum size 4097 bytes (I use 10000) and
execute the following code:
```go
gitRepo, err := gitrepo.OpenRepository(db.DefaultContext, <repo>)
assert.NoError(t, err)

commit, err := gitRepo.GetCommit(<sha>)
assert.NoError(t, err)

entry, err := commit.GetTreeEntryByPath(<file>)
assert.NoError(t, err)

b := entry.Blob()

// Create a reader
r, err := b.DataAsync()
assert.NoError(t, err)
defer r.Close()

// Create a second reader
r2, err := b.DataAsync()
assert.NoError(t, err) // Should be no error but is ErrNotExist
defer r2.Close()
```

The problem is the check in `CatFileBatch`:


79217ea63c/modules/git/repo_base_nogogit.go (L81-L87)
`Buffered() > 0` is used to check if there is a "operation" in progress
at the moment. This is a problem because we can't control the internal
buffer in the `bufio.Reader`. The code above demonstrates a sequence
which initiates an operation for which the code thinks there is no
active processing. The second call to `DataAsync()` therefore reuses the
existing instances instead of creating a new batch reader.
2024-02-22 03:20:20 +00:00
yp05327
f80ea95eb5
Fix gitea-action user avatar broken on edited menu () ()
Backport 

Fix 
2024-02-22 02:53:38 +00:00
Zettat123
dcb9c38568
Fix error display when merging PRs () ()
Backport 
Partially fix , regression of Modernize merge button  

Fix some missing `Redirect` -> `JSONRedirect`.

Thanks @yp05327 for the help in
https://github.com/go-gitea/gitea/issues/29071#issuecomment-1931261075
2024-02-22 03:32:54 +01:00
wxiaoguang
c4a86b20a4
Fix missing link on outgoing new release notifications () ()
Backport 

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Co-authored-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-21 19:01:48 +00:00
wxiaoguang
f634982d23
Fix debian InRelease Acquire-By-Hash newline () ()
Backport 

Co-authored-by: Robin Schoonover <robin@cornhooves.org>
2024-02-21 19:40:16 +01:00
wxiaoguang
9379352db6
Always write proc-receive hook for all git versions () ()
Backport 
2024-02-21 12:08:34 +01:00
Zettat123
e940443b27
Do not show delete button when time tracker is disabled () ()
Backport  
Fix 

The delete button of time logs won't be shown when the time tracker is
disabled.
 

![image](https://github.com/go-gitea/gitea/assets/15528715/5cc4e0c9-d2f9-4b8f-a2f5-fe202b94c191)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-20 09:11:01 +00:00
Lunny Xiao
2762921e73
Fix missed edit issues event for actions () ()
Fix 
Backport 
2024-02-20 11:13:05 +08:00
Markus Amshove
78f41e4fc4
Disallow merge when required checked are missing () ()
backport 

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-19 20:48:17 +00:00
6543
c01b266d86
Workaround to clean up old reviews on creating a new one () ()
close  
backport 

---
*Sponsored by Kithara Software GmbH*
2024-02-19 16:48:58 +00:00
Lunny Xiao
e2eac7574f
Fix bug when the linked account was disactived and list the linked accounts ()
The bug has been fixed on v1.22 but not backport to v1.21.
This original PR have many refactors so I don't think it's necessary to
backport all of them.

Fix 
2024-02-19 15:23:47 +00:00
Km
5b8b22bd75
Explained where create issue/PR template ()
For some user (as me), documentation lack of precision about where to
store issue/pr template.

I propose an enhancement about this point. With bold exergue and
precision about server itself.

I've found some user with same interrogation as :
https://forum.gitea.com/t/issue-template-directory/3328

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-02-19 15:57:25 +01:00
Jason Song
f79530c50e
Do not use lower tag names to find releases/tags () ()
Backport .

Fix , see
https://github.com/go-gitea/gitea/issues/26090#issuecomment-1952013206

Since `TagName` stores the original tag name and `LowerTagName` stores
the lower tag name, it doesn't make sense to use lowercase tags as
`TagNames` in `FindReleasesOptions`.

5e72526da4/services/repository/push.go (L396-L397)

While the only other usage looks correct:

5e72526da4/routers/web/repo/repo.go (L416)
2024-02-19 10:09:36 +00:00
Tim-Nicas Oelschläger
39735c43a8
Convert visibility to number () ()
Backport 

Don't throw error while creating user (Fixes )

---

The backport info from Giteabot
https://github.com/go-gitea/gitea/pull/29226#issuecomment-1951341322
needs to specify the version, because the default is v1.18
2024-02-18 18:51:00 +00:00
Jimmy Praet
3604b7d8ad
Load outdated comments when (un)resolving conversation on PR timeline () ()
Backport 

Relates to ,  and .

The "show outdated comments" flag should only apply to the file diff
view.
On the PR timeline, outdated comments are always shown. So they should
also be loaded when (un)resolving a conversation on the timeline page.
2024-02-18 06:58:26 +00:00
wxiaoguang
d41d367c35
Make submit event code work with both jQuery event and native event () ()
Backport  (no conflict)
2024-02-18 06:36:41 +00:00
Zettat123
7e0299b4fd
Only delete scheduled workflows when needed () ()
Backport  

Fix 

`handleSchedules` should be called only if `DetectWorkflows` should
detect schedule workflows
2024-02-18 14:31:05 +08:00
Lunny Xiao
933cc4da64
Fix push to create with capitalize repo name () ()
Fix 
Backport 

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-17 12:06:55 +00:00
Lunny Xiao
fea6bd130e
rm outdated docs from some languages () ()
backport  to make pull request lint happy
https://github.com/go-gitea/gitea/actions/runs/7939560756/job/21679856929?pr=29206
since 

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2024-02-17 12:44:33 +01:00
wxiaoguang
906a722fca
Refactor git version functions and check compatibility () ()
Backport  with an extra change: tolerate the git 2.43.1 GIT_FLUSH
bug in Gitea 1.21.x, more details in the comment of repo_attribute.go

Manually tested with git 2.43.1 and an old git (2.39.2)
2024-02-17 02:47:18 +00:00
silverwind
8cd83ff391
Rework spellchecking, add lint-spell ()
Backport clean cherry-picks of
9c39f8515f
and
c7a21cbb0c
onto 1.21.

- Use maintained fork https://github.com/golangci/misspell
- Rename `mispell-check` to `lint-spell`, add `lint-spell-fix`
- Run `lint-spell` in separate actions step
- Lint more files, fix discovered issues
- Remove inaccurate and outdated info in docs (we do not need GOPATH for
tools anymore)

Maybe later we can add more spellchecking tools, but I have not found
any good ones yet.
2024-02-16 02:42:26 +00:00
KN4CK3R
d823465d94
Use ghost user if user was not found () ()
Backport 
2024-02-14 12:51:51 -05:00
wxiaoguang
dd8bc1d61d
Refactor issue template parsing and fix API endpoint () ()
Backport 

The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate,
map[string]error)` doesn't really follow Golang's habits, then the
second returned value might be misused. For example, the API function
`GetIssueTemplates` incorrectly checked the second returned value and
always responds 500 error.

This PR refactors GetTemplatesFromDefaultBranch to
ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes
the API endpoint bug, and adds some tests.

And by the way, add proper prefix `X-` for the header generated in
`checkDeprecatedAuthMethods`, because non-standard HTTP headers should
have `X-` prefix, and it is also consistent with the new code in
`GetIssueTemplates`
2024-02-14 01:32:31 +00:00
6543
0ac3186267
Dont load Review if Comment is CommentTypeReviewRequest () ()
Backport 

RequestReview get deleted on review.
So we don't have to try to load them on comments.
2024-02-13 23:29:33 +01:00
wxiaoguang
732d511e04
Refactor parseSignatureFromCommitLine () ()
Backport . Fix 

This backport is for 1.21 only and it is different from the change in
1.22: this backport still accept the legacy date format to avoid
breaking.
2024-02-09 10:26:43 +01:00
CEnnis91
1aaeec6da7
Fix swift packages not resolving () () 2024-02-08 18:26:54 +00:00