(cherry picked from commit 1d7ce2a39c841e77492ef08c0e86c3544ecca88d)
(cherry picked from commit 1abfc0c0a17a429102ba5f70b874263cc7b2ecf8)
(cherry picked from commit 823ab34c64b275bf57fa60fef25a67338d8cb26e)
(cherry picked from commit 095a5b0c88543e40853cc95dc21e7cc6614d20e8)
(cherry picked from commit b0e5c7504a)
(cherry picked from commit 107f64a02ec4f9a7e6174cdd13fd9f78faf81878)
(cherry picked from commit e76c50c95d)
(cherry picked from commit 6ebb567eb5)
(cherry picked from commit c99026eb35)
(cherry picked from commit aa0087d124)
(cherry picked from commit c2a7aaeee82293793b2740251dc5fd27dfb32ddb)
(cherry picked from commit 4277bdb7414885ef87a4c72fa73c088caa7cc5f1)
(cherry picked from commit adebc446711af1342671a75570edc69c73a480e9)
(cherry picked from commit 9a7332c2be588884056e34aa301f37967f33c0f2)
(cherry picked from commit cf5e3b046c)
(cherry picked from commit eec15a625e621e2e884c8740815881a54fae20fb)
(cherry picked from commit 1d7d8f4565)
(cherry picked from commit a6e1410f26)
(cherry picked from commit 61bcece963)
(cherry picked from commit adfc9f0a06)
(cherry picked from commit 6d910daafb)
(cherry picked from commit d447861cc911aa89539cbbcdbbf0e68d0bc23e53)
(cherry picked from commit 60071e20a9c1fcb61ac8029835768bd9b86d8f47)
(cherry picked from commit 0915c367ced393d203f86dbfb8c9a3e32252c28d)
(cherry picked from commit 9438f6e42267714753df76716e03098dbf88a13d)
(cherry picked from commit 90177a2b95)
(cherry picked from commit 9f776eae4878912a1c937f5172c27e6ccf5989b5)
(cherry picked from commit a3ec7ab137)
(cherry picked from commit 0623524e68)
(cherry picked from commit a4bb93239d)
(cherry picked from commit 2661b58c38)
Backport #24231 by @sillyguodong
Close#24213
Replace #23830
#### Cause
- Before, in order to making PR can get latest commit after reopening,
the `ref`(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR
will be updated when pushing commits to the `head branch` of the closed
PR.
#### Changes
- For closed PR , won't perform these behavior: insert`comment`, push
`notification` (UI and email), exectue
[pushToBaseRepo](7422503341/services/pull/pull.go (L409))
function and trigger `action` any more when pushing to the `head branch`
of the closed PR.
- Refresh the reference of the PR when reopening the closed PR (**even
if the head branch has been deleted before**). Make the reference of PR
consistent with the `head branch`.
Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
Backport #24573
Help some users like #16832#1851
There are many users reporting similar problem: if the SECRET_KEY
mismatches, some operations (like 2FA login) only reports unclear 500
error and unclear "base64 decode error" log (some maintainers ever spent
a lot of time on debugging such problem)
The SECRET_KEY was not well-designed and it is also a kind of technical
debt. Since it couldn't be fixed easily, it's good to add clearer error
messages, then at least users could know what the real problem is.
Backport #24536 by @sillyguodong
close#24449
The unit of `Actions` should be contorlled not only by
`repository.DISABLED_REPO_UNITS` but also by `actions.ENABLED`
in the `app.ini`.
Previously, the permission of the team's `Actions` unit was not
controlled by `actions.Enabled`. So, even if the user sets
`actions.Enabled` to false, he can still select the permission of the
`Actions` unit for the team.
This PR makes the permissions of the team's `Actions` unit also
controlled by `actions.Enabled`. Just append`TypeActions` into
`DisabledRepoUnits` slice when initializing if `actions.Enabled` is
false.
### Changes:
If `Actions` is set disbaled in `app.ini`, like below:
```yaml
[actions]
ENABLED = false
```
1. If user try to create/edit a team, will prompt user that `Actions` is
disbaled.
![image](https://user-images.githubusercontent.com/33891828/236370415-961082b2-82d2-4d9e-8025-83872ad08cbb.png)
2. `actions` is not displayed in the sidebar on the team details page
![image](https://user-images.githubusercontent.com/33891828/236371817-f39f9bc9-5926-4b88-b5e6-d93617fcfb07.png)
Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
Backport #23062
Backport #24515Fix#23617
This notably brings support for GOARCH=loong64, among other fixes.
This PR also fix bleve search architecture problem.
---------
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Co-authored-by: WÁNG Xuěruì <1175567+xen0n@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Backport #24487 by @fnetX
On the @Forgejo instance of Codeberg, we discovered that forking a repo
which is already forked now returns a 500 Internal Server Error, which
is unexpected. This is an attempt at fixing this.
The error message in the log:
~~~
2023/05/02 08:36:30 .../api/v1/repo/fork.go:147:CreateFork() [E]
[6450cb8e-113] ForkRepository: repository is already forked by user
[uname: ...., repo path: .../..., fork path: .../...]
~~~
The service that is used for forking returns a custom error message
which is not checked against.
About the order of options:
The case that the fork already exists should be more common, followed by
the case that a repo with the same name already exists for other
reasons. The case that the global repo limit is hit is probably not the
likeliest.
---------
Co-authored-by: Otto Richter (fnetX) <git@fralix.ovh>
Backport #24382 by @lunny
Fix https://github.com/go-gitea/gitea/pull/24362/files#r1179095324
`getAuthenticatedMeta` has checked them, these code are duplicated one.
And the first invokation has a wrong permission check. `DownloadHandle`
should require read permission but not write.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Backport #24362 by @jolheiser
> The scoped token PR just checked all API routes but in fact, some web
routes like `LFS`, git `HTTP`, container, and attachments supports basic
auth. This PR added scoped token check for them.
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Backport #24339 by @yardenshoham
I made it render the script even if the repo is archived
- Fixes#24324
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
Backport #24307Fix#24305
According to MDN, "bold" starts from 700, some fonts do not provide
"bolding" for weight 600
Manually backport, no CSS conflict.
Backport #24035 by @garymoon
This change prevents Gitea from bypassing the manual approval process
for newly registered users when OIDC is used.
- Resolves https://github.com/go-gitea/gitea/issues/23392
Signed-off-by: Gary Moon <gary@garymoon.net>
Co-authored-by: Gary Moon <garymoon@users.noreply.github.com>
Backport #24116 by @techknowlogick
Proposal found here: https://github.com/go-gitea/gitea/issues/23654
TODO: make non-breaking (can we publish docker image using dev and
nightly prefix? at same time). if anyone has advice please comment :)
If this PR is merged, then I can add redirects to the downloads site.
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Backport #24148
`repoCtx.CommitsCount` is not reliably the commit count of the default
branch (Repository.GetCommitsCount depends on what is currently
displayed).
_contributed in the context of @forgejo_
---------
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Backport #24194 by @harryzcy
- [x] Identify endpoints that should be public
- [x] Update integration tests
Fix#24159
Co-authored-by: harryzcy <harry@harryzheng.com>
Backport #24202Close#24195
Fix the bug:
1. The old code doesn't handle `removedfile` event correctly
2. The old code doesn't provide attachments for type=CommentTypeReview
---------
Co-authored-by: silverwind <me@silverwind.io>