]> source.dussan.org Git - gitea.git/log
gitea.git
13 months agoFix panic in storageHandler (#27446) (#27479) v1.21.0-rc1
Giteabot [Fri, 6 Oct 2023 14:51:26 +0000 (22:51 +0800)]
Fix panic in storageHandler (#27446) (#27479)

Backport #27446 by @sryze

storageHandler() is written as a middleware but is used as an endpoint
handler, and thus `next` is actually `nil`, which causes a null pointer
dereference when a request URL does not match the pattern (where it
calls `next.ServerHTTP()`).

Example CURL command to trigger the panic:

```
curl -I "http://yourhost/gitea//avatars/a"
```

Fixes #27409

---

Note: the diff looks big but it's actually a small change - all I did
was to remove the outer closure (and one level of indentation) ~and
removed the HTTP method and pattern checks as they seem redundant
because go-chi already does those checks~. You might want to check "Hide
whitespace" when reviewing it.

Alternative solution (a bit simpler): append `, misc.DummyOK` to the
route declarations that utilize `storageHandler()` - this makes it
return an empty response when the URL is invalid. I've tested this one
and it works too. Or maybe it would be better to return a 400 error in
that case (?)

Co-authored-by: Sergey Zolotarev <sryze@outlook.com>
13 months agoRevert #27426 (#27474)
delvh [Fri, 6 Oct 2023 12:47:45 +0000 (14:47 +0200)]
Revert #27426 (#27474)

Apparently, we didn't backport one of the refactoring PRs which caused
the fixup we backported to fail.

Fixes: https://github.com/go-gitea/gitea/issues/27473
13 months agoDon't let API add 2 exclusive labels from same scope (#27433) (#27460)
Giteabot [Thu, 5 Oct 2023 21:06:31 +0000 (05:06 +0800)]
Don't let API add 2 exclusive labels from same scope (#27433) (#27460)

Backport #27433 by @JakobDev

Fixes #27380

Co-authored-by: JakobDev <jakobdev@gmx.de>
13 months agoRefactor system setting (#27000) (#27452)
Giteabot [Thu, 5 Oct 2023 10:37:59 +0000 (18:37 +0800)]
Refactor system setting (#27000) (#27452)

Backport #27000 by @wxiaoguang

This PR reduces the complexity of the system setting system.

It only needs one line to introduce a new option, and the option can be
used anywhere out-of-box.

It is still high-performant (and more performant) because the config
values are cached in the config system.

![image](https://github.com/go-gitea/gitea/assets/2114189/f8cdd743-1145-41ab-9f8f-3996aa97d440)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoWhen comparing with an non-exist repository, return 404 but 500 (#27437) (#27442)
Giteabot [Wed, 4 Oct 2023 14:41:57 +0000 (22:41 +0800)]
When comparing with an non-exist repository, return 404 but 500 (#27437) (#27442)

Backport #27437 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoFix pr template (#27436) (#27440)
Giteabot [Wed, 4 Oct 2023 12:56:02 +0000 (20:56 +0800)]
Fix pr template (#27436) (#27440)

Backport #27436 by @lunny

Fix #27431

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoFix missing `ctx` in new_form.tmpl (#27434) (#27438)
Giteabot [Wed, 4 Oct 2023 12:12:06 +0000 (20:12 +0800)]
Fix  missing `ctx`  in new_form.tmpl  (#27434) (#27438)

Backport #27434 by @CaiCandong

Fix  #27432
Regression of #27265

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
13 months agoFix yet another `ctx` template bug (#27417) (#27426)
Giteabot [Wed, 4 Oct 2023 07:52:57 +0000 (15:52 +0800)]
Fix yet another `ctx` template bug (#27417) (#27426)

Backport #27417 by @delvh

Fixes #27416

Co-authored-by: delvh <dev.lh@web.de>
13 months agoUse flex-container for repo and org settings (#27418) (#27430)
Giteabot [Wed, 4 Oct 2023 07:20:43 +0000 (15:20 +0800)]
Use flex-container for repo and org settings (#27418) (#27430)

Backport #27418 by @silverwind

Same as https://github.com/go-gitea/gitea/pull/26046 but for repo and
org settings pages, reducing the margins between the boxes:

<img width="1247" alt="Screenshot 2023-10-03 at 23 25 19"
src="https://github.com/go-gitea/gitea/assets/115237/4e68ad5e-5fdc-4466-aefb-ec71bf411d45">
<img width="1255" alt="Screenshot 2023-10-03 at 23 27 12"
src="https://github.com/go-gitea/gitea/assets/115237/9068369b-a75d-401e-8b8d-3bd4bbe097dc">

Co-authored-by: silverwind <me@silverwind.io>
13 months agoAdd Index to `action.user_id` (#27403) (#27425)
Giteabot [Wed, 4 Oct 2023 06:53:00 +0000 (14:53 +0800)]
Add Index to `action.user_id` (#27403) (#27425)

Backport #27403 by @JakobDev

Another Column that needs a Index. Found at
https://codeberg.org/forgejo/discussions/issues/61#issuecomment-1258744.

Co-authored-by: JakobDev <jakobdev@gmx.de>
13 months agoAdd 1.20.5 changelog (#27404) (#27412)
Lunny Xiao [Tue, 3 Oct 2023 14:21:19 +0000 (22:21 +0800)]
Add 1.20.5 changelog (#27404) (#27412)

frontend #27404

13 months agoDon't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408)
Giteabot [Tue, 3 Oct 2023 09:59:45 +0000 (17:59 +0800)]
Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408)

Backport #27332 by @JakobDev

Part of https://codeberg.org/forgejo/discussions/issues/61

This is workaround for a bug in MariaDB

Co-authored-by: JakobDev <jakobdev@gmx.de>
13 months agoAdd support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)
Giteabot [Tue, 3 Oct 2023 08:13:49 +0000 (16:13 +0800)]
Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)

Backport #27384 by @rbhz

Add support for HEAD in paths:
```
/src/branch/HEAD/README.md
/src/commit/HEAD/README.md
```

Closes #26920

Co-authored-by: Kirill Sorokin <48334247+rbhz@users.noreply.github.com>
13 months agoMake Actions tasks/jobs timeouts configurable by the user (#27400) (#27402)
Giteabot [Tue, 3 Oct 2023 02:26:35 +0000 (10:26 +0800)]
Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402)

Backport #27400 by @fantognazza

With this PR we added the possibility to configure the Actions timeouts
values for killing tasks/jobs.
Particularly this enhancement is closely related to the `act_runner`
configuration reported below:
```
# The timeout for a job to be finished.
# Please note that the Gitea instance also has a timeout (3h by default) for the job.
# So the job could be stopped by the Gitea instance if it's timeout is shorter than this.
timeout: 3h
```

---

Setting the corresponding key in the INI configuration file, it is
possible to let jobs run for more than 3 hours.

Signed-off-by: Francesco Antognazza <francesco.antognazza@gmail.com>
13 months agoFix git 2.11 error when checking IsEmpty (#27393) (#27397)
Giteabot [Mon, 2 Oct 2023 20:36:18 +0000 (04:36 +0800)]
Fix git 2.11 error when checking IsEmpty (#27393) (#27397)

Backport #27393 by @wxiaoguang

Fix #27389

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoHide archived labels when filtering by labels on the issue list (#27115) (#27381)
Giteabot [Mon, 2 Oct 2023 02:56:48 +0000 (10:56 +0800)]
Hide archived labels when filtering by labels on the issue list (#27115) (#27381)

Backport #27115 by @puni9869

Followup  https://github.com/go-gitea/gitea/pull/26820
## Archived labels UI for issue filter and issue filter actions for
issues/pull request pages.

Changed:
* Enhanced the Issue filter and Issue filter actions UI page to
seamlessly incorporate a list of archived labels.
* Pagination functionality is same as before. If archived label checkbox
is checked then we are adding a query string`archived=true` in the url
to save the state of page.
* Issue filter actions menu is separated into different template.
* Adding the archived flag in issue url labels.
* Pull Request page is also work the same.

Outsourced:
* Defer the implementation of specialized handling for archived labels
to upcoming pull requests. This step will be undertaken subsequent to
the successful merge of this pull request.

Screenshots
### Issue page
<img width="1360" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/d7efb2ef-5b2b-449d-83f0-d430a32ec432">

### Issue page with label filter on archived label checkbox when not
checked --> No archived label is there in list
<img width="1249" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/ceea68ef-91f2-4693-910f-2e25e236bfc9">

### Issue page with label filter on archived label checkbox when checked
--> Show archived label in the list.
<img width="710" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2414d26b-2079-4c3c-bd9e-f2f5411bcabf">

### Issue page with label filter on issue action menu on archived label
checkbox when checked --> Show archived label in the list.
<img width="409" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/259cac87-3e21-4778-99a2-a6a0b8c81178">

### Applied the archived=true in Issue labels when archived checkbox is
checked.
<img width="984" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/657ce3db-c0ae-402e-b12d-3b580d3c2ed0">

---

Part of https://github.com/go-gitea/gitea/issues/25237

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
Co-authored-by: delvh <dev.lh@web.de>
13 months agoAllow get release download files and lfs files with oauth2 token format (#26430)...
Giteabot [Sun, 1 Oct 2023 11:54:11 +0000 (19:54 +0800)]
Allow get release download files and lfs files with oauth2 token format (#26430) (#27379)

Backport #26430 by @lunny

Fix #26165
Fix #25257

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agohighlight user details link (#26998) (#27376)
Giteabot [Sun, 1 Oct 2023 10:23:42 +0000 (18:23 +0800)]
highlight user details link (#26998) (#27376)

Backport #26998 by @denyskon

This PR adds a separated column in the users table for operations. The
username link now redirects back to user page.

![grafik](https://github.com/go-gitea/gitea/assets/47871822/df8c8b30-3da6-443c-ae0f-6e3cac7dd9bb)

Resolves
https://github.com/go-gitea/gitea/pull/26713#pullrequestreview-1603001285

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: silverwind <me@silverwind.io>
13 months agoFix missing ctx for GetRepoLink in dashboard (#27372) (#27375)
Giteabot [Sun, 1 Oct 2023 09:54:58 +0000 (17:54 +0800)]
Fix missing ctx for GetRepoLink in dashboard (#27372) (#27375)

Backport #27372 by @CaiCandong

As title
Fix #27369
Regression of #27265

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
13 months agoIntroduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365)
Giteabot [Sat, 30 Sep 2023 15:58:35 +0000 (23:58 +0800)]
Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365)

Backport #26803 by @n0toose

This change introduces some fixes for my original PR
(https://github.com/go-gitea/gitea/pull/26214) and introduces some
additional tests so that such a regression does not happen again in the
future.

Co-authored-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
13 months agoAbsolute positioned checkboxes overlay floated elements (#26870) (#27366)
Giteabot [Sat, 30 Sep 2023 15:10:48 +0000 (23:10 +0800)]
Absolute positioned checkboxes  overlay floated elements (#26870) (#27366)

Backport #26870 by @rafh

Currently, checkboxes are positioned as absolute. This positioning
causes the input to overlay an element that has been floated within the
editor. Floated elements are useful if you want your text to wrap around
this element. This PR fixes the overlaying of checkboxes by removing the
absolute positioning, updating the `ul` padding, and
displaying`.task-list-item` `flex` to ensure inputs and the associated
label are on the same line.

Screenshots:

Before:
<img width="762" alt="Screenshot 2023-09-01 at 3 40 59 PM"
src="https://github.com/go-gitea/gitea/assets/6152817/570247c7-7f5c-4697-bfc9-ad4655e37991">

After:
<img width="762" alt="Screenshot 2023-09-01 at 3 42 20 PM"
src="https://github.com/go-gitea/gitea/assets/6152817/db53df45-1294-4eee-84c0-b21ac4fdf805">

Co-authored-by: Rafael Heard <rafael.heard@gmail.com>
Co-authored-by: rafh <rafaelheard@gmail.com>
13 months agoFix template bug (#27362) (#27364)
Giteabot [Sat, 30 Sep 2023 09:30:30 +0000 (17:30 +0800)]
Fix template bug (#27362) (#27364)

Backport #27362 by @lunny

Fix #27361

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoFix repo count in org action settings (#27245) (#27353)
Giteabot [Fri, 29 Sep 2023 18:00:24 +0000 (02:00 +0800)]
Fix repo count in org action settings (#27245) (#27353)

Backport #27245 by @yp05327

Only in org action settings, repo count is missing

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/4a74c090-c55f-4f06-810a-c390337efa9d)

![image](https://github.com/go-gitea/gitea/assets/18380374/e234f7e7-178c-4186-bbc0-0f291192b011)

![image](https://github.com/go-gitea/gitea/assets/18380374/c1db70cd-973b-40d5-ba17-1f354aed9149)
In other setting page:

![image](https://github.com/go-gitea/gitea/assets/18380374/43bfec6b-a1a4-48a9-8280-ab6f967b7ec4)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/9a697bd8-ce9f-40e2-8749-b46726d68d84)

![image](https://github.com/go-gitea/gitea/assets/18380374/3b6d1e59-64dd-4655-953b-064718e6aa7a)

![image](https://github.com/go-gitea/gitea/assets/18380374/5604c063-556c-4252-8778-4e5a5e23b7e1)

Co-authored-by: yp05327 <576951401@qq.com>
13 months agoAdd protected branch name description (#27257) (#27351)
Giteabot [Fri, 29 Sep 2023 14:38:11 +0000 (22:38 +0800)]
Add protected branch name description (#27257) (#27351)

Backport #27257 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
13 months agoMore `db.DefaultContext` refactor (#27265) (#27347)
Giteabot [Fri, 29 Sep 2023 13:35:01 +0000 (21:35 +0800)]
More `db.DefaultContext` refactor (#27265) (#27347)

Backport #27265 by @JakobDev

Part of #27065

This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.

Co-authored-by: JakobDev <jakobdev@gmx.de>
13 months agoImprove tree not found page (#26570) (#27346)
Giteabot [Fri, 29 Sep 2023 10:35:11 +0000 (18:35 +0800)]
Improve tree not found page (#26570) (#27346)

Backport #26570 by @yp05327

Before:

![before](https://github.com/go-gitea/gitea/assets/18380374/383822d5-7d77-4ec3-b49b-4ab1e8b167ce)

After:

![after](https://github.com/go-gitea/gitea/assets/18380374/32afa0a3-fa05-4087-b96e-7d067f0ed756)

In Github:
https://github.com/yp05327/test/blob/main/test.drawio

Updated:
UI changed

![image](https://github.com/go-gitea/gitea/assets/18380374/41ed07ff-b815-4b4e-9779-5ab36b5f3980)

![image](https://github.com/go-gitea/gitea/assets/18380374/5d7b28d6-a2fc-4d4c-8d6d-d93f9c9a270b)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoAdd logs for data broken of comment review (#27326) (#27345)
Giteabot [Fri, 29 Sep 2023 05:31:13 +0000 (13:31 +0800)]
Add logs for data broken of comment review (#27326) (#27345)

Backport #27326 by @lunny

Fix #27306

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoAdd Index to `comment.dependent_issue_id` (#27325) (#27340)
Giteabot [Fri, 29 Sep 2023 02:00:14 +0000 (10:00 +0800)]
Add Index to `comment.dependent_issue_id` (#27325) (#27340)

Backport #27325 by @JakobDev

This Column is missing index. It is used by
[issue_service.deleteIssue](https://github.com/go-gitea/gitea/blob/7ea2a910cebaf51cfd13c0941029c404e408ae54/services/issue/issue.go#L300).

Co-authored-by: JakobDev <jakobdev@gmx.de>
13 months agoFix the approval count of PR when there is no protection branch rule (#27272) (#27343)
Giteabot [Fri, 29 Sep 2023 01:31:35 +0000 (09:31 +0800)]
Fix the approval count of PR when there is no protection branch rule (#27272) (#27343)

Backport #27272 by @lng2020

As title

![ksnip_20230926-115158](https://github.com/go-gitea/gitea/assets/70063547/a60be44a-06ad-421e-ba27-e4e0adfa5db7)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
13 months agoFix review UI (#27322) (#27331)
Giteabot [Thu, 28 Sep 2023 13:27:13 +0000 (21:27 +0800)]
Fix review UI (#27322) (#27331)

Backport #27322 by @wxiaoguang

Close #26730

1. The `diff-detail-box` was abused, it shouldn't be used for
"DiffFileList/DiffFileTree".
2. Fix the sticky position for various screens.

![image](https://github.com/go-gitea/gitea/assets/2114189/558a5c06-c94c-4e5c-8395-d38473dd21c2)

![image](https://github.com/go-gitea/gitea/assets/2114189/3390fb0e-7dc7-457f-bd0c-398fdb6d24c0)

![image](https://github.com/go-gitea/gitea/assets/2114189/d19dd350-aecf-4909-8ef9-73b09d94560e)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoFix Bug in Issue Config when only contact links are set (#26521) (#27334)
Giteabot [Thu, 28 Sep 2023 12:55:45 +0000 (20:55 +0800)]
Fix Bug in Issue Config when only contact links are set (#26521) (#27334)

Backport #26521 by @JakobDev

Blank Issues should be enabled if they are not explicit disabled through
the `blank_issues_enabled` field of the Issue Config. The Implementation
has currently a Bug: If you create a Issue Config file with only
`contact_links` and without a `blank_issues_enabled` field,
`blank_issues_enabled` is set to false by default.

The fix is only one line, but I decided to also improve the tests to
make sure there are no other problems with the Implementation.

This is a bugfix, so it should be backported to 1.20.

Co-authored-by: JakobDev <jakobdev@gmx.de>
13 months agoFix divider in subscription page (#27298) (#27301)
Giteabot [Thu, 28 Sep 2023 10:37:33 +0000 (18:37 +0800)]
Fix divider in subscription page (#27298) (#27301)

Backport #27298 by @yp05327

divider should always display in subscription page.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/5a5c948c-8e45-4faa-827e-a05356f3a714)

![image](https://github.com/go-gitea/gitea/assets/18380374/8f6a6747-5414-45cc-8b4c-aa99ea869038)

After:
(no changes when there's no subscriptions)

![image](https://github.com/go-gitea/gitea/assets/18380374/261faf8d-97e2-4d79-a255-5077a42979d2)

![image](https://github.com/go-gitea/gitea/assets/18380374/fc73c837-2efb-40b2-a8f8-2b5c77c32f3b)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
13 months agoImprove issue history dialog and make poster can delete their own history (#27323...
Giteabot [Thu, 28 Sep 2023 09:46:46 +0000 (17:46 +0800)]
Improve issue history dialog and make poster can delete their own history (#27323) (#27327)

Backport #27323 by @wxiaoguang

Fix #27313 (see the comment)

And some UI improvements:

### Before

![image](https://github.com/go-gitea/gitea/assets/2114189/420a314d-8f34-4e30-a557-f41cf4f0d2f2)

![image](https://github.com/go-gitea/gitea/assets/2114189/60ca0be4-b55e-4e65-be73-fd53e0d4fc36)

### After

![image](https://github.com/go-gitea/gitea/assets/2114189/d354f815-5a0c-4e63-8d59-d03ed344dbea)

![image](https://github.com/go-gitea/gitea/assets/2114189/6ef437a4-aa6f-4917-a260-00625ee71e79)

![image](https://github.com/go-gitea/gitea/assets/2114189/9d88a36c-616b-4dc9-8c6b-76adaad8acf6)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoImprove branch list UI (#27319) (#27324)
Giteabot [Thu, 28 Sep 2023 06:14:34 +0000 (14:14 +0800)]
Improve branch list UI (#27319) (#27324)

Backport #27319 by @wxiaoguang

1. Put the `"octicon-shield-lock"` into the flex container, then it
doesn't need a separate flex box
2. Remove some unnecessary `gt-df` helpers
3. Make `btn` button has the same flex behavior as `ui button`

![image](https://github.com/go-gitea/gitea/assets/2114189/60ce75f7-7fac-4157-9c42-91c7dee9300e)

![image](https://github.com/go-gitea/gitea/assets/2114189/ea606baf-6f52-41e1-b964-c4840d3b1529)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoRedefine the meaning of column is_active to make Actions Registration Token generatio...
Giteabot [Thu, 28 Sep 2023 04:15:53 +0000 (12:15 +0800)]
Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143) (#27304)

Backport #27143 by @lunny

Partially Fix #25041

This PR redefined the meaning of column `is_active` in table
`action_runner_token`.
Before this PR, `is_active` means whether it has been used by any
runner. If it's true, other runner cannot use it to register again.

In this PR, `is_active` means whether it's validated to be used to
register runner. And if it's true, then it can be used to register
runners until it become false. When creating a new `is_active` register
token, any previous tokens will be set `is_active` to false.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agofix orphan check for deleted branch (#27310) (#27321)
Giteabot [Thu, 28 Sep 2023 02:52:53 +0000 (10:52 +0800)]
fix orphan check for deleted branch (#27310) (#27321)

Backport #27310 by @earl-warren

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

(cherry picked from commit c1d888686fe445e4edecb9d835c5b3893b574b75)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
13 months agoFix protected branch icon location (#26576) (#27317)
Giteabot [Wed, 27 Sep 2023 22:51:01 +0000 (06:51 +0800)]
Fix protected branch icon location (#26576) (#27317)

Backport #26576 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/717c726d-d3ae-4ea3-86bf-36fd8430f1ba)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/f4508428-380a-4b44-9cc2-fa9483971808)

Co-authored-by: yp05327 <576951401@qq.com>
13 months agoUse vitest globals (#27102) (#27311)
Giteabot [Wed, 27 Sep 2023 14:10:08 +0000 (22:10 +0800)]
Use vitest globals (#27102) (#27311)

Backport #27102 by @silverwind

Enable [globals](https://vitest.dev/config/#globals) in vitest, reducing
the noise in test files.

Co-authored-by: silverwind <me@silverwind.io>
13 months agobump bleve (#27300) (#27305)
Giteabot [Wed, 27 Sep 2023 07:47:30 +0000 (15:47 +0800)]
bump bleve (#27300) (#27305)

Backport #27300 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoFix yaml test (#27297) (#27303)
Giteabot [Wed, 27 Sep 2023 07:05:35 +0000 (15:05 +0800)]
Fix yaml test (#27297) (#27303)

Backport #27297 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoEnable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295)
Giteabot [Wed, 27 Sep 2023 02:26:28 +0000 (10:26 +0800)]
Enable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295)

Backport #27291 by @silverwind

Previously, the production build never output sourcemaps. Now we emit
one file for `index.js` because it is the most likely one where we need
to be able to better debug reported issues like
https://github.com/go-gitea/gitea/issues/27213. This will currently
increase the binary size of gitea by around 700kB which is what the
gzipped source map file has.

Also, I fixed the CSS sourcemap generation which was broken since the
introduction of lightningcss.

The chinese docs are machine-translated, please correct accordingly.

Co-authored-by: silverwind <me@silverwind.io>
13 months agoFix some animation bugs (#27287) (#27294)
Giteabot [Wed, 27 Sep 2023 01:24:25 +0000 (09:24 +0800)]
Fix some animation bugs (#27287) (#27294)

Backport #27287

Fix #27286
Replace #27279

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoAdd missed return to actions view fetch (#27289) (#27293)
Giteabot [Wed, 27 Sep 2023 01:10:21 +0000 (09:10 +0800)]
Add missed return to actions view fetch (#27289) (#27293)

Backport #27289 by @silverwind

Should fix: https://github.com/go-gitea/gitea/issues/27213

@denyskon can you test this? I can not reproduce this error locally.

Co-authored-by: silverwind <me@silverwind.io>
13 months agoFix more yaml lint errors (#27284) (#27288)
Giteabot [Tue, 26 Sep 2023 17:00:12 +0000 (01:00 +0800)]
Fix more yaml lint errors (#27284) (#27288)

Backport #27284 by @lunny

Fix #27268

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoAdd missing IconHTML size (#27269) (#27283)
Giteabot [Tue, 26 Sep 2023 15:10:41 +0000 (23:10 +0800)]
Add missing IconHTML size (#27269) (#27283)

Backport #27269 by @wxiaoguang

Fix #27223

Regression of #27122

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoFix incorrect change from #27231 (#27275) (#27282)
Giteabot [Tue, 26 Sep 2023 13:39:39 +0000 (21:39 +0800)]
Fix incorrect change from #27231 (#27275) (#27282)

Backport #27275 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
13 months agoAnother round of `db.DefaultContext` refactor (#27103) (#27262)
Giteabot [Mon, 25 Sep 2023 17:24:35 +0000 (01:24 +0800)]
Another round of `db.DefaultContext` refactor (#27103) (#27262)

Backport #27103 by @JakobDev

Part of #27065

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
13 months agoBackport ctx locale refactoring manually (#27231) (#27259) (#27260)
wxiaoguang [Mon, 25 Sep 2023 13:15:51 +0000 (21:15 +0800)]
Backport ctx locale refactoring manually (#27231) (#27259) (#27260)

Backport #27231 #27259 manually

---------

Co-authored-by: delvh <dev.lh@web.de>
13 months agoDisable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211...
Giteabot [Mon, 25 Sep 2023 10:21:06 +0000 (18:21 +0800)]
Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211) (#27253)

Backport #27211 by @yardenshoham

These buttons are now disabled when the webhook is not active.

The buttons were always enabled before this change.

- Fixes #26824
- Replaces #26814

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/e783d0d8-b433-440e-b95f-50d7c42613d3)

![image](https://github.com/go-gitea/gitea/assets/20454870/b4886151-9f32-4e83-8001-dd3f20c23d70)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/74b76a72-0818-4143-8548-5d42c4119a05)

![image](https://github.com/go-gitea/gitea/assets/20454870/d5ae4e5c-c1ac-4751-a072-e6f7511b1e07)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
13 months agoFix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251)
Giteabot [Mon, 25 Sep 2023 08:24:50 +0000 (16:24 +0800)]
Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251)

Backport #27203 by @Nabapadma-sarker

Fixes #27202

Co-authored-by: Nabapadma-sarker <nabapadmacse1991@gmail.com>
13 months agoUse mask-based fade-out effect for `.new-menu` (#27181) (#27243)
Giteabot [Mon, 25 Sep 2023 07:52:41 +0000 (15:52 +0800)]
Use mask-based fade-out effect for `.new-menu` (#27181) (#27243)

Backport #27181 by @silverwind

The `.new-menu` was using a pseudo-element based fade-out effect.
Replace this with a more modern mask-based effect which in this case
required a child element to avoid fading out the background as well, so
I applied it to child `new-menu-inner` which was present on all these
menus except explore where I added it.

There is no visual difference except that the items on the explore page
have no `gap` between them any longer, making it consistent with other
menus. Before and after:

<img width="221" alt="Screenshot 2023-09-21 at 21 13 19"
src="https://github.com/go-gitea/gitea/assets/115237/b4a38ce2-cee1-4c54-84a5-e1d0bfd79e29">
<img width="222" alt="Screenshot 2023-09-21 at 21 32 36"
src="https://github.com/go-gitea/gitea/assets/115237/bb6b1335-d935-4ad4-bb85-3b0fc3027c2b">

Also, this cleans up the related CSS vars:

- `--color-header-wrapper-transparent` is removed, no longer needed
- `--color-header-wrapper` is defined in base theme as well, was
previously unset and therefor transparent.

[no whitespace
diff](https://github.com/go-gitea/gitea/pull/27181/files?diff=unified&w=1)
[demo of mask fade](https://jsfiddle.net/silverwind/tsfadb3u/)

Co-authored-by: silverwind <me@silverwind.io>
13 months agoAdd missing public user visibility in user details page (#27246) (#27250)
Giteabot [Mon, 25 Sep 2023 07:03:22 +0000 (15:03 +0800)]
Add missing public user visibility in user details page (#27246) (#27250)

Backport #27246 by @yp05327

It seems that `Public` user visibility is missing in the template.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/a8e7f3e0-1b77-41a0-921a-10adba90211e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/b0bffe13-0ca6-453e-95d7-0794528d5733)

Co-authored-by: yp05327 <576951401@qq.com>
13 months agocleanup locale function usage (#27227) (#27240)
Giteabot [Mon, 25 Sep 2023 00:21:38 +0000 (08:21 +0800)]
cleanup locale function usage (#27227) (#27240)

Backport #27227 by @denyskon

Throughout the Gitea codebase, you can meet some weird constructions to
make `locale.Tr` work in subtemplates.
Since we now have `ctx.Locale.Tr` which solves that problem, clean up
various templates which pass `locale` through `dict` or use some weird
constructions like `$.root.locale`

Going on, it would be great to replace every case of `$.locale.Tr` and
`.locale.Tr` with `ctx.Locale.Tr`, but that needs to be done with
patience.

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
13 months agoFix z-index on markdown completion (#27237) (#27239)
Giteabot [Sun, 24 Sep 2023 23:41:37 +0000 (07:41 +0800)]
Fix z-index on markdown completion (#27237) (#27239)

Backport #27237 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/27230
Co-authored-by: silverwind <me@silverwind.io>
13 months agoFix EOL handling in web editor (#27141) (#27234)
Giteabot [Sun, 24 Sep 2023 22:10:38 +0000 (06:10 +0800)]
Fix EOL handling in web editor (#27141) (#27234)

Backport #27141 by @silverwind

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

This does the following for Monaco's EOL setting:

1. Use editorconfig setting if present
2. Use the file's dominant line ending as detected by monaco, which uses
LF for empty file

Co-authored-by: silverwind <me@silverwind.io>
13 months agoUpdate database-preparation and add note re: MariaDB (#27232) (#27236)
Giteabot [Sun, 24 Sep 2023 21:27:25 +0000 (05:27 +0800)]
Update database-preparation and add note re: MariaDB (#27232) (#27236)

Backport #27232 by @techknowlogick

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

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
13 months agoAllow copying issue comment link on archived repos and when not logged in (#27193...
Giteabot [Sun, 24 Sep 2023 19:25:09 +0000 (03:25 +0800)]
Allow copying issue comment link on archived repos and when not logged in (#27193) (#27210)

Backport #27193 by @JakobDev

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

Co-authored-by: JakobDev <jakobdev@gmx.de>
13 months agofix issues on action runners page (#27226) (#27233)
Giteabot [Sun, 24 Sep 2023 18:43:12 +0000 (02:43 +0800)]
fix issues on action runners page (#27226) (#27233)

Backport #27226 by @denyskon

- switch from some weird status badge to label
- translate untranslated `Reset registration token` string
- change documentation link from act_runner README to Gitea Docs site
- fix "No runners available" message width
- use `ctx.Locale.Tr` where possible

![grafik](https://github.com/go-gitea/gitea/assets/47871822/65547228-f9ed-4f80-9cfd-df5e55513a44)

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
14 months agoFix Fomantic UI dropdown icon bug when there is a search input in menu (#27225) ...
Giteabot [Sun, 24 Sep 2023 13:42:00 +0000 (21:42 +0800)]
Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225) (#27228)

Backport #27225 by @wxiaoguang

Fix #27224

And add the case to the devtest page.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoQuote table `release` in sql queries (#27205) (#27218)
Giteabot [Sat, 23 Sep 2023 21:15:05 +0000 (05:15 +0800)]
Quote table `release` in sql queries (#27205) (#27218)

Backport #27205 by @KN4CK3R

Fixes #27174

`release` is a reserved keyword in MySql. I can't reproduce the issue on
my setup and we have a test for that code but it seems there can be
setups where it fails.

https://github.com/go-gitea/gitea/blob/a101dbaa7952e359843c6d8303ca24a0e63c865c/tests/integration/repo_activity_test.go#L45-L46

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
14 months agoUpdate go-enry to 2.8.5 (#27215) (#27217)
Giteabot [Sat, 23 Sep 2023 20:05:59 +0000 (04:05 +0800)]
Update go-enry to 2.8.5 (#27215) (#27217)

14 months agoUpdate nodejs installation method in release container (#27207) (#27212)
Giteabot [Sat, 23 Sep 2023 13:25:34 +0000 (21:25 +0800)]
Update nodejs installation method in release container (#27207) (#27212)

Backport #27207 by @silverwind

Nodesource has
[deprecated](https://github.com/nodesource/distributions#new-update-%EF%B8%8F)
their install script, so use this new [manual
method](https://github.com/nodesource/distributions#installation-instructions)
instead.

14 months agofix: text decorator on issue sidebar menu label (#27206) (#27209)
Giteabot [Sat, 23 Sep 2023 12:47:40 +0000 (20:47 +0800)]
fix: text decorator on issue sidebar menu label (#27206) (#27209)

Backport #27206 by @metiftikci

fix underline for label on issue sidebar

Co-authored-by: metiftikci <metiftikci@hotmail.com>
14 months agoUpdate JS and Poetry dependencies and eslint (#27200) (#27201)
Giteabot [Fri, 22 Sep 2023 21:26:42 +0000 (05:26 +0800)]
Update JS and Poetry dependencies and eslint (#27200) (#27201)

Backport #27200 by @silverwind

- Update all JS and Poetry dependencies
- Remove deprecated `eslint-plugin-custom-elements` and replace it with
rules from `eslint-plugin-wc`
- Add a convenience `make update` to update both js and py dependencies
- Tested markdown toolbar, swagger and citation

Co-authored-by: silverwind <me@silverwind.io>
14 months agoFix release URL in webhooks (#27182) (#27185)
Giteabot [Thu, 21 Sep 2023 23:22:14 +0000 (07:22 +0800)]
Fix release URL in webhooks (#27182) (#27185)

Backport #27182 by @jolheiser

Resolves #27180

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

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

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
14 months agoFix review request number and add more tests (#27104) (#27168)
Giteabot [Thu, 21 Sep 2023 17:01:37 +0000 (01:01 +0800)]
Fix review request number and add more tests (#27104) (#27168)

Backport #27104 by @lng2020

fix #27019
## testfixture yml
1. add issue20(a pr issue) in repo 23, org 17
2. add user15 to team 9
3. add four reviews about issue20
## test case
add two tests that are described with code comments
the code before pr #26784 failed the first test
<img width="479" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/1d9b5787-11b4-4c4d-931f-6a9869547f35">
current code failed the second test(as mentioned in #27019)
<img width="484" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/05608055-7587-43d1-bae1-92c688270819">
Any advice is appreciated.

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
14 months agoFix dropdown icon position (#27175) (#27177)
Giteabot [Thu, 21 Sep 2023 16:24:07 +0000 (00:24 +0800)]
Fix dropdown icon position (#27175) (#27177)

Backport #27175 by @wxiaoguang

According to https://fomantic-ui.com/modules/dropdown.html and our
"devtest" page, many dropdown elements has incorrect "icon" position.

This PR fixes all of them. Fix #27173

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix repo sub menu (#27169) (#27170)
Giteabot [Thu, 21 Sep 2023 13:22:38 +0000 (21:22 +0800)]
Fix repo sub menu (#27169) (#27170)

Backport #27169 by @wxiaoguang

Fix #27166

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix the variable regexp pattern on web page (#27161) (#27164)
Giteabot [Thu, 21 Sep 2023 12:09:44 +0000 (20:09 +0800)]
Fix the variable regexp pattern on web page (#27161) (#27164)

Backport #27161 by @lng2020

same as (https://github.com/go-gitea/gitea/pull/26910)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
14 months agoFix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27163)
Giteabot [Thu, 21 Sep 2023 10:15:20 +0000 (18:15 +0800)]
Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27163)

Backport #27150 by @memphis88

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

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

Co-authored-by: Dionysios Kakouris <1369451+memphis88@users.noreply.github.com>
14 months agoAdd index to `issue_user.issue_id` (#27154) (#27158)
Giteabot [Thu, 21 Sep 2023 03:42:34 +0000 (11:42 +0800)]
Add index to `issue_user.issue_id` (#27154) (#27158)

Backport #27154 by @JakobDev

This fixes a performance bottleneck. It was discovered by Codeberg.
Every where query on that table (which has grown big over time) uses
this column, but there is no index on it.

See this part of the log which was posted on Matrix:
```
2023/09/10 00:52:01 ...rs/web/repo/issue.go:1446:ViewIssue() [W] [Slow SQL Query] UPDATE `issue_user` SET is_read=? WHERE uid=? AND issue_id=? [true x y] - 51.395434887s
2023/09/10 00:52:01 ...rs/web/repo/issue.go:1447:ViewIssue() [E] ReadBy: Error 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
2023/09/10 00:52:01 ...eb/routing/logger.go:102:func1() [I] router: completed GET /Codeberg/Community/issues/1201 for [::ffff:xxx]:0, 500 Internal Server Error in 52384.2ms @ repo/issue.go:1256(repo.ViewIssue)
```

Co-authored-by: JakobDev <jakobdev@gmx.de>
14 months agoFix successful return value for `SyncAndGetUserSpecificDiff` (#27152) v1.21.0-rc0
delvh [Wed, 20 Sep 2023 20:28:17 +0000 (22:28 +0200)]
Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152)

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

14 months agoImprove actions docs related to `pull_request` event (#27126)
Zettat123 [Wed, 20 Sep 2023 06:28:35 +0000 (14:28 +0800)]
Improve actions docs related to `pull_request` event (#27126)

Related to #27039

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

14 months agoRemove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119)
delvh [Wed, 20 Sep 2023 03:02:58 +0000 (05:02 +0200)]
Remove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119)

No backport needed as this new state only applies to 1.21+

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
14 months agoFix: treat tab "overview" as "repositories" in user profiles without readme (#27124)
hazy [Wed, 20 Sep 2023 01:48:44 +0000 (20:48 -0500)]
Fix: treat tab "overview" as "repositories" in user profiles without readme (#27124)

Beginning since 2af30f715e64dbb0a3900168e3768ffb36c06392, Gitea has a
500 error when visiting a user profile with `?tab=overview` in the URL
when the user doesn't have a `.profile/README.md`, because the backend
code assumes that if the tab is overview a profile repository must
exist, and checks that the repository is nil aren't done.

In this PR I treat `?tab=overview` the same as if no tab is set in the
URL, which corrects this behaviour- Now, when visiting `?tab=overview`,
if `.profile/README.md` exists on that user's profile it'll show that as
it should, otherwise it'll show the repositories tab.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix incorrect test code for error handling (#27139)
wxiaoguang [Wed, 20 Sep 2023 00:51:36 +0000 (08:51 +0800)]
Fix incorrect test code for error handling (#27139)

If `assert.NoError` fails, it should return. Otherwise the code could
still execute even if the error occurs.

14 months agoIncrease auth provider icon size on login page (#27122)
silverwind [Tue, 19 Sep 2023 21:47:13 +0000 (23:47 +0200)]
Increase auth provider icon size on login page (#27122)

Before, 20px:
<img width="474" alt="Screenshot 2023-09-19 at 00 10 05"
src="https://github.com/go-gitea/gitea/assets/115237/4bed4edb-219d-4844-9d3c-0d747033b09f">

After, 28px:
<img width="576" alt="Screenshot 2023-09-19 at 00 20 40"
src="https://github.com/go-gitea/gitea/assets/115237/f482ac09-38ae-4c84-80d9-0bd39b7f9772">

Dropdown in account settings is unchanged at 20px:
<img width="157" alt="Screenshot 2023-09-19 at 00 09 11"
src="https://github.com/go-gitea/gitea/assets/115237/9c998cdf-eeed-4118-9262-664faaa56092">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agofix pagination for followers and following (#27127)
Earl Warren [Tue, 19 Sep 2023 15:24:54 +0000 (17:24 +0200)]
fix pagination for followers and following (#27127)

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

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

(cherry picked from commit c1a136318be3bf72511bed108f2d67f2cf34e1b8)

Co-authored-by: Gusted <postmaster@gusted.xyz>
14 months agoservices/wiki: Close() after error handling (#27129)
Earl Warren [Tue, 19 Sep 2023 14:45:44 +0000 (16:45 +0200)]
services/wiki: Close() after error handling (#27129)

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

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

Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
14 months agoUse fetch helpers instead of fetch (#27026)
silverwind [Tue, 19 Sep 2023 00:50:30 +0000 (02:50 +0200)]
Use fetch helpers instead of fetch (#27026)

WIP because:

- [x] Some calls set a `content-type` but send no body, can likely
remove the header
- [x] Need to check whether `charset=utf-8` has any significance on the
webauthn calls, I assume not as it is the default for json content.
- [x] Maybe `no-restricted-globals` is better for eslint, but will
require a lot of duplication in the yaml or moving eslint config to a
`.js` extension.
- [x] Maybe export `request` as `fetch`, shadowing the global.

14 months agoChange green buttons to primary color (#27099)
silverwind [Mon, 18 Sep 2023 22:05:31 +0000 (00:05 +0200)]
Change green buttons to primary color (#27099)

I think it's better if the primary actions have primary color instead of
green which fits better into the overall single-color UI design. This PR
currently replaces every green button with primary:

<img width="141" alt="Screenshot 2023-09-16 at 14 07 59"
src="https://github.com/go-gitea/gitea/assets/115237/843c1e50-4fb2-4ec6-84ba-0efb9472dcbe">
<img width="161" alt="Screenshot 2023-09-16 at 14 07 51"
src="https://github.com/go-gitea/gitea/assets/115237/9442195a-a3b2-4a42-b262-8377d6f5c0d1">

Modal actions now use uncolored/primary instead of previous green/red
colors. I also removed the box-shadow on all basic buttons:

<img width="259" alt="Screenshot 2023-09-16 at 14 16 39"
src="https://github.com/go-gitea/gitea/assets/115237/5beea529-127a-44b0-8d4c-afa7b034a490">
<img width="261" alt="Screenshot 2023-09-16 at 14 17 42"
src="https://github.com/go-gitea/gitea/assets/115237/4757f7b2-4d46-49bc-a797-38bb28437b88">

The change currently includes the "Merge PR" button, for which we might
want to make an exception to match the icon color there:

<img width="442" alt="Screenshot 2023-09-16 at 14 33 53"
src="https://github.com/go-gitea/gitea/assets/115237/993ac1a5-c94d-4895-b76c-0d872181a70b">

14 months agoFix wrong xorm get usage on migration (#27111)
Lunny Xiao [Mon, 18 Sep 2023 19:59:19 +0000 (03:59 +0800)]
Fix wrong xorm get usage on migration (#27111)

Fix the bug on try.gitea.io

```log
2023/09/18 01:48:41 ...ations/migrations.go:635:Migrate() [I] Migration[276]: Add RemoteAddress to mirrors
2023/09/18 01:48:41 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: migrate: migration[276]: Add RemoteAddress to mirrors failed: exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
```

Caused by #26952

---------

Co-authored-by: Jason Song <i@wolfogre.com>
14 months agoFix the incorrect route path in the user edit page. (#27007)
CaiCandong [Mon, 18 Sep 2023 12:08:09 +0000 (20:08 +0800)]
Fix the incorrect route path in the user edit page. (#27007)

Regression of #26713

After #26713 , the base path of user edit has been changed to
`/admin/users/{userid}/edit`
## Before

https://github.com/go-gitea/gitea/assets/50507092/5f4a3f64-fe2b-4499-b110-e01c9d87ea19

14 months agoRefactor lfs requests (#26783)
Chongyi Zheng [Mon, 18 Sep 2023 08:40:50 +0000 (04:40 -0400)]
Refactor lfs requests (#26783)

- Refactor lfs request code
- The original code uses `performRequest` function to create the
request, uses a callback to modify the request, and then send the
request.
- Now it's replaced with `createRequest` that only creates request and
`performRequest` that only sends the request.
- Reuse `createRequest` and `performRequest` in `http_client.go` and
`transferadapter.go`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoDisplay archived labels specially when listing labels (#26820)
puni9869 [Mon, 18 Sep 2023 04:54:05 +0000 (10:24 +0530)]
Display archived labels specially when listing labels (#26820)

Follow up https://github.com/go-gitea/gitea/pull/26741

Changes:
Added archived label for org labels and added into issue filter list.

Part of https://github.com/go-gitea/gitea/issues/25237

---------

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
14 months agoRemove a `gt-float-right` and some unnecessary helpers (#27110)
wxiaoguang [Mon, 18 Sep 2023 04:25:36 +0000 (12:25 +0800)]
Remove a `gt-float-right` and some unnecessary helpers (#27110)

Follow  Remove polluted .ui.right #26825

Remove more `gt-float-right`, remove unnecessary helpers, remove
negative margin tricks.

![image](https://github.com/go-gitea/gitea/assets/2114189/2785c6e6-7823-4699-a4f3-184eef50ceda)

14 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 18 Sep 2023 00:23:39 +0000 (00:23 +0000)]
[skip ci] Updated licenses and gitignores

14 months agoFix token endpoints ignore specified account (#27080)
CaiCandong [Mon, 18 Sep 2023 00:21:15 +0000 (08:21 +0800)]
Fix token endpoints ignore specified account (#27080)

Fix #26234
close #26323
close #27040

---------

Co-authored-by: silverwind <me@silverwind.io>
14 months agoMake SSPI auth mockable (#27036)
wxiaoguang [Sun, 17 Sep 2023 23:32:56 +0000 (07:32 +0800)]
Make SSPI auth mockable (#27036)

Before, the SSPI auth is only complied for Windows, it's difficult to
test and it breaks a lot.

Now, make the SSPI auth mockable and testable.

14 months agoSearch branches (#27055)
Lunny Xiao [Sun, 17 Sep 2023 08:24:40 +0000 (16:24 +0800)]
Search branches (#27055)

Resolve #25233

<img width="1315" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/3ba59b58-471a-4e1b-985c-87edac2268c0">

<img width="1297" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/b6caa12f-323b-4f70-9c44-ef91cb71a26c">

14 months agoFix wrong migration for email address (#27106)
Lunny Xiao [Sun, 17 Sep 2023 03:15:04 +0000 (11:15 +0800)]
Fix wrong migration for email address (#27106)

On Iterate, `sess` should not be used in the closure function body.

Caused by #26952

14 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 17 Sep 2023 00:24:27 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

14 months agoSupport `.git-blame-ignore-revs` file (#26395)
KN4CK3R [Sat, 16 Sep 2023 17:42:34 +0000 (19:42 +0200)]
Support `.git-blame-ignore-revs` file (#26395)

Closes #26329

This PR adds the ability to ignore revisions specified in the
`.git-blame-ignore-revs` file in the root of the repository.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/9e91be0c-6e9c-431c-bbe9-5f80154251c8)

The banner is displayed in this case. I intentionally did not add a UI
way to bypass the ignore file (same behaviour as Github) but you can add
`?bypass-blame-ignore=true` to the url manually.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoAdd `RemoteAddress` to mirrors (#26952)
KN4CK3R [Sat, 16 Sep 2023 16:03:02 +0000 (18:03 +0200)]
Add `RemoteAddress` to mirrors (#26952)

This PR adds a new field `RemoteAddress` to both mirror types which
contains the sanitized remote address for easier (database) access to
that information. Will be used in the audit PR if merged.

14 months agoUpgrading the actions/checkout@4 (#27096)
puni9869 [Sat, 16 Sep 2023 15:06:27 +0000 (20:36 +0530)]
Upgrading the actions/checkout@4 (#27096)

as title
..Upgrading the actions/checkout@4

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
14 months agoNext round of `db.DefaultContext` refactor (#27089)
JakobDev [Sat, 16 Sep 2023 14:39:12 +0000 (16:39 +0200)]
Next round of `db.DefaultContext` refactor (#27089)

Part of #27065

14 months agoUi correction in mobile view nav bar left aligned items. (#27046)
puni9869 [Sat, 16 Sep 2023 14:09:25 +0000 (19:39 +0530)]
Ui correction in mobile view nav bar left aligned items. (#27046)

As title
From the long time I was looking for this UI, Now its the time to fix
it.

Before
<img width="252" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/963f2cb4-5cfd-4a14-ab85-88e25c3daef5">

<img width="502" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/58453ef1-2555-4568-95d0-5293055b33b8">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoAdd missing deps to files-changed (#27100)
silverwind [Sat, 16 Sep 2023 13:23:06 +0000 (15:23 +0200)]
Add missing deps to files-changed (#27100)

The `docs` and `yaml` actions categories need to run when the
dependencies `markdownlin-cli` or `yamllint` change, so add those to the
list of dependencies for these actions.

Fixes: https://github.com/go-gitea/gitea/issues/27098
14 months agoUse db.WithTx for AddTeamMember to avoid ctx abuse (#27095)
wxiaoguang [Sat, 16 Sep 2023 12:54:23 +0000 (20:54 +0800)]
Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095)

Compare with ignoring spaces:
https://github.com/go-gitea/gitea/pull/27095/files?diff=split&w=1

14 months agoDrop Node.js 16 and update js dependencies (#27094)
Chongyi Zheng [Sat, 16 Sep 2023 11:36:35 +0000 (07:36 -0400)]
Drop Node.js 16 and update js dependencies (#27094)

- Drop Node.js 16 since it reached EOL
- Upgrade js dependencies
- Two packages have major version bump
  - `updates`: require node 18
- `eslint-plugin-array-func`: require `eslint` 8.40.0, which is
satisfied
- Run `make svg` for `@primer/octicons` update