]> source.dussan.org Git - gitea.git/log
gitea.git
6 months agoImprove job commit description (#30579) (#30709) release/v1.22-legacy
Giteabot [Fri, 26 Apr 2024 19:46:32 +0000 (03:46 +0800)]
Improve job commit description (#30579) (#30709)

Backport #30579 by @yp05327

Fix https://github.com/go-gitea/gitea/issues/30567

When job is a schedule:

![image](https://github.com/go-gitea/gitea/assets/18380374/b07e9d43-e8b7-4ee2-87b3-a7050c3a8ca5)
When it is a normal one:

![image](https://github.com/go-gitea/gitea/assets/18380374/0d58dab9-74bb-421b-8952-0578cdf21a52)

also add a 'space' behind  `:`

![image](https://github.com/go-gitea/gitea/assets/18380374/4cebece0-bfe6-4ad9-b806-e5c49bb9be43)

![image](https://github.com/go-gitea/gitea/assets/18380374/02da7681-474b-4c0f-9dad-b6558f6cb484)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6 months agoFix a panic bug when head repository deleting (#30674) (#30676)
Giteabot [Thu, 25 Apr 2024 06:22:02 +0000 (14:22 +0800)]
Fix a panic bug when head repository deleting (#30674) (#30676)

Backport #30674 & #30679 by @lunny

When visiting a pull request files which head repository has been
deleted, it will panic because headrepo is nil.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoTweak repo buttons on mobile and labeled button border-radius (#30503) (#30525)
silverwind [Wed, 24 Apr 2024 03:34:25 +0000 (05:34 +0200)]
Tweak repo buttons on mobile and labeled button border-radius (#30503) (#30525)

Backport of https://github.com/go-gitea/gitea/pull/30503 to v1.22, the
only change excluded is the border-radius changes which aren't necessary
on this branch because the button css was not migrated.

Fixes: https://github.com/go-gitea/gitea/issues/30514
Fixes:
https://github.com/go-gitea/gitea/pull/30288#issuecomment-2057466623

- Fix border-radius regression from
https://github.com/go-gitea/gitea/pull/30475
- Fix and simplify hover state
- Move the modal HTML so it does not interfere with the CSS
- Make the star and unwatch text show on mobile. There is still plenty
of space, below is iPhone 12 viewport size

<img width="696" alt="Screenshot 2024-04-15 at 20 34 03"
src="https://github.com/go-gitea/gitea/assets/115237/af90bb00-4671-4973-a255-8eb44ee6ba8d">
<img width="230" alt="Screenshot 2024-04-15 at 20 31 42"
src="https://github.com/go-gitea/gitea/assets/115237/986ef533-7a01-4bb0-8dcd-fd19e4259e84">
<img width="233" alt="Screenshot 2024-04-15 at 20 31 47"
src="https://github.com/go-gitea/gitea/assets/115237/5b825dd8-0ccc-4d56-9d8f-774abb935b68">

7 months agoFix project name wrapping, remove horizontal margin on header (#30631) (#30654)
Giteabot [Tue, 23 Apr 2024 10:48:36 +0000 (18:48 +0800)]
Fix project name wrapping, remove horizontal margin on header (#30631) (#30654)

Backport #30631 by @silverwind

Enable wrapping of unbroken lines:

<img width="1308" alt="Screenshot 2024-04-22 at 00 31 33"
src="https://github.com/go-gitea/gitea/assets/115237/1a28ade1-d708-4260-96a3-cf508b6dcb79">

Remove extra margin added by nested `.ui.container` on certain
viewports:

Before:
<img width="1305" alt="Screenshot 2024-04-22 at 00 40 23"
src="https://github.com/go-gitea/gitea/assets/115237/d3d8c0d1-380c-4867-b95c-4d53d70d4a93">

After:
<img width="1310" alt="Screenshot 2024-04-22 at 00 40 33"
src="https://github.com/go-gitea/gitea/assets/115237/2ba7b9f2-db2f-4bcc-8cce-5c415625ddea">

---------

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix wrong table name (#30557) (#30651)
Lunny Xiao [Tue, 23 Apr 2024 09:15:16 +0000 (17:15 +0800)]
Fix wrong table name (#30557) (#30651)

Backport #30557

The table name should be `oauth2_application` but `o_auth2_application`

Caused by

https://github.com/go-gitea/gitea/pull/21316/files#diff-9610efbc608a41f1f2eaff5790423f0a187906f6ff0beb23a5e8d18366cc2ccfR38

7 months agoUse maintained gziphandler (#30592) (#30637)
Lunny Xiao [Tue, 23 Apr 2024 02:56:49 +0000 (10:56 +0800)]
Use maintained gziphandler (#30592) (#30637)

Replace #27894
Backport #30592

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoHide diff stats on empty PRs (#30629) (#30645)
Giteabot [Mon, 22 Apr 2024 14:43:44 +0000 (22:43 +0800)]
Hide diff stats on empty PRs (#30629) (#30645)

Backport #30629 by @silverwind

When a PR is empty, e.g. has neither additions nor deletions, we don't
need to show this:

<img width="125" alt="Screenshot 2024-04-21 at 23 25 38"
src="https://github.com/go-gitea/gitea/assets/115237/0b987eb5-66f5-4b9b-b5aa-7e9e267e9b52">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoUse correct hash for "git update-index" (#30626) (#30634)
Giteabot [Mon, 22 Apr 2024 13:55:01 +0000 (21:55 +0800)]
Use correct hash for "git update-index" (#30626) (#30634)

Backport #30626 by @wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix dropdown text ellipsis (#30628) (#30633)
Giteabot [Mon, 22 Apr 2024 06:52:08 +0000 (14:52 +0800)]
Fix dropdown text ellipsis (#30628) (#30633)

Backport #30628 by @wxiaoguang

Follow
https://github.com/go-gitea/gitea/pull/30547#discussion_r1573866519

Fix #30624

The Fomantic UI Dropdown wasn't designed to work that way, its "text"
element might contain images. So the "overflow" shouldn't be added to
any general dropdown text.

![image](https://github.com/go-gitea/gitea/assets/2114189/f6ceaabd-bc89-4bf2-baa2-a6f0324c1962)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoAdd --skip-db option to dump command (#30613) (#30630)
Giteabot [Mon, 22 Apr 2024 06:25:07 +0000 (14:25 +0800)]
Add --skip-db option to dump command (#30613) (#30630)

Backport #30613 by @kemzeb

Attempts to resolve #28720.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
7 months agoRefactor and fix archive link bug (#30535) (#30570)
Giteabot [Sun, 21 Apr 2024 21:12:47 +0000 (05:12 +0800)]
Refactor and fix archive link bug (#30535) (#30570)

Backport #30535 by wxiaoguang

Regression of #29920
Fixes: https://github.com/go-gitea/gitea/issues/30569
Also this is a rewriting to eliminate the remaining jQuery usages from
code.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix package list performance (#30520) (#30616)
Giteabot [Sun, 21 Apr 2024 00:50:50 +0000 (08:50 +0800)]
Fix package list performance (#30520) (#30616)

Backport #30520 by @KN4CK3R

Fixes #28255

The new query uses the id field to sort by "newer". This most not be
correct (usually it is) but it's faster (see #28255).
If someone has a better idea, please propose changes.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoFix links in PyPI Simple Repository API page (#30594) (#30612)
Giteabot [Sat, 20 Apr 2024 03:46:26 +0000 (11:46 +0800)]
Fix links in PyPI Simple Repository API page (#30594) (#30612)

Backport #30594 by wxiaoguang

Thanks to @Zottelchen for looking into problem and proposing the fix.

Ref: https://github.com/astral-sh/uv/issues/3017 ,
https://peps.python.org/pep-0503/

This PR's change is from Zottelchen's work.

And I by the way rename the `$p` to `$pd` because `p` is used as
"package" in code, while `pd` is used as "package description".

----

Co-authored-by: Zottelchen
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoUse action user as the trigger user of schedules (#30581) (#30610)
Giteabot [Sat, 20 Apr 2024 02:45:53 +0000 (10:45 +0800)]
Use action user as the trigger user of schedules (#30581) (#30610)

Backport #30581 by @yp05327

Follow https://github.com/go-gitea/gitea/pull/30357

When user push to default branch, the schedule trigger user will be the
user.
When disable then enable action units in settings, the schedule trigger
user will be action user.
When repo is a mirror, the schedule trigger user will be action user. (
before it will return error, fixed by #30357)

As scheduled job is a cron, the trigger user should be action user from
Gitea, not a real user.

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoFix HEAD method for robots.txt (#30603) (#30605)
Giteabot [Fri, 19 Apr 2024 20:32:49 +0000 (04:32 +0800)]
Fix HEAD method for robots.txt (#30603) (#30605)

Backport #30603 by @wxiaoguang

Fix #30601

```
~$ curl --head localhost:3000/robots.txt
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 5
Content-Type: text/plain; charset=utf-8
Last-Modified: Wed, 19 Jul 2023 04:56:12 GMT
X-Gitea-Debug: RUN_MODE=dev
Date: Fri, 19 Apr 2024 12:59:44 GMT
```

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoAvoid importing `modules/web/middleware` in `modules/session` (#30584) (#30589)
Giteabot [Fri, 19 Apr 2024 07:44:24 +0000 (15:44 +0800)]
Avoid importing `modules/web/middleware` in `modules/session` (#30584) (#30589)

Backport #30584 by @wolfogre

Related to #30375.

It doesn't make sense to import `modules/web/middleware` and
`modules/setting` in `modules/web/session` since the last one is more
low-level.

And it looks like a workaround to call `DeleteLegacySiteCookie` in
`RegenerateSession`, so maybe we could reverse the importing by
registering hook functions.

Co-authored-by: Jason Song <i@wolfogre.com>
7 months agoEnable npm cache on `setup-node` action (#30577) (#30586)
Giteabot [Fri, 19 Apr 2024 07:16:42 +0000 (15:16 +0800)]
Enable npm cache on `setup-node` action (#30577) (#30586)

Backport #30577 by @silverwind

Enable npm dependency cache in
[setup-node](https://github.com/actions/setup-node). This should work
reliably and across branches as well.

Co-authored-by: silverwind <me@silverwind.io>
7 months agoImprove "Reference in new issue" modal (#30547) (#30574)
Giteabot [Thu, 18 Apr 2024 19:58:37 +0000 (03:58 +0800)]
Improve "Reference in new issue" modal (#30547) (#30574)

Backport #30547 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/29994
Also some misc enhancements done to the form in the modal.

<img width="840" alt="Screenshot 2024-04-17 at 23 02 55"
src="https://github.com/go-gitea/gitea/assets/115237/e71fba55-55cd-4e48-a497-6b1025c36a43">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFixup app.example.ini for task section, which is now queue.task (#30555) (#30563)
Giteabot [Thu, 18 Apr 2024 13:16:01 +0000 (21:16 +0800)]
Fixup app.example.ini for task section, which is now queue.task (#30555) (#30563)

Backport #30555 by xor-gate

Config section `[task]` has been deprecated in favor of `[queue.task]`

Co-authored-by: Jerry Jacobs <xor-gate@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoAdd form field id generation, remove duplicated ids (#30546) (#30561)
Giteabot [Thu, 18 Apr 2024 10:33:32 +0000 (18:33 +0800)]
Add form field id generation, remove duplicated ids (#30546) (#30561)

Backport #30546 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/30384
On repo settings page, there id `repo_name` was used 5 times on the same
page, some in modal and such. I think we are better off just
auto-generating these IDs in the future so that labels link up with
their form element.

Ideally this id generation would be done in backend in a subtemplate,
but seeing that we already have similar JS patches for checkboxes, I
took the easy path for now.

I also checked that these `#repo_name` were not in use in JS and the
only case where this id appears in JS is on the migration page where
it's still there.

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix border-radius on view, blame and code search (#30545) (#30560)
Giteabot [Thu, 18 Apr 2024 10:04:47 +0000 (18:04 +0800)]
Fix border-radius on view, blame and code search (#30545) (#30560)

Backport #30545 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/30540
1. Fix all these boxes by adding `bottom attached` and removing a
problematic CSS rule:

<img width="1319" alt="Screenshot 2024-04-17 at 22 25 31"
src="https://github.com/go-gitea/gitea/assets/115237/346445a4-4944-4003-a1ef-6f5b0eda624e">
<img width="643" alt="Screenshot 2024-04-17 at 22 21 18"
src="https://github.com/go-gitea/gitea/assets/115237/10f17ed3-9ad6-48de-92fa-bac6621815b9">

2. Change the "last commit" box to `ui segment` which has correct
border-radius. Also included is a tiny tweak to make author name ellipse
instead of wrap.

<img width="1331" alt="Screenshot 2024-04-17 at 22 23 23"
src="https://github.com/go-gitea/gitea/assets/115237/285fbd45-ced0-4d33-abe3-7384ffa03188">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoDisable enter key for accepting code completion in Monaco (#30548) (#30559)
Giteabot [Thu, 18 Apr 2024 09:38:32 +0000 (17:38 +0800)]
Disable enter key for accepting code completion in Monaco (#30548) (#30559)

Backport #30548 by @silverwind

Fixes https://github.com/go-gitea/gitea/issues/28114 and behaviour
matches vscode on desktop as well.

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix branch_protection api shows users/teams who has no readAccess (#30291) (#30544)
Giteabot [Wed, 17 Apr 2024 13:50:49 +0000 (21:50 +0800)]
Fix branch_protection api shows users/teams who has no readAccess (#30291) (#30544)

Backport #30291 by @edwardzhanged

Add some logic in `convert.ToBranchProtection` to return only the names
associated with readAccess instead of returning all names. This will
ensure consistency in behavior between the frontend and backend.
Fixes: #27694
Co-authored-by: Edward Zhang <45360012+edwardzhanged@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: wenzhuo.zhang <wenzhuo.zhang@geely.com>
7 months agoRun `go generate` and `go vet` on all packages (#30529) (#30541)
Giteabot [Wed, 17 Apr 2024 11:34:30 +0000 (19:34 +0800)]
Run `go generate` and `go vet` on all packages (#30529) (#30541)

Backport #30529 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/30512
I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix install page checkboxes and dropdown width (#30526) (#30538)
Giteabot [Wed, 17 Apr 2024 08:51:38 +0000 (16:51 +0800)]
Fix install page checkboxes and dropdown width (#30526) (#30538)

Backport #30526 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/30523
1. Fix checkbox rendering:

<img width="406" alt="Screenshot 2024-04-16 at 21 37 03"
src="https://github.com/go-gitea/gitea/assets/115237/42df99b0-58c7-47d1-b99d-0c15250560c7">

2. Fix width of selection dropdowns (was too small):

<img width="826" alt="Screenshot 2024-04-16 at 21 37 09"
src="https://github.com/go-gitea/gitea/assets/115237/e006d0d6-ac3d-4804-94de-b2c3c8a5900d">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
7 months agoTweak and fix toggle checkboxes (#30527) (#30531)
Giteabot [Wed, 17 Apr 2024 07:15:02 +0000 (15:15 +0800)]
Tweak and fix toggle checkboxes (#30527) (#30531)

Backport #30527 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/30524. Slightly restyled
them so that the "knob" is contained inside the background.

<img width="179" alt="Screenshot 2024-04-16 at 21 58 09"
src="https://github.com/go-gitea/gitea/assets/115237/be94517b-9cb7-46e2-ae96-fcf6767ce4ba">
<img width="187" alt="Screenshot 2024-04-16 at 21 58 50"
src="https://github.com/go-gitea/gitea/assets/115237/c13a1959-5c5a-4e88-9225-e5f6fb72e3e0">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix empty field `login_name` in API response JSON when creating user (#30511) (#30516)
Giteabot [Tue, 16 Apr 2024 17:34:48 +0000 (01:34 +0800)]
Fix empty field `login_name` in API response JSON when creating user (#30511) (#30516)

Backport #30511 by @yp05327

Fix #30508

ps: if `sourceID` is not set, `LoginName` will be ignored

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoFix various overflows on actions view (#30344) (#30505)
Giteabot [Tue, 16 Apr 2024 00:24:06 +0000 (08:24 +0800)]
Fix various overflows on actions view (#30344) (#30505)

Backport #30344 by @silverwind

Fix a number of text overflow issues in actions view and run list. Also
improve mobile view of run list.

Fixes: https://github.com/go-gitea/gitea/issues/30328
<img width="782" alt="Screenshot 2024-04-08 at 23 10 16"
src="https://github.com/go-gitea/gitea/assets/115237/3d9f9f88-3eab-44a0-8144-30c2b58b24cb">
<img width="935" alt="Screenshot 2024-04-08 at 23 17 46"
src="https://github.com/go-gitea/gitea/assets/115237/581d73ea-a31d-416b-be3a-47313b879b12">
<img width="1008" alt="Screenshot 2024-04-08 at 23 49 05"
src="https://github.com/go-gitea/gitea/assets/115237/c5d10565-f285-477f-8659-1caf94797647">
<img width="397" alt="Screenshot 2024-04-08 at 23 55 30"
src="https://github.com/go-gitea/gitea/assets/115237/368aaa75-1903-4058-9d75-d1fe91c564d6">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoConvert max file name length to 255 (#30489) (#30504)
Giteabot [Mon, 15 Apr 2024 19:42:15 +0000 (03:42 +0800)]
Convert max file name length to 255 (#30489) (#30504)

Backport #30489 by @yp05327

Quick/Partly fix #29907

In Linux and MacOS, by default the max file name length is 255.
In windows, it depends on the version and settings, and has no file name
length limitation, but has path length limitation.
By default it is 260, considering path length is longer than filename,
so I think it is ok to do this.

For Windows, see
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
For Linux, see
https://github.com/torvalds/linux/blob/master/include/uapi/linux/limits.h#L12-L13
For MacOS, see
https://discussions.apple.com/thread/254788848?sortBy=best

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoFix code owners will not be mentioned when a pull request comes from a forked reposit...
Giteabot [Mon, 15 Apr 2024 17:08:16 +0000 (01:08 +0800)]
Fix code owners will not be mentioned when a pull request comes from a forked repository (#30476) (#30496)

Backport #30476 by @lunny

Fix #30277
Caused by #29783

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoFix commit status cache which missed target_url (#30426) (#30444)
Lunny Xiao [Mon, 15 Apr 2024 09:31:14 +0000 (17:31 +0800)]
Fix commit status cache which missed target_url (#30426) (#30444)

Fix #30421
Backport #30426

Co-authored-by: Jason Song <i@wolfogre.com>
7 months agoFix overflow on issue dependency (#30484) (#30494)
Giteabot [Mon, 15 Apr 2024 08:58:09 +0000 (16:58 +0800)]
Fix overflow on issue dependency (#30484) (#30494)

Backport #30484 by @silverwind

Small tweak here to prevent this and likely other events from
overflowing in the timeline:

<img width="895" alt="Screenshot 2024-04-14 at 22 53 17"
src="https://github.com/go-gitea/gitea/assets/115237/001b4f6b-f649-44ff-b2f0-c8e0dedeb384">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoImprove "must-change-password" logic and document (#30472) (#30478)
Giteabot [Sun, 14 Apr 2024 17:49:16 +0000 (01:49 +0800)]
Improve "must-change-password" logic and document (#30472) (#30478)

Backport #30472 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agofix: Fix to delete cookie when AppSubURL is non-empty (#30375) (#30469)
Giteabot [Sun, 14 Apr 2024 12:27:36 +0000 (20:27 +0800)]
fix: Fix to delete cookie when AppSubURL is non-empty (#30375) (#30469)

Backport #30375 by @jtran

Cookies may exist on "/subpath" and "/subpath/" for some legacy reasons
(eg: changed CookiePath behavior in code). The legacy cookie should be
removed correctly.

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Kyle D <kdumontnu@gmail.com>
7 months agoRewrite and restyle reaction selector and enable no-sizzle eslint rule (#30453) ...
Giteabot [Sun, 14 Apr 2024 11:58:48 +0000 (19:58 +0800)]
Rewrite and restyle reaction selector and enable no-sizzle eslint rule (#30453) (#30473)

Backport #30453 by @silverwind

Enable `no-sizzle` lint rule, there was only one use in
`initCompReactionSelector` which I have rewritten as follows:

- Remove all jQuery except the necessary fomantic dropdown init
- Remove the recursion, instead bind event listeners to common parent
container nodes

Did various tests, works with our without attachments, in diff view and
in diff comments inside comment list.

Additionally the style of reactions now matches between code comments
and issue comments:

<img width="275" alt="Screenshot 2024-04-13 at 14 58 10"
src="https://github.com/go-gitea/gitea/assets/115237/9d08f188-8661-4dd9-bff4-cad6d6d09cab">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix JS error when opening to expanded code comment (#30463) (#30470)
Giteabot [Sun, 14 Apr 2024 10:46:21 +0000 (18:46 +0800)]
Fix JS error when opening to expanded code comment (#30463) (#30470)

Backport #30463 by silverwind

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix network error when open/close organization/individual projects and redirect to...
Giteabot [Sat, 13 Apr 2024 17:53:14 +0000 (01:53 +0800)]
Fix network error when open/close organization/individual projects and redirect to project page (#30387) (#30465)

Backport #30387 by @yp05327

Follow #27734

![image](https://github.com/go-gitea/gitea/assets/18380374/02ed6b9a-cbb6-4f49-a54a-ca76a0d052a9)

Updated:
Redirect to project page instead of project list page.

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoAvoid losing token when updating mirror settings (#30429) (#30464)
Giteabot [Sat, 13 Apr 2024 16:57:53 +0000 (00:57 +0800)]
Avoid losing token when updating mirror settings (#30429) (#30464)

Backport #30429 by @wolfogre

Fix #30416.

Before (it shows as "Unset" while there's a token):

<img width="980" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/d7148e3e-62c9-4d2e-942d-3d795b79515a">

After:

<img width="977" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/24aaa1db-5baa-4204-9081-470b15ea72b5">

The username shows as "oauth2" because of
https://github.com/go-gitea/gitea/blob/f9fdac9809335729b2ac3227b2a5f71a62fc64ad/services/migrations/dump.go#L99

I have checked that all usage of `MirrorRemoteAddress` has been updated.

<img width="1806" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2f042501-2824-4511-9203-c84a6731a02d">

However, it needs to be checked again when backporting.

Co-authored-by: Jason Song <i@wolfogre.com>
7 months agoFix label rendering (#30456) (#30460)
Giteabot [Sat, 13 Apr 2024 10:33:32 +0000 (18:33 +0800)]
Fix label rendering (#30456) (#30460)

Backport #30456 by wxiaoguang

1. Check whether the label is for an issue or a pull request.
2. Don't use space to layout
3. Make sure the test strings have trailing spaces explicitly, to avoid
some IDE removing the trailing spaces automatically.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix mirror error when mirror repo is empty (#30432) (#30455)
Giteabot [Sat, 13 Apr 2024 09:20:10 +0000 (17:20 +0800)]
Fix mirror error when mirror repo is empty (#30432) (#30455)

Backport #30432 by @yp05327

Fix #30424

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoFix admin notice view-detail (#30450) (#30458)
Giteabot [Sat, 13 Apr 2024 08:49:44 +0000 (16:49 +0800)]
Fix admin notice view-detail (#30450) (#30458)

Backport #30450 by @silverwind

Fix https://github.com/go-gitea/gitea/issues/30434, regression from
https://github.com/go-gitea/gitea/pull/30115.

I also removed the date insertion into the modal which was also broken
since that date was switched to `absolute-date` because I see no real
purpose to putting that date into the modal.

Result:

<img width="1038" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/aa2eb8b4-73dc-4d98-9b80-3f276f89d9e5">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoChange the default maxPerPage for gitbucket (#30392) (#30425)
Giteabot [Fri, 12 Apr 2024 11:23:34 +0000 (19:23 +0800)]
Change the default maxPerPage for gitbucket (#30392) (#30425)

Backport #30392 by @jam7

This patch improves the migration from gitbucket to gitea.

The gitbucket uses it's own internal perPage value (= 25) for paging and
ignore per_page arguments in the requested URL. This cause gitea to
migrate only 25 issues and 25 PRs from gitbucket repository. This may
not happens on old gitbucket. But recent gitbucket 4.40 or 4.38.4 has
this problem.

This patch change to use this internally hardcoded perPage of gitbucket
as gitea's maxPerPage numer when migrating from gitbucket. There are
several perPage values in gitbucket like 25 for Isseus/PRs and 10 for
Releases. Some of those API doesn't support paging yet. It sounds
difficult to implement, but using the minimum number among them worked
out very well. So, I use 10 in this patch.

Brief descriptions of problems and this patch are also available in
https://github.com/go-gitea/gitea/issues/30316.

In addition, I'm not sure what kind of test cases are possible to write
here. It's a test for migration, so it requires testing gitbucket server
and gitea server, I guess. Please let me know if it is possible to write
such test cases here. Thanks!

Co-authored-by: Kazushi (Jam) Marukawa <jam@pobox.com>
7 months agoFix rename branch 500 when the target branch is deleted but exist in database (#30430...
Giteabot [Fri, 12 Apr 2024 10:56:14 +0000 (18:56 +0800)]
Fix rename branch 500 when the target branch is deleted but exist in database (#30430) (#30438)

Backport #30430 by @lunny

Fix #30428

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoFix the spacing issue in the Project view (#30415) (#30423)
Giteabot [Fri, 12 Apr 2024 09:23:00 +0000 (17:23 +0800)]
Fix the spacing issue in the Project view (#30415) (#30423)

Backport #30415 by @HEREYUA

**fix**:  [#30388](https://github.com/go-gitea/gitea/issues/30388)

**before**

![image](https://github.com/go-gitea/gitea/assets/37935145/52ca7311-dca4-4430-9a37-3c45b08fe3dd)

**after**

![image](https://github.com/go-gitea/gitea/assets/37935145/6b75ce69-4423-4ea4-99a1-d7234287c5c0)

Co-authored-by: HEREYUA <37935145+HEREYUA@users.noreply.github.com>
7 months agoLimit the max line length when parsing git grep output (#30418) (#30427)
Giteabot [Fri, 12 Apr 2024 04:13:14 +0000 (12:13 +0800)]
Limit the max line length when parsing git grep output (#30418) (#30427)

Backport #30418 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoSplit `issue edit` code from `repo-legacy.js` into its own file (#30419) (#30422)
Giteabot [Fri, 12 Apr 2024 03:11:57 +0000 (11:11 +0800)]
Split `issue edit` code from `repo-legacy.js` into its own file (#30419) (#30422)

Backport #30419 by wxiaoguang

Follow Split `index.js` to separate files (#17315)

It's time to move some code away from the messy "legacy" file.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoCheck the token's owner and repository when registering a runner (#30406) (#30411)
Giteabot [Thu, 11 Apr 2024 08:57:34 +0000 (16:57 +0800)]
Check the token's owner and repository when registering a runner (#30406) (#30411)

Backport #30406 by @Zettat123

Fix #30378

Co-authored-by: Zettat123 <zettat123@gmail.com>
7 months agoAvoid user does not exist error when detecting schedule actions when the commit autho...
Giteabot [Thu, 11 Apr 2024 07:51:02 +0000 (15:51 +0800)]
Avoid user does not exist error when detecting schedule actions when the commit author is an external user  (#30357) (#30409)

Backport #30357 by @yp05327

![image](https://github.com/go-gitea/gitea/assets/18380374/ddf6ee84-2242-49b9-b066-bd8429ba4d76)

When repo is a mirror, and commit author is an external user, then
`GetUserByEmail` will return error.

reproduce/test:
- mirror Gitea to your instance
- disable action and enable it again, this will trigger
`DetectAndHandleSchedules`

ps: also follow #24706, it only fixed normal runs, not scheduled runs.

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoUpdate actions variables documents (#30394) (#30405)
Giteabot [Thu, 11 Apr 2024 04:03:13 +0000 (12:03 +0800)]
Update actions variables documents (#30394) (#30405)

Backport #30394 by @lunny

Fix #30393

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Zettat123 <zettat123@gmail.com>
7 months agoMinor color tweaks (#30397) (#30398)
Giteabot [Thu, 11 Apr 2024 02:14:28 +0000 (10:14 +0800)]
Minor color tweaks (#30397) (#30398)

Backport #30397 by @silverwind

New approach to color shades: Stem all colors off the body color
`#1b1f23` using [this](https://pinetools.com/darken-color) and
[this](https://pinetools.com/lighten-color) tool. The differences are
very subtle, but it will give a more consistent color scheme until
https://github.com/go-gitea/gitea/issues/30160.

<img width="1342" alt="Screenshot 2024-04-10 at 20 44 16"
src="https://github.com/go-gitea/gitea/assets/115237/75b65797-2521-46ea-91d8-d76f77b591b1">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoVarious improvements for long file and commit names (#30374) (#30386)
Giteabot [Wed, 10 Apr 2024 06:56:21 +0000 (14:56 +0800)]
Various improvements for long file and commit names (#30374) (#30386)

Backport #30374 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/29438
This contains numerous enhancements for how large commit messages and
large filenames render. Another notable change is that the file path is
no longer cut off by backend at 30 chars, but rendered in full with
wrapping.

<img width="1329" alt="Screenshot 2024-04-09 at 21 53 57"
src="https://github.com/go-gitea/gitea/assets/115237/5ccbb3d6-643a-4f60-ba79-3572b36d5182">
<hr>
<img width="711" alt="Screenshot 2024-04-09 at 21 44 24"
src="https://github.com/go-gitea/gitea/assets/115237/6ffe8fbb-407c-4aa7-b591-3d80daea7d57">
<hr>
<img width="439" alt="Screenshot 2024-04-09 at 21 19 03"
src="https://github.com/go-gitea/gitea/assets/115237/1ec7f6e9-2fd8-4841-87eb-6ca02ab9cd61">
<hr>
<img width="444" alt="Screenshot 2024-04-09 at 21 18 52"
src="https://github.com/go-gitea/gitea/assets/115237/70931b9e-5841-477e-b3bc-98f8d2662964">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix line height on inline code preview (#30372) (#30385)
Giteabot [Wed, 10 Apr 2024 05:49:40 +0000 (13:49 +0800)]
Fix line height on inline code preview (#30372) (#30385)

Backport #30372 by @silverwind

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

I don't know what causes `code-inner` to not inherit `line-height` from
its direct parent `.lines-code` but instead from grandparent `.markup`
even thought MDN tells me it's
[inherited](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#formal_definition).
This causes no negative impact on other code views, so I think it's the
best solution.

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix label-list rendering in timeline, decrease gap (#30342) (#30380)
Giteabot [Wed, 10 Apr 2024 05:36:04 +0000 (13:36 +0800)]
Fix label-list rendering in timeline, decrease gap (#30342) (#30380)

Backport #30342 by @silverwind

Not sure exactly when this regressed, but has been a while I think.

Before:

<img width="895" alt="Screenshot 2024-04-08 at 22 46 50"
src="https://github.com/go-gitea/gitea/assets/115237/9b1788f8-017e-4fe1-8ab9-938e0d76fb41">

After:

<img width="689" alt="Screenshot 2024-04-08 at 23 00 58"
src="https://github.com/go-gitea/gitea/assets/115237/90193df9-5c24-4a1a-96fe-3d4e8392063c">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix ambiguous id when fetch Actions tasks (#30382) (#30383)
Giteabot [Wed, 10 Apr 2024 03:24:31 +0000 (11:24 +0800)]
Fix ambiguous id when fetch Actions tasks (#30382) (#30383)

Backport #30382 by @wolfogre

Fix regression of #30331.

```txt
time="2024-04-10T02:23:49Z" level=error msg="failed to fetch task" func="[fetchTask]" file="[poller.go:91]" error="unknown: rpc error: code = Internal desc = pick task: CreateTaskForRunner: Error 1052 (23000): Column 'id' in field list is ambiguous"
```

I have tested it in my local env, and it should work now.

Co-authored-by: Jason Song <i@wolfogre.com>
7 months agoFix actions design about default actions download url (#30360) (#30371)
Giteabot [Wed, 10 Apr 2024 02:07:34 +0000 (10:07 +0800)]
Fix actions design about default actions download url (#30360) (#30371)

Backport #30360 by @lunny

Fix #30359

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoFix and rewrite contrast color calculation, fix project-related bugs (#30326)
silverwind [Tue, 9 Apr 2024 09:45:29 +0000 (11:45 +0200)]
Fix and rewrite contrast color calculation, fix project-related bugs (#30326)

Backport https://github.com/go-gitea/gitea/pull/30237 to 1.22. Also
includes https://github.com/go-gitea/gitea/pull/30183. Both were clean
cherry-picks.

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoPerformance optimization for git push (#30104) (#30348)
Giteabot [Tue, 9 Apr 2024 06:34:30 +0000 (14:34 +0800)]
Performance optimization for git push (#30104) (#30348)

Backport #30104 by @lunny

Agit returned result should be from `ProcReceive` hook but not
`PostReceive` hook. Then for all non-agit pull requests, it will not
check the pull requests for every pushing `refs/pull/%d/head`.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoReduce checkbox size to 15px (#30346) (#30347)
Giteabot [Tue, 9 Apr 2024 06:06:39 +0000 (14:06 +0800)]
Reduce checkbox size to 15px (#30346) (#30347)

Backport #30346 by @silverwind

16 seems to big, 14 too small. Let's do 15. Alignment:

<img width="181" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/f2988611-dee2-492e-a18f-dc5ab3a1cd6c">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix missed doer (#30231) (#30343)
Giteabot [Mon, 8 Apr 2024 23:42:45 +0000 (07:42 +0800)]
Fix missed doer (#30231) (#30343)

Backport #30231 by @lunny

Fix #29879

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoAvoid running action when action unit is disabled after workflows detected (#30331...
Giteabot [Mon, 8 Apr 2024 14:34:44 +0000 (22:34 +0800)]
Avoid running action when action unit is disabled after workflows detected (#30331) (#30338)

Backport #30331 by @yp05327

Fix #30243

We only checking unit disabled when detecting workflows, but not in
runner `FetchTask`.
So if a workflow was detected when action unit is enabled, but disabled
later, `FetchTask` will still return these detected actions.

Global setting: repo.ENABLED and repository.`DISABLED_REPO_UNITS` will
not effect this.

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoFix create commit status (#30225)
Lunny Xiao [Mon, 8 Apr 2024 13:15:23 +0000 (21:15 +0800)]
Fix create commit status (#30225)

Partially backport #30223

This PR uses the service layer `CreateCommitstatus` method instead of
the git model method.

7 months agoAvoid showing `Failed to change the default wiki branch` if repo has no wiki when...
Giteabot [Mon, 8 Apr 2024 12:48:43 +0000 (20:48 +0800)]
Avoid showing `Failed to change the default wiki branch` if repo has no wiki when saving repo settings (#30329) (#30337)

Backport #30329 by @yp05327

If repo does not have wiki, we should return after save the default wiki
branch into DB.
Or you will always see `Failed to change the default wiki branch` error.

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoFix oauth2 builtin application logic (#30304) (#30327)
Giteabot [Mon, 8 Apr 2024 07:46:21 +0000 (15:46 +0800)]
Fix oauth2 builtin application logic (#30304) (#30327)

Backport #30304 by wxiaoguang

Fix #29074 (allow to disable all builtin apps) and don't make the doctor
command remove the builtin apps.

By the way, rename refobject and joincond to camel case.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoAdd `--page-spacing` variable, fix admin dashboard notice (#30302) (#30323)
Giteabot [Mon, 8 Apr 2024 02:04:24 +0000 (10:04 +0800)]
Add `--page-spacing` variable, fix admin dashboard notice (#30302) (#30323)

Backport #30302 by @silverwind

Fixes https://github.com/go-gitea/gitea/issues/30293 and introduce the
`--page-spacing` variable which holds the spacing between the elements
on the page. This is working vertically for all pages, including ones
that have fomantic grid, and horizontally for all that use
`flex-container`.

The `.page-content > :first-child:not(.secondary-nav)` selector uses
margin which in some cases enables to adjacent margins to overlap, which
is nice.

<img width="1320" alt="Screenshot 2024-04-06 at 01 35 19"
src="https://github.com/go-gitea/gitea/assets/115237/3e81e707-e9ff-4b7f-a211-3d98f4f85353">
---
<img width="1327" alt="Screenshot 2024-04-06 at 01 35 45"
src="https://github.com/go-gitea/gitea/assets/115237/aad196c0-9e21-4c06-ae59-7e33a76c61e1">
---
<img width="1321" alt="Screenshot 2024-04-06 at 01 35 31"
src="https://github.com/go-gitea/gitea/assets/115237/785f6c5d-08b6-4e66-aa16-aeca7cfed3ad">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoSome NuGet package enhancements (#30280) (#30324)
Giteabot [Sun, 7 Apr 2024 17:13:36 +0000 (01:13 +0800)]
Some NuGet package enhancements (#30280) (#30324)

Backport #30280 by @KN4CK3R

Fixes #30265

1. Read second type of dependencies
2. Render `Description` and `ReleaseNotes`

old:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/abac057c-11cd-4d25-b196-01ff899d948e)

new:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/35302273-740c-481a-a031-1f80d2d7d336)

The NuGet spec does not specify what kind of text can be stored in the
description but we can best guess markdown. The official NuGet registry
just [converts the newlines to html
lines](https://www.nuget.org/packages/rb.Firefox#readme-body-tab).

3. Extract and render the readme. This is the new and better place to
store larger text than in the description. The content is markdown.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/f442264e-3735-4b55-92c4-3b89a8ebafb0)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Benjamin Heemann <benjamin.heemann@raith.de>
7 months agoAction view mobile improvements and fixes (#30309) (#30320)
Giteabot [Sun, 7 Apr 2024 15:22:47 +0000 (23:22 +0800)]
Action view mobile improvements and fixes (#30309) (#30320)

Backport #30309 by @silverwind

Fix the action issue in https://github.com/go-gitea/gitea/issues/30303,
specifically:

- Use opaque step header hover background to avoid transparency issue
- Un-sticky the `action-view-left` on mobile, it would otherwise overlap
into right view
- Improve commit summary, let it wrap
- Fix and comment z-indexes
- Tweak width for run-list-item-right so it wastes less space on desktop
- Synced latest changes to console colors from dark to light theme

<img width="467" alt="Screenshot 2024-04-06 at 18 58 15"
src="https://github.com/go-gitea/gitea/assets/115237/8ad26b72-6cd9-4522-8ad1-6fd86b2d0d53">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix checkboxes on mobile view, remove some dead css (#30308) (#30319)
Giteabot [Sun, 7 Apr 2024 13:10:40 +0000 (21:10 +0800)]
Fix checkboxes on mobile view, remove some dead css (#30308) (#30319)

Backport #30308 by @silverwind

Fix the checkbox issues in
https://github.com/go-gitea/gitea/issues/30303 which were existing
problems with these selectors, but made visible with
https://github.com/go-gitea/gitea/pull/30162.

There is a lot of dead/useless CSS in `form.css`, I only fixed the two
problems and remove CSS that was definitely not in use or needed.

<img width="369" alt="Screenshot 2024-04-06 at 18 00 08"
src="https://github.com/go-gitea/gitea/assets/115237/720f178b-1b22-48d4-8704-becb8ce66129">
<img width="405" alt="Screenshot 2024-04-06 at 18 00 28"
src="https://github.com/go-gitea/gitea/assets/115237/61c0f8ec-34af-46c5-a3fa-7c5c4d30c7d2">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoClean up log messages (#30313) (#30318)
Giteabot [Sun, 7 Apr 2024 11:44:09 +0000 (19:44 +0800)]
Clean up log messages (#30313) (#30318)

Backport #30313 by wxiaoguang

`log.Xxx("%v")` is not ideal, this PR adds necessary context messages.
Remove some unnecessary logs.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRefactor startup deprecation messages (#30305) (#30312)
Giteabot [Sun, 7 Apr 2024 01:43:54 +0000 (09:43 +0800)]
Refactor startup deprecation messages (#30305) (#30312)

Backport #30305 by wxiaoguang

It doesn't change logic, it only does:

1. Rename the variable and function names
2. Use more consistent format when mentioning config section&key
3. Improve some messages

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoMarkup color and font size fixes (#30282) (#30310)
Giteabot [Sat, 6 Apr 2024 21:48:41 +0000 (05:48 +0800)]
Markup color and font size fixes (#30282) (#30310)

Backport #30282 by @silverwind

1. Distinguish inline an block code with new CSS variable
`--color-markup-code-inline`
2. Various color tweaks, better contrast from background

<img width="447" alt="Screenshot 2024-04-05 at 00 51 00"
src="https://github.com/go-gitea/gitea/assets/115237/93e069f4-6807-4f2c-9331-2d69730919d4">
<img width="456" alt="Screenshot 2024-04-05 at 00 50 44"
src="https://github.com/go-gitea/gitea/assets/115237/0dc9c745-c531-40fa-94ec-b0ba10bd7ccf">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoAlways use `octicon-eye` on watch button (#30288) (#30307)
Giteabot [Sat, 6 Apr 2024 15:42:11 +0000 (23:42 +0800)]
Always use `octicon-eye` on watch button (#30288) (#30307)

Backport #30288 by @silverwind

This might appear odd but I think it's the right thing to do: On Github,
the "Watch" button always has the open eye icon:

<img width="177" alt="Screenshot 2024-04-05 at 08 26 48"
src="https://github.com/go-gitea/gitea/assets/115237/0c1188d1-145b-4c6d-909f-2e1460499941">
<img width="179" alt="Screenshot 2024-04-05 at 08 26 40"
src="https://github.com/go-gitea/gitea/assets/115237/e29d91fa-f122-4e10-9589-f79c1d612cf9">

On Gitea, while watching, the icon is this and this sometimes confuses
me slightly, being used to above:

<img width="158" alt="Screenshot 2024-04-05 at 08 29 08"
src="https://github.com/go-gitea/gitea/assets/115237/3301021b-744e-409f-a9d8-887ec2772fdc">

After this PR, both states will use the same icon:

<img width="145" alt="Screenshot 2024-04-05 at 08 26 27"
src="https://github.com/go-gitea/gitea/assets/115237/8addfa5b-c009-4bdb-bfa1-4f3dfaffa4cd">
<img width="161" alt="Screenshot 2024-04-05 at 08 26 33"
src="https://github.com/go-gitea/gitea/assets/115237/cef383e6-2cc0-460f-a4d3-83ebb321debe">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix code block style for code preview (#30298) (#30306)
Giteabot [Sat, 6 Apr 2024 12:34:38 +0000 (20:34 +0800)]
Fix code block style for code preview (#30298) (#30306)

Backport #30298 by wxiaoguang

Fix #30292

To avoid unnecessary style overriding, use "div" instead of "code"

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix view commit link (#30297) (#30299)
wxiaoguang [Fri, 5 Apr 2024 21:38:26 +0000 (05:38 +0800)]
Fix view commit link (#30297) (#30299)

Backport #30297

7 months agoAdd gap to commit status details (#30284) (#30290)
Giteabot [Fri, 5 Apr 2024 14:44:03 +0000 (22:44 +0800)]
Add gap to commit status details (#30284) (#30290)

Backport #30284 by @silverwind

Co-authored-by: silverwind <me@silverwind.io>
7 months agoUpgrade `golang.org/x/net` to v0.24.0 (#30283) (#30286)
Giteabot [Fri, 5 Apr 2024 03:31:04 +0000 (11:31 +0800)]
Upgrade `golang.org/x/net` to v0.24.0 (#30283) (#30286)

Backport #30283 by @silverwind

Result of `go get -u golang.org/x/net; make tidy`.

This is related to the following vulncheck warning:
```
There are 2 vulnerabilities in modules that you require that are
neither imported nor called. You may not need to take any action.
See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck for details.

Vulnerability #1: GO-2024-2687
    HTTP/2 CONTINUATION flood in net/http
  More info: https://pkg.go.dev/vuln/GO-2024-2687
  Module: golang.org/x/net
    Found in: golang.org/x/net@v0.22.0
    Fixed in: golang.org/x/net@v0.23.0

Vulnerability #2: GO-2022-0470
    No access control in github.com/blevesearch/bleve and bleve/v2
  More info: https://pkg.go.dev/vuln/GO-2022-0470
  Module: github.com/blevesearch/bleve/v2
    Found in: github.com/blevesearch/bleve/v2@v2.3.10
    Fixed in: N/A
```

Co-authored-by: silverwind <me@silverwind.io>
7 months agoCommit-Dropdown: Show Author of commit if available (#30272) (#30285)
Giteabot [Fri, 5 Apr 2024 02:00:20 +0000 (10:00 +0800)]
Commit-Dropdown: Show Author of commit if available (#30272) (#30285)

Backport #30272 by @sebastian-sauer

As in commits page we show the author of the commit in the commits
dropdown and not the committer.

Commits Page:
![Screenshot from 2024-04-03
22-34-41](https://github.com/go-gitea/gitea/assets/1135157/1c7c5c19-6d0a-4176-8a87-7bca6a0c6dc8)

and the same contents in our dropdown:

![image](https://github.com/go-gitea/gitea/assets/1135157/aa094af2-c369-47ac-9c27-ca208d1d03f0)

fixes #29588

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
7 months agoupdate mailer example config, remove deprecated HOST (#30267) (#30274)
Giteabot [Wed, 3 Apr 2024 23:18:43 +0000 (07:18 +0800)]
update mailer example config, remove deprecated HOST (#30267) (#30274)

7 months agoClose file in the Upload func (#30262) (#30270)
Giteabot [Wed, 3 Apr 2024 15:29:49 +0000 (23:29 +0800)]
Close file in the Upload func (#30262) (#30270)

Co-authored-by: guangwu <guoguangwu@magic-shield.com>
7 months agoFixes #27605: inline math blocks can't be preceeded/followed by alphanumerical charac...
Giteabot [Wed, 3 Apr 2024 06:17:02 +0000 (14:17 +0800)]
Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175) (#30251)

Backport #30175 by @jmlt2002

- Inline math blocks couldn't be preceeded or succeeded by
alphanumerical characters due to changes introduced in PR #21171.
Removed the condition that caused this (precedingCharacter condition)
and added a new exit condition of the for-loop that checks if a specific
'$' was escaped using '\' so that the math expression can be rendered as
intended.
- Additionally this PR fixes another bug where math blocks of the type
'$xyz$abc$' where the dollar sign was not escaped by the user, generated
an error (shown in the screenshots below)
- Altered the tests to accomodate for the changes

Former behaviour (from try.gitea.io):

![image](https://github.com/go-gitea/gitea/assets/114936010/8f0cbb21-321d-451c-b871-c67a8e1e9235)

Fixed behaviour (from my local build):

![image](https://github.com/go-gitea/gitea/assets/114936010/5c22687c-6f11-4407-b5e7-c14b838bc20d)

(Edit) Source code for the README.md file:
```
$x$ -$x$ $x$-

a$xa$ $xa$a 1$xb$ $xb$1

$a a$b b$

a$b $a a$b b$

$a a\$b b$
```

Signed-off-by: João Tiago <joao.leal.tintas@tecnico.ulisboa.pt>
Co-authored-by: João Tiago <114936010+jmlt2002@users.noreply.github.com>
7 months agoAdd -u git to docs when using docker exec with root installation (#29314) (#30259)
Giteabot [Wed, 3 Apr 2024 05:44:26 +0000 (13:44 +0800)]
Add -u git to docs when using docker exec with root installation (#29314) (#30259)

Backport #29314 by @scribblemaniac

This fixes a minor issue in the documentation for SSH Container
Passthrough for non-rootless installs. The non-rootless Dockerfile and
docker-compose do not set `USER`/`user` instructions so `docker exec`
will run as root by default. While running as root, gitea commands will
refuse to execute, breaking these approaches. For containers built with
the rootless instructions, `docker exec` will run as git by default so
this is not necessary in that case.

This issue was already discussed in #19065, but it does not appear this
part of the issue was ever added to the documentation.

Co-authored-by: scribblemaniac <scribblemaniac@users.noreply.github.com>
7 months agoShow 12 lines in markup code preview (#30255) (#30257)
Giteabot [Wed, 3 Apr 2024 03:51:34 +0000 (11:51 +0800)]
Show 12 lines in markup code preview (#30255) (#30257)

Backport #30255 by @silverwind

Show up to 12 lines instead of previous 5.

<img width="929" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/de68f200-b9e2-4a25-bd6e-c46849849620">

Co-authored-by: silverwind <me@silverwind.io>
7 months agoRefactor "dump" sub-command (#30240) (#30260)
Giteabot [Wed, 3 Apr 2024 02:47:06 +0000 (10:47 +0800)]
Refactor "dump" sub-command (#30240) (#30260)

Backport #30240 by wxiaoguang

Major changes:

* Move some functions like "addReader" / "isSubDir" /
"addRecursiveExclude" to a separate package, and add tests
* Clarify the filename&dump type logic and add tests
* Clarify the logger behavior and remove FIXME comments

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRender embedded code preview by permlink in markdown (#30234) (#30249)
Giteabot [Tue, 2 Apr 2024 18:20:16 +0000 (02:20 +0800)]
Render embedded code preview by permlink in markdown (#30234) (#30249)

Backport #30234 by wxiaoguang

The permlink in markdown will be rendered as a code preview block, like GitHub

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix missing 0 prefix of GPG key id (#30245) (#30248)
Giteabot [Tue, 2 Apr 2024 16:23:52 +0000 (00:23 +0800)]
Fix missing 0 prefix of GPG key id (#30245) (#30248)

Backport #30245 by @KN4CK3R

Fixes #30235

If the key id "front" byte has a single digit, `%X` is missing the 0
prefix.
38D1A3EADDBEA9C` instead of
`038D1A3EADDBEA9C`
When using the `IssuerFingerprint` slice `%X` is enough but I changed it
to `%016X` too to be consistent.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoFix spacing in issue navbar (#30238) (#30242)
Giteabot [Tue, 2 Apr 2024 12:15:50 +0000 (20:15 +0800)]
Fix spacing in issue navbar (#30238) (#30242)

Backport #30238 by @silverwind

Create a new `issue-navbar` class specifically for this bar, previous
class used in many places and I thought I had them all removed, but not
this one.

Fixes: https://github.com/go-gitea/gitea/issues/30226
Co-authored-by: silverwind <me@silverwind.io>
7 months agoRefactor dropzone (#30232) (#30233)
Giteabot [Mon, 1 Apr 2024 19:05:05 +0000 (03:05 +0800)]
Refactor dropzone (#30232) (#30233)

Backport #30232 by wxiaoguang

Simplify code and use `.files` elements

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove scheduled action tasks if the repo is archived (#30224) (#30230)
Giteabot [Mon, 1 Apr 2024 17:43:09 +0000 (01:43 +0800)]
Remove scheduled action tasks if the repo is archived (#30224) (#30230)

Backport #30224 by @Zettat123

Fix #30220

Co-authored-by: Zettat123 <zettat123@gmail.com>
7 months agoRefactor file view & render (#30227) (#30229)
Giteabot [Mon, 1 Apr 2024 13:39:36 +0000 (21:39 +0800)]
Refactor file view & render (#30227) (#30229)

Backport #30227 by wxiaoguang

The old code is inconsistent and fragile, and the UI isn't right.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoPrevent flash of dropdown menu on labels list (#30215) (#30216)
Giteabot [Mon, 1 Apr 2024 06:16:55 +0000 (14:16 +0800)]
Prevent flash of dropdown menu on labels list (#30215) (#30216)

Backport #30215 by @silverwind

On the labels list, This `left` class caused the dropdown content to
flash on page load until JS had hidden it. Remove it as I see no purpose
to it.

<img width="215" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9e1de97f-dd89-41e0-9229-5c4a786ba762">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRefactor DeleteInactiveUsers, fix bug and add tests (#30206) (#30222)
Giteabot [Mon, 1 Apr 2024 04:58:46 +0000 (12:58 +0800)]
Refactor DeleteInactiveUsers, fix bug and add tests (#30206) (#30222)

Backport #30206 by wxiaoguang

1. check `IsActive` before calling `IsLastAdminUser`.
2. Fix some comments and error messages.
3. Don't `return err` if "removing file" fails in `DeleteUser`.
4. Remove incorrect `DeleteInactiveEmailAddresses`. Active users could
also have inactive emails, and inactive emails do not support
"olderThan"
5. Add tests

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix home topic edit form layout (#30213)
wxiaoguang [Sun, 31 Mar 2024 13:19:12 +0000 (21:19 +0800)]
Fix home topic edit form layout (#30213)

The UI has been refactored by #30191 , so here are 2 choices:

1. Backport #30191
2. Apply this quick fix

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/0db583cf-8ce8-4fdb-9e4d-8c93fe6766c7)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/0e732c4c-d28d-4c04-b328-72b9efd7daa9)

</details>

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoFix markdown color code detection (#30208) (#30211)
Giteabot [Sun, 31 Mar 2024 12:25:15 +0000 (20:25 +0800)]
Fix markdown color code detection (#30208) (#30211)

Backport #30208 by wxiaoguang

When reviewing PRs, some color names might be mentioned, the
`transformCodeSpan` (which calls `css.ColorHandler`) considered it as a
valid color, but actually it shouldn't be rendered as a color codespan.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove `modifies/frontend` from labeler (#30198) (#30212)
Giteabot [Sun, 31 Mar 2024 11:37:01 +0000 (19:37 +0800)]
Remove `modifies/frontend` from labeler (#30198) (#30212)

Backport #30198 by @silverwind

Remove this label, I find it barely useful and we already have more
useful labels like `modifies/js`. Backport so that we can eventually
delete that label.

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix GPG subkey verify (#30193) (#30203)
Giteabot [Sun, 31 Mar 2024 06:48:33 +0000 (14:48 +0800)]
Fix GPG subkey verify (#30193) (#30203)

Backport #30193 by @KN4CK3R

Fixes #30189

Can't verify subkeys if they are not loaded.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoDo not allow different storage configurations to point to the same directory (#30169...
Giteabot [Sun, 31 Mar 2024 03:29:51 +0000 (11:29 +0800)]
Do not allow different storage configurations to point to the same directory (#30169) (#30204)

Backport #30169 by wxiaoguang

Replace #29171

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix unclickable checkboxes (#30195) (#30199)
Giteabot [Sun, 31 Mar 2024 00:05:52 +0000 (08:05 +0800)]
Fix unclickable checkboxes (#30195) (#30199)

Backport #30195 by @silverwind

Fix https://github.com/go-gitea/gitea/issues/30185, regression from
https://github.com/go-gitea/gitea/pull/30162.

The checkboxes were unclickable because the label was positioned over
the checkbox with `padding`. Now it uses `margin` so the checkbox itself
will be clickable in all cases.

Secondly, I changed the for/id linking to also add missing `for`
attributes when `id` is present. The other way around (only `for`
present) is currently not handled and I think there are likey no
occurences in the code and introducing new non-generated `id`s might
cause problems elsewhere if we do, so I skipped on that.

Co-authored-by: silverwind <me@silverwind.io>
7 months agoInclude encoding in signature payload (#30174) (#30182)
Giteabot [Fri, 29 Mar 2024 23:03:11 +0000 (07:03 +0800)]
Include encoding in signature payload (#30174) (#30182)

Backport #30174 by @KN4CK3R

Fixes #30119

Include the encoding in the signature payload.

before

![grafik](https://github.com/go-gitea/gitea/assets/1666336/01ab94a3-8af5-4d6f-be73-a10b65a15421)

after

![grafik](https://github.com/go-gitea/gitea/assets/1666336/3a37d438-c70d-4d69-b178-d170e74aa683)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoRemove fomantic checkbox module (#30162) (#30168)
Giteabot [Fri, 29 Mar 2024 17:44:22 +0000 (01:44 +0800)]
Remove fomantic checkbox module (#30162) (#30168)

Backport #30162 by @silverwind

CSS is pretty slim already and the `.ui.toggle.checkbox` sliders on
admin page also still work. The only necessary JS is the one that links
`input` and `label` so that it can be toggled via label. All checkboxes
except the markdown ones render at `--checkbox-size: 16px` now.

<img width="174" alt="Screenshot 2024-03-28 at 22 15 10"
src="https://github.com/go-gitea/gitea/assets/115237/3455c1bb-166b-47e4-9847-2d20dd1f04db">

<img width="499" alt="Screenshot 2024-03-28 at 21 00 07"
src="https://github.com/go-gitea/gitea/assets/115237/412be2b3-d5a0-478a-b17b-43e6bc12e8ce">

<img width="83" alt="Screenshot 2024-03-28 at 22 14 34"
src="https://github.com/go-gitea/gitea/assets/115237/d8c89838-a420-4723-8c49-89405bb39474">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
7 months agoFix:the rounded corners of the folded file are not displayed correctly (#29953) ...
Giteabot [Fri, 29 Mar 2024 17:16:40 +0000 (01:16 +0800)]
Fix:the rounded corners of the folded file are not displayed correctly (#29953) (#30177)

Backport #29953 by @HEREYUA

Fix:    [#29933](https://github.com/go-gitea/gitea/issues/29933)

**Before**

![image](https://github.com/go-gitea/gitea/assets/37935145/71ec80f6-5896-4e4a-b686-4d792c11ebe2)

**After**

![image](https://github.com/go-gitea/gitea/assets/37935145/81348a61-946a-4562-881d-8d873e50228f)

Co-authored-by: HEREYUA <37935145+HEREYUA@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoRefactor topic Find functions and add more tests for pagination (#30127) (#30167)
Giteabot [Fri, 29 Mar 2024 17:09:40 +0000 (01:09 +0800)]
Refactor topic Find functions and add more tests for pagination (#30127) (#30167)

Backport #30127 by @lunny

This also fixed #22238

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>