]> source.dussan.org Git - gitea.git/log
gitea.git
9 months agoUpdate github.com/cloudflare/circl (#28789) (#28790)
Chongyi Zheng [Mon, 15 Jan 2024 05:19:18 +0000 (13:19 +0800)]
Update github.com/cloudflare/circl (#28789) (#28790)

Backport #28789

cloudflare/circl: https://github.com/advisories/GHSA-9763-4f94-gfch

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9 months agoSpeed up loading the dashboard on mysql/mariadb (#28546) (#28784)
Giteabot [Mon, 15 Jan 2024 02:01:25 +0000 (10:01 +0800)]
Speed up loading the dashboard on mysql/mariadb (#28546) (#28784)

Backport #28546 by @lunny

Fixes #28155

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoModernize merge button (#28140) (#28786)
Giteabot [Mon, 15 Jan 2024 01:40:52 +0000 (09:40 +0800)]
Modernize merge button (#28140) (#28786)

Backport #28140 by @earl-warren

- Make use of the `form-fetch-action` for the merge button, which will
automatically prevent the action from happening multiple times and show
a nice loading indicator as user feedback while the merge request is
being processed by the server.
- Adjust the merge PR code to JSON response as this is required for the
`form-fetch-action` functionality.
- Resolves https://codeberg.org/forgejo/forgejo/issues/774
- Likely resolves the cause of
https://codeberg.org/forgejo/forgejo/issues/1688#issuecomment-1313044

(cherry picked from commit 4ec64c19507caefff7ddaad722b1b5792b97cc5a)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
9 months agoFix schedule tasks bugs (#28691) (#28780)
Lunny Xiao [Sun, 14 Jan 2024 22:54:22 +0000 (06:54 +0800)]
Fix schedule tasks bugs (#28691) (#28780)

Fix #28157
Backport #28691

This PR fix the possible bugs about actions schedule.

- Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to
service layer
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when actions unit has been disabled
or global disabled.
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when default branch changed.

9 months agoRequire token for GET subscription endpoint (#28765) (#28778)
Jack Hay [Sat, 13 Jan 2024 02:01:15 +0000 (21:01 -0500)]
Require token for GET subscription endpoint (#28765) (#28778)

Backport #28765 for 1.21

9 months agoAssign pull request to project during creation (#28227) (#28775)
Giteabot [Fri, 12 Jan 2024 21:53:16 +0000 (05:53 +0800)]
Assign pull request to project during creation (#28227) (#28775)

Backport #28227 by @denyskon

When creating a pull request, allow directly assigning it to a project,
as it is already possible for issues.

After:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/01dc2b3d-d56a-4053-b2fc-138725d7633a)

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: delvh <dev.lh@web.de>
9 months agoFix issue dependencies (#27736) (#28776)
Giteabot [Fri, 12 Jan 2024 21:29:22 +0000 (05:29 +0800)]
Fix issue dependencies (#27736) (#28776)

Backport #27736 by @lng2020

Fix #27722
Fix #27357
Fix #25837
Fix #28732
1. Fix the typo `BlockingByDependenciesNotPermitted`, which causes the
`not permitted message` not to show. The correct one is `Blocking` or
`BlockedBy`
2. Rewrite the perm check. The perm check uses a very tricky way to
avoid duplicate checks for a slice of issues, which is confusing. In
fact, it's also the reason causing the bug. It uses `lastRepoID` and
`lastPerm` to avoid duplicate checks, but forgets to assign the
`lastPerm` at the end of the code block. So I rewrote this to avoid this
trick.
![I U1AT{GNFY3
1HZ`6L{(2L](https://github.com/go-gitea/gitea/assets/70063547/79acd02a-a567-4316-ae0d-11c6461becf1)
3. It also reuses the `blocks` slice, which is even more confusing. So I
rewrote this too.

![UARFPXRGGZQFB7J$2`R}5_R](https://github.com/go-gitea/gitea/assets/70063547/f21cff0f-d9ac-4ce4-ae4d-adffc98ecd99)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
9 months agoFix button size in "attached header right" (#28770) (#28774)
Giteabot [Fri, 12 Jan 2024 15:04:19 +0000 (23:04 +0800)]
Fix button size in "attached header right" (#28770) (#28774)

Backport #28770 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoFix `convert.ToTeams` on empty input (#28426) (#28767)
Giteabot [Fri, 12 Jan 2024 07:12:18 +0000 (15:12 +0800)]
Fix `convert.ToTeams` on empty input (#28426) (#28767)

Backport #28426 by @KN4CK3R

Fixes #28420

Don't return `nil` if the input was empty.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoRequire token for GET subscription endpoint (#28765) (#28768)
Giteabot [Fri, 12 Jan 2024 06:51:27 +0000 (14:51 +0800)]
Require token for GET subscription endpoint (#28765) (#28768)

Backport #28765 by @jackHay22

Fixes  #28756

## Changes
- Require and check API token for `GET
/repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.

Co-authored-by: Jack Hay <jack@allspice.io>
9 months agoShow description as tooltip instead of title for labels (#28754) (#28766)
Giteabot [Fri, 12 Jan 2024 02:45:07 +0000 (10:45 +0800)]
Show description as tooltip instead of title for labels (#28754) (#28766)

Backport #28754 by @delvh

Follow GitHubs behavior of showing the label description as a tooltip
instead of the browser native title.

## Before

![grafik](https://github.com/go-gitea/gitea/assets/51889757/70448327-467b-4bee-b799-40a442a5ce16)

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/abe7d700-148b-4cef-a487-6b0f8f20b212)

Co-authored-by: delvh <dev.lh@web.de>
9 months agoHide code related setting options in repository when code unit is disabled (#28631...
Giteabot [Thu, 11 Jan 2024 04:31:24 +0000 (12:31 +0800)]
Hide code related setting options in repository when code unit is disabled (#28631) (#28749)

Backport #28631 by @lunny

Since #20805, code can be hidden.
However, the related settings are still shown even though they don't
have any meaning then.

https://github.com/go-gitea/gitea/assets/81045/5fdee54d-ac81-418a-82f7-eadff048cedd

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoAdd -F to commit search to treat keywords as strings (#28744) (#28748)
Giteabot [Wed, 10 Jan 2024 20:29:01 +0000 (04:29 +0800)]
Add -F to commit search to treat keywords as strings (#28744) (#28748)

Backport #28744 by @me-heer

Fixes #28269

The [default
behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp)
of --grep in git log is to interpret the keyword as a regular
expression. This causes the search to fail in the cases where the search
keyword contains a `[`, since `[` is a special character used in grep.

If we want our keywords to be interpreted as 'strings', we should use
[-F
flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).

Co-authored-by: Mihir Joshi <mihir67mj@gmail.com>
9 months agoConcatenate error in `checkIfPRContentChanged` (#28731) (#28737)
Giteabot [Tue, 9 Jan 2024 14:06:12 +0000 (22:06 +0800)]
Concatenate error in `checkIfPRContentChanged` (#28731) (#28737)

Backport #28731 by @earl-warren

- If there's a error with the Git command in `checkIfPRContentChanged`
the stderr wasn't concatendated to the error, which results in still not
knowing why an error happend.
- Adds concatenation for stderr to the returned error.
- Ref: https://codeberg.org/forgejo/forgejo/issues/2077

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
9 months agoAdd download attribute to release attachments (#28739) (#28740)
Giteabot [Tue, 9 Jan 2024 13:18:13 +0000 (21:18 +0800)]
Add download attribute to release attachments (#28739) (#28740)

Backport #28739 by @JakobDev

Fixes #28736

Co-authored-by: JakobDev <jakobdev@gmx.de>
9 months agoSuggest to use Type=simple for systemd service (#28717) (#28722)
wxiaoguang [Sun, 7 Jan 2024 15:42:43 +0000 (23:42 +0800)]
Suggest to use Type=simple for systemd service (#28717) (#28722)

Backport #28717 (only the gitea.service sample)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoFix incorrect URL for "Reference in New Issue" (#28716) (#28723)
Giteabot [Sun, 7 Jan 2024 15:40:29 +0000 (23:40 +0800)]
Fix incorrect URL for "Reference in New Issue" (#28716) (#28723)

Backport #28716 by wxiaoguang

Gitea prefers to use relative URLs in code (to make multiple domain work
for some users)

So it needs to use `toAbsoluteUrl` to generate a full URL when click
"Reference in New Issues"

And add some comments in the test code

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoAvoid unnecessary 500 panic when a commit doesn't exist (#28719) (#28721)
Giteabot [Sun, 7 Jan 2024 10:40:30 +0000 (18:40 +0800)]
Avoid unnecessary 500 panic when a commit doesn't exist (#28719) (#28721)

Backport #28719 by wxiaoguang

In #26851, it assumed that `Commit` always exists when
`PageIsDiff==true`.

But for a 404 page, the `Commit` doesn't exist, so the following code
would cause panic because nil value can't be passed as string parameter
to `IsMultilineCommitMessage(string)` (or the StringUtils.Cut in later
PRs)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoImprove frontend guideline (#28711) (#28713)
Giteabot [Sat, 6 Jan 2024 17:30:36 +0000 (01:30 +0800)]
Improve frontend guideline (#28711) (#28713)

9 months agoFix panic when parsing empty pgsql host (#28708) (#28709)
Giteabot [Sat, 6 Jan 2024 12:05:49 +0000 (20:05 +0800)]
Fix panic when parsing empty pgsql host (#28708) (#28709)

Backport #28708 by wxiaoguang

Regression of #27723
Fix #28705

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoFix wrapping of label list (#28684) (#28688)
Giteabot [Thu, 4 Jan 2024 02:21:35 +0000 (10:21 +0800)]
Fix wrapping of label list (#28684) (#28688)

Backport #28684 by @denyskon

Before:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/2fbd7ef2-22ad-4515-9c66-81c29bfbb7a3)

After:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/df86d1ae-03db-4543-834c-761859c367be)

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
9 months agoMake template `DateTime` show proper tooltip (#28677) (#28683)
wxiaoguang [Wed, 3 Jan 2024 10:41:03 +0000 (18:41 +0800)]
Make template `DateTime` show proper tooltip (#28677) (#28683)

Backport #28677

9 months agoFix: system webhooks API bug (#28531) (#28666)
Giteabot [Sun, 31 Dec 2023 12:53:09 +0000 (20:53 +0800)]
Fix: system webhooks API bug (#28531) (#28666)

Backport #28531 by @pulltheflower

- Fix the bug about admin/hooks API that `GET /admin/hooks` can only
fetch system_hooks, `POST /admin/hooks` can only create default_hooks.

Co-authored-by: vincent <38434877+pulltheflower@users.noreply.github.com>
9 months agoFix alpine package files are not rebuilt (#28638) (#28665)
Giteabot [Sun, 31 Dec 2023 06:18:26 +0000 (14:18 +0800)]
Fix alpine package files are not rebuilt (#28638) (#28665)

Backport #28638 by @lng2020

I noticed the `BuildAllRepositoryFiles` function under the Alpine folder
is unused and I thought it was a bug.
But I'm not sure about this. Was it on purpose?

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
9 months agoUpgrade xorm to new version which supported update join for all supported databases...
Giteabot [Sun, 31 Dec 2023 05:57:36 +0000 (13:57 +0800)]
Upgrade xorm to new version which supported update join for all supported databases (#28590) (#28668)

Backport #28590 by @lunny

Fix https://github.com/go-gitea/gitea/pull/28547#issuecomment-1867740842

Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports
UPDATE JOIN.
To keep consistent from different databases, xorm use
`engine.Join().Update`, but the actural generated SQL are different
between different databases.

For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx
Where xxx`.

For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE
join_conditions`.

For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support
`UPDATE table1 SET xxx FROM table2 WHERE join conditions` from
3.33.0(2020-8-14).

POSTGRES is the same as SQLITE.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoAvoid cycle-redirecting user/login page (#28636) (#28658)
wxiaoguang [Sat, 30 Dec 2023 12:50:08 +0000 (20:50 +0800)]
Avoid cycle-redirecting user/login page (#28636) (#28658)

Backport #28636

Fix #28231, and remove some unused code.

9 months agofix empty ref for cron workflow runs (#28640) (#28647)
Giteabot [Fri, 29 Dec 2023 09:08:16 +0000 (17:08 +0800)]
fix empty ref for cron workflow runs (#28640) (#28647)

Backport #28640 by @denyskon

Fix #27678
Please see
https://github.com/go-gitea/gitea/issues/27678#issuecomment-1871445853
for details.

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
9 months agoRemove unnecessary syncbranchToDB with tests (#28624) (#28629)
Lunny Xiao [Fri, 29 Dec 2023 08:47:02 +0000 (16:47 +0800)]
Remove unnecessary syncbranchToDB with tests (#28624) (#28629)

Replace #28625

Backport #28624 by lunny

#28361 introduced `syncBranchToDB` in `CreateNewBranchFromCommit`. This
PR will revert the change because it's unnecessary. Every push will
already be checked by `syncBranchToDB`.
This PR also created a test to ensure it's right.

9 months agoImprove document for ARTIFACT_RETENTION_DAYS (#28646) (#28648)
Giteabot [Fri, 29 Dec 2023 07:39:59 +0000 (15:39 +0800)]
Improve document for ARTIFACT_RETENTION_DAYS (#28646) (#28648)

Backport #28646 by wxiaoguang

Follow #28626

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoswitch destination directory for apt signing keys (#28639) (#28642)
Giteabot [Fri, 29 Dec 2023 05:44:47 +0000 (13:44 +0800)]
switch destination directory for apt signing keys (#28639) (#28642)

Backport #28639 by @denyskon

According to [Debian
docs](https://wiki.debian.org/DebianRepository/UseThirdParty):

> The certificate MUST NOT be placed in /etc/apt/trusted.gpg.d or loaded
by apt-key add.
> ...
> If future updates to the certificate will be managed by an apt/dpkg
package as recommended below, then it SHOULD be downloaded into
/usr/share/keyrings using the same filename that will be provided by the
package. If it will be managed locally , it SHOULD be downloaded into
/etc/apt/keyrings instead.
> ...
> A sources.list entry SHOULD have the signed-by option set.

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
9 months agoImprove 1.21 document for Database Preparation (#28643) (#28644)
wxiaoguang [Fri, 29 Dec 2023 05:05:12 +0000 (13:05 +0800)]
Improve 1.21 document for Database Preparation (#28643) (#28644)

Backport #28643

Fix #28247

9 months agoExtend description for ARTIFACT_RETENTION_DAYS (#28626) (#28630)
Giteabot [Thu, 28 Dec 2023 10:21:46 +0000 (18:21 +0800)]
Extend description for ARTIFACT_RETENTION_DAYS (#28626) (#28630)

Backport #28626 by @hakito

Make it clear that this value is just a default value and that every
artifact can have it's own value.

Co-authored-by: Gerd Katzenbeisser <hakito@users.noreply.github.com>
9 months agoUse known issue IID to generate new PR index number when migrating from GitLab (...
Giteabot [Wed, 27 Dec 2023 01:59:29 +0000 (09:59 +0800)]
Use known issue IID to generate new PR index number when migrating from GitLab (#28616) (#28618)

Backport #28616 by wxiaoguang

Fix #13884

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoRefactor CORS handler (#28587) (#28611)
wxiaoguang [Mon, 25 Dec 2023 13:01:24 +0000 (21:01 +0800)]
Refactor CORS handler (#28587) (#28611)

Backport #28587, the only conflict is the test file.

The CORS code has been unmaintained for long time, and the behavior is
not correct.

This PR tries to improve it. The key point is written as comment in
code. And add more tests.

Fix #28515
Fix #27642
Fix #17098

9 months agoRevert "improve possible performance bottleneck (#28547)" (#28593) (#28608)
Giteabot [Mon, 25 Dec 2023 08:01:11 +0000 (16:01 +0800)]
Revert "improve possible performance bottleneck (#28547)" (#28593) (#28608)

Backport #28593 by @lunny

This reverts commit b35d3fddfac389a7be401a63b4e1283dd74af681.

This is totally wrong. I think `Update join` hasn't been supported well
by xorm.

I just revert the PR and will try to send another one.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoFix the scroll behavior for emoji/mention list (#28597) (#28601)
Giteabot [Mon, 25 Dec 2023 07:02:09 +0000 (15:02 +0800)]
Fix the scroll behavior for emoji/mention list (#28597) (#28601)

Backport #28597 by wxiaoguang

Fix #28595 by https://github.com/github/combobox-nav/pull/79 (combobox-nav v2.3.1)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoFix flex container width (#28603) (#28605)
Giteabot [Sun, 24 Dec 2023 14:44:03 +0000 (22:44 +0800)]
Fix flex container width (#28603) (#28605)

Backport #28603 by wxiaoguang

Fix #28489

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoInclude heap pprof in diagnosis report to help debugging memory leaks (#28596) (...
Giteabot [Sun, 24 Dec 2023 01:18:43 +0000 (09:18 +0800)]
Include heap pprof in diagnosis report to help debugging memory leaks (#28596) (#28599)

9 months agoFix wrong due date rendering in issue list page (#28588) (#28591)
Giteabot [Fri, 22 Dec 2023 17:25:43 +0000 (01:25 +0800)]
Fix wrong due date rendering in issue list page (#28588) (#28591)

Backport #28588 by @yardenshoham

It included the hours, minutes, and seconds. By removing these, the date
renders correctly.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
9 months agoFix `status_check_contexts` matching bug (#28582) (#28589)
Giteabot [Fri, 22 Dec 2023 15:32:22 +0000 (23:32 +0800)]
Fix `status_check_contexts` matching bug (#28582) (#28589)

Backport #28582 by @Zettat123

Fix #28570
Follow #24633

---
Copied from
https://github.com/go-gitea/gitea/issues/28570#issuecomment-1867327999

The feature introduced in #24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.

https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663

Co-authored-by: Zettat123 <zettat123@gmail.com>
9 months agoFix 405 method not allowed CORS / OIDC (#28583) (#28586)
Giteabot [Fri, 22 Dec 2023 12:55:43 +0000 (20:55 +0800)]
Fix 405 method not allowed CORS / OIDC (#28583) (#28586)

Backport #28583 by @morphelinho

Follow #28184
Follow #28515

Fix problem with 405 method not allowed for CORS wrt OIDC

Co-authored-by: morphelinho <morphelinho@users.noreply.github.com>
9 months agoFix 500 error of searching commits (#28576) (#28579)
Giteabot [Fri, 22 Dec 2023 02:29:28 +0000 (10:29 +0800)]
Fix 500 error of searching commits (#28576) (#28579)

Backport #28576 by wxiaoguang

Regression of #28454 . Now the string is escaped HTML, so it doesn't
need `| Safe`.

Fix #28575

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoimprove possible performance bottleneck (#28547) (#28578)
Giteabot [Thu, 21 Dec 2023 23:37:08 +0000 (07:37 +0800)]
improve possible performance bottleneck (#28547) (#28578)

Backport #28547 by @lunny

Replace #28500

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoUse information from previous blame parts (#28572) (#28577)
Giteabot [Thu, 21 Dec 2023 22:47:34 +0000 (06:47 +0800)]
Use information from previous blame parts (#28572) (#28577)

Backport #28572 by @KN4CK3R

Fixes #28545

`git blame` output can contain blocks without commit information if it
was outputted before (the `0dafa97ea3f6d9662299579e5be1875cd28baaae 48
26 1` line):
```
fec25436488499df7231f63b857f66457c193d5c 24 25 1
author Bastien Montagne
author-mail <bastien@blender.org>
author-time 1660731031
author-tz +0200
committer Bastien Montagne
committer-mail <bastien@blender.org>
committer-time 1660731031
committer-tz +0200
summary LibOverride: Add Make/Reset/Clear entries to IDTemplate contextual menu.
previous 839ece6477203382b7a7483062961540180ff1cd source/blender/editors/interface/interface_ops.c
filename source/blender/editors/interface/interface_ops.c
        #include "BLT_translation.h"
0dafa97ea3f6d9662299579e5be1875cd28baaae 48 26 1

3d57bc4397fca53bc9702a27bbf50102827829b0 27 27 1
author Hans Goudey
author-mail <hans@blender.org>
author-time 1700131315
author-tz +0100
committer Hans Goudey
committer-mail <hooglyboogly@noreply.localhost>
committer-time 1700131315
committer-tz +0100
summary Cleanup: Move several blenkernel headers to C++
previous 451c054d9b7d3148a646caa5a72fb127a5b5c408 source/blender/editors/interface/interface_ops.cc
filename source/blender/editors/interface/interface_ops.cc
        #include "BKE_context.hh"
```
This PR reuses data from the previous blame part to fill these gaps.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoUpdate mermaid for 1.21 (#28571)
wxiaoguang [Thu, 21 Dec 2023 12:14:50 +0000 (20:14 +0800)]
Update mermaid for 1.21 (#28571)

Try to fix #28170

9 months agoAdd changelog for 1.21.3 (#28569) v1.21.3
Lunny Xiao [Thu, 21 Dec 2023 07:47:15 +0000 (15:47 +0800)]
Add changelog for 1.21.3 (#28569)

9 months agoFix merging artifact chunks error when minio storage basepath is set (#28555) (#28568)
Giteabot [Thu, 21 Dec 2023 07:38:39 +0000 (15:38 +0800)]
Fix merging artifact chunks error when minio storage basepath is set (#28555) (#28568)

Backport #28555 by @fuxiaohei

Related to  https://github.com/go-gitea/gitea/issues/28279

When merging artifact chunks, it lists chunks from storage. When storage
is minio, chunk's path contains `MINIO_BASE_PATH` that makes merging
break.

<del>So trim the `MINIO_BASE_PATH` when handle chunks.</del>

Update the chunk file's basename to retain necessary information. It
ensures that the directory in the chunk's path remains unaffected.

Co-authored-by: FuXiaoHei <fuxiaohei@vip.qq.com>
9 months agoUpdate actions document about comparsion as Github Actions (#28560) (#28564)
Giteabot [Wed, 20 Dec 2023 21:00:30 +0000 (05:00 +0800)]
Update actions document about comparsion as Github Actions (#28560) (#28564)

Backport #28560 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoFix inperformant query on retrifing review from database. (#28552) (#28562)
Giteabot [Wed, 20 Dec 2023 15:55:08 +0000 (23:55 +0800)]
Fix inperformant query on retrifing review from database. (#28552) (#28562)

Backport #28552 by @6543

can we please PLEAS PLEASE only use raw SQL statements if it is relay
needed!!!

source is https://github.com/go-gitea/gitea/pull/28544 (before
refactoring)

Co-authored-by: 6543 <m.huber@kithara.com>
9 months agoFix the issue ref rendering for wiki (#28556) (#28559)
Giteabot [Wed, 20 Dec 2023 14:51:25 +0000 (22:51 +0800)]
Fix the issue ref rendering for wiki (#28556) (#28559)

Backport #28556 by wxiaoguang

Fix #28526, regression of
* #26365

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoFix duplicate ID when deleting repo (#28520) (#28528)
Giteabot [Tue, 19 Dec 2023 08:40:03 +0000 (16:40 +0800)]
Fix duplicate ID when deleting repo (#28520) (#28528)

Backport #28520 by @framitdavid

There is an accessibility issue in the interface when attempting to
delete a repository. When I click on "Delete repository," a dialog box
appears, requiring confirmation to proceed with the repository deletion.
However, when I press the "Repo name" label, the wrong input field gains
focus. The focused field is located behind the dialog and is intended
for renaming the repository.

I am submitting these pull requests to ensure that the correct input
field is focused when the user clicks on the label. This change will
also facilitate the writing of tests using Playwright or Testing Library
to retrieve elements based on roles. This PR will also improve
acessibility of this area.

Co-authored-by: David Øvrelid <46874830+framitdavid@users.noreply.github.com>
9 months agoOnly check online runner when detecting matching runners in workflows (#28286) (...
Giteabot [Tue, 19 Dec 2023 04:06:31 +0000 (12:06 +0800)]
Only check online runner when detecting matching runners in workflows (#28286) (#28512)

Backport #28286 by @yp05327

Mentioned:
[#28277](https://github.com/go-gitea/gitea/issues/28277#issuecomment-1831325276)

We should only check online runner when detecting matching runners in
workflows,
as if runner is not online, the workflow will not run.

![image](https://github.com/go-gitea/gitea/assets/18380374/11855e9d-7241-4b7a-b8d7-49dbb94ba1c5)

Co-authored-by: yp05327 <576951401@qq.com>
9 months agochore(api): support ignore password if login source type is LDAP for creating user...
Giteabot [Tue, 19 Dec 2023 03:14:06 +0000 (11:14 +0800)]
chore(api): support ignore password if login source type is LDAP for creating user API (#28491) (#28525)

Backport #28491 by @appleboy

- Modify the `Password` field in `CreateUserOption` struct to remove the
`Required` tag
- Update the `v1_json.tmpl` template to include the `email` field and
remove the `password` field

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
9 months agoUpdate golang.org/x/crypto (#28519)
wxiaoguang [Mon, 18 Dec 2023 23:04:21 +0000 (07:04 +0800)]
Update golang.org/x/crypto (#28519)

ref: https://groups.google.com/g/golang-announce/c/qA3XtxvMUyg,
CVE-2023-48795, https://go.dev/issue/64784

9 months agoImprove the prompt for "ssh-keygen sign" (#28509) (#28510)
Giteabot [Mon, 18 Dec 2023 15:25:52 +0000 (23:25 +0800)]
Improve the prompt for "ssh-keygen sign" (#28509) (#28510)

Backport #28509 by wxiaoguang

Close #28505

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoAdd option to disable ambiguous unicode characters detection (#28454) (#28499)
wxiaoguang [Mon, 18 Dec 2023 04:20:37 +0000 (12:20 +0800)]
Add option to disable ambiguous unicode characters detection (#28454) (#28499)

Backport #28454 (the only conflict is caused by some comments)

* Close #24483
* Close #28123
* Close #23682
* Close #23149

10 months agoInitalize stroage for orphaned repository doctor (#28487) (#28490)
Giteabot [Sat, 16 Dec 2023 14:06:37 +0000 (22:06 +0800)]
Initalize stroage for orphaned repository doctor (#28487) (#28490)

Backport #28487 by @earl-warren

- When a repository is orphaned and has objects stored in any of the
storages such as repository avatar or attachments the delete function
would error, because the storage module wasn't initalized.
- Add code to initialize the storage module.

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

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
10 months agoUpdate docs for DISABLE_QUERY_AUTH_TOKEN (#28485) (#28488)
Giteabot [Sat, 16 Dec 2023 05:04:05 +0000 (13:04 +0800)]
Update docs for DISABLE_QUERY_AUTH_TOKEN (#28485) (#28488)

Backport #28485 by @kdumontnu

As described
[here](https://github.com/go-gitea/gitea/pull/28390#issuecomment-1857553331).

Co-authored-by: Kyle D <kdumontnu@gmail.com>
10 months agoRefactor SSH clone URL generation code (#28421) (#28480)
Giteabot [Fri, 15 Dec 2023 06:54:40 +0000 (14:54 +0800)]
Refactor SSH clone URL generation code (#28421) (#28480)

Backport #28421 by wxiaoguang

Refactor the code and add tests, keep the old logic.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoPolyfill SubmitEvent for PaleMoon (#28441) (#28478)
Giteabot [Fri, 15 Dec 2023 03:04:37 +0000 (11:04 +0800)]
Polyfill SubmitEvent for PaleMoon (#28441) (#28478)

Backport #28441 by wxiaoguang

Fix #28319

It only polyfills if there is no "SubmitEvent" class, so it has no side
effect for most users.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoFix Chinese translation of config cheat sheet[API] (#28472) (#28473)
Giteabot [Thu, 14 Dec 2023 23:54:32 +0000 (07:54 +0800)]
Fix Chinese translation of config cheat sheet[API] (#28472) (#28473)

Backport #28472 by @CaiCandong

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
10 months agoFix documents for "custom/public/assets/" (#28465) (#28467)
Giteabot [Thu, 14 Dec 2023 09:00:39 +0000 (17:00 +0800)]
Fix documents for "custom/public/assets/" (#28465) (#28467)

Backport #28465 by wxiaoguang

Fix #28463

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoRetry SSH key verification with additional CRLF if it failed (#28392) (#28464)
Giteabot [Thu, 14 Dec 2023 04:50:26 +0000 (12:50 +0800)]
Retry SSH key verification with additional CRLF if it failed (#28392) (#28464)

Backport #28392 by @nekrondev

Windows-based shells will add a CRLF when piping the token into
ssh-keygen command resulting in
verification error. This resolves #21527.

Co-authored-by: nekrondev <heiko@noordsee.de>
Co-authored-by: Heiko Besemann <heiko.besemann@qbeyond.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoAdd endpoint for not implemented Docker auth (#28457) (#28462)
Giteabot [Wed, 13 Dec 2023 21:06:24 +0000 (05:06 +0800)]
Add endpoint for not implemented Docker auth (#28457) (#28462)

Backport #28457 by @KN4CK3R

Recently Docker started to use the optional `POST /v2/token` endpoint
which should respond with a `404 Not Found` status code instead of the
current `405 Method Not Allowed`.

> Note: Not all token servers implement oauth2. If the request to the
endpoint returns 404 using the HTTP POST method, refer to Token
Documentation for using the HTTP GET method supported by all token
servers.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
10 months agoFix possible nil pointer access (#28428) (#28440)
Giteabot [Tue, 12 Dec 2023 15:35:32 +0000 (23:35 +0800)]
Fix possible nil pointer access (#28428) (#28440)

Backport #28428 by @KN4CK3R

There could be a nil pointer exception if the file is not found because
that specific error is suppressed but not handled.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
10 months agoDon't show unnecessary citation JS error on UI (#28433) (#28437)
Giteabot [Tue, 12 Dec 2023 13:14:04 +0000 (21:14 +0800)]
Don't show unnecessary citation JS error on UI (#28433) (#28437)

Backport #28433 by wxiaoguang

Fix #28226

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months ago1.21.2 changelog (#28387) v1.21.2
techknowlogick [Tue, 12 Dec 2023 06:23:54 +0000 (22:23 -0800)]
1.21.2 changelog (#28387)

To be rebuilt with latest golang version

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 months agoDo some missing checks (#28423) (#28432)
Lunny Xiao [Tue, 12 Dec 2023 06:20:18 +0000 (14:20 +0800)]
Do some missing checks (#28423) (#28432)

backport #28423

10 months agoDeprecate query string auth tokens (#28390) (#28430)
Giteabot [Tue, 12 Dec 2023 05:45:00 +0000 (13:45 +0800)]
Deprecate query string auth tokens (#28390) (#28430)

Backport #28390 by @jackHay22

## Changes
- Add deprecation warning to `Token` and `AccessToken` authentication
methods in swagger.
- Add deprecation warning header to API response. Example:
  ```
  HTTP/1.1 200 OK
  ...
  Warning: token and access_token API authentication is deprecated
  ...
  ```
- Add setting `DISABLE_QUERY_AUTH_TOKEN` to reject query string auth
tokens entirely. Default is `false`

## Next steps
- `DISABLE_QUERY_AUTH_TOKEN` should be true in a subsequent release and
the methods should be removed in swagger
- `DISABLE_QUERY_AUTH_TOKEN` should be removed and the implementation of
the auth methods in question should be removed

## Open questions
- Should there be further changes to the swagger documentation?
Deprecation is not yet supported for security definitions (coming in
[OpenAPI Spec version
3.2.0](https://github.com/OAI/OpenAPI-Specification/issues/2506))
- Should the API router logger sanitize urls that use `token` or
`access_token`? (This is obviously an insufficient solution on its own)

Co-authored-by: Jack Hay <jack@allspice.io>
Co-authored-by: delvh <dev.lh@web.de>
10 months agoRecover from panic in cron task (#28409) (#28425)
Giteabot [Tue, 12 Dec 2023 03:28:56 +0000 (11:28 +0800)]
Recover from panic in cron task (#28409) (#28425)

Backport #28409 by @earl-warren

- Currently there's code to recover gracefully from panics that happen
within the execution of cron tasks. However this recover code wasn't
being run, because `RunWithShutdownContext` also contains code to
recover from any panic and then gracefully shutdown Forgejo. Because
`RunWithShutdownContext` registers that code as last, that would get run
first which in this case is not behavior that we want.
- Move the recover code to inside the function, so that is run first
before `RunWithShutdownContext`'s recover code (which is now a noop).

Fixes: https://codeberg.org/forgejo/forgejo/issues/1910
Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
10 months agoImprove doctor cli behavior (#28422) (#28424)
Giteabot [Mon, 11 Dec 2023 16:28:27 +0000 (00:28 +0800)]
Improve doctor cli behavior (#28422) (#28424)

Backport #28422 by wxiaoguang

1. Do not sort the "checks" slice again and again when "Register", it
just wastes CPU when the Gitea instance runs
2. If a check doesn't exist, tell the end user
3. Add some tests

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoFix links in docs (#28302) (#28418)
Giteabot [Mon, 11 Dec 2023 14:53:59 +0000 (22:53 +0800)]
Fix links in docs (#28302) (#28418)

Backport #28302 by @yp05327

Close #28287

## How to test it in local
convert Makefile L34 into:
```
cd .tmp/upstream-docs && git clean -f && git reset --hard && git fetch origin pull/28302/head:pr28302 && git switch pr28302
```

Co-authored-by: yp05327 <576951401@qq.com>
10 months agoAlso sync DB branches on push if necessary (#28361) (#28403)
Lunny Xiao [Mon, 11 Dec 2023 06:16:56 +0000 (14:16 +0800)]
Also sync DB branches on push if necessary (#28361) (#28403)

Fix #28056
Backport #28361

This PR will check whether the repo has zero branch when pushing a
branch. If that, it means this repository hasn't been synced.

The reason caused that is after user upgrade from v1.20 -> v1.21, he
just push branches without visit the repository user interface. Because
all repositories routers will check whether a branches sync is necessary
but push has not such check.

For every repository, it has two states, synced or not synced. If there
is zero branch for a repository, then it will be assumed as non-sync
state. Otherwise, it's synced state. So if we think it's synced, we just
need to update branch/insert new branch. Otherwise do a full sync. So
that, for every push, there will be almost no extra load added. It's
high performance than yours.

For the implementation, we in fact will try to update the branch first,
if updated success with affect records > 0, then all are done. Because
that means the branch has been in the database. If no record is
affected, that means the branch does not exist in database. So there are
two possibilities. One is this is a new branch, then we just need to
insert the record. Another is the branches haven't been synced, then we
need to sync all the branches into database.

10 months agoFix missing check (#28406) (#28411)
Giteabot [Mon, 11 Dec 2023 01:10:48 +0000 (09:10 +0800)]
Fix missing check (#28406) (#28411)

Backport #28406 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 months agoenable system users search via the API (#28013) (#28018)
Giteabot [Fri, 8 Dec 2023 21:46:08 +0000 (05:46 +0800)]
enable system users search via the API (#28013) (#28018)

Backport #28013 by @earl-warren

Refs: https://codeberg.org/forgejo/forgejo/issues/1403

(cherry picked from commit dd4d17c159eaf8b642aa9e6105b0532e25972bb7)

---------

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 months agoFix Docker meta action for releases (#28232) (#28395)
Giteabot [Fri, 8 Dec 2023 00:29:17 +0000 (08:29 +0800)]
Fix Docker meta action for releases (#28232) (#28395)

10 months agoMake gogit Repository.GetBranchNames consistent (#28348) (#28386)
Giteabot [Thu, 7 Dec 2023 18:03:27 +0000 (02:03 +0800)]
Make gogit Repository.GetBranchNames consistent (#28348) (#28386)

Backport #28348 by @AdamMajer

nogogit GetBranchNames() lists branches sorted in reverse commit date
order. On the other hand the gogit implementation doesn't apply any
ordering resulting in unpredictable behaviour. In my case, the unit
tests requiring particular order fail

    repo_branch_test.go:24:
                Error Trace:
               ./gitea/modules/git/repo_branch_test.go:24
                Error:          elements differ

                                extra elements in list A:
                                ([]interface {}) (len=1) {
                                 (string) (len=6) "master"
                                }

                                extra elements in list B:
                                ([]interface {}) (len=1) {
                                 (string) (len=7) "branch1"
                                }

                                listA:
                                ([]string) (len=2) {
                                 (string) (len=6) "master",
                                 (string) (len=7) "branch2"
                                }

                                listB:
                                ([]string) (len=2) {
                                 (string) (len=7) "branch1",
                                 (string) (len=7) "branch2"
                                }
                Test:           TestRepository_GetBranches

To fix this, we sort branches based on their commit date in gogit
implementation.

Fixes: #28318
Co-authored-by: Adam Majer <amajer@suse.de>
10 months agoFix margin in server signed signature verification view (#28379) (#28381)
Giteabot [Thu, 7 Dec 2023 02:37:12 +0000 (10:37 +0800)]
Fix margin in server signed signature verification view (#28379) (#28381)

Backport #28379 by @lafriks

Before:

![image](https://github.com/go-gitea/gitea/assets/165205/e2e2256d-03c5-4ab8-8ed9-08ef68571a43)

After:

![image](https://github.com/go-gitea/gitea/assets/165205/804132ef-18f9-4ab8-949d-f6c71e7f4d24)

Co-authored-by: Lauris BH <lauris@nix.lv>
10 months agoFix object does not exist error when checking citation file (#28314) (#28369)
Giteabot [Wed, 6 Dec 2023 22:06:51 +0000 (06:06 +0800)]
Fix object does not exist error when checking citation file (#28314) (#28369)

Backport #28314 by @yp05327

Fix #28264

`DataAsync()` will be called twice.
Caused by https://github.com/go-gitea/gitea/pull/27958.
I'm sorry, I didn't completely remove all unnecessary codes.

Co-authored-by: yp05327 <576951401@qq.com>
10 months agoFix incorrect default value of `[attachment].MAX_SIZE` (#28373) (#28376)
Giteabot [Wed, 6 Dec 2023 19:32:23 +0000 (03:32 +0800)]
Fix incorrect default value of `[attachment].MAX_SIZE` (#28373) (#28376)

Backport #28373 by @capvor

In the documents, the `[attachment] MAX_SIZE` default value should be 4.

Reference the source code `modules/setting/attachment.go` line 29.

Co-authored-by: capvor <capvor@sina.com>
10 months agoUse `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378)
Giteabot [Wed, 6 Dec 2023 17:22:18 +0000 (01:22 +0800)]
Use `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Fix #28300

10 months agoFix the runs will not be displayed bug when the main branch have no workflows but...
Giteabot [Wed, 6 Dec 2023 07:28:00 +0000 (15:28 +0800)]
Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) (#28365)

Backport #28359 by @lunny

The left menu will only display the default branch's workflows but the
right side will display the runs triggered by all branches' workflows.
So we cannot hide right side if default branch has no workflows.

Fix #28332
Replace #28333

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 months agohandle repository.size column being NULL in migration v263 (#28336) (#28363)
Giteabot [Tue, 5 Dec 2023 14:51:56 +0000 (22:51 +0800)]
handle repository.size column being NULL in migration v263 (#28336) (#28363)

Co-authored-by: Nate Levesque <nate@thenaterhood.com>
10 months agoConvert git commit summary to valid UTF8. (#28356) (#28358)
Giteabot [Tue, 5 Dec 2023 09:19:08 +0000 (17:19 +0800)]
Convert git commit summary to valid UTF8. (#28356) (#28358)

Backport #28356 by @darrinsmart

The summary string ends up in the database, and (at least) MySQL &
PostgreSQL require valid UTF8 strings.

Fixes #28178

Co-authored-by: darrinsmart <darrin@djs.to>
Co-authored-by: Darrin Smart <darrin@filmlight.ltd.uk>
10 months agoFix migration panic due to an empty review comment diff (#28334) (#28362)
Giteabot [Tue, 5 Dec 2023 08:58:15 +0000 (16:58 +0800)]
Fix migration panic due to an empty review comment diff (#28334) (#28362)

Backport #28334 by @lng2020

Fix #28328
```
func (p *PullRequestComment) GetDiffHunk() string {
if p == nil || p.DiffHunk == nil {
return ""
}
return *p.DiffHunk
}
```
This function in the package `go-github` may return an empty diff. When
it's empty, the following code will panic because it access `ss[1]`

https://github.com/go-gitea/gitea/blob/ec1feedbf582b05b6a5e8c59fb2457f25d053ba2/services/migrations/gitea_uploader.go#L861-L867

https://github.com/go-gitea/gitea/blob/ec1feedbf582b05b6a5e8c59fb2457f25d053ba2/modules/git/diff.go#L97-L101

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
10 months agoAdd `HEAD` support for rpm repo files (#28309) (#28360)
Giteabot [Tue, 5 Dec 2023 08:24:57 +0000 (16:24 +0800)]
Add `HEAD` support for rpm repo files (#28309) (#28360)

Backport #28309 by @KN4CK3R

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

zypper uses HEAD requests to check file existence.

https://github.com/openSUSE/libzypp/blob/HEAD/zypp/RepoManager.cc#L2549

https://github.com/openSUSE/libzypp/blob/HEAD/zypp-curl/ng/network/private/downloaderstates/basicdownloader_p.cc#L116

@ExplodingDragon fyi

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
10 months agoRefactor template empty checks (#28351) (#28354)
Giteabot [Tue, 5 Dec 2023 06:07:15 +0000 (14:07 +0800)]
Refactor template empty checks (#28351) (#28354)

Backport #28351 by @KN4CK3R

Fix #28347

As there is no info how to reproduce it, I can't test it.
Fix may be `section_split.tmpl @ 126/130`.

Other changes are "empty check" refactorings.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
10 months agoFix RPM/Debian signature key creation (#28352) (#28353)
Giteabot [Tue, 5 Dec 2023 05:42:41 +0000 (13:42 +0800)]
Fix RPM/Debian signature key creation (#28352) (#28353)

Backport #28352 by @KN4CK3R

Fixes #28324

The name parameter can't contain some characters
(https://github.com/keybase/go-crypto/blob/master/openpgp/keys.go#L680)
but is optional. Therefore just use an empty string.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
10 months agoKeep profile tab when clicking on Language (#28320) (#28331)
Giteabot [Sun, 3 Dec 2023 14:54:53 +0000 (22:54 +0800)]
Keep profile tab when clicking on Language (#28320) (#28331)

Backport #28320 by @JakobDev

Fixes https://codeberg.org/Codeberg/Community/issues/1355

Co-authored-by: JakobDev <jakobdev@gmx.de>
10 months agoFix missing issue search index update when changing status (#28325) (#28330)
Giteabot [Sun, 3 Dec 2023 11:43:17 +0000 (19:43 +0800)]
Fix missing issue search index update when changing status (#28325) (#28330)

Backport #28325 by @brechtvl

Changing an issue status, assignee, labels or milestone without also
adding a comment would not update the index, resulting in wrong search
results.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
10 months agoFix wrong link in `protect_branch_name_pattern_desc` (#28313) (#28315)
Giteabot [Fri, 1 Dec 2023 12:06:08 +0000 (20:06 +0800)]
Fix wrong link in `protect_branch_name_pattern_desc` (#28313) (#28315)

Backport #28313 by @yp05327

The current href will link to
`https://domain/owner/repo/settings/branches/github.com/gobwas/glob`

Co-authored-by: yp05327 <576951401@qq.com>
10 months agoRead `previous` info from git blame (#28306) (#28310)
Giteabot [Fri, 1 Dec 2023 07:27:35 +0000 (15:27 +0800)]
Read `previous` info from git blame (#28306) (#28310)

Backport #28306 by @KN4CK3R

Fixes #28280

Reads the `previous` info from the `git blame` output instead of
calculating it afterwards.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
10 months agoIgnore "non-existing" errors when getDirectorySize calculates the size (#28276) ...
wxiaoguang [Thu, 30 Nov 2023 16:39:16 +0000 (00:39 +0800)]
Ignore "non-existing" errors when getDirectorySize calculates the size (#28276) (#28285)

Backport #28276

The git command may operate the git directory (add/remove) files in any
time.

So when the code iterates the directory, some files may disappear during
the "walk". All "IsNotExist" errors should be ignored.

10 months agoUse appSubUrl for OAuth2 callback URL tip (#28266) (#28275)
Giteabot [Thu, 30 Nov 2023 00:26:47 +0000 (08:26 +0800)]
Use appSubUrl for OAuth2 callback URL tip (#28266) (#28275)

Backport #28266 by @earl-warren

- When crafting the OAuth2 callbackURL take into account `appSubUrl`,
which is quite safe given that its strictly formatted.
- No integration testing as this is all done in Javascript.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1795

(cherry picked from commit 27cb6b7956136f87aa78067d9adb5a4c4ce28a24)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
10 months agoMeilisearch: require all query terms to be matched (#28293) (#28296)
Giteabot [Wed, 29 Nov 2023 15:38:04 +0000 (23:38 +0800)]
Meilisearch: require all query terms to be matched (#28293) (#28296)

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
10 months agoFix required error for token name (#28267) (#28284)
Giteabot [Wed, 29 Nov 2023 15:00:32 +0000 (23:00 +0800)]
Fix required error for token name (#28267) (#28284)

Backport #28267 by @earl-warren

- Say to the binding middleware which locale should be used for the
required error.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1683

(cherry picked from commit 5a2d7966127b5639332038e9925d858ab54fc360)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
10 months agoFix issue will be detected as pull request when checking `First-time contributor...
Giteabot [Wed, 29 Nov 2023 02:49:33 +0000 (10:49 +0800)]
Fix issue will be detected as pull request when checking `First-time contributor` (#28237) (#28271)

Backport #28237 by @yp05327

Fix #28224

Co-authored-by: yp05327 <576951401@qq.com>
10 months agoCheck for v prefix on tags for release clean name (#28257) (#28270)
Giteabot [Tue, 28 Nov 2023 22:02:26 +0000 (06:02 +0800)]
Check for v prefix on tags for release clean name (#28257) (#28270)

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
10 months agoUse full width for project boards (#28225) (#28245)
Giteabot [Mon, 27 Nov 2023 18:20:53 +0000 (02:20 +0800)]
Use full width for project boards (#28225) (#28245)

Backport #28225 by @denyskon

Inspired by #28182

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
10 months agoIncrease "version" when update the setting value to a same value as before (#28243...
Giteabot [Mon, 27 Nov 2023 17:58:39 +0000 (01:58 +0800)]
Increase "version" when update the setting value to a same value as before (#28243) (#28244)

Backport #28243

Setting the same value should not trigger DuplicateKey error, and the
"version" should be increased

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>