]> source.dussan.org Git - gitea.git/log
gitea.git
7 months agoRefactor generate-svg.js (#29348)
silverwind [Fri, 23 Feb 2024 22:07:27 +0000 (23:07 +0100)]
Refactor generate-svg.js (#29348)

Small refactor to avoid `process` global and to sync it with
`generate-images`.

7 months agoMake optional.Option[T] type serializable (#29282)
6543 [Fri, 23 Feb 2024 21:51:46 +0000 (22:51 +0100)]
Make optional.Option[T] type serializable (#29282)

make the generic `Option` type de-/serializable for json and yaml

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoRemove jQuery from the stopwatch (#29351)
Yarden Shoham [Fri, 23 Feb 2024 21:19:54 +0000 (23:19 +0200)]
Remove jQuery from the stopwatch (#29351)

- Switched to plain JavaScript
- Tested the stopwatch functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/c8e9a401-45e5-4a1d-a683-0d655f1d570e)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoFix tarball/zipball download bug (#29342)
Zettat123 [Fri, 23 Feb 2024 17:49:46 +0000 (01:49 +0800)]
Fix tarball/zipball download bug (#29342)

Fix #29249

~~Use the `/repos/{owner}/{repo}/archive/{archive}` API to download.~~

Apply #26430 to archive download URLs.

7 months agoAdd support for `linguist-detectable` and `linguist-documentation` (#29267)
KN4CK3R [Fri, 23 Feb 2024 17:24:27 +0000 (18:24 +0100)]
Add support for `linguist-detectable` and `linguist-documentation` (#29267)

Add support for `linguist-detectable` and `linguist-documentation`
Add tests for the attributes

https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#detectable

https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#documentation

7 months agoAdjust changelog for v1.21.6 to move prs to correct labels (#29339) (#29343)
Lunny Xiao [Fri, 23 Feb 2024 11:09:18 +0000 (19:09 +0800)]
Adjust changelog for v1.21.6 to move prs to correct labels (#29339) (#29343)

When releasing, the releaser should read all the pull requests carefully
and do some adjustments because some of pull requests' labels are not
right when it's merged.

And the changelog tool needs to be adjusted. If one pull request has
both `bug` and `API`, it should mark it as `bug` but not `API`.

Backport #29339

7 months agoAllow options to disable user deletion from the interface on app.ini (#29275)
Lunny Xiao [Fri, 23 Feb 2024 07:24:04 +0000 (15:24 +0800)]
Allow options to disable user deletion from the interface on app.ini (#29275)

Extract from #20549

This PR added a new option on app.ini `[admin]USER_DISABLED_FEATURES` to
allow the site administrator to disable users visiting deletion user
interface or allow.
This options are also potentially allowed to define more features in
future PRs.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoStart to migrate from `util.OptionalBool` to `optional.Option[bool]` (#29329)
6543 [Fri, 23 Feb 2024 02:18:33 +0000 (03:18 +0100)]
Start to migrate from `util.OptionalBool` to `optional.Option[bool]` (#29329)

just create transition helper and migrate two structs

7 months agoAdd slow SQL query warning (#27545)
Earl Warren [Fri, 23 Feb 2024 00:57:24 +0000 (01:57 +0100)]
Add slow SQL query warning (#27545)

- Databases are one of the most important parts of Forgejo, every
interaction uses the database in one way or another. Therefore, it is
important to maintain the database and recognize when the server is not
doing well with the database. There already is the option to log *every*
SQL query along with its execution time, but monitoring becomes
impractical for larger instances and takes up unnecessary storage in the
logs.
- Add a QoL enhancement that allows instance administrators to specify a
threshold value beyond which query execution time is logged as a warning
in the xorm logger. The default value is a conservative five seconds to
avoid this becoming a source of spam in the logs.
- The use case for this patch is that with an instance the size of
Codeberg, monitoring SQL logs is not very fruitful and most of them are
uninteresting. Recently, in the context of persistent deadlock issues
(https://codeberg.org/forgejo/forgejo/issues/220), I have noticed that
certain queries hold locks on tables like comment and issue for several
seconds. This patch helps to identify which queries these are and when
they happen.
- Added unit test.

(cherry picked from commit 9cf501f1af4cd870221cef6af489618785b71186)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
7 months agoUnify organizations header (#29248)
Tim-Nicas Oelschläger [Fri, 23 Feb 2024 00:24:57 +0000 (01:24 +0100)]
Unify organizations header (#29248)

Unify organizations header

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/74474e0d-33c3-4bbf-9324-d130ea2c62f8)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/1c65de0d-fa0f-4b17-ab8d-067de8c7113b)

---------

Co-authored-by: silverwind <me@silverwind.io>
7 months agoFrontport changelogs of minor releases (#29337)
6543 [Fri, 23 Feb 2024 00:24:07 +0000 (01:24 +0100)]
Frontport changelogs of minor releases (#29337)

as title

7 months agoSupport SAML authentication (#25165)
techknowlogick [Fri, 23 Feb 2024 00:08:17 +0000 (19:08 -0500)]
Support SAML authentication (#25165)

Closes https://github.com/go-gitea/gitea/issues/5512

This PR adds basic SAML support
- Adds SAML 2.0 as an auth source
- Adds SAML configuration documentation
- Adds integration test:
- Use bare-bones SAML IdP to test protocol flow and test account is
linked successfully (only runs on Postgres by default)
- Adds documentation for configuring and running SAML integration test
locally

Future PRs:
- Support group mapping
- Support auto-registration (account linking)

Co-Authored-By: @jackHay22
---------

Co-authored-by: jackHay22 <jack@allspice.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: morphelinho <morphelinho@users.noreply.github.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoUpgrade to fabric 6 (#29334)
silverwind [Thu, 22 Feb 2024 23:31:24 +0000 (00:31 +0100)]
Upgrade to fabric 6 (#29334)

Upgrade fabric to latest v6 beta. It works for our use case, even
thought it does not fix the upstream issue
https://github.com/fabricjs/fabric.js/issues/9679 that
https://github.com/go-gitea/gitea/issues/29326 relates to.

7 months agoDon't show third-party JS errors in production builds (#29303)
silverwind [Thu, 22 Feb 2024 21:21:43 +0000 (22:21 +0100)]
Don't show third-party JS errors in production builds (#29303)

So we don't get issues like
https://github.com/go-gitea/gitea/issues/29080 and
https://github.com/go-gitea/gitea/issues/29273 any more. Only active in
[production
builds](https://webpack.js.org/guides/production/#specify-the-mode), in
non-production the errors will still show.

7 months agoRemove bountysource (#29330)
Kyle D [Thu, 22 Feb 2024 18:53:03 +0000 (13:53 -0500)]
Remove bountysource (#29330)

[Bountysource is dead](https://github.com/bountysource/core/issues/1586). So remove them from our repo.

7 months ago Remove unnecessary "Str2html" modifier from templates (#29319)
wxiaoguang [Thu, 22 Feb 2024 18:05:47 +0000 (02:05 +0800)]
 Remove unnecessary "Str2html" modifier from templates (#29319)

Follow #29165

7 months agoIgnore the linux anchor point to avoid linux migrate failure (#29295)
Lunny Xiao [Thu, 22 Feb 2024 17:40:53 +0000 (01:40 +0800)]
Ignore the linux anchor point to avoid linux migrate failure (#29295)

Fix #28843

This PR will bypass the pushUpdateTag to database failure when
syncAllTags. An error log will be recorded.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove jQuery from the repo commit functions (#29230)
Yarden Shoham [Thu, 22 Feb 2024 17:13:25 +0000 (19:13 +0200)]
Remove jQuery from the repo commit functions (#29230)

- Switched to plain JavaScript
- Tested the commit ellipsis button functionality and it works as before
- Tested the commits statuses tippy functionality and it works as before
- Tested the last commit loader functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/465516f8-0ff3-438c-a17e-26cbab82750b)

![action](https://github.com/go-gitea/gitea/assets/20454870/968da210-9382-4b50-a4c2-09419dc86e07)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoRemove unnecessary "Safe" modifier from templates (#29318)
wxiaoguang [Thu, 22 Feb 2024 17:02:33 +0000 (01:02 +0800)]
Remove unnecessary "Safe" modifier from templates (#29318)

Follow #29165

7 months agoRemove jQuery from the image pasting functionality (#29324)
Yarden Shoham [Thu, 22 Feb 2024 16:35:58 +0000 (18:35 +0200)]
Remove jQuery from the image pasting functionality (#29324)

- Switched to plain JavaScript
- Tested the image pasting functionality and it works as before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/018993ff-7b09-4d5f-88e0-f276368bacd6)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoImprove the `issue_comment` workflow trigger event (#29277)
Zettat123 [Thu, 22 Feb 2024 14:47:35 +0000 (22:47 +0800)]
Improve the `issue_comment` workflow trigger event (#29277)

Fix #29175
Replace #29207

This PR makes some improvements to the `issue_comment` workflow trigger
event.

1. Fix the bug that pull requests cannot trigger `issue_comment`
workflows
2. Previously the `issue_comment` event only supported the `created`
activity type. This PR adds support for the missing `edited` and
`deleted` activity types.
3. Some events (including `issue_comment`, `issues`, etc. ) only trigger
workflows that belong to the workflow file on the default branch. This
PR introduces the `IsDefaultBranchWorkflow` function to check for these
events.

7 months agoProperly migrate automatic merge GitLab comments (#27873)
Sebastian Brückner [Thu, 22 Feb 2024 07:29:03 +0000 (07:29 +0000)]
Properly migrate automatic merge GitLab comments (#27873)

GitLab generates "system notes" whenever an event happens within the
platform. Unlike Gitea, those events are stored and retrieved as text
comments with no semantic details. The only way to tell whether a
comment was generated in this manner is the `system` flag on the note
type.

This PR adds detection for two specific kinds of events: Scheduling and
un-scheduling of automatic merges on a PR. When detected, they are
downloaded using Gitea's type for these events, and eventually uploaded
into Gitea in the expected format, i.e. with no text content in the
comment.

This PR also updates the template used to render comments to add support
for migrated comments of these two types.

ref:
https://gitlab.com/gitlab-org/gitlab/-/blob/11bd6dc826e0bea2832324a1d7356949a9398884/app/services/system_notes/merge_requests_service.rb#L6-L17

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRefactor cmd setup and remove deadcode (#29313)
wxiaoguang [Thu, 22 Feb 2024 07:04:30 +0000 (15:04 +0800)]
Refactor cmd setup and remove deadcode (#29313)

* use `setup(ctx, c.Bool("debug"))` like all other callers
* `setting.RunMode = "dev"` is a no-op.
* `if _, err := os.Stat(setting.RepoRootPath); err != nil` could be
simplified

7 months agosmall cache when get user id on interation (#29296)
Lunny Xiao [Thu, 22 Feb 2024 05:31:37 +0000 (13:31 +0800)]
small cache when get user id on interation (#29296)

7 months agoDiscard unread data of `git cat-file` (#29297)
KN4CK3R [Thu, 22 Feb 2024 03:48:19 +0000 (04:48 +0100)]
Discard unread data of `git cat-file` (#29297)

Fixes #29101
Related #29298

Discard all read data to prevent misinterpreting existing data. Some
discard calls were missing in error cases.

---------

Co-authored-by: yp05327 <576951401@qq.com>
7 months agoDon't install playwright twice (#29302)
silverwind [Thu, 22 Feb 2024 03:19:13 +0000 (04:19 +0100)]
Don't install playwright twice (#29302)

1. `playwright/test` is already installed as part of `deps-frontend` on
CI which runs before, so it's better to not install it again (on a
potentially different version), and just use the version from
package.json and add the `deps-frontend` dependency.
2. `PLAYWRIGHT_DIR` is a undefined variable, so I removed it

```bash
$ git show c8ded77680db7344c8dc1ccee76bce0b4e02e103 | grep PLAYWRIGHT_DIR
+playwright: $(PLAYWRIGHT_DIR)
```

7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 22 Feb 2024 00:23:48 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoPrevent double use of `git cat-file` session. (#29298)
KN4CK3R [Wed, 21 Feb 2024 18:54:17 +0000 (19:54 +0100)]
Prevent double use of `git cat-file` session. (#29298)

Fixes the reason why #29101 is hard to replicate.
Related #29297

Create a repo with a file with minimum size 4097 bytes (I use 10000) and
execute the following code:
```go
gitRepo, err := gitrepo.OpenRepository(db.DefaultContext, <repo>)
assert.NoError(t, err)

commit, err := gitRepo.GetCommit(<sha>)
assert.NoError(t, err)

entry, err := commit.GetTreeEntryByPath(<file>)
assert.NoError(t, err)

b := entry.Blob()

// Create a reader
r, err := b.DataAsync()
assert.NoError(t, err)
defer r.Close()

// Create a second reader
r2, err := b.DataAsync()
assert.NoError(t, err) // Should be no error but is ErrNotExist
defer r2.Close()
```

The problem is the check in `CatFileBatch`:

https://github.com/go-gitea/gitea/blob/79217ea63c1f77de7ca79813ae45950724e63d02/modules/git/repo_base_nogogit.go#L81-L87
`Buffered() > 0` is used to check if there is a "operation" in progress
at the moment. This is a problem because we can't control the internal
buffer in the `bufio.Reader`. The code above demonstrates a sequence
which initiates an operation for which the code thinks there is no
active processing. The second call to `DataAsync()` therefore reuses the
existing instances instead of creating a new batch reader.

7 months agoRevert #28753 because UI broken. (#29293)
Lunny Xiao [Wed, 21 Feb 2024 14:14:37 +0000 (22:14 +0800)]
Revert #28753 because UI broken. (#29293)

Revert #29255
Revert #28753

7 months agoFix error display when merging PRs (#29288)
Zettat123 [Wed, 21 Feb 2024 11:40:46 +0000 (19:40 +0800)]
Fix error display when merging PRs (#29288)

Partially fix #29071, regression of Modernize merge button #28140

Fix some missing `Redirect` -> `JSONRedirect`.

Thanks @yp05327 for the help in
https://github.com/go-gitea/gitea/issues/29071#issuecomment-1931261075

7 months agoRefactor markup rendering to accept general "protocol:" prefix (#29276)
wxiaoguang [Wed, 21 Feb 2024 10:08:08 +0000 (18:08 +0800)]
Refactor markup rendering to accept general "protocol:" prefix (#29276)

Follow #29024

Major changes:

* refactor validLinksPattern to fullURLPattern and add comments, now it
accepts "protocol:" prefix
* rename `IsLink*` to `IsFullURL*`, and remove unnecessray "mailto:"
check
* fix some comments (by the way)
* rename EmojiShortCodeRegex -> emojiShortCodeRegex (by the way)

7 months agoRemove jQuery from the installation page (#29284)
Yarden Shoham [Wed, 21 Feb 2024 08:13:48 +0000 (10:13 +0200)]
Remove jQuery from the installation page (#29284)

- Switched to plain JavaScript
- Tested the installation page functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/286475b3-1919-4d99-b790-def10fa36e66)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoAlways write proc-receive hook for all git versions (#29287)
wxiaoguang [Wed, 21 Feb 2024 07:01:48 +0000 (15:01 +0800)]
Always write proc-receive hook for all git versions (#29287)

7 months agoDo not use `ctx.Doer` when reset password (#29289)
Jason Song [Wed, 21 Feb 2024 04:57:22 +0000 (12:57 +0800)]
Do not use `ctx.Doer` when reset password (#29289)

Fix #29278.

Caused by a small typo in #28733

7 months agoUpdate Discord logo (#29285)
DC [Wed, 21 Feb 2024 01:55:26 +0000 (01:55 +0000)]
Update Discord logo (#29285)

Fixes #27057 by changing the discord .svg file and running `make svg`.

Before:

<img width="637"
src="https://private-user-images.githubusercontent.com/85847352/267667100-1eaf5d20-b4e9-4736-bb55-7f1da04bbde7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDg0NzAwNDUsIm5iZiI6MTcwODQ2OTc0NSwicGF0aCI6Ii84NTg0NzM1Mi8yNjc2NjcxMDAtMWVhZjVkMjAtYjRlOS00NzM2LWJiNTUtN2YxZGEwNGJiZGU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjIwVDIyNTU0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIwN2Y2ODc5N2MzZDU5NzgzODRhNDIzZWY3MDk3ODhiYmIzZDU4NWVlYmFmZjc2OTIyZjE3MWM4ZDg0ODZjNTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.C6jVQLFPfq4fhGV8wiY9D-P21PUNTDMkX2d2-kU17Ug">

After:

<img width="637"
src="https://github.com/go-gitea/gitea/assets/106393991/45b197ae-e422-42f4-999e-25dc8f6b7a92">

7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 21 Feb 2024 00:23:41 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoRemove jQuery .map() and enable eslint rules for it (#29272)
silverwind [Wed, 21 Feb 2024 00:05:17 +0000 (01:05 +0100)]
Remove jQuery .map() and enable eslint rules for it (#29272)

- Use case in `repo-commit` was tested until the point where the POST
request was sent with the same payload.
- Use case in `repo-legacy` was tested completely with comment editing.
- `jquery/no-fade` was disabled as well to stay in sync with
`no-jquery/no-fade`, had no violations.

7 months agoExplained where create issue/PR template (#29035) (#29266)
6543 [Tue, 20 Feb 2024 20:12:47 +0000 (21:12 +0100)]
Explained where create issue/PR template (#29035) (#29266)

For some user (as me), documentation lack of precision about where to
store issue/pr template.

I propose an enhancement about this point. With bold exergue and
precision about server itself.

I've found some user with same interrogation as :
https://forum.gitea.com/t/issue-template-directory/3328

---------

Co-authored-by: Km <cam.lafit@azerttyu.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
7 months agoRemove jQuery from repo wiki creation page (#29271)
Yarden Shoham [Tue, 20 Feb 2024 10:37:37 +0000 (12:37 +0200)]
Remove jQuery from repo wiki creation page (#29271)

- Switched to plain JavaScript
- Tested the wiki creation form functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/2dfc95fd-40cc-4ffb-9ae6-50f798fddd67)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoDo not show delete button when time tracker is disabled (#29257)
Zettat123 [Tue, 20 Feb 2024 01:39:44 +0000 (09:39 +0800)]
Do not show delete button when time tracker is disabled (#29257)

Fix #29233

The delete button of time logs won't be shown when the time tracker is disabled.

![image](https://github.com/go-gitea/gitea/assets/15528715/5cc4e0c9-d2f9-4b8f-a2f5-fe202b94c191)

7 months agoLeft align the input labels for the link account page (#29255)
Rafael Heard [Tue, 20 Feb 2024 01:01:48 +0000 (20:01 -0500)]
Left align the input labels for the link account page (#29255)

In a previous [PR](https://github.com/go-gitea/gitea/pull/28753) we
moved the labels to be above the inputs. The PR ensures that the
alignment is also on both tabs of the link account page
(`/user/link_account`).

Before
<img width="1094" alt="before"
src="https://github.com/go-gitea/gitea/assets/6152817/ac1e86bd-c4d6-4e45-87d1-87bb8a736149">

After
<img width="1094" alt="after"
src="https://github.com/go-gitea/gitea/assets/6152817/1b5fc109-f4d2-43ee-b924-0a9e53a0e391">

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
7 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 20 Feb 2024 00:23:17 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

7 months agoRemove jQuery from the repo migration form (#29229)
Yarden Shoham [Mon, 19 Feb 2024 22:34:35 +0000 (00:34 +0200)]
Remove jQuery from the repo migration form (#29229)

- Switched to plain JavaScript
- Tested the repo migration form functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/3496ec05-48a7-449e-8cdd-f8372ba0d589)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoFix content size does not match error when uploading lfs file (#29259)
vincent [Mon, 19 Feb 2024 14:50:03 +0000 (22:50 +0800)]
Fix content size does not match error when uploading lfs file (#29259)

![image](https://github.com/go-gitea/gitea/assets/38434877/cd726b4d-4771-4547-8aee-ae4e4b56b1d1)
When we update an lfs file by API
`api/v1/repos/{owner}/{repo}/contents/{filepath}`, there will show an
error

```json
{
  "message": "Put \"http://localhost:9000/gitea/lfs/38/92/05904d6c7bb83fc676513911226f2be25bf1465616bb9b29587100ab1414\": readfrom tcp [::1]:57300->[::1]:9000: content size does not match",
  "url": "http://localhost:3000/api/swagger"
}
```

The reason of this error is
https://github.com/go-gitea/gitea/blob/main/services/repository/files/update.go,
in this file, the `file.ContentReader` been used twice. So when use
`file.ContentReader` in the second time, the `i` of this Reader has been
updated to the length of the content. it will return 0 and an `io.EOF`
error when we try to read cotent from this Reader.

7 months agoWorkaround to clean up old reviews on creating a new one (#28554)
6543 [Mon, 19 Feb 2024 13:42:18 +0000 (14:42 +0100)]
Workaround to clean up old reviews on creating a new one (#28554)

close  #28542

blocks  #28544

---
*Sponsored by Kithara Software GmbH*

7 months agoDeduplicate translations for contributors graph (#29256)
Şahin Akkaya [Mon, 19 Feb 2024 12:47:38 +0000 (15:47 +0300)]
Deduplicate translations for contributors graph (#29256)

I have implemented three graph pages
([contributors](https://github.com/go-gitea/gitea/pull/27882), [code
frequency](https://github.com/go-gitea/gitea/pull/29191) and [recent
commits](https://github.com/go-gitea/gitea/pull/29210)) and they have
all same page title as the tab name so I decided to use same
translations for them. This PR is for contributors graph. Other PR's
have their own respective commits.

7 months agoRemove DataRaceCheck (#29258)
wxiaoguang [Mon, 19 Feb 2024 11:25:58 +0000 (19:25 +0800)]
Remove DataRaceCheck (#29258)

Since #26254, it started using `{{ctx.Locale.Tr ...}}`

Now the `ctx` seems stable enough, so the check could be removed.

7 months agoFix c/p error in inline documentation (#29148)
Johan Van de Wauw [Mon, 19 Feb 2024 10:51:58 +0000 (11:51 +0100)]
Fix c/p error in inline documentation (#29148)

Fix small copy/paste error in inline documentation

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoShow commit status for releases (#29149)
KN4CK3R [Mon, 19 Feb 2024 10:27:05 +0000 (11:27 +0100)]
Show commit status for releases (#29149)

Fixes #29082

![grafik](https://github.com/go-gitea/gitea/assets/1666336/bb2ccde1-ee99-459d-9e74-0fb8ea79e8b3)

7 months agoDisallow merge when required checked are missing (#29143)
Markus Amshove [Mon, 19 Feb 2024 09:57:08 +0000 (10:57 +0100)]
Disallow merge when required checked are missing (#29143)

fixes #21892

This PR disallows merging a PR when not all commit status contexts
configured in the branch protection are met.

Previously, the PR was happy to merge when one commit status was
successful and the other contexts weren't reported.

Any feedback is welcome, first time Go :-)
I'm also not sure if the changes in the template break something else

Given the following branch protection:

![branch_protection](https://github.com/go-gitea/gitea/assets/2401875/f871b4e4-138b-435a-b496-f9ad432e3dec)

This was shown before the change:

![before](https://github.com/go-gitea/gitea/assets/2401875/60424ff0-ee09-4fa0-856e-64e6e3fb0612)

With the change, it is now shown as this:

![after](https://github.com/go-gitea/gitea/assets/2401875/4e464142-efb1-4889-8166-eb3be26c8f3d)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoDo not use lower tag names to find releases/tags (#29261)
Jason Song [Mon, 19 Feb 2024 09:31:36 +0000 (17:31 +0800)]
Do not use lower tag names to find releases/tags (#29261)

Fix #26090, see
https://github.com/go-gitea/gitea/issues/26090#issuecomment-1952013206

Since `TagName` stores the original tag name and `LowerTagName` stores
the lower tag name, it doesn't make sense to use lowercase tags as
`TagNames` in `FindReleasesOptions`.

https://github.com/go-gitea/gitea/blob/5e72526da4e915791f03af056890e16821bde052/services/repository/push.go#L396-L397

While the only other usage looks correct:

https://github.com/go-gitea/gitea/blob/5e72526da4e915791f03af056890e16821bde052/routers/web/repo/repo.go#L416

7 months agoDownscale pasted PNG images based on metadata (#29123)
silverwind [Mon, 19 Feb 2024 02:23:06 +0000 (03:23 +0100)]
Downscale pasted PNG images based on metadata (#29123)

Some images like MacOS screenshots contain
[pHYs](http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.div.8)
data which we can use to downscale uploaded images so they render in the
same dppx ratio in which they were taken.

Before:

<img width="584" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/50979e3a-5d5a-40dc-a0a4-36eb6e28f14a">

After:

<img width="329" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/0690902a-f2fe-4c6b-97b3-6fdd67c21bad">

7 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 19 Feb 2024 00:24:35 +0000 (00:24 +0000)]
[skip ci] Updated licenses and gitignores

7 months agoDe-duplicate contributor graph translations (#29247)
Şahin Akkaya [Sun, 18 Feb 2024 21:02:07 +0000 (00:02 +0300)]
De-duplicate contributor graph translations (#29247)

7 months agoUse general token signing secret (#29205)
wxiaoguang [Sun, 18 Feb 2024 17:39:04 +0000 (01:39 +0800)]
Use general token signing secret (#29205)

Use a clearly defined "signing secret" for token signing.

7 months agoFix missed edit issues event for actions (#29237)
Lunny Xiao [Sun, 18 Feb 2024 15:16:34 +0000 (23:16 +0800)]
Fix missed edit issues event for actions (#29237)

Fix #29213

7 months agoClean up diff header css and reduce global textarea min-height (#29232)
silverwind [Sun, 18 Feb 2024 14:51:21 +0000 (15:51 +0100)]
Clean up diff header css and reduce global textarea min-height (#29232)

1. Tweak diff header and remove a numbe of unneeded CSS for it:

Before:
<img width="433" alt="Screenshot 2024-02-18 at 01 08 09"
src="https://github.com/go-gitea/gitea/assets/115237/d8b377c0-57bc-44d5-bb57-a582c7d4b3b4">

After:
<img width="463" alt="Screenshot 2024-02-18 at 01 07 56"
src="https://github.com/go-gitea/gitea/assets/115237/d08c17e7-5b86-4d07-81da-6371f4754325">

3. Reduce height of review textarea and also reduce fomantic's CSS from
12em to 8em. Now fits better on my screen:

<img width="1352" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/5c658d13-295e-4929-94da-13ade888020d">

---------

Co-authored-by: delvh <dev.lh@web.de>
7 months agoExpire artifacts before deleting them physically (#29241)
FuXiaoHei [Sun, 18 Feb 2024 14:25:14 +0000 (22:25 +0800)]
Expire artifacts before deleting them physically (#29241)

https://github.com/go-gitea/gitea/pull/27172#discussion_r1493735466

When cleanup artifacts, it removes storage first. If storage is not
exist (maybe delete manually), it gets error and continue loop. It makes
a dead loop if there are a lot pending but non-existing artifacts.

Now it updates db record at first to avoid keep a lot of pending status
artifacts.

7 months agoImprove TrHTML and add more tests (#29228)
wxiaoguang [Sun, 18 Feb 2024 12:15:24 +0000 (20:15 +0800)]
Improve TrHTML and add more tests (#29228)

Follow #29165.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
7 months agoConvert visibility to number (#29226)
Tim-Nicas Oelschläger [Sun, 18 Feb 2024 11:47:50 +0000 (12:47 +0100)]
Convert visibility to number (#29226)

Don't throw error while creating user (Fixes #29218)

7 months agoImplement some action notifier functions (#29173)
yp05327 [Sun, 18 Feb 2024 10:58:46 +0000 (19:58 +0900)]
Implement some action notifier functions (#29173)

Fix #29166

Add support for the following activity types of `pull_request`
- assigned
- unassigned
- review_requested
- review_request_removed
- milestoned
- demilestoned

7 months agoArtifact deletion in actions ui (#27172)
FuXiaoHei [Sun, 18 Feb 2024 10:33:50 +0000 (18:33 +0800)]
Artifact deletion in actions ui (#27172)

Add deletion link in runs view page.
Fix #26315

![image](https://github.com/go-gitea/gitea/assets/2142787/aa65a4ab-f434-4deb-b953-21e63c212033)

When click deletion button. It marks this artifact `need-delete`.

This artifact would be deleted when actions cleanup cron task.

7 months agoUpdate docs for actions variables (#29239)
zhangnew [Sun, 18 Feb 2024 10:04:58 +0000 (18:04 +0800)]
Update docs for actions variables (#29239)

the variables is supported, see
https://github.com/go-gitea/gitea/blob/a784ed3d6c6946fd9bf95f2e910f52f549326fe2/docs/content/usage/actions/act-runner.zh-cn.md?plain=1#L262-L289

7 months agoRefactor more code in templates (#29236)
wxiaoguang [Sun, 18 Feb 2024 09:52:02 +0000 (17:52 +0800)]
Refactor more code in templates  (#29236)

Follow #29165.

* Introduce JSONTemplate to help to render JSON templates
* Introduce JSEscapeSafe for templates. Now only use `{{ ... |
JSEscape}}` instead of `{{ ... | JSEscape | Safe}}`
* Simplify "UserLocationMapURL" useage

7 months agoUse "Safe" modifier for manually constructed safe HTML strings in templates (#29227)
wxiaoguang [Sun, 18 Feb 2024 01:48:59 +0000 (09:48 +0800)]
Use "Safe" modifier for manually constructed safe HTML strings in templates (#29227)

Follow #29165. These HTML strings are safe to be rendered directly, to
avoid double-escaping.

7 months agoRemove jQuery from the repo release form (#29225)
Yarden Shoham [Sun, 18 Feb 2024 01:22:09 +0000 (03:22 +0200)]
Remove jQuery from the repo release form (#29225)

- Switched to plain JavaScript
- Tested the repo release form functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/ede2072a-823d-418f-9890-a5a7445a1cc6)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoMake submit event code work with both jQuery event and native event (#29223)
wxiaoguang [Sat, 17 Feb 2024 20:48:10 +0000 (04:48 +0800)]
Make submit event code work with both jQuery event and native event (#29223)

Partially related to #29200 and fix other potential bugs.

Co-authored-by: Giteabot <teabot@gitea.io>
7 months agoRemove jQuery from repo migrate page (#29219)
Yarden Shoham [Sat, 17 Feb 2024 20:07:47 +0000 (22:07 +0200)]
Remove jQuery from repo migrate page (#29219)

- Switched to plain JavaScript
- Tested the repo migrate functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/44ad134b-832e-44b8-8e77-7cc8603d95fe)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
7 months agoRemove unneccesary `initUserAuthLinkAccountView` from "link account" page (#29217)
Yarden Shoham [Sat, 17 Feb 2024 17:51:35 +0000 (19:51 +0200)]
Remove unneccesary `initUserAuthLinkAccountView` from "link account" page (#29217)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoFix labels referencing the wrong ID in the user profile settings (#29199)
Yarden Shoham [Sat, 17 Feb 2024 15:01:25 +0000 (17:01 +0200)]
Fix labels referencing the wrong ID in the user profile settings (#29199)

2 instances of `for` with a wrong value and 1 `for` that had a reference
to a `name` instead of `id`.

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoFix label `for` pointing to a `name` instead of `id` in webhook settings (#29209)
Yarden Shoham [Sat, 17 Feb 2024 14:32:43 +0000 (16:32 +0200)]
Fix label `for` pointing to a `name` instead of `id` in webhook settings (#29209)

Here's the spec for the `for` attribute:
https://html.spec.whatwg.org/multipage/forms.html#attr-label-for

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoLoad outdated comments when (un)resolving conversation on PR timeline (#29203)
Jimmy Praet [Sat, 17 Feb 2024 14:07:56 +0000 (15:07 +0100)]
Load outdated comments when (un)resolving conversation on PR timeline (#29203)

Relates to #28654, #29039 and #29050.

The "show outdated comments" flag should only apply to the file diff
view.
On the PR timeline, outdated comments are always shown.
So they should also be loaded when (un)resolving a conversation on the
timeline page.

7 months agoFix missing template for follow button in organization (#29215)
Yarden Shoham [Sat, 17 Feb 2024 13:42:52 +0000 (15:42 +0200)]
Fix missing template for follow button in organization (#29215)

Leftover from https://github.com/go-gitea/gitea/pull/29005

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/24c74278-ccac-4dc6-bf26-713e90c07239)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/f91d503b-87d4-4c17-a56c-9c0a81fd9082)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agoEnable markdownlint `no-trailing-punctuation` and `no-blanks-blockquote` (#29214)
silverwind [Sat, 17 Feb 2024 13:18:05 +0000 (14:18 +0100)]
Enable markdownlint `no-trailing-punctuation` and `no-blanks-blockquote` (#29214)

Enable these two and fix issues.

7 months agoRemove jQuery from the webhook editor (#29211)
Yarden Shoham [Sat, 17 Feb 2024 13:17:04 +0000 (15:17 +0200)]
Remove jQuery from the webhook editor (#29211)

- Switched to plain JavaScript
- Tested the webhook editing functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/b24c264d-d5e5-4954-8789-e72564a99027)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
7 months agoRemove jQuery from issue reference context popup attach (#29216)
Yarden Shoham [Sat, 17 Feb 2024 13:11:56 +0000 (15:11 +0200)]
Remove jQuery from issue reference context popup attach (#29216)

- Switched to plain JavaScript
- Tested the context popup functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/1d2f173e-e626-4f7d-82c8-d1539d38d247)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
7 months agofix typo (#29212)
xkcdstickfigure [Sat, 17 Feb 2024 11:01:54 +0000 (11:01 +0000)]
fix typo (#29212)

7 months agoFix debian InRelease Acquire-By-Hash newline (#29204)
Robin Schoonover [Sat, 17 Feb 2024 05:40:13 +0000 (22:40 -0700)]
Fix debian InRelease Acquire-By-Hash newline (#29204)

There is a missing newline when generating the debian apt repo InRelease
file, which results in output like:

```
[...]
Date: Wed, 14 Feb 2024 05:03:01 UTC
Acquire-By-Hash: yesMD5Sum:
 51a518dbddcd569ac3e0cebf330c800a 3018 main-dev/binary-amd64/Packages
[...]
```

It appears this would probably result in apt ignoring the
Acquire-By-Hash setting and not using the by-hash functionality,
although I'm not sure how to confirm it.

7 months agoFix broken following organization (#29005)
yp05327 [Sat, 17 Feb 2024 05:13:37 +0000 (14:13 +0900)]
Fix broken following organization (#29005)

- following organization is broken from #28908
- add login check for the follow button in organization profile page

8 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 17 Feb 2024 00:23:24 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

8 months agoAdd `eslint-plugin-github` and fix issues (#29201)
silverwind [Fri, 16 Feb 2024 21:41:23 +0000 (22:41 +0100)]
Add `eslint-plugin-github` and fix issues (#29201)

This plugin has a few useful rules. The only thing I dislike about it is
that it pulls in a rather big number of dependencies for react-related
rules we don't use, but it can't really be avoided.

Rule docs:
https://github.com/github/eslint-plugin-github?tab=readme-ov-file#rules

8 months agoRemove jQuery from the "quick submit" handler (#29200)
Yarden Shoham [Fri, 16 Feb 2024 20:03:50 +0000 (22:03 +0200)]
Remove jQuery from the "quick submit" handler (#29200)

- Switched to plain JavaScript
- Tested the quick submit functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/abbd6c49-ad0f-4f95-b4ba-e969b85a46e8)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoFix `initCompLabelEdit` not being called (#29198)
Yarden Shoham [Fri, 16 Feb 2024 16:03:52 +0000 (18:03 +0200)]
Fix `initCompLabelEdit` not being called (#29198)

Fix broken `if` from https://github.com/go-gitea/gitea/pull/29195

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoRemove jQuery from username change prompt and fix its detection (#29197)
Yarden Shoham [Fri, 16 Feb 2024 15:52:50 +0000 (17:52 +0200)]
Remove jQuery from username change prompt and fix its detection (#29197)

- Switched to plain JavaScript
- Tested the user rename prompt toggling functionality and it works as
before
- Fixed bug that allowed pasting with the mouse to avoid the prompt

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/aa300ad7-612b-461e-bbb2-3f74b3b83ede)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/f2b5a51b-7b39-43c7-8a4a-62f1f77acae4)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
8 months agoRemove jQuery from organization rename prompt toggle (#29195)
Yarden Shoham [Fri, 16 Feb 2024 15:48:01 +0000 (17:48 +0200)]
Remove jQuery from organization rename prompt toggle (#29195)

- Switched to plain JavaScript
- Tested the organization rename prompt toggling functionality and it
works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/e6f641b0-aa46-4b85-9693-0d608cca855e)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
8 months agoRefactor JWT secret generating & decoding code (#29172)
wxiaoguang [Fri, 16 Feb 2024 15:18:30 +0000 (23:18 +0800)]
Refactor JWT secret generating & decoding code (#29172)

Old code is not consistent for generating & decoding the JWT secrets.

Now, the callers only need to use 2 consistent functions:
NewJwtSecretWithBase64 and DecodeJwtSecretBase64

And remove a non-common function Base64FixedDecode from util.go

8 months agoReference labels by IDs instead of names in `keys` settings (#29194)
Yarden Shoham [Fri, 16 Feb 2024 13:59:48 +0000 (15:59 +0200)]
Reference labels by IDs instead of names in `keys` settings (#29194)

Here's the spec for the `for` attribute:
https://html.spec.whatwg.org/multipage/forms.html#attr-label-for

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoRemove jQuery from SSH key form parser (#29193)
Yarden Shoham [Fri, 16 Feb 2024 13:34:29 +0000 (15:34 +0200)]
Remove jQuery from SSH key form parser (#29193)

- Switched to plain JavaScript
- Tested the SSH key title functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/4785c13d-8d30-448e-b74a-263935e2769f)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
8 months agoRefactor request function (#29187)
silverwind [Fri, 16 Feb 2024 13:27:00 +0000 (14:27 +0100)]
Refactor request function (#29187)

- Remove and prevent use of `body` argument, it is not used anywhere
- Remove uppercasing of method, we can require it to be uppercase

8 months agoDocker Tag Information in Docs (#29047)
wienans [Fri, 16 Feb 2024 13:22:00 +0000 (14:22 +0100)]
Docker Tag Information in Docs (#29047)

Add more details for the docker tag when using container registry.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
8 months agoFix gitea-action user avatar broken on edited menu (#29190)
yp05327 [Fri, 16 Feb 2024 09:50:20 +0000 (18:50 +0900)]
Fix gitea-action user avatar broken on edited menu (#29190)

Fix #29178

8 months agoDisable parallel Make execution (#29186)
silverwind [Fri, 16 Feb 2024 03:17:34 +0000 (04:17 +0100)]
Disable parallel Make execution (#29186)

Ref:
https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html

> If the .NOTPARALLEL special target with no prerequisites is specified
anywhere then the entire instance of make will be run serially,
regardless of the parallel setting

8 months agoAuto-update the system status in admin dashboard (#29163)
Yarden Shoham [Fri, 16 Feb 2024 02:52:25 +0000 (04:52 +0200)]
Auto-update the system status in admin dashboard (#29163)

- Refactor the system status list into its own template
- Change the backend to return only the system status if htmx initiated
the request
- `hx-get="{{$.Link}}/system_status`: reuse the backend handler
- `hx-swap="innerHTML"`: replace the `<div>`'s innerHTML (essentially
the new template)
- `hx-trigger="every 5s"`: call every 5 seconds
- `hx-indicator=".divider"`: the `is-loading` class shouldn't be added
to the div during the request, so set it on an element it has no effect
on
- Render "Since Last GC Time" with `<relative-time>`, so we send a
timestamp

# Auto-update in action GIF

![action](https://github.com/go-gitea/gitea/assets/20454870/c6e1f220-f0fb-4460-ac3b-59f315e30e29)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
8 months agoAvoid vue warning in dev mode (#29188)
silverwind [Fri, 16 Feb 2024 02:27:45 +0000 (03:27 +0100)]
Avoid vue warning in dev mode (#29188)

`vue` currently outputs a warning for this undefined variable during
development, which is apparently caused by a bug in `vue-cli`.
Workaround by setting this variable.

Ref: https://github.com/vuejs/vue-cli/pull/7443
Ref: https://stackoverflow.com/a/77765007/808699

8 months agoUpdate JS and PY dependencies (#29184)
silverwind [Fri, 16 Feb 2024 02:20:50 +0000 (03:20 +0100)]
Update JS and PY dependencies (#29184)

- Update all excluding `@mcaptcha/vanilla-glue` and
`eslint-plugin-array-func`
- Tested pdf, chart.js, swagger

8 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 16 Feb 2024 00:23:19 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

8 months agoImplement contributors graph (#27882)
Şahin Akkaya [Thu, 15 Feb 2024 22:21:13 +0000 (01:21 +0300)]
Implement contributors graph (#27882)

Continuation of https://github.com/go-gitea/gitea/pull/25439. Fixes #847

Before:
<img width="1296" alt="image"
src="https://github.com/go-gitea/gitea/assets/32161460/24571ac8-b254-43c9-b178-97340f0dc8a9">

----
After:
<img width="1296" alt="image"
src="https://github.com/go-gitea/gitea/assets/32161460/c60b2459-9d10-4d42-8d83-d5ef0f45bf94">

---
#### Overview
This is the implementation of a requested feature: Contributors graph
(#847)

It makes Activity page a multi-tab page and adds a new tab called
Contributors. Contributors tab shows the contribution graphs over time
since the repository existed. It also shows per user contribution graphs
for top 100 contributors. Top 100 is calculated based on the selected
contribution type (commits, additions or deletions).

---
#### Demo
(The demo is a bit old but still a good example to show off the main
features)

<video src="https://github.com/go-gitea/gitea/assets/32161460/9f68103f-8145-4cc2-94bc-5546daae7014" controls width="320" height="240">
  <a href="https://github.com/go-gitea/gitea/assets/32161460/9f68103f-8145-4cc2-94bc-5546daae7014">Download</a>
</video>

#### Features:

- Select contribution type (commits, additions or deletions)
- See overall and per user contribution graphs for the selected
contribution type
- Zoom and pan on graphs to see them in detail
- See top 100 contributors based on the selected contribution type and
selected time range
- Go directly to users' profile by clicking their name if they are
registered gitea users
- Cache the results so that when the same repository is visited again
fetching data will be faster

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: hiifong <i@hiif.ong>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: yp05327 <576951401@qq.com>
8 months agoAdd support for action artifact serve direct (#29120)
KN4CK3R [Thu, 15 Feb 2024 20:39:50 +0000 (21:39 +0100)]
Add support for action artifact serve direct (#29120)

Fixes #29093

8 months agoAdvertise WebAuthn support (#29176)
6543 [Thu, 15 Feb 2024 17:49:13 +0000 (18:49 +0100)]
Advertise WebAuthn support (#29176)

This well-known indicates for password manager, that passkeys are supported.

source:
https://android-developers.googleblog.com/2023/10/make-passkey-endpoints-well-known-url-part-of-your-passkey-implementation.html

spec:
https://github.com/ms-id-standards/MSIdentityStandardsExplainers/blob/main/PasskeyEndpointsWellKnownUrl/explainer.md

8 months agoTweak repo header (#29134)
silverwind [Thu, 15 Feb 2024 16:52:21 +0000 (17:52 +0100)]
Tweak repo header (#29134)

- Tweak colors, remove link color from repo name and make text use
inherited color
- Downsize repo icon from 32px to 24px

Before:
<img width="255" alt="Screenshot 2024-02-11 at 15 31 00"
src="https://github.com/go-gitea/gitea/assets/115237/f65c1d02-d8a3-4171-ad3d-4c95871fb2ba">

After:
<img width="260" alt="Screenshot 2024-02-11 at 15 30 48"
src="https://github.com/go-gitea/gitea/assets/115237/a9b25b56-8d3f-4910-af60-2513d44f6d81">

---------

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