15943 Commits

Author SHA1 Message Date
4126aad4aa Add 1.20.5 changelog () v1.20.5 2023-10-03 12:53:35 +00:00
5c96a2be87 Fix bug of review request number ()
Manually backport  without tests because too many conflicted files
to backport it completely.
2023-10-03 08:08:12 +00:00
acedf0f702 Fix git 2.11 error when checking IsEmpty () ()
Backport  by @wxiaoguang

Fix 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-02 23:30:04 +08:00
23139aa27b Allow get release download files and lfs files with oauth2 token format () ()
Backport  by @lunny

Fix 
Fix 

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-10-01 19:54:15 +08:00
b6b71c78c4 Add logs for data broken of comment review () ()
Backport  by @lunny

Fix 

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-09-29 13:31:10 +08:00
2138661dae fix orphan check for deleted branch () ()
Backport  by @earl-warren

- Modify the deleted branch orphan check to check for the new table
instead.
- Regression from 6e19484f4d3bf372212f2da462110a1a8c10cbf2
- Resolves https://codeberg.org/forgejo/forgejo/issues/1522

(cherry picked from commit c1d888686fe445e4edecb9d835c5b3893b574b75)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-09-28 11:16:05 +08:00
4b37eb2c23 Fix PushEvent NullPointerException jenkinsci/github-plugin () ()
Backport  by @Nabapadma-sarker

Fixes 

Co-authored-by: Nabapadma-sarker <nabapadmacse1991@gmail.com>
2023-09-25 07:02:08 +00:00
dd2f007501 Fix z-index on markdown completion () ()
Backport  by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/27230

Co-authored-by: silverwind <me@silverwind.io>
2023-09-25 09:10:46 +08:00
dd44c2164e Fix z-index on markdown completion () ()
Backport  by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/27230

Co-authored-by: silverwind <me@silverwind.io>
2023-09-24 23:37:58 +00:00
2604571993 Update database-preparation and add note re: MariaDB () ()
Backport  by @techknowlogick

update DB docs per feedback.
https://gitea.com/gitea/gitea-docusaurus/issues/69

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-09-25 05:27:15 +08:00
eae6985b63 Quote table release in sql queries () ()
Backport of 

Fixes 

`release` is a reserved keyword in MySql. I can't reproduce the issue on
my setup and we have a test for that code but it seems there can be
setups where it fails.
2023-09-24 01:48:50 +03:00
d8583edfe7 Fix release URL in webhooks () ()
Backport  by @jolheiser

Resolves 

`URL` points to the API URL, `HTMLURL` points to the web page.

Notably, however, for PRs they are the same URL. I switched them to use
HTMLURL to match the rest of the codebase terminology.

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2023-09-21 23:59:27 +00:00
d99479c810 Fix organization field being null in POST /orgs/{orgid}/teams () ()
Backport  by @memphis88

Similarly to the fix in https://github.com/go-gitea/gitea/pull/24694,
this addresses the team creation not returning the organization
information in the response.

This fix is connected to the
[issue](https://gitea.com/gitea/terraform-provider-gitea/issues/27)
discovered in the terraform provider.
Moreover, the
[documentation](https://docs.gitea.com/api/1.20/#tag/organization/operation/orgCreateTeam)
suggests that the response body should include the `organization` field
(currently being `null`).

Co-authored-by: Dionysios Kakouris <1369451+memphis88@users.noreply.github.com>
2023-09-21 22:23:33 +02:00
fbe1f35112 Fix organization field being null in POST /orgs/{orgid}/teams () ()
Backport  by @memphis88

Similarly to the fix in https://github.com/go-gitea/gitea/pull/24694,
this addresses the team creation not returning the organization
information in the response.

This fix is connected to the
[issue](https://gitea.com/gitea/terraform-provider-gitea/issues/27)
discovered in the terraform provider.
Moreover, the
[documentation](https://docs.gitea.com/api/1.20/#tag/organization/operation/orgCreateTeam)
suggests that the response body should include the `organization` field
(currently being `null`).

Co-authored-by: Dionysios Kakouris <1369451+memphis88@users.noreply.github.com>
2023-09-21 12:14:59 +02:00
25233a9bdc Fix successful return value for SyncAndGetUserSpecificDiff () ()
Backport  by @delvh

A function should not return an error when it is successful.
Otherwise, things like
https://discord.com/channels/322538954119184384/322538954119184384/1153705341620600833
happen…

Co-authored-by: delvh <dev.lh@web.de>
2023-09-21 00:58:13 +02:00
7a99c7b83c Improve actions docs related to pull_request event () ()
Backport  by @Zettat123

Related to 

The `ref` property in Gitea Actions is different from GitHub Actions.
This PR improves the documentation to explain the difference.

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-09-20 11:49:58 +02:00
1d6e5c8e58 fix pagination for followers and following () ()
Backport  by @earl-warren

- Use the correct total amount for pagination. Thereby correctly show
the pagination bare when there's more than one page of
followers/followings.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1477

(cherry picked from commit c1a136318be3bf72511bed108f2d67f2cf34e1b8)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-09-19 16:03:01 +00:00
882e465c3a services/wiki: Close() after error handling () ()
Backport  by @earl-warren

Refs: https://codeberg.org/forgejo/forgejo/pulls/1385

Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
(cherry picked from commit 589e7d346f51de4a0e2c461b220c8cad34133b2f)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2023-09-19 15:13:23 +00:00
b139234fa8 Fix issue templates when blank isses are disabled () ()
Backport  by @JakobDev

Fixes 

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
2023-09-14 17:39:34 +02:00
d8b39324d7 Load reviewer before sending notification () ()
Fixes 
2023-09-13 15:32:58 -05:00
9df573bddc Fix context cache bug & enable context cache for dashabord commits' authors() ()
backport  

Unfortunately, when a system setting hasn't been stored in the database,
it cannot be cached.
Meanwhile, this PR also uses context cache for push email avatar display
which should avoid to read user table via email address again and again.

According to my local test, this should reduce dashboard elapsed time
from 150ms -> 80ms .
2023-09-13 15:15:00 +08:00
b0a405c5fa Use secure cookie for HTTPS sites () ()
Backport 

If the AppURL(ROOT_URL) is an HTTPS URL, then the COOKIE_SECURE's
default value should be true.

And, if a user visits an "http" site with "https" AppURL, they won't be
able to login, and they should have been warned. The only problem is
that the "language" can't be set either in such case, while I think it
is not a serious problem, and it could be fixed easily if needed.
2023-09-11 09:59:00 +00:00
3c53740244 Correct the database.LOG_SQL default value in config cheat sheet () ()
This is a manual backport of  to v1.20.
2023-09-10 21:43:42 -04:00
da7d7e60d8 Fix INI parsing for value with trailing slash () ()
Backport  by @wxiaoguang

Fix  (a temp fix)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-09-10 20:52:25 +02:00
e502be46f3 Fix changelog typo () v1.20.4 2023-09-08 16:35:37 +08:00
4a886de71e 1.20.4 changelog () 2023-09-08 12:17:00 +08:00
b6fd1e48c0 Improve LDAP group config documentation () ()
backport 

author @svenseeberg

Co-authored-by: Sven Seeberg <mail@sven-seeberg.de>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-05 22:41:10 -04:00
69c4e2954c update footer link to new landing page () ()
Backport 
2023-09-05 19:06:35 +00:00
9f14b2173a Update documents to fix some links () ()
Backport  by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-09-03 19:37:42 +00:00
e15794f62f Update docs about attachment path () ()
Backport  
This change was caused by , for configuration as below:
```
[attachment]
ENABLE = true
PATH = data/attachments
MAX_SIZE = 100
MAX_FILES = 5
```
Before , the resolved path is ${AppWorkPath}/${attachments.PATH}
(such as `/var/lib/gitea/data/attachments`)
After , the resolved path is ${AppDataPath}/${attachments.PATH}
(such as `/var/lib/gitea/data/data/attachments`)

Fix https://github.com/go-gitea/gitea/issues/26864 Follow
https://github.com/go-gitea/gitea/pull/26271
2023-09-03 18:45:37 +00:00
2a184796b5 Fix wrong review requested number () ()
Backport  by @lng2020

Fix the wrong review requested number mentioned by  .
Fix  
Before:

![ksnip_20230829-140750](https://github.com/go-gitea/gitea/assets/70063547/0af2055b-6f16-4699-a944-c7186831d7f9)
After:

![ksnip_20230829-141817](https://github.com/go-gitea/gitea/assets/70063547/16633264-20ba-45e3-bfbb-a495ed76a45b)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
2023-09-03 12:37:07 +02:00
2cfabb68ff Redirect from {repo}/issues/new to {repo}/issues/new/choose when blank issues are disabled () ()
Backport  by @JakobDev

You can currently visit `{repo}/issues/new` and create a blank issue,
even if it's disabled. This PR fixes this,

Fixes https://codeberg.org/forgejo/forgejo/issues/1356

Co-authored-by: JakobDev <jakobdev@gmx.de>
2023-09-01 15:14:54 +00:00
e8da63c24e Avoid double-unescaping of form value () ()
Backport 

The old `prepareQueryArg` did double-unescaping of form value.
2023-09-01 21:15:00 +08:00
93c36f395c Fix verifyCommits error when push a new branch () ()
Backport  by @CaiCandong

> ### Description
> If a new branch is pushed, and the repository has a rule that would
require signed commits for the new branch, the commit is rejected with a
500 error regardless of whether it's signed.
> 
> When pushing a new branch, the "old" commit is the empty ID
(0000000000000000000000000000000000000000). verifyCommits has no
provision for this and passes an invalid commit range to git rev-list.
Prior to 1.19 this wasn't an issue because only pre-existing individual
branches could be protected.
> 
> I was able to reproduce with
[try.gitea.io/CraigTest/test](https://try.gitea.io/CraigTest/test),
which is set up with a blanket rule to require commits on all branches.


Fix 
Very thanks to @Craig-Holmquist-NTI for reporting the bug and suggesting
an valid solution!

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-08-31 15:29:55 +00:00
302c03c4a9 Sync tags when adopting repos () ()
Backport  by @Zettat123

Fixes 

Sync the tags into database when adopting repos

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-08-31 02:15:28 +00:00
41bae29f84 check blocklist for emails when adding them to account () ()
Backport  by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-08-31 00:52:19 +00:00
c72f6067b3 Fix context filter has no effect in dashboard () ()
Backport 
2023-08-30 11:14:54 +00:00
54cc459ea8 Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests () ()
Backport 

Co-authored-by: Jason Song <i@wolfogre.com>
2023-08-30 02:25:34 -04:00
c3d323fd85 Add fix incorrect can_create_org_repo for org owner team () ()
Backport  by @yp05327

Related to:  

In migration v109, we only added a new column `CanCreateOrgRepo` in Team
table, but not initial the value of it.
This may cause bug like .

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-08-29 21:26:40 +00:00
4013f3f600 Fix some slice append usages () ()
Backport  by @harryzcy

Co-authored-by: Chongyi Zheng <git@zcy.dev>
Co-authored-by: delvh <dev.lh@web.de>
2023-08-29 16:13:24 +00:00
3bab20491e Fix being unable to use a repo that prohibits accepting PRs as a PR source. () ()
Backport  by @CaiCandong

## Description 
Sometimes, we need to use an upstream mirror repository to update the
current development repository, but mirror repositories are prohibited
from PR. It should not appear in `merge to,` but it can appear in `pull
from.`
Fix   
Related 

Many thanks to @apnote  for assisting me in reproducing this bug!

## ScreenShot
---
### Before

<img
src="https://github.com/go-gitea/gitea/assets/50507092/3d76c376-1f54-45b9-80c9-6ba8319d6a9a"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/fbfd9f7f-421f-4a2e-9a3e-f2958bbf3312"
width="400px">

### After

<img
src="https://github.com/go-gitea/gitea/assets/50507092/e6984524-4f61-4310-b795-4d8598bd8963"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/04065b44-78d7-4721-bf31-0f1674150727"
width="400px">

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
2023-08-29 18:06:05 +08:00
087df926cc Improve the "bug report" template and "support options" document () ()
Backport  by @wxiaoguang

* `/help/support` is a better document than
`/administration/logging-config` for bug reporting
* Improve `support.en-us.md`
    * Move/add detailed contents into `Advanced Bug Report Tips` section
    * Merge `Chinese Support` section into `Support Options`

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-08-29 07:57:21 +08:00
b159ebbab7 Use docs.gitea.com instead of docs.gitea.io ()
backport 
2023-08-28 19:58:16 +08:00
c8b189eb01 Fix Page Not Found error ()
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-08-28 18:07:38 +08:00
a1cec4141e Fix bug for ctx usage ()
Fix  
Backport 
2023-08-28 12:20:31 +08:00
307ee2c044 Fix incorrect "tabindex" attributes () ()
Backport  manually

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-26 10:44:17 +08:00
2f6c0e6596 Fix link in mirror docs () ()
Backport  by @silverwind

Fix hash fragment in this link

Co-authored-by: silverwind <me@silverwind.io>
2023-08-25 19:14:43 +02:00
e6173acac9 Add matrix to support () ()
Backport  by @jolheiser

This PR adds our matrix space to the support options and alphabetizes
the list.

I also considered adding our Mastodon, however that isn't as suitable as
the other options because it's just whoever has access to the account vs
a community chat/forum.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2023-08-25 01:55:53 -04:00
4af872178e Make issue template field template access correct template data () ()
Backport  by @wxiaoguang

Regression of , the `{{$field := .}}` was missing during that
refactoring.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-08-24 11:40:55 +00:00
508c624e99 Backport line height fix ()
Backport the `line-height: normal`, because  was backported
2023-08-24 10:39:09 +00:00