]> source.dussan.org Git - gitea.git/log
gitea.git
14 months agoFix admin queue page title (#26409)
wxiaoguang [Thu, 10 Aug 2023 02:05:37 +0000 (10:05 +0800)]
Fix admin queue page title (#26409)

Fix #26408

```
# locale_en-US.ini
[admin]
monitor.queues = Queues
```

---------

Co-authored-by: silverwind <me@silverwind.io>
14 months agoPre-register OAuth2 applications for git credential helpers (#26291)
Denys Konovalov [Wed, 9 Aug 2023 12:24:07 +0000 (14:24 +0200)]
Pre-register OAuth2 applications for git credential helpers (#26291)

This PR is an extended implementation of #25189 and builds upon the
proposal by @hickford in #25653, utilizing some ideas proposed
internally by @wxiaoguang.

Mainly, this PR consists of a mechanism to pre-register OAuth2
applications on startup, which can be enabled or disabled by modifying
the `[oauth2].DEFAULT_APPLICATIONS` parameter in app.ini. The OAuth2
applications registered this way are being marked as "locked" and
neither be deleted nor edited over UI to prevent confusing/unexpected
behavior. Instead, they're being removed if no longer enabled in config.

![grafik](https://github.com/go-gitea/gitea/assets/47871822/81a78b1c-4b68-40a7-9e99-c272ebb8f62e)

The implemented mechanism can also be used to pre-register other OAuth2
applications in the future, if wanted.

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

Co-authored-by: M Hickford <mirth.hickford@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoMake `user-content-* ` consistent with github (#26388)
CaiCandong [Wed, 9 Aug 2023 09:30:31 +0000 (17:30 +0800)]
Make `user-content-* ` consistent with github (#26388)

Fix #26367
Related #19745

Thanks @lazyky for providing  test cases

14 months agoAdd pull request review request webhook event (#26401)
Yarden Shoham [Wed, 9 Aug 2023 08:30:34 +0000 (11:30 +0300)]
Add pull request review request webhook event (#26401)

Add webhook events for pull request review requests

- Fixes #26371
- Added support for the "Pull request review requested" and "Pull
request review request removed" webhook events.
- Updated the `getPullRequestPayloadInfo` function in `general.go` to
handle these new webhook events.

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/bd942971-fb1d-40f3-8961-46638e3588fa)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/216e9c7d-0a4d-49f9-8492-2d14c88bbf4e)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoIntroduce ctx.PathParamRaw to avoid incorrect unescaping (#26392)
wxiaoguang [Wed, 9 Aug 2023 06:57:45 +0000 (14:57 +0800)]
Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392)

Fix #26389

And complete an old TODO: `ctx.Params does un-escaping,..., which is
incorrect.`

14 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 9 Aug 2023 00:26:05 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

14 months agofix artifact merging chunks path with correct slash on Windows (#26400)
FuXiaoHei [Tue, 8 Aug 2023 17:21:48 +0000 (01:21 +0800)]
fix artifact merging chunks path with correct slash on Windows (#26400)

From Discord
https://discord.com/channels/322538954119184384/1069795723178160168/1136719889684500480

Artifact chunks merging is break on Windows.

```
Gitea Log:
2023/08/03 20:51:15 ...actions/artifacts.go:271:comfirmUploadArtifact() [E] Error merge chunks: parse content range error: input does not match format
```

Artifact uses wrong slash to parse saved chunks path.

14 months agoUse flex classes in package settings (#26314)
KN4CK3R [Tue, 8 Aug 2023 16:28:24 +0000 (18:28 +0200)]
Use flex classes in package settings (#26314)

Regression of #25790
Fixes #26310

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoImprove multiple strings in en-US locale (#26213)
Panagiotis "Ivory" Vasilopoulos [Tue, 8 Aug 2023 15:25:05 +0000 (15:25 +0000)]
Improve multiple strings in en-US locale (#26213)

I kept sending pull requests that consisted of one-line changes. It's
time to
settle this once and for all. (Maybe.)

- Explain Gitea behavior and the consequences of each
  setting better, so that the user does not have to consult
  the docs.
- Do not use different spellings of identical terms
  interchangeably, e.g. `e-mail` and `email`.
- Use more conventional terms to describe the same things,
  e.g. `Confirm Password` instead of `Re-Type Password`.
- Introduces additional clarification for Mirror Settings
- Small adjustments in test
- This is a cry for help.
- Grammar and spelling consistencies for en-US locale
  (e.g. cancelled -> canceled)
- Introduce tooltip improvements.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoRefactor "editorconfig" (#26391)
wxiaoguang [Tue, 8 Aug 2023 10:44:19 +0000 (18:44 +0800)]
Refactor "editorconfig" (#26391)

There are 2 kinds of ".Editorconfig" in code, one is `JSON string` for
the web edtior, another is `*editorconfig.Editorconfig` for the file
rendering (used by `TabSizeClass`)

This PR distinguish them with different names.

And by the way, change the default tab size from 8 to 4, I think few
people would like to use 8-size tabs nowadays.

14 months agofix generated source URL on rendered files (#26364)
Earl Warren [Tue, 8 Aug 2023 09:04:04 +0000 (11:04 +0200)]
fix generated source URL on rendered files (#26364)

- The permalink and 'Reference in New issue' URL of an renderable file
(those where you can see the source and a rendered version of it, such
as markdown) doesn't contain `?display=source`. This leads the issue
that the URL doesn't have any effect, as by default the rendered version
is shown and thus not the source.
- Add `?display=source` to the permalink URL and to 'Reference in New
Issue' if it's renderable file.
- Add integration testing.

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

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoRemove unnecessary template helper DisableGravatar (#26386)
wxiaoguang [Tue, 8 Aug 2023 08:29:14 +0000 (16:29 +0800)]
Remove unnecessary template helper DisableGravatar (#26386)

And one "AllowedUserVisibilityModes" was missing, add it.

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoRemove unnecessary template helper repoAvatar (#26387)
wxiaoguang [Tue, 8 Aug 2023 07:29:35 +0000 (15:29 +0800)]
Remove unnecessary template helper repoAvatar (#26387)

And simplify the "repo/icon" code

14 months agoStart using template context function (#26254)
wxiaoguang [Tue, 8 Aug 2023 01:22:47 +0000 (09:22 +0800)]
Start using template context function (#26254)

Before:

* `{{.locale.Tr ...}}`
* `{{$.locale.Tr ...}}`
* `{{$.root.locale.Tr ...}}`
* `{{template "sub" .}}`
* `{{template "sub" (dict "locale" $.locale)}}`
* `{{template "sub" (dict "root" $)}}`
* .....

With context function: only need to `{{ctx.Locale.Tr ...}}`

The "ctx" could be considered as a super-global variable for all
templates including sub-templates.

To avoid potential risks (any bug in the template context function
package), this PR only starts using "ctx" in "head.tmpl" and
"footer.tmpl" and it has a "DataRaceCheck". If there is anything wrong,
the code can be fixed or reverted easily.

14 months agoAllow package cleanup from admin page (#25307)
KN4CK3R [Tue, 8 Aug 2023 00:46:10 +0000 (02:46 +0200)]
Allow package cleanup from admin page (#25307)

Until now expired package data gets deleted daily by a cronjob. The
admin page shows the size of all packages and the size of unreferenced
data. The users (#25035, #20631) expect the deletion of this data if
they run the cronjob from the admin page but the job only deletes data
older than 24h.

This PR adds a new button which deletes all expired data.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/b3e35d73-9496-4fa7-a20c-e5d30b1f6850)

---------

Co-authored-by: silverwind <me@silverwind.io>
14 months agoFix text truncate (#26354)
Maxim Slipenko [Mon, 7 Aug 2023 20:44:04 +0000 (23:44 +0300)]
Fix text truncate (#26354)

Fixes: https://github.com/go-gitea/gitea/issues/25597
Before:

![image](https://github.com/go-gitea/gitea/assets/36362599/c8c27bcb-469f-4def-8521-d9e054c16ecb)

After:

![image](https://github.com/go-gitea/gitea/assets/36362599/2405b6e8-fc5c-4b13-b66b-007bc11edbc4)

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix incorrect sort link with `.profile` repository (#26374)
CaiCandong [Mon, 7 Aug 2023 19:59:17 +0000 (03:59 +0800)]
Fix incorrect sort link with  `.profile`  repository (#26374)

fix #26360

14 months agoUse more `IssueList` instead of `[]*Issue` (#26369)
Lunny Xiao [Mon, 7 Aug 2023 19:26:40 +0000 (03:26 +0800)]
Use more `IssueList` instead of `[]*Issue` (#26369)

14 months agoRename code_langauge.go to code_language.go (#26377)
cassiozareck [Mon, 7 Aug 2023 19:00:53 +0000 (16:00 -0300)]
Rename code_langauge.go to code_language.go (#26377)

14 months agoAdd changelog for 1.20.3 (#26373)
delvh [Mon, 7 Aug 2023 16:11:33 +0000 (18:11 +0200)]
Add changelog for 1.20.3 (#26373)

14 months agoDo not highlight `#number` in documents (#26365)
Earl Warren [Mon, 7 Aug 2023 13:11:25 +0000 (15:11 +0200)]
Do not highlight `#number` in documents (#26365)

- Currently the post processing will transform all issue indexes (such as `#6`) into a clickable link.
- This makes sense in an situation like issues or PRs,
where referencing to other issues is quite common
and only referencing their issue index is an handy and efficient way to do it.
- Currently this is also run for documents
(which is the user profile and viewing rendered files),
but in those situations it's less common to reference issues by their index and instead could mean something else.
- This patch disables this post processing for issue index for documents. Matches Github's behavior.
- Added unit tests.
- Resolves https://codeberg.org/Codeberg/Community/issues/1120

Co-authored-by: Gusted <postmaster@gusted.xyz>
14 months agoBypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (...
wxiaoguang [Mon, 7 Aug 2023 10:23:59 +0000 (18:23 +0800)]
Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279)

Close #26277
Fix #26285

14 months agoFix nil pointer dereference error when open link with invalid pull index (#26353)
CaiCandong [Mon, 7 Aug 2023 03:43:18 +0000 (11:43 +0800)]
Fix nil pointer dereference  error when open link with invalid pull index (#26353)

fix #26331

Before:

![image](https://github.com/go-gitea/gitea/assets/50507092/028e6944-84d1-4404-80b6-4a4accdc7d0a)

After:

![image](https://github.com/go-gitea/gitea/assets/50507092/b78978f9-e77f-459f-96e1-3a1f36ec8abe)

14 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 7 Aug 2023 00:27:21 +0000 (00:27 +0000)]
[skip ci] Updated licenses and gitignores

14 months agoDisplay human-readable text instead of cryptic filemodes (#26352)
delvh [Sun, 6 Aug 2023 19:52:34 +0000 (21:52 +0200)]
Display human-readable text instead of cryptic filemodes (#26352)

Now, you don't need to be a git expert anymore to know what these
numbers mean.

## Before

![grafik](https://github.com/go-gitea/gitea/assets/51889757/9a964bf6-10fd-40a6-aeb2-ac8f437f8c32)

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/84573cb9-55b6-4dde-9866-95f71b657554)

or when the mode actually changed:

![grafik](https://github.com/go-gitea/gitea/assets/51889757/0f327538-ebdc-40e7-8c99-f9e21b67f638)

14 months ago[docs] Add missing backtick in quickstart.zh-cn.md (#26349)
Track3 [Sat, 5 Aug 2023 16:28:25 +0000 (00:28 +0800)]
[docs] Add missing backtick in quickstart.zh-cn.md (#26349)

Added missing backtick in quickstart.zh-cn.md docs so inline code can
render properly.

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix incorrect CLI exit code and duplicate error message (#26346)
wxiaoguang [Sat, 5 Aug 2023 15:36:45 +0000 (23:36 +0800)]
Fix incorrect CLI exit code and duplicate error message (#26346)

Follow the CLI refactoring, and add tests.

14 months agoImprove CLI and messages (#26341)
wxiaoguang [Sat, 5 Aug 2023 13:24:49 +0000 (21:24 +0800)]
Improve CLI and messages (#26341)

Follow the CLI refactoring

1. Remove the "checkCommandFlags" helper
2. Unify the web startup message, make them have consistent names as `./gitea help`
3. Fine tune some other messages (see the diff)

14 months agoRemove backslashed newlines on markdown (#26344)
Lunny Xiao [Sat, 5 Aug 2023 12:48:46 +0000 (20:48 +0800)]
Remove backslashed newlines on markdown (#26344)

Fix https://gitea.com/gitea/gitea-docusaurus/issues/56

14 months agoHide `last indexed SHA` when a repo could not be indexed yet (#26340)
CaiCandong [Sat, 5 Aug 2023 11:04:14 +0000 (19:04 +0800)]
Hide `last indexed SHA` when a repo could not be indexed yet (#26340)

Now, for a new repo without any commit, the Last indexed SHA field looks like this:
Before:
![image](https://github.com/go-gitea/gitea/assets/50507092/cecc6e24-3366-4093-ae07-c361ea34b373)
After:
![image](https://github.com/go-gitea/gitea/assets/50507092/9b6ba703-b0d5-4648-ad6b-9a2341dd60f9)

Fixes #26336

14 months agoFix log typo in task.go (#26337)
cassiozareck [Sat, 5 Aug 2023 09:43:03 +0000 (06:43 -0300)]
Fix log typo in task.go (#26337)

Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
14 months agoPrevent newline errors with Debian packages (#26332)
KN4CK3R [Sat, 5 Aug 2023 08:59:52 +0000 (10:59 +0200)]
Prevent newline errors with Debian packages (#26332)

Fixes #26313

14 months agoFix the bug when getting files changed for `pull_request_target` event (#26320)
Zettat123 [Sat, 5 Aug 2023 06:26:06 +0000 (14:26 +0800)]
Fix the bug when getting files changed for `pull_request_target` event (#26320)

Follow #25229

Copy from
https://github.com/go-gitea/gitea/pull/26290#issuecomment-1663135186

The bug is that we cannot get changed files for the
`pull_request_target` event. This event runs in the context of the base
branch, so we won't get any changes if we call
`GetFilesChangedSinceCommit` with `PullRequest.Base.Ref`.

14 months agoRefactor backend SVG package and add tests (#26335)
wxiaoguang [Sat, 5 Aug 2023 04:34:59 +0000 (12:34 +0800)]
Refactor backend SVG package and add tests (#26335)

Introduce a well-tested `svg.Normalize` function.
Make `RenderHTML` faster and more stable.

14 months agoFix bug with sqlite load read (#26305)
Lunny Xiao [Sat, 5 Aug 2023 02:40:27 +0000 (10:40 +0800)]
Fix bug with sqlite load read (#26305)

Possible fix #26280

14 months agoRemove commit load branches and tags in wiki repo (#26304)
yp05327 [Fri, 4 Aug 2023 15:49:43 +0000 (00:49 +0900)]
Remove commit load branches and tags in wiki repo (#26304)

If click `load branches and tags`, you will get 500 error from backend,
as it is a wiki repo.

![image](https://github.com/go-gitea/gitea/assets/18380374/1eb2a68b-cc72-4607-a1d1-4f74f83623f6)

![image](https://github.com/go-gitea/gitea/assets/18380374/c385de25-0cfb-4084-9452-d7e9d27deea9)

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoAdd highlight to selected repos in milestone dashboard (#26300)
yp05327 [Fri, 4 Aug 2023 15:16:56 +0000 (00:16 +0900)]
Add highlight to selected repos in milestone dashboard (#26300)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/d3fa1e15-423a-4216-8a60-b02f5aa4f5d3)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/643df586-ec2f-4480-b7a0-bd252883d761)

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoDo not show Profile README when repository is private (#26295)
Nicholas Pease [Fri, 4 Aug 2023 14:45:33 +0000 (10:45 -0400)]
Do not show Profile README when repository is private (#26295)

As mentioned in the original thread (#23260) and in the enhancements PR
#24753, this PR ensures the .profile repository is public before the
README file is shown.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix incorrect color of selected assignees when create issue (#26324)
yp05327 [Fri, 4 Aug 2023 14:14:30 +0000 (23:14 +0900)]
Fix incorrect color of selected assignees when create issue (#26324)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/75d610b2-3823-4366-be85-c77c9106feff)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/15afc6ac-f5ad-4e24-8983-fea8ace5921f)

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoDelete `issue_service.CreateComment` (#26298)
caicandong [Fri, 4 Aug 2023 13:34:34 +0000 (21:34 +0800)]
Delete `issue_service.CreateComment` (#26298)

I noticed that `issue_service.CreateComment` adds transaction operations
on `issues_model.CreateComment`, we can merge the two functions and we
can avoid calling each other's methods in the `services` layer.

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoMake git batch operations use parent context timeout instead of default timeout ...
wxiaoguang [Fri, 4 Aug 2023 12:50:41 +0000 (20:50 +0800)]
Make git batch operations use parent context timeout instead of default timeout (#26325)

Fix #26064

Some git commands should use parent context, otherwise it would exit too
early (by the default timeout, 10m), and the "cmd.Wait" waits till the
pipes are closed.

14 months agoFix typos and grammer problems for actions documentation (#26328)
sillyguodong [Fri, 4 Aug 2023 10:04:37 +0000 (18:04 +0800)]
Fix typos and grammer problems for actions documentation (#26328)

follow #26317
fix typos and adjust grammer problems.

14 months agoUpdate documentation for 1.21 actions (#26317)
sillyguodong [Fri, 4 Aug 2023 09:06:02 +0000 (17:06 +0800)]
Update documentation for 1.21 actions (#26317)

As title.
Close #26309
Related to #24724, #24806

14 months agoFix the wrong derive path (#26271)
Lunny Xiao [Fri, 4 Aug 2023 03:41:16 +0000 (11:41 +0800)]
Fix the wrong derive path (#26271)

This PR will fix #26264, caused by #23911.

The package configuration derive is totally wrong when storage type is
local in that PR.

This PR fixed the inherit logic when storage type is local with some
unit tests.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoSupport getting changed files when commit ID is `EmptySHA` (#26290)
Zettat123 [Fri, 4 Aug 2023 02:53:15 +0000 (10:53 +0800)]
Support getting changed files when commit ID is `EmptySHA` (#26290)

Fixes #26270.

Co-Author: @wxiaoguang

Thanks @lunny for providing this solution

As
https://github.com/go-gitea/gitea/issues/26270#issuecomment-1661695151
said, at present we cannot get the names of changed files correctly when
the `OldCommitID` is `EmptySHA`. In this PR, the `GetCommitFilesChanged`
method is added and will be used to get the changed files by commit ID.

References:
- https://stackoverflow.com/a/424142

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoAdd `Retry` button when creating a mirror-repo fails (#26228)
Kerwin Bryant [Fri, 4 Aug 2023 02:21:32 +0000 (10:21 +0800)]
Add `Retry` button when creating a mirror-repo fails (#26228)

fixed #26156
* Added a retry button in the frontend (only displayed when the status
is abnormal)
* After clicking Retry, the backend adds the task back to the task queue

![7UJDNM671RI})EA8~~XPL39](https://github.com/go-gitea/gitea/assets/3371163/e088fd63-5dcc-4bc6-8849-7db3086511b7)

![T83F1WL9)VGHR@MB956$VT9](https://github.com/go-gitea/gitea/assets/3371163/744425bb-dde1-4315-be2e-5c99ac3a44d4)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 4 Aug 2023 00:26:21 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

14 months agoAdd locale for deleted head branch (#26296)
yp05327 [Thu, 3 Aug 2023 22:07:15 +0000 (07:07 +0900)]
Add locale for deleted head branch (#26296)

As title.

It will be displayed in:

![image](https://github.com/go-gitea/gitea/assets/18380374/e8507a3b-14f4-4418-a347-a36689707a16)

14 months agoUse yellow if an approved review is stale (#26312)
sebastian-sauer [Thu, 3 Aug 2023 21:28:21 +0000 (23:28 +0200)]
Use yellow if an approved review is stale (#26312)

By using a different color it's clear that the review isn't pointing to
the latest commit.

**Screenshots:**
Not stale review:

![image](https://github.com/go-gitea/gitea/assets/1135157/2901ad69-e0d8-4041-b760-277d02dafd45)
Stale review:

![image](https://github.com/go-gitea/gitea/assets/1135157/500b306e-a994-42d4-a2fd-1174774ba5ee)

fixes #26306

14 months agoRemove nonsense `<a>` for commit status check icon (#26287)
yp05327 [Thu, 3 Aug 2023 17:58:41 +0000 (02:58 +0900)]
Remove nonsense `<a>` for commit status check icon (#26287)

We are using `<a>` for commit status check icon with no link. So it is
clickable but this is no sense.
I think we can convert this to `div`.

![image](https://github.com/go-gitea/gitea/assets/18380374/23db1a11-b0c7-4444-bfa6-fe68aeb1c682)

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoMake confusable character warning less jarring (#25069)
Panagiotis "Ivory" Vasilopoulos [Thu, 3 Aug 2023 14:16:06 +0000 (14:16 +0000)]
Make confusable character warning less jarring (#25069)

This commit assumes that the warning can be made more discreet
so as to make it less annoying for the people that do not actually
need the warning, without necessarily increasing the risk for those
that do need it.

This doesn't fix the underlying problem of the warning being shown
in certain cases that, say, a certain kind of whitespace character
like 0x1E could be absolutely justifiable from a technical
perspective.

---------

Co-authored-by: delvh <dev.lh@web.de>
14 months agoUpdate Gmail example (#26302)
BÃ¥rd Aase [Thu, 3 Aug 2023 10:20:40 +0000 (11:20 +0100)]
Update Gmail example (#26302)

The `IS_TLS_ENABLED` option in the `mailer` section is deprecated. This
is specified by setting `PROTOCOL=smtps`

14 months agoFix the topic validation rule and suport dots (#26286)
wxiaoguang [Thu, 3 Aug 2023 09:18:06 +0000 (17:18 +0800)]
Fix the topic validation rule and suport dots (#26286)

1. Allow leading and trailing spaces by user input, these spaces have
already been trimmed at backend
2. Allow using dots in the topic

14 months agoUpgrade x/net to 0.13.0 (#26297)
Lunny Xiao [Thu, 3 Aug 2023 08:29:57 +0000 (16:29 +0800)]
Upgrade x/net to 0.13.0 (#26297)

14 months agoadd unit test for user renaming (#26261)
Earl Warren [Thu, 3 Aug 2023 01:38:51 +0000 (03:38 +0200)]
add unit test for user renaming (#26261)

- The user renaming function has zero test coverage.
- This patch brings that up to speed to test for various scenarios and
ensure that in a normal workflow the correct things has changed to their
respective new value. Most scenarios are to ensure certain things DO NOT
happen.

(cherry picked from commit 5b9d34ed115c9ef24012b8027959ea0afdcb4e2d)

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

Co-authored-by: Gusted <postmaster@gusted.xyz>
14 months agoadd some Wiki unit tests (#26260)
Earl Warren [Thu, 3 Aug 2023 01:37:48 +0000 (03:37 +0200)]
add some Wiki unit tests (#26260)

- Just to get 100% coverage on services/wiki/wiki_path.go, nothing
special. This is just an formality.

(cherry picked from commit 6b3528920fbf18c41d6aeb95498af48443282370)

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

Co-authored-by: Gusted <postmaster@gusted.xyz>
14 months agoClarify the logger's MODE config option (#26267)
wxiaoguang [Tue, 1 Aug 2023 18:28:23 +0000 (02:28 +0800)]
Clarify the logger's MODE config option (#26267)

1. Fix the wrong document (add the missing `MODE=`)
2. Add a more friendly log message to tell users to add `MODE=` in their
config

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agospeed up TestEventSourceManagerRun (#26262)
Earl Warren [Tue, 1 Aug 2023 17:57:11 +0000 (19:57 +0200)]
speed up TestEventSourceManagerRun (#26262)

- `setting.UI.Notification.EventSourceUpdateTime` is by default 10
seconds, which adds an 10 second delay before the test succeeds.
- Lower the interval to reduce it to at most 3 second delay (the code
only send events when they are at least 2 seconds old).

(cherry picked from commit 3adb9ae6009ff3ddebaed4875e086343f668ef7b)

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

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoMerge `templates/projects/list.tmpl` and `templates/repo/projects/list.tmpl` together...
Earl Warren [Tue, 1 Aug 2023 16:54:54 +0000 (18:54 +0200)]
Merge `templates/projects/list.tmpl` and `templates/repo/projects/list.tmpl` together (#26265)

(cherry picked from commit 473862a1d599382ca022482e2e044025872d240b)

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

Co-authored-by: Louis Seubert <louis.seubert.ls@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoAllow editing push mirrors after creation (#26151)
puni9869 [Tue, 1 Aug 2023 16:00:59 +0000 (21:30 +0530)]
Allow editing push mirrors after creation (#26151)

Allow users to edit the sync interval for existing push mirrors.
Currently, there is no way to modify the interval once the mirror is
created.
<details>
  <summary>Screenshots</summary>

## Before
<img width="936" alt="Screenshot 2023-07-26 at 9 31 21 AM"
src="https://github.com/go-gitea/gitea/assets/80308335/35b8a40c-4320-474c-a866-1dea0f1fa0de">

## After
<img width="945" alt="Screenshot 2023-07-26 at 9 44 40 AM"
src="https://github.com/go-gitea/gitea/assets/80308335/ee12e12f-0f68-4feb-90eb-33366f5997d3">

### On hover

<img width="247" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2f32de45-bd50-4150-9623-3be2ef3ea7f8">
<img width="237" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/49f4ab4d-ccff-4489-80ce-a9788a73c3bb">
<img width="245" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/165fc888-9d48-438a-b730-d4beb12122af">

### Edit modal
<img width="905" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2a7ca24b-4f36-4e0e-9799-39f2ecc46413">

### Only valid times are allowed
<img width="728" alt="Screenshot 2023-07-26 at 9 50 01 AM"
src="https://github.com/go-gitea/gitea/assets/80308335/ced6d330-c235-4e29-8f17-28daddcf1444">
<img width="853" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/8636f62a-70d1-4684-a3e8-b205adc03580">

</details>
Fixes #21295

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoUpdate Arch linux URL from community to extra (#26273)
minijaws [Tue, 1 Aug 2023 15:28:20 +0000 (11:28 -0400)]
Update Arch linux URL from community to extra (#26273)

Arch linux package link has changed from the community repo to the extra repo.
The link has been updated.

14 months agoFix due date rendering the wrong date in issue (#26268)
Yarden Shoham [Tue, 1 Aug 2023 14:21:04 +0000 (17:21 +0300)]
Fix due date rendering the wrong date in issue (#26268)

Closes #26263

We have to pass the date without the time.

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/6b6cb43d-2b1c-4679-951d-20f48c94bfdd)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/50441baf-2c52-452b-bb0d-6034a407abde)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
14 months agoSome fixes of the prompt of new branches (#26257)
Zettat123 [Tue, 1 Aug 2023 07:25:11 +0000 (15:25 +0800)]
Some fixes of the prompt of new branches (#26257)

Related to #26239

This PR makes some fixes:
- do not show the prompt for mirror repos and repos with pull request
units disabled
- use `commit_time` instead of `updated_unix`, as `commit_time` is the
real time when the branch was pushed

14 months agoIntroduce `flex-list` & `flex-item` elements for Gitea UI (#25790)
Denys Konovalov [Mon, 31 Jul 2023 22:13:42 +0000 (00:13 +0200)]
Introduce `flex-list` & `flex-item` elements for Gitea UI (#25790)

This PR introduces a new UI element type for Gitea called `flex-item`.
It consists of a horizontal card with a leading, main and trailing part:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/395dd3f3-3906-4481-8f65-be6ac0acbe03)

The idea behind it is that in Gitea UI, we have many cases where we use
this kind of layout, but it is achieved in many different ways:
  - grid layout
  - `.ui.list` with additional hacky flexbox
- `.ui.key.list` - looks to me like a style set originally created for
ssh/gpg key list, was used in many other places
  - `.issue.list` - created for issue cards, used in many other places
  - ...

This new style is based on `.issue.list`, specifically the refactoring
of it done in #25750.

In this PR, the new element is introduced and lots of templates are
being refactored to use that style. This allows to remove a lot of
page-specific css, makes many of the elements responsive or simply
provides a cleaner/better-looking way to present information.

A devtest section with the new style is also available.

<details>
<summary>Screenshots (left: before, right: after)</summary>

![Bildschirmfoto vom 2023-07-09
21-01-21](https://github.com/go-gitea/gitea/assets/47871822/545b7da5-b300-475f-bd6d-b7d836950bb5)
![Bildschirmfoto vom 2023-07-09
21-01-56](https://github.com/go-gitea/gitea/assets/47871822/b6f70415-6795-4f71-a5ea-117d56107ea1)
![Bildschirmfoto vom 2023-07-09
21-02-45](https://github.com/go-gitea/gitea/assets/47871822/47407121-3f2a-4778-8f6d-ad2687c2e7b3)
![Bildschirmfoto vom 2023-07-09
21-03-44](https://github.com/go-gitea/gitea/assets/47871822/76167aaf-c3b2-46f6-9ffd-709f20aa6a34)
![Bildschirmfoto vom 2023-07-09
21-04-52](https://github.com/go-gitea/gitea/assets/47871822/af8fdde5-711e-4524-99cf-fb5d68af85b9)
![Bildschirmfoto vom 2023-07-09
21-05-25](https://github.com/go-gitea/gitea/assets/47871822/ae406946-e3e4-4109-abfe-b3588a07b468)
![Bildschirmfoto vom 2023-07-09
21-06-35](https://github.com/go-gitea/gitea/assets/47871822/2dbacc04-24d6-4f91-9e42-e16d6e4b5f1f)
![Bildschirmfoto vom 2023-07-09
21-09-03](https://github.com/go-gitea/gitea/assets/47871822/d3ca4e56-a72f-4179-adc8-98bfd638025b)
![Bildschirmfoto vom 2023-07-09
21-09-44](https://github.com/go-gitea/gitea/assets/47871822/df1fa689-499c-4e54-b6fb-3b81644b725f)
![Bildschirmfoto vom 2023-07-09
21-10-27](https://github.com/go-gitea/gitea/assets/47871822/b21cac71-a85a-4c8c-bb99-ab90373d8e09)
![Bildschirmfoto vom 2023-07-09
21-11-12](https://github.com/go-gitea/gitea/assets/47871822/89be39cf-0af9-4f2d-9fca-42f9eb5e7824)
![Bildschirmfoto vom 2023-07-09
21-12-01](https://github.com/go-gitea/gitea/assets/47871822/079579ea-1ecb-49c0-b32b-b59ed957caec)
![Bildschirmfoto vom 2023-07-09
21-17-44](https://github.com/go-gitea/gitea/assets/47871822/61ac6ec4-a319-4d5c-9c99-2e02a77295ba)
![Bildschirmfoto vom 2023-07-09
21-18-27](https://github.com/go-gitea/gitea/assets/47871822/5b55b73f-6244-47f7-a3e6-c5e4a7474585)
![Bildschirmfoto vom 2023-07-09
21-19-18](https://github.com/go-gitea/gitea/assets/47871822/c1b7c22e-3e5a-46d4-b8d6-5560db478c0b)
![Bildschirmfoto vom 2023-07-09
21-29-13](https://github.com/go-gitea/gitea/assets/47871822/82ffca8d-ab2e-4a18-9954-5b685bf6a422)
![Bildschirmfoto vom 2023-07-09
21-30-11](https://github.com/go-gitea/gitea/assets/47871822/ad2fdccc-2be8-41bb-bfdc-a084aa387b61)
![Bildschirmfoto vom 2023-07-09
21-32-44](https://github.com/go-gitea/gitea/assets/47871822/2d298ba7-d084-48b5-a139-f86d56262110)
![Bildschirmfoto vom 2023-07-09
21-33-28](https://github.com/go-gitea/gitea/assets/47871822/4cbd838e-9de8-4ad0-8ed9-438da5c9a5cb)

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoMention `devtest` in frontend contributing guidelines (#26249)
Denys Konovalov [Mon, 31 Jul 2023 10:49:21 +0000 (12:49 +0200)]
Mention `devtest` in frontend contributing guidelines (#26249)

Our `devtest` page contains some good UI examples which should be taken
as example when working on Gitea UI. Mention it in our frontend
contributing guidelines to for new contributors to know about it.

14 months agoAdd 'Show on a map' button to Location in profile, fix layout (#26214)
Panagiotis "Ivory" Vasilopoulos [Mon, 31 Jul 2023 08:44:45 +0000 (08:44 +0000)]
Add 'Show on a map' button to Location in profile, fix layout (#26214)

Not too important, but I think that it'd be a pretty neat touch.

Also fixes some layout bugs introduced by a previous PR.

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoUse shared template for webhook icons (#26242)
silverwind [Mon, 31 Jul 2023 08:00:52 +0000 (10:00 +0200)]
Use shared template for webhook icons (#26242)

Fixes: https://github.com/go-gitea/gitea/issues/26241
14 months agoReduce margins on user settings page, introduce `flex-container` (#26046)
silverwind [Mon, 31 Jul 2023 07:16:03 +0000 (09:16 +0200)]
Reduce margins on user settings page, introduce `flex-container` (#26046)

Same as https://github.com/go-gitea/gitea/pull/26026 but for the user
settings page. It introduces a new `flex-container` class and shares it
across both pages.

Before and After:
<img width="1264" alt="Screenshot 2023-07-21 at 19 35 57"
src="https://github.com/go-gitea/gitea/assets/115237/1358dab4-55c0-40ce-a4d5-673099304f3d">
<img width="1269" alt="Screenshot 2023-07-21 at 19 35 42"
src="https://github.com/go-gitea/gitea/assets/115237/34812f6d-dc65-4009-b977-90e03efdc6d1">

14 months agoRefactor and enhance issue indexer to support both searching, filtering and paging...
Jason Song [Mon, 31 Jul 2023 06:28:53 +0000 (14:28 +0800)]
Refactor and enhance issue indexer to support both searching, filtering and paging (#26012)

Fix #24662.

Replace #24822 and #25708 (although it has been merged)

## Background

In the past, Gitea supported issue searching with a keyword and
conditions in a less efficient way. It worked by searching for issues
with the keyword and obtaining limited IDs (as it is heavy to get all)
on the indexer (bleve/elasticsearch/meilisearch), and then querying with
conditions on the database to find a subset of the found IDs. This is
why the results could be incomplete.

To solve this issue, we need to store all fields that could be used as
conditions in the indexer and support both keyword and additional
conditions when searching with the indexer.

## Major changes

- Redefine `IndexerData` to include all fields that could be used as
filter conditions.
- Refactor `Search(ctx context.Context, kw string, repoIDs []int64,
limit, start int, state string)` to `Search(ctx context.Context, options
*SearchOptions)`, so it supports more conditions now.
- Change the data type stored in `issueIndexerQueue`. Use
`IndexerMetadata` instead of `IndexerData` in case the data has been
updated while it is in the queue. This also reduces the storage size of
the queue.
- Enhance searching with Bleve/Elasticsearch/Meilisearch, make them
fully support `SearchOptions`. Also, update the data versions.
- Keep most logic of database indexer, but remove
`issues.SearchIssueIDsByKeyword` in `models` to avoid confusion where is
the entry point to search issues.
- Start a Meilisearch instance to test it in unit tests.
- Add unit tests with almost full coverage to test
Bleve/Elasticsearch/Meilisearch indexer.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
14 months agoShow image size on view page (#25884)
JakobDev [Mon, 31 Jul 2023 05:04:45 +0000 (07:04 +0200)]
Show image size on view page (#25884)

This simply shows the Image size on the view page. This is useful, if
you search a image with a specific size.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/9868e361-1c2e-447f-b824-70aa28bafcbc)

14 months agoFix pull request check list is limited (#26179)
caicandong [Mon, 31 Jul 2023 02:21:09 +0000 (10:21 +0800)]
Fix pull request check list is limited (#26179)

In the original implementation, we can only get the first 30 records of
the commit status (the default paging size), if the commit status is
more than 30, it will lead to the bug #25990. I made the following two
changes.
- On the page, use the ` db.ListOptions{ListAll: true}` parameter
instead of `db.ListOptions{}`
- The `GetLatestCommitStatus` function makes a determination as to
whether or not a pager is being used.

fixed #25990

14 months agoFix API leaking Usermail if not logged in (#25097)
JakobDev [Mon, 31 Jul 2023 01:18:38 +0000 (03:18 +0200)]
Fix API leaking Usermail if not logged in (#25097)

The API should only return the real Mail of a User, if the caller is
logged in. The check do to this don't work. This PR fixes this. This not
really a security issue, but can lead to Spam.

---------

Co-authored-by: silverwind <me@silverwind.io>
14 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 31 Jul 2023 00:32:16 +0000 (00:32 +0000)]
[skip ci] Updated licenses and gitignores

14 months agoFix typo in metadata (#26207)
KN4CK3R [Sun, 30 Jul 2023 23:54:22 +0000 (01:54 +0200)]
Fix typo in metadata (#26207)

https://github.com/go-gitea/gitea/pull/26194#discussion_r1277094525

There is no need to backport because these names are just used internal.

14 months agoUpdate js and py dependencies (#26243)
silverwind [Sun, 30 Jul 2023 23:16:12 +0000 (01:16 +0200)]
Update js and py dependencies (#26243)

- Update all JS and PY dependencies minus
`eslint-plugin-eslint-comments` (because of
https://github.com/eslint-community/eslint-plugin-eslint-comments/issues/89)
- Regenerate SVGs
- Remove depreacted eslint rule
- Tested mermaid and swagger

14 months agoDe-emphasize issue sidebar buttons (#26171)
silverwind [Sun, 30 Jul 2023 22:46:53 +0000 (00:46 +0200)]
De-emphasize issue sidebar buttons (#26171)

I find the colored buttons in the issue sidebar distracting, given that
they are not primary actions, I think we can de-colorize them.

Before:
<img width="285" alt="Screenshot 2023-07-26 at 19 42 22"
src="https://github.com/go-gitea/gitea/assets/115237/7e784805-4e01-4199-94bb-0538a0130264">
<img width="288" alt="Screenshot 2023-07-26 at 19 43 06"
src="https://github.com/go-gitea/gitea/assets/115237/3a89c661-e24a-4ebf-a585-d404d0a6a78a">
<img width="285" alt="Screenshot 2023-07-26 at 19 44 36"
src="https://github.com/go-gitea/gitea/assets/115237/c1aa8c13-6f41-4763-8149-d1c07cb4be5c">:

After:
<img width="286" alt="Screenshot 2023-07-26 at 19 42 04"
src="https://github.com/go-gitea/gitea/assets/115237/74d640c2-e0ab-4fef-87aa-9e788e9010e2">
<img width="285" alt="Screenshot 2023-07-26 at 19 42 51"
src="https://github.com/go-gitea/gitea/assets/115237/3b69976a-9aa4-4e1c-8df3-4168f4a9fcf9">
<img width="286" alt="Screenshot 2023-07-26 at 19 45 15"
src="https://github.com/go-gitea/gitea/assets/115237/897222fd-4df2-4d99-98eb-e5f8fb77c4d6">

14 months agoDon't autosize textarea in diff view (#26233)
silverwind [Sun, 30 Jul 2023 22:11:15 +0000 (00:11 +0200)]
Don't autosize textarea in diff view (#26233)

Resizing the comment editor can be a very expensive operation because it
triggers page reflows, which on large PRs can take upwards of seconds to
complete. Disable this mechanism on the diff page only where we know
that the page can get large.

Fixes https://github.com/go-gitea/gitea/issues/26201 for the textarea
editor.

I don't think this can be fixed for EasyMDE because as far as I can
tell, it exposes no option to disable this resizing.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoAdd `/public/assets` to `.ignore` (#26232)
silverwind [Sun, 30 Jul 2023 10:34:20 +0000 (12:34 +0200)]
Add `/public/assets` to `.ignore` (#26232)

Ignore compiled assets when searching via ripgrep and similar search
tools.

14 months agoFix attachment clipboard copy on insecure origin (#26224)
silverwind [Sat, 29 Jul 2023 22:56:45 +0000 (00:56 +0200)]
Fix attachment clipboard copy on insecure origin (#26224)

Fixes: https://github.com/go-gitea/gitea/issues/26202
Actually later I found out the code did not use `clippie`, so I fixed
it. The bug was never in the clippie module like I initially suspected.
Also, I added a tooltip for feedback.

<img width="139" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/da501670-9c15-4412-969a-b559773c7ab9">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix commit compare style (#26209)
puni9869 [Sat, 29 Jul 2023 16:19:12 +0000 (21:49 +0530)]
Fix commit compare style (#26209)

as title

Fixes : #25825
Before
<img width="1334" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c54a41b0-39bd-4094-a956-081a8f4128f2">

After change
<img width="1340" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c112d235-6bbe-4bcb-9529-78da3ab0fa14">

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix unable to display individual-level project (#26198)
caicandong [Sat, 29 Jul 2023 15:35:53 +0000 (23:35 +0800)]
Fix unable to display individual-level project (#26198)

As title

Before:

![image](https://github.com/go-gitea/gitea/assets/50507092/94afc3bf-5597-4151-a59b-5632840ffa21)

After:

![image](https://github.com/go-gitea/gitea/assets/50507092/df81aa0b-98a6-477d-a270-2e45b3dca0fc)

fix #26189

14 months agoFix access check for org-level project (#26182)
Zettat123 [Sat, 29 Jul 2023 14:13:24 +0000 (22:13 +0800)]
Fix access check for org-level project (#26182)

Fix #25934

Add `ignoreGlobal` parameter to `reqUnitAccess` and only check global
disabled units when `ignoreGlobal` is true. So the org-level projects
and user-level projects won't be affected by global disabled
`repo.projects` unit.

14 months agoFixed incorrect locale references (#26218)
Kerwin Bryant [Sat, 29 Jul 2023 13:34:22 +0000 (21:34 +0800)]
Fixed incorrect locale references (#26218)

Fixed two incorrect headers for setting the page navigation bar:
* User settings page, should not use the title "`org.settings`"
* Repo settings page, should not use the title "`org.settings`"

14 months agoUse calendar icon for `Joined on...` in profiles (#26215)
Panagiotis "Ivory" Vasilopoulos [Sat, 29 Jul 2023 11:34:49 +0000 (11:34 +0000)]
Use calendar icon for `Joined on...` in profiles (#26215)

14 months agoAdd changelog for 1.20.2 (#26208)
delvh [Sat, 29 Jul 2023 07:07:03 +0000 (09:07 +0200)]
Add changelog for 1.20.2 (#26208)

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoAdd commits dropdown in PR files view and allow commit by commit review (#25528)
sebastian-sauer [Fri, 28 Jul 2023 19:18:12 +0000 (21:18 +0200)]
Add commits dropdown in PR files view and allow commit by commit review (#25528)

This PR adds a new dropdown to select a commit or a commit range
(shift-click like github) of a Pull Request.
After selection of a commit only the changes of this commit will be shown.
When selecting a range of commits the diff of this range is shown.

This allows to review a PR commit by commit or by viewing only commit ranges.
The "Show changes since your last review" mechanism github uses is implemented, too.
When reviewing a single commit or a commit range the "Viewed" functionality is disabled.

## Screenshots

### The commit dropdown

![image](https://github.com/go-gitea/gitea/assets/51889757/0db3ae62-1272-436c-be64-4730c5d611e3)

### Selecting a commit range

![image](https://github.com/go-gitea/gitea/assets/51889757/ad81eedb-8437-42b0-8073-2d940c25fe8f)

### Show changes of a single commit only

![image](https://github.com/go-gitea/gitea/assets/51889757/6b1a113b-73ef-4ecc-adf6-bc2340bb8f97)

### Show changes of a commit range

![image](https://github.com/go-gitea/gitea/assets/51889757/6401b358-cd66-4c09-8baa-6cf6177f23a7)

Fixes https://github.com/go-gitea/gitea/issues/20989
Fixes https://github.com/go-gitea/gitea/issues/19263

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
14 months agoWarn instead of reporting an error when a webhook cannot be found (#26039)
puni9869 [Fri, 28 Jul 2023 17:46:48 +0000 (23:16 +0530)]
Warn instead of reporting an error when a webhook cannot be found (#26039)

Attemp fix: #25744
Fixing the log level when we delete any repo then we get error hook not
found by id. That should be warn level to reduce the noise in the logs.

---------

Co-authored-by: delvh <dev.lh@web.de>
14 months agoFixing the align of commit stats in commit_page template. (#26161)
puni9869 [Fri, 28 Jul 2023 17:12:44 +0000 (22:42 +0530)]
Fixing the align of commit stats in commit_page template. (#26161)

Fixing the align center to row and space around for commit_page
template.

14 months agoFix allowed user types setting problem (#26200)
Lunny Xiao [Fri, 28 Jul 2023 16:15:39 +0000 (00:15 +0800)]
Fix allowed user types setting problem (#26200)

Fix #25951

14 months agoHide branch/tag icon if branches/tags are empty (#26204)
wxiaoguang [Fri, 28 Jul 2023 15:05:24 +0000 (23:05 +0800)]
Hide branch/tag icon if branches/tags are empty (#26204)

The branch/tag icons aren't hidden correctly if there is no branch/tag. This PR fixes it.

14 months agoPrevent primary key update on migration (#26192)
KN4CK3R [Fri, 28 Jul 2023 07:54:31 +0000 (09:54 +0200)]
Prevent primary key update on migration (#26192)

Fixes #25918

The migration fails on MSSQL because xorm tries to update the primary
key column. xorm prevents this if the column is marked as auto
increment:

https://gitea.com/xorm/xorm/src/commit/c622cdaf893fbfe3f40a6b79f6bc17ee10f53865/internal/statements/update.go#L38-L40

I think it would be better if xorm would check for primary key columns
here because updating such columns is bad practice. It looks like if
that auto increment check should do the same.

fyi @lunny

14 months agoimprove unit test for caching (#26185)
Earl Warren [Thu, 27 Jul 2023 20:24:40 +0000 (22:24 +0200)]
improve unit test for caching (#26185)

- Configure `setting.CacheService.TTL` which will force the code to go
trough the caching mechanism.
- Remove the TODO and uncomment the test code.

(cherry picked from commit a201f2f1896c1a086f3e37f86b1306d44c07f2e4)

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

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
14 months agoRender plaintext task list items for markdown files (#26186)
Earl Warren [Thu, 27 Jul 2023 14:15:31 +0000 (16:15 +0200)]
Render plaintext task list items for markdown files (#26186)

- The library that's being used for org-mode, [doesn't render the status
of list items](https://github.com/niklasfasching/go-org/issues/63).
- Add a modified version of the proposed CSS snippet to still display
the status for the list items. The alternative was parsing HTML and
transforming it, which is too complicated for this small task.
- Resolves https://codeberg.org/Codeberg/Community/issues/1099

(cherry picked from commit 9753c7e4b8490b8f1e3d19cb06187503b88afb88)

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

Co-authored-by: Gusted <postmaster@gusted.xyz>
14 months agoAdd tooltip to describe LFS table column and color `delete LFS file` button red ...
puni9869 [Thu, 27 Jul 2023 13:39:09 +0000 (19:09 +0530)]
Add tooltip to describe LFS table column and color `delete LFS file` button red (#26181)

Fix: https://github.com/go-gitea/gitea/issues/26152
Thease changes are related to UX and accessibility changes in desktop
mode.

<img width="50" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/30a75b50-4f8d-4108-9219-2c69b2a8fa6f">

Also  this is incomplete header
<img width="264" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/87837076-dfc7-4a68-863a-795edf61eb02">
Lets add a tooltip if it is applicable or add `title` attribute so that
it will be clearly visible.

After

![image](https://github.com/go-gitea/gitea/assets/80308335/e1f91458-a0ab-4a9a-b32a-d1eaaac05b37)

![image](https://github.com/go-gitea/gitea/assets/80308335/fe2031d3-0b26-427f-8438-49e8f54bc12f)

14 months agoShow branches and tags that contain a commit (#25180)
delvh [Thu, 27 Jul 2023 10:47:41 +0000 (12:47 +0200)]
Show branches and tags that contain a commit (#25180)

Now, you can see for a commit which existing branches and tags contain it.
You first have to click on the `load branches and tags` button, they are not preloaded by default.
All branches and tags are ordered descending by creation date.
You can even see without much hassle if the given commit is already part of the default branch.

Closes #25152

## Screenshots

### Initial

![image](https://github.com/go-gitea/gitea/assets/51889757/84db2c0b-aaef-4f69-ab92-0b812793d2ad)

### Loaded

![image](https://github.com/go-gitea/gitea/assets/51889757/a9b84e66-8e44-4c55-b017-c37f4a45f41b)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoRelease attachments duplicated check (#26176)
Lunny Xiao [Thu, 27 Jul 2023 09:24:22 +0000 (17:24 +0800)]
Release attachments duplicated check (#26176)

14 months agoCalculate MAX_WORKERS default value by CPU number (#26177)
wxiaoguang [Thu, 27 Jul 2023 08:40:35 +0000 (16:40 +0800)]
Calculate MAX_WORKERS default value by CPU number (#26177)

To avoid consuming user's 100% CPU, limit the default value of
MAX_WORKERS

Fix #26063 (the CPU 100% problem mentioned in it)

14 months agoFixing redirection issue for logged-in users (#26105)
cassiozareck [Thu, 27 Jul 2023 05:08:51 +0000 (02:08 -0300)]
Fixing redirection issue for logged-in users (#26105)

This PR addresses an issue where logged-in users get redirected to the
homepage when trying to access a URL with the redirect_to parameter. The
issue was traced back to a middleware function in
services/auth/middleware.go that redirects logged-in users to the
homepage. This function didn't account the redirect_to parameter.

The fix modifies the middleware function to check for this case and
redirect the user to the specified URL instead of the homepage.

Closes: #26005
---------

Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoUpdate govulncheck, fix typo (#26168)
silverwind [Wed, 26 Jul 2023 22:51:02 +0000 (00:51 +0200)]
Update govulncheck, fix typo (#26168)

- Update govulncheck to latest version
- Fix typo in variable name

14 months agoFix handling of plenty Nuget package versions (#26075)
KN4CK3R [Wed, 26 Jul 2023 19:43:21 +0000 (21:43 +0200)]
Fix handling of plenty Nuget package versions (#26075)

Fixes #25953

- Do not load full version information (v3)
- Add pagination support (v2)