]> source.dussan.org Git - gitea.git/log
gitea.git
14 months agoFix various line-height styles (#26553)
wxiaoguang [Thu, 17 Aug 2023 21:50:32 +0000 (05:50 +0800)]
Fix various line-height styles (#26553)

Fix #26537

Use the same default line-height as "normalize.css" instead of "1". "1"
is not right because it doesn't work with descent part and causes
overflow problems.

![image](https://github.com/go-gitea/gitea/assets/2114189/3f2e8fb5-b326-4889-bfff-c79c75f1b7f4)

---------

Co-authored-by: silverwind <me@silverwind.io>
14 months agoReturn empty when searching issues with no repos (#26545)
Jason Song [Thu, 17 Aug 2023 17:42:17 +0000 (01:42 +0800)]
Return empty when searching issues with no repos (#26545)

14 months agoSupport rebuilding issue indexer manually (#26546)
Jason Song [Thu, 17 Aug 2023 14:05:17 +0000 (22:05 +0800)]
Support rebuilding issue indexer manually (#26546)

Provide a way to rebuild issue indexer manually.

So if the indexer get outdated because of some bugs like #26539, we can
rebuild it.

<img width="1104" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/ac242e29-6f04-47ca-b3d0-801a796448d3">

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix label filter between `all` and `no` (#26557)
CaiCandong [Thu, 17 Aug 2023 13:19:24 +0000 (21:19 +0800)]
Fix label filter between `all` and `no` (#26557)

Regression of https://github.com/go-gitea/gitea/pull/25886.
# Description
For `labelIDs`:

https://github.com/go-gitea/gitea/blob/9afcb0e0461aa48a4fbda7740d4c5424911e35ef/routers/web/repo/issue.go#L171-L174
 - `nil` mean no filter
 - `[0]` mean `no label` filter

When `selectLabels == "0"`, labelIDs should be `[0]` rather than `nil`
 # Before:

https://github.com/go-gitea/gitea/assets/50507092/3dac5075-6da0-4769-ba20-48a56f4063c0

#  After:

https://github.com/go-gitea/gitea/assets/50507092/ff79fd4c-b02e-4dfb-9309-ae7851f4dcdb

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix "issueReposQueryPattern does not match query" (#26556)
Jason Song [Thu, 17 Aug 2023 12:38:02 +0000 (20:38 +0800)]
Fix "issueReposQueryPattern does not match query" (#26556)

Fix
`https://github.com/go-gitea/gitea/pull/26545#discussion_r1295734340`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoSync repo's IsEmpty status correctly (#26517)
wxiaoguang [Thu, 17 Aug 2023 04:43:39 +0000 (12:43 +0800)]
Sync repo's IsEmpty status correctly (#26517)

Close #26509

14 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 17 Aug 2023 00:21:25 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

14 months agoRemove fomantic transition module (#26469)
silverwind [Wed, 16 Aug 2023 22:12:40 +0000 (00:12 +0200)]
Remove fomantic transition module (#26469)

Removes all dropdown and dimmer animations. Works everywhere as far as I
can tell, but need to give this thorough testing. Removes around 70kb
JS/CSS.

Note, I'm not 100% sure regarding the various callbacks, those will need
more investigation, but it appears to work nonetheless.

Fixes: https://github.com/go-gitea/gitea/issues/15709
14 months agoExplain SearchOptions and fix ToSearchOptions (#26542)
Jason Song [Wed, 16 Aug 2023 15:40:13 +0000 (23:40 +0800)]
Explain SearchOptions and fix ToSearchOptions (#26542)

Follow #26012 #26490.

A detailed description has been added to the comment.

14 months agoUpdate go dependencies (#26534)
wxiaoguang [Wed, 16 Aug 2023 12:02:40 +0000 (20:02 +0800)]
Update go dependencies (#26534)

14 months agoDifferentiate better between user settings and admin settings (#26538)
yp05327 [Wed, 16 Aug 2023 10:12:03 +0000 (19:12 +0900)]
Differentiate better between user settings and admin settings (#26538)

User settings page and admin settings page are too similar. I thinlk
this will be better of using `User Settings` and `Admin Settings` as the
navbar's title.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/68db06f3-918b-41bc-b4d3-522b1057eb57)

![image](https://github.com/go-gitea/gitea/assets/18380374/24f53d91-54e1-410c-ad9b-438bb2c8069f)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/6600a872-d630-4ea6-a58f-d9ded7d38067)

![image](https://github.com/go-gitea/gitea/assets/18380374/501cde5d-9868-4cba-829d-ff8bafce695d)

14 months agoAdd missing triggers to update issue indexer (#26539)
Jason Song [Wed, 16 Aug 2023 09:36:05 +0000 (17:36 +0800)]
Add missing triggers to update issue indexer (#26539)

Fix #26536

Follow #26012

Whatever the comment type is, always update the issue indexer. So the
issue indexer will be updated when there is a change in Status,
Assignee, Label, and so on.

I added the logic for `NotifyUpdateComment`, but missed it for
`NotifyCreateIssueComment` and `NotifyDeleteComment`.

14 months agoImprove deadline icon location in milestone list page (#26532)
yp05327 [Wed, 16 Aug 2023 08:22:25 +0000 (17:22 +0900)]
Improve deadline icon location in milestone list page (#26532)

14 months agoUse unique class for breadcrumb divider (#26524)
silverwind [Wed, 16 Aug 2023 00:08:23 +0000 (02:08 +0200)]
Use unique class for breadcrumb divider (#26524)

Fix regression from https://github.com/go-gitea/gitea/pull/25539:
https://github.com/go-gitea/gitea/pull/26519#issuecomment-1678825200.

Before:
<img width="429" alt="Screenshot 2023-08-15 at 15 46 12"
src="https://github.com/go-gitea/gitea/assets/115237/a818f60a-77a2-48fe-8e6f-363d152ccb1e">

After:
<img width="424" alt="Screenshot 2023-08-15 at 15 46 19"
src="https://github.com/go-gitea/gitea/assets/115237/c90159e2-ced2-4a74-8a0f-a1b2b5d0b565">

<img width="605" alt="Screenshot 2023-08-15 at 15 56 11"
src="https://github.com/go-gitea/gitea/assets/115237/3ded6f57-86f4-422a-86cb-56dd2c216dee">

14 months agoFix typo of RunerOwnerID (#26508)
yp05327 [Tue, 15 Aug 2023 23:10:40 +0000 (08:10 +0900)]
Fix typo of RunerOwnerID (#26508)

14 months agoImprove clickable area in repo action view page (#26115)
yp05327 [Tue, 15 Aug 2023 22:44:43 +0000 (07:44 +0900)]
Improve clickable area in repo action view page (#26115)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/52e4dda1-0221-440b-93e1-242db8bd5885)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/dda5e72b-205e-44f7-b4a9-83703021f2d1)

In current design, the clickable area is too small, and it is hard to
find the correct clickable area as the area with background color (div
with class name `job-brief-item selected`) is bigger than it.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix dark theme highlight for "NameNamespace" (#26519)
wxiaoguang [Tue, 15 Aug 2023 22:10:10 +0000 (06:10 +0800)]
Fix dark theme highlight for "NameNamespace" (#26519)

The color is taken from "Name"

Before:

![image](https://github.com/go-gitea/gitea/assets/2114189/b94d7521-770c-4e14-a63b-f30c44fe883f)

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/d99c1f13-a0c0-4dc8-82ab-bfdd451e46ec)

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoRemove duplicate CSS import for chroma/base.css (#26523)
silverwind [Tue, 15 Aug 2023 21:13:56 +0000 (23:13 +0200)]
Remove duplicate CSS import for chroma/base.css (#26523)

14 months agoFix project filter bugs (#26490)
CaiCandong [Tue, 15 Aug 2023 14:50:12 +0000 (22:50 +0800)]
Fix project filter bugs (#26490)

related: #26012

### Bugs
1. missing project filter on the issue page.

https://github.com/go-gitea/gitea/blob/1e76a824bcd71acd59cdfb2c4547806bc34b3d86/modules/indexer/issues/dboptions.go#L11-L15
3. incorrect SQL condition: some issue does not belong to a project but
exists on the project_issue table.

https://github.com/go-gitea/gitea/blob/f5dbac9d36f1678b928bee04e85fbd045c725698/models/issues/issue_search.go#L233

### Before:

![before](https://github.com/go-gitea/gitea/assets/50507092/1dcde39e-3e2f-4151-b2c6-4d67bf493c2f)

### After:

![after](https://github.com/go-gitea/gitea/assets/50507092/badfb81f-056d-4a2f-9838-1cba9c15768d)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix display problems of members and teams unit (#26363)
yp05327 [Tue, 15 Aug 2023 14:00:35 +0000 (23:00 +0900)]
Fix display problems of members and teams unit (#26363)

Fix:
- display member count and team count in the menu bar

![image](https://github.com/go-gitea/gitea/assets/18380374/7f03ced4-67e2-41ce-b19f-a992823726bb)
- Also display member unit in the menu bar if there are no hidden
members in public org

![image](https://github.com/go-gitea/gitea/assets/18380374/31422ad6-7190-438d-8e99-8a4af9cce908)
- hidden member board when there's no seeable members.
In this org, we only have hidden members:

![image](https://github.com/go-gitea/gitea/assets/18380374/d749420b-554a-4483-8cd2-221df61b5ca7)
We will hidden the member board when doer is not the member of this org

![image](https://github.com/go-gitea/gitea/assets/18380374/93bb782e-7d4d-4ad3-a096-133afbc51f8a)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/eafc0b3e-6218-42ab-a892-39645d08a5eb)
If you click the number in the members board, you will access the
members page, which is not expected.

![image](https://github.com/go-gitea/gitea/assets/18380374/73d6dadc-0ef2-4ca9-8485-c5f4211bffb2)

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoUse `hidden` over `clip` for text truncation (#26520)
silverwind [Tue, 15 Aug 2023 13:23:51 +0000 (15:23 +0200)]
Use `hidden` over `clip` for text truncation (#26520)

Avoid browser bugs:

- Firefox not cutting off -
https://github.com/go-gitea/gitea/pull/26354#issuecomment-1678456052
- Safari not showing ellipsis -
https://github.com/go-gitea/gitea/pull/26354#issuecomment-1678812801

14 months agoAdd API route to list org secrets (#26485)
Bo-Yi Wu [Tue, 15 Aug 2023 12:32:43 +0000 (20:32 +0800)]
Add API route to list org secrets (#26485)

- Add a new function `CountOrgSecrets` in the file
`models/secret/secret.go`
- Add a new file `modules/structs/secret.go`
- Add a new function `ListActionsSecrets` in the file
`routers/api/v1/api.go`
- Add a new file `routers/api/v1/org/action.go`
- Add a new function `listActionsSecrets` in the file
`routers/api/v1/org/action.go`

go-sdk: https://gitea.com/gitea/go-sdk/pulls/629

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoSet "type=button" for editor's toolbar buttons (#26510)
wxiaoguang [Tue, 15 Aug 2023 11:31:48 +0000 (19:31 +0800)]
Set "type=button" for editor's toolbar buttons (#26510)

The editor usually is in a form, so the buttons should have
"type=button", avoid conflicting with the form's submit.

14 months agoApply to become a maintainer (#26514)
CaiCandong [Tue, 15 Aug 2023 09:30:06 +0000 (17:30 +0800)]
Apply to become a maintainer (#26514)

Here is my PR list:- [go-gitea/gitea/pulls (author:caicandong is:merged)](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+sort%3Aupdated-desc+author%3ACaiCandong+is%3Amerged)

14 months agoDetect ogg mime-type as audio or video (#26494)
wxiaoguang [Tue, 15 Aug 2023 02:31:25 +0000 (10:31 +0800)]
Detect ogg mime-type as audio or video (#26494)

"ogg" is just a "container" format for audio and video.

Golang's `DetectContentType` only reports "application/ogg" for
potential ogg files.

Actually it could do more "guess" to see whether it is a audio file or a
video file.

14 months agoUse `object-fit: contain` for oauth2 custom icons (#26493)
wxiaoguang [Mon, 14 Aug 2023 16:21:04 +0000 (00:21 +0800)]
Use `object-fit: contain` for oauth2 custom icons (#26493)

14 months agoadd disable workflow feature (#26413)
a1012112796 [Mon, 14 Aug 2023 15:14:30 +0000 (23:14 +0800)]
add disable workflow feature (#26413)

As title, that's simmilar with github.

![image](https://github.com/go-gitea/gitea/assets/25342410/9e8b2444-63e0-4e87-80da-730c1e4d09d6)

![image](https://github.com/go-gitea/gitea/assets/25342410/6c3a3345-3ba7-48c9-9acd-3e621632491b)

---------

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Jason Song <i@wolfogre.com>
14 months agoMove dropzone progress bar to bottom to show filename when uploading (#26492)
wxiaoguang [Mon, 14 Aug 2023 14:36:53 +0000 (22:36 +0800)]
Move dropzone progress bar to bottom to show filename when uploading (#26492)

1. Make the "filename" visible
2. Avoiding UI flicker when the uploading is completing

14 months agoHandle base64 decoding correctly to avoid panic (#26483)
wxiaoguang [Mon, 14 Aug 2023 10:30:16 +0000 (18:30 +0800)]
Handle base64 decoding correctly to avoid panic (#26483)

Fix the panic if the "base64 secret" is too long.

14 months agoAllow to archive labels (#26478)
puni9869 [Mon, 14 Aug 2023 09:56:14 +0000 (15:26 +0530)]
Allow to archive labels (#26478)

## Archived labels

This adds the structure to allow for archived labels.
Archived labels are, just like closed milestones or projects, a medium to hide information without deleting it.
It is especially useful if there are outdated labels that should no longer be used without deleting the label entirely.

## Changes

1. UI and API have been equipped with the support to mark a label as archived
2. The time when a label has been archived will be stored in the DB

## Outsourced for the future

There's no special handling for archived labels at the moment.
This will be done in the future.

## Screenshots

![image](https://github.com/go-gitea/gitea/assets/80308335/208f95cd-42e4-4ed7-9a1f-cd2050a645d4)

![image](https://github.com/go-gitea/gitea/assets/80308335/746428e0-40bb-45b3-b992-85602feb371d)

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

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoUpdate zh-cn documentation (#26406)
CaiCandong [Mon, 14 Aug 2023 05:35:49 +0000 (13:35 +0800)]
Update zh-cn documentation (#26406)

14 months agoFix NuGet search endpoints (#25613)
KN4CK3R [Mon, 14 Aug 2023 02:50:55 +0000 (04:50 +0200)]
Fix NuGet search endpoints (#25613)

Fixes #25564
Fixes #23191

- Api v2 search endpoint should return only the latest version matching
the query
- Api v3 search endpoint should return `take` packages not package
versions

14 months agoFix tooltip of commit select button (#26472)
silverwind [Mon, 14 Aug 2023 02:16:40 +0000 (04:16 +0200)]
Fix tooltip of commit select button (#26472)

Previously, the tooltip for this button was only shown after opening and
closing it once because it was only set after the server response, now
it shows before opening it.

14 months agofix grab cursor on default column (#26476)
Denys Konovalov [Mon, 14 Aug 2023 01:15:16 +0000 (03:15 +0200)]
fix grab cursor on default column (#26476)

Fix https://github.com/go-gitea/gitea/pull/26448#issuecomment-1676194200

I accidentally set grab cursor for project columns instead of issue
cards, which actually turned out not to be a problem - with proper check
for the default column, which can't be moved.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix storage path logic especially for relative paths (#26441)
Lunny Xiao [Sun, 13 Aug 2023 20:09:25 +0000 (04:09 +0800)]
Fix storage path logic especially for relative paths (#26441)

This PR rewrites the function `getStorage` and make it more clear.

Include tests from #26435, thanks @earl-warren

---------

Co-authored-by: Earl Warren <contact@earl-warren.org>
14 months agoRename `Sync2` -> `Sync` (#26479)
delvh [Sun, 13 Aug 2023 19:17:21 +0000 (21:17 +0200)]
Rename `Sync2` -> `Sync` (#26479)

The xorm `Sync2` has already been deprecated in favor of `Sync`,
so let's do the same inside the Gitea codebase.

Command used to replace everything:
```sh
for i in $(ag Sync2 --files-with-matches); do vim $i -c ':%sno/Sync2/Sync/g' -c ':wq'; done
```

14 months agoAdd ThreadID parameter for Telegram webhooks (#25996)
Earl Warren [Sun, 13 Aug 2023 14:00:06 +0000 (16:00 +0200)]
Add ThreadID parameter for Telegram webhooks (#25996)

Telegram has recently implemented threads (channels) for group chats.

Co-authored-by: neveraskedtoexist <matikot415@gmail.com>
14 months agoFix stderr usages (#26477)
wxiaoguang [Sun, 13 Aug 2023 12:49:30 +0000 (20:49 +0800)]
Fix stderr usages (#26477)

14 months agoUse correct pull request commit link instead of a generic commit link (#26434)
Lunny Xiao [Sun, 13 Aug 2023 09:04:42 +0000 (17:04 +0800)]
Use correct pull request commit link instead of a generic commit link (#26434)

Replace #26197
Since #25528 merged, the links of pull request commits should be
redirect to pull file changes UI but not the generic one.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoClose stdout correctly for "git blame" (#26470)
wxiaoguang [Sun, 13 Aug 2023 02:11:20 +0000 (10:11 +0800)]
Close stdout correctly for "git blame" (#26470)

Close stdout correctly for "git blame", otherwise the failed "git blame"
would case the request hanging forever.

And "os.Stderr" should never (seldom) be used as git command's stderr

14 months agoRefactor tests (#26464)
wxiaoguang [Sat, 12 Aug 2023 16:30:16 +0000 (00:30 +0800)]
Refactor tests (#26464)

1. Give the global variable clear names
2. Use generic parameter for `onGiteaRun`

14 months agoRemove last newline from config file (#26468)
wxiaoguang [Sat, 12 Aug 2023 15:28:35 +0000 (23:28 +0800)]
Remove last newline from config file (#26468)

When users put the secrets into a file (GITEA__sec__KEY__FILE), the
newline sometimes is different to avoid (eg: echo/vim/...)

So the last newline could be removed when reading, it makes the users
easier to maintain the secret files.

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoAdd matrix to support (#26382)
John Olheiser [Sat, 12 Aug 2023 14:54:50 +0000 (09:54 -0500)]
Add matrix to support (#26382)

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

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

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoRefactor project templates (#26448)
Denys Konovalov [Sat, 12 Aug 2023 10:30:28 +0000 (12:30 +0200)]
Refactor project templates (#26448)

This PR refactors a bunch of projects-related code, mostly the
templates.
The following things were done:
  - rename boards to columns in frontend code
  - use the new `ctx.Locale.Tr` method
  - cleanup template, remove useless newlines, classes, comments
  - merge org-/user and repo level project template together
    - move "new column" button into project toolbar
- move issue card (shared by projects and pinned issues) to shared
template, remove useless duplicated styles
- add search function to projects (to make the layout more similar to
milestones list where it is inherited from :laughing:)
  - maybe more changes I forgot I've done :laughing:

Closes #24893

After:
![Bildschirmfoto vom 2023-08-10
23-02-00](https://github.com/go-gitea/gitea/assets/47871822/cab61456-1d23-4373-8163-e567f1b3b5f9)
![Bildschirmfoto vom 2023-08-10
23-02-26](https://github.com/go-gitea/gitea/assets/47871822/94b55d60-5572-48eb-8111-538a52d8bcc6)
![Bildschirmfoto vom 2023-08-10
23-02-46](https://github.com/go-gitea/gitea/assets/47871822/a0358f4b-4e05-4194-a7bc-6e0ecba5a9b6)

---------

Co-authored-by: silverwind <me@silverwind.io>
14 months agoAvoiding accessing undefined mentionValues (#26461)
wxiaoguang [Sat, 12 Aug 2023 08:36:23 +0000 (16:36 +0800)]
Avoiding accessing undefined mentionValues (#26461)

The `window.config.mentionValues` might be undefined:

```
{{if or .Participants .Assignees .MentionableTeams}}
    mentionValues: ...
{{end}}
```

14 months agoTweak actions menu (#26278)
silverwind [Sat, 12 Aug 2023 08:26:53 +0000 (10:26 +0200)]
Tweak actions menu (#26278)

Ressurect lost changes from
https://github.com/go-gitea/gitea/pull/24451.

- Always show icons for each entry in the menu
- Make all checkboxes toggle only their feature, e.g. "seconds" and
"timestamps" can now be toggled on together.
- Reorder the items

<img width="845" alt="Screenshot 2023-08-01 at 19 19 27"
src="https://github.com/go-gitea/gitea/assets/115237/8a76e9bf-7966-42a6-87c9-e88cdddaec82">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoAdjust minio new sequence, now it will check whether bucket exist first and then...
Lunny Xiao [Sat, 12 Aug 2023 08:03:54 +0000 (16:03 +0800)]
Adjust minio new sequence, now it will check whether bucket exist first and then create one if it doesn't exist (#26420)

For some reason, the permission of the client_id and secret may cannot
create bucket, so now we will check whether bucket does exist first and
then try to create a bucket if it doesn't exist.

Try to fix #25984

Co-authored-by: silverwind <me@silverwind.io>
14 months agoSet commit id when ref used explicitly (#26447)
Jack Hay [Sat, 12 Aug 2023 07:33:12 +0000 (03:33 -0400)]
Set commit id when ref used explicitly (#26447)

In the `RepoRefForAPI()` context function `CommitID` is not set if `ref`
is used. It is set correctly for other if/else branches where `Commit`
is set. It doesn't appear that any routes that use `RepoRefForAPI()`
also use `CommitID` but that may be the case in the future.

## Changes
- Sets `ctx.Repo.CommitID` when `ref` is explicitly used for api routes
that use `RepoRefForAPI()`

14 months agoFix 404 error when remove self from an organization (#26362)
yp05327 [Sat, 12 Aug 2023 07:02:22 +0000 (16:02 +0900)]
Fix 404 error when remove self from an organization (#26362)

Same to #24322

Not only `leave` action but also `remove` action should check whether
user still belongs to the org.

14 months agoUpdate index doc (#26455)
CaiCandong [Sat, 12 Aug 2023 00:49:23 +0000 (08:49 +0800)]
Update index doc (#26455)

In the previous feature description, numerous functionalities of Gitea
were listed, which appeared redundant and failed to highlight the unique
characteristics of Gitea. Therefore, I have rewritten this section based
on the description provided on the official Gitea website

14 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 12 Aug 2023 00:20:47 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

14 months agoremove unnecessary explore org template (#26459)
Denys Konovalov [Fri, 11 Aug 2023 20:07:04 +0000 (22:07 +0200)]
remove unnecessary explore org template (#26459)

14 months agoFix URL of padlock icon in profile (#26446)
Panagiotis "Ivory" Vasilopoulos [Fri, 11 Aug 2023 17:40:38 +0000 (17:40 +0000)]
Fix URL of padlock icon in profile (#26446)

14 months agoCount only visible repos on profile (#25928)
JakobDev [Fri, 11 Aug 2023 17:08:05 +0000 (19:08 +0200)]
Count only visible repos on profile (#25928)

Fixes #25914

14 months agoUpdate upgrade documentation to add a check for deprecated configurations (#26451)
Lunny Xiao [Fri, 11 Aug 2023 05:53:23 +0000 (13:53 +0800)]
Update upgrade documentation to add a check for deprecated configurations (#26451)

fix
https://github.com/go-gitea/gitea/issues/25995#issuecomment-1674096710

---------

Co-authored-by: silverwind <me@silverwind.io>
14 months agoFall back to esbuild for css minify (#26445)
silverwind [Fri, 11 Aug 2023 04:13:25 +0000 (06:13 +0200)]
Fall back to esbuild for css minify (#26445)

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

The minification result is not ideal with esbuild, but it's better than
failing competely.

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoUpdate JS dependencies (#26449)
silverwind [Fri, 11 Aug 2023 00:29:15 +0000 (02:29 +0200)]
Update JS dependencies (#26449)

- Update all JS dependencies
- Tested Monaco and Swagger

14 months agoCall git.InitSimple for runRepoSyncReleases (#26396)
wxiaoguang [Thu, 10 Aug 2023 22:42:48 +0000 (06:42 +0800)]
Call git.InitSimple for runRepoSyncReleases (#26396)

Fix #26394

Otherwise, the git module is not initialized and it doesn't respect the
"timeout" config in app.ini

14 months agoTarget specific OS for devcontainer base image (#26422)
techknowlogick [Thu, 10 Aug 2023 21:57:29 +0000 (17:57 -0400)]
Target specific OS for devcontainer base image (#26422)

fixes #25842

credit to philippbeckmann for discovering this

14 months agoLock go to 1.21 on CI (#26433)
silverwind [Thu, 10 Aug 2023 21:53:44 +0000 (23:53 +0200)]
Lock go to 1.21 on CI (#26433)

To prevent unwanted surprises with new minor versions of go, lock the
version to minor version using [semver tilde
syntax](https://github.com/npm/node-semver#tilde-ranges-123-12-1). We
were already getting 1.21.0 since yesterday, so use that version now as
minimum.

14 months agoAlways show usernames in reaction tooltips (#26444)
Panagiotis "Ivory" Vasilopoulos [Thu, 10 Aug 2023 21:20:01 +0000 (21:20 +0000)]
Always show usernames in reaction tooltips (#26444)

Even if GetDisplayName() is normally preferred elsewhere, this change
provides more consistency, as usernames are also always being shown
when participating in a conversation taking place in an issue or
a pull request. This change makes conversations easier to follow, as
you would not have to have a mental association between someone's
username and someone's real name in order to follow what is happening.

This behavior matches GitHub's. Optimally, both the username and the
full name (if applicable) could be shown, but such an effort is a
much bigger task that needs to be thought out well.

14 months agoFix incorrect redirection in new issue using references (#26440)
CaiCandong [Thu, 10 Aug 2023 20:04:08 +0000 (04:04 +0800)]
Fix incorrect redirection in new issue using references (#26440)

fix #26427
related https://github.com/go-gitea/gitea/pull/25258

---

Before:

![gitea](https://github.com/go-gitea/gitea/assets/50507092/ed8d3a17-1f63-42f2-a698-3b684e70dc91)

---

After:

![After](https://github.com/go-gitea/gitea/assets/50507092/b8e1338f-c520-4abc-b0df-b812c021ac7e)

14 months agoFix the display of orgs listed in user profile (#26424)
yp05327 [Thu, 10 Aug 2023 19:28:36 +0000 (04:28 +0900)]
Fix the display of orgs listed in user profile (#26424)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/55759aad-cbf7-4d91-8559-b7781d184911)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/9de5136b-d0a0-4756-9426-125fd4b603d3)

In #26214, we changed each row's display into `flex` which caused this
problem.

![image](https://github.com/go-gitea/gitea/assets/18380374/66546e7e-a224-45e7-9008-224f0f2952c6)

![image](https://github.com/go-gitea/gitea/assets/18380374/e5190f88-e561-4361-894a-86c5fe88837e)
In old version:

![image](https://github.com/go-gitea/gitea/assets/18380374/36e58e98-7d75-4a63-844a-2beee460997a)

Maybe we can add paddings here?

![image](https://github.com/go-gitea/gitea/assets/18380374/dc61acd2-8995-46d4-b606-eb10c77dd877)
In old version;

![image](https://github.com/go-gitea/gitea/assets/18380374/478acba7-0bbc-4852-b208-3ae43fcea976)

14 months agominio: add missing region on client initialization (#26412) 25824/head
nekrondev [Thu, 10 Aug 2023 11:21:09 +0000 (13:21 +0200)]
minio: add missing region on client initialization (#26412)

The MinIO client isn't redirecting to the correct AWS endpoint if a
non-default data center is used.

In my use case I created an AWS bucket at `eu-central-1` region. Because
of the missing region initialization of the client the default
`us-east-1` API endpoint is used returning a `301 Moved Permanently`
response that's not handled properly by MinIO client. This in return
aborts using S3 storage on AWS as the `BucketExists()` call will fail
with the http moved error.

MinIO client trace shows the issue:

```text
---------START-HTTP---------
HEAD / HTTP/1.1
Host: xxxxxxxxxxx-prod-gitea-data.s3.dualstack.us-east-1.amazonaws.com
User-Agent: MinIO (windows; amd64) minio-go/v7.0.61
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20230809/accesspoint.eu-central-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20230809T141143Z

HTTP/1.1 301 Moved Permanently
Connection: close
Content-Type: application/xml
Date: Wed, 09 Aug 2023 14:11:43 GMT
Server: AmazonS3
X-Amz-Bucket-Region: eu-central-1
X-Amz-Id-2: UK7wfeYi0HcTcytNvQ3wTAZ5ZP1mOSMnvRZ9Fz4xXzeNsS47NB/KfFx2unFxo3L7XckHpMNPPVo=
X-Amz-Request-Id: S1V2MJV8SZ11GEVN
---------END-HTTP---------
```

Co-authored-by: Heiko Besemann <heiko.besemann@qbeyond.de>
14 months agoFix wrong middleware sequence (#26428)
Lunny Xiao [Thu, 10 Aug 2023 10:51:46 +0000 (18:51 +0800)]
Fix wrong middleware sequence (#26428)

14 months agoUse template context function for avatar rendering (#26385)
wxiaoguang [Thu, 10 Aug 2023 03:19:39 +0000 (11:19 +0800)]
Use template context function for avatar rendering (#26385)

Introduce `AvatarUtils`, no need to pass `$.Context` to every
sub-template, and simplify the template helper functions.

14 months agoAdd transaction when creating pull request created dirty data (#26259)
Lunny Xiao [Thu, 10 Aug 2023 02:39:21 +0000 (10:39 +0800)]
Add transaction when creating pull request created dirty data (#26259)

Fix #26129
Replace #26258

This PR will introduce a transaction on creating pull request so that if
some step failed, it will rollback totally. And there will be no dirty
pull request exist.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
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`.