]> source.dussan.org Git - gitea.git/log
gitea.git
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>
8 months agoChange webhook-type in create-view (#29114)
Tim-Nicas Oelschläger [Thu, 15 Feb 2024 13:59:48 +0000 (14:59 +0100)]
Change webhook-type in create-view (#29114)

It's now possible to change webhook-type in create-view.

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/9ee1b9fb-843b-4f28-b8d6-6361e5d184f1)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/9dbf058f-5912-43af-9acd-487271212f2d)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
8 months agoRemove jQuery from the comment task list (#29170)
Yarden Shoham [Thu, 15 Feb 2024 13:27:07 +0000 (15:27 +0200)]
Remove jQuery from the comment task list (#29170)

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

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
8 months agoFix can not select team reviewers when reviewers is empty (#29174)
yp05327 [Thu, 15 Feb 2024 11:30:11 +0000 (20:30 +0900)]
Fix can not select team reviewers when reviewers is empty (#29174)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/b29e9c0c-f0fc-454f-b82d-ff9688d9e871)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/a982f7c6-4911-4951-91a5-4bb347e866f9)

Is this a bug? Maybe we don't need to fix this, as it only occurs when
there's only one user in the organization. 🤔

8 months agomove sign in labels to be above inputs (#28753)
Rafael Heard [Thu, 15 Feb 2024 08:47:49 +0000 (03:47 -0500)]
move sign in labels to be above inputs (#28753)

There are a few inconsistencies within Gitea and this PR addresses one of them.
This PR updates the sign-in page layout, including the register and openID tabs,
to match the layout of the settings pages (`/user/settings`) for more consistency.

**Before**
<img width="968" alt="Screenshot 2024-02-05 at 8 27 24 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/fb0cb517-57c0-4eed-be1d-56f36bd1960d">

**After**
<img width="968" alt="Screenshot 2024-02-05 at 8 26 39 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/428d691d-0a42-4a67-a646-05527f2a7b41">

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
8 months agoRefactor locale&string&template related code (#29165)
wxiaoguang [Wed, 14 Feb 2024 21:48:45 +0000 (05:48 +0800)]
Refactor locale&string&template related code (#29165)

Clarify when "string" should be used (and be escaped), and when
"template.HTML" should be used (no need to escape)

And help PRs like  #29059 , to render the error messages correctly.

8 months agoExtract linguist code to method (#29168)
KN4CK3R [Wed, 14 Feb 2024 18:50:31 +0000 (19:50 +0100)]
Extract linguist code to method (#29168)

8 months agobump to use go 1.22 (#29119)
techknowlogick [Wed, 14 Feb 2024 18:19:57 +0000 (13:19 -0500)]
bump to use go 1.22 (#29119)

8 months agoRemove unused `KeyID`. (#29167)
KN4CK3R [Wed, 14 Feb 2024 17:50:10 +0000 (18:50 +0100)]
Remove unused `KeyID`. (#29167)

`KeyID` is never set.

8 months agoRefactor git version functions and check compatibility (#29155)
wxiaoguang [Wed, 14 Feb 2024 17:18:30 +0000 (01:18 +0800)]
Refactor git version functions and check compatibility (#29155)

Introduce a new function checkGitVersionCompatibility, when the git
version can't be used by Gitea, tell the end users to downgrade or
upgrade. The refactored functions are related to make the code easier to
test.

And simplify the comments for "safe.directory"

---------

Co-authored-by: delvh <dev.lh@web.de>
8 months agoUse ghost user if user was not found (#29161)
KN4CK3R [Wed, 14 Feb 2024 16:31:51 +0000 (17:31 +0100)]
Use ghost user if user was not found (#29161)

Fixes #29159

8 months agoDocument how the TOC election process works (#29135)
delvh [Wed, 14 Feb 2024 10:10:16 +0000 (11:10 +0100)]
Document how the TOC election process works (#29135)

This is supposed to prevent a power vacuum so that a problem similar to
the 2024 election will not happen again

Additionally, update current TOC members from 2023 to 2024.

8 months agoRunner tokens are multi use (#29153)
Scott Yeager [Tue, 13 Feb 2024 23:24:35 +0000 (15:24 -0800)]
Runner tokens are multi use (#29153)

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

Co-authored-by: Giteabot <teabot@gitea.io>
8 months agoFix Gitpod logic of setting ROOT_URL (#29162)
Yarden Shoham [Tue, 13 Feb 2024 22:57:55 +0000 (00:57 +0200)]
Fix Gitpod logic of setting ROOT_URL (#29162)

8 months agoRemove jQuery from the user search form in admin page (#29151)
Yarden Shoham [Tue, 13 Feb 2024 14:13:06 +0000 (16:13 +0200)]
Remove jQuery from the user search form in admin page (#29151)

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

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
8 months agoDont load Review if Comment is CommentTypeReviewRequest (#28551)
6543 [Tue, 13 Feb 2024 08:45:31 +0000 (09:45 +0100)]
Dont load Review if Comment is CommentTypeReviewRequest (#28551)

RequestReview get deleted on review.
So we don't have to try to load them on comments.

broken out #28544

8 months agoShow `View at this point in history` for every commit (#29122)
Tim-Nicas Oelschläger [Tue, 13 Feb 2024 08:07:59 +0000 (09:07 +0100)]
Show `View at this point in history` for every commit (#29122)

Shows the 'View at this point in history'-link (from #27354) for every
commit

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/0e5cd763-e099-4bb4-9519-653fe21f85a6)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/2b57346f-51e3-4901-b85e-63a690878939)

8 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 13 Feb 2024 00:24:22 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

8 months agoAdd merge style `fast-forward-only` (#28954)
Chris Copeland [Mon, 12 Feb 2024 22:37:23 +0000 (14:37 -0800)]
Add merge style `fast-forward-only` (#28954)

With this option, it is possible to require a linear commit history with
the following benefits over the next best option `Rebase+fast-forward`:
The original commits continue existing, with the original signatures
continuing to stay valid instead of being rewritten, there is no merge
commit, and reverting commits becomes easier.

Closes #24906

8 months agoUse Markdown alert syntax for notes in README (#29150)
Yarden Shoham [Mon, 12 Feb 2024 21:14:24 +0000 (23:14 +0200)]
Use Markdown alert syntax for notes in README (#29150)

- It looks nicer
- This syntax is supported on both GitHub and Gitea

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoRefactor issue template parsing and fix API endpoint (#29069)
wxiaoguang [Mon, 12 Feb 2024 05:04:10 +0000 (13:04 +0800)]
Refactor issue template parsing and fix API endpoint (#29069)

The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate,
map[string]error)` doesn't really follow Golang's habits, then the
second returned value might be misused. For example, the API function
`GetIssueTemplates` incorrectly checked the second returned value and
always responds 500 error.

This PR refactors GetTemplatesFromDefaultBranch to
ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes the
API endpoint bug, and adds some tests.

And by the way, add proper prefix `X-` for the header generated in
`checkDeprecatedAuthMethods`, because non-standard HTTP headers should
have `X-` prefix, and it is also consistent with the new code in
`GetIssueTemplates`

8 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 12 Feb 2024 00:24:21 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

8 months agoUpdate some translations and fix markdown formatting (#29099)
me2seeks [Sun, 11 Feb 2024 17:03:49 +0000 (01:03 +0800)]
Update some translations and fix markdown formatting (#29099)

Update `docs/content/administration/backup-and-restore.zh-cn.md`
`docs/content/contributing/guidelines-frontend.zh-cn.md`
`docs/content/help/support.zh-cn.md`
`docs/content/installation/database-preparation.zh-cn.md`
`docs/content/installation/windows-service.zh-cn.md`
`docs/content/usage/profile-readme.zh-cn.md` to be consistent with the
English document

8 months agoShow more settings for empty repositories (#29130)
Tim-Nicas Oelschläger [Sun, 11 Feb 2024 14:10:04 +0000 (15:10 +0100)]
Show more settings for empty repositories (#29130)

Shows more settings for empty repositories (Fixes #29060)

8 months agoUpdate JS and PY dependencies (#29127)
silverwind [Sun, 11 Feb 2024 12:55:11 +0000 (13:55 +0100)]
Update JS and PY dependencies (#29127)

- Update all excluding `@mcaptcha/vanilla-glue` and
`eslint-plugin-array-func`
- Remove deprecated and duplicate eslint rule
- Tested Monaco, Mermaid and Swagger

8 months agoAdd alert blocks in markdown (#29121)
Yarden Shoham [Sat, 10 Feb 2024 18:43:09 +0000 (20:43 +0200)]
Add alert blocks in markdown (#29121)

- Follows https://github.com/go-gitea/gitea/pull/21711
- Closes https://github.com/go-gitea/gitea/issues/28316

Implement GitHub's alert blocks markdown feature

Docs:
-
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
- https://github.com/orgs/community/discussions/16925

### Before

![image](https://github.com/go-gitea/gitea/assets/20454870/14f7b02a-5de5-4fd0-8437-a055dadb31f2)

### After

![image](https://github.com/go-gitea/gitea/assets/20454870/ed06a869-e545-42f1-bf25-4ba20b1be196)

## :warning: BREAKING :warning:

The old syntax no longer works

How to migrate:

If you used
```md
> **Note** My note
```

Switch to
```md
> [!NOTE]
> My note
```

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
8 months agoRemove obsolete border-radius on comment content (#29128)
silverwind [Sat, 10 Feb 2024 18:18:46 +0000 (19:18 +0100)]
Remove obsolete border-radius on comment content (#29128)

This border-radius is obsolete since we changed the comment rendering a
few months ago and it caused incorrect display on blockquotes.

Before:
<img width="160" alt="Screenshot 2024-02-10 at 18 42 48"
src="https://github.com/go-gitea/gitea/assets/115237/ccbf4660-acf9-4268-aad9-1ad49d317a67">

After:
<img width="135" alt="Screenshot 2024-02-10 at 18 42 40"
src="https://github.com/go-gitea/gitea/assets/115237/6f588e02-3b2a-49ee-b459-81d8068b2f4e">

8 months agoMake blockquote border size less aggressive (#29124)
Yarden Shoham [Sat, 10 Feb 2024 12:55:46 +0000 (14:55 +0200)]
Make blockquote border size less aggressive (#29124)

It's too thick

I made it match GitHub's size

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/08c05004-acd9-485e-9219-110d93fe1226)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/e2e32b6c-4ba8-488e-9405-95d33f80adf7)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
8 months agoDrop "@" from email sender to avoid spam filters (#29109)
Gwyneth Morgan [Sat, 10 Feb 2024 03:40:48 +0000 (03:40 +0000)]
Drop "@" from email sender to avoid spam filters (#29109)

Commit 360b3fd17c (Include username in email headers (#28981),
2024-02-03) adds usernames to the From field of notification emails in
the form of `Display Name (@username)`, to prevent spoofing. However,
some email filtering software flags "@" in the display name part of the
From field as potential spoofing, as you could set the display name part
to another email address than the one you are sending from (e.g.
`From: "apparent@email-address" <actual@email-address>`). To avoid
being flagged, instead send emails from `Display Name (username)`.

Closes: #29107
---------

Co-authored-by: Giteabot <teabot@gitea.io>
8 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 10 Feb 2024 00:22:56 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

8 months agoDisallow duplicate storage paths (#26484)
Lunny Xiao [Fri, 9 Feb 2024 14:06:03 +0000 (22:06 +0800)]
Disallow duplicate storage paths (#26484)

Replace #26380

8 months agoadd lint-spell-fix to lint-fix (#29111)
silverwind [Fri, 9 Feb 2024 10:57:09 +0000 (11:57 +0100)]
add lint-spell-fix to lint-fix (#29111)

Followup to https://github.com/go-gitea/gitea/pull/29106, fix this
oversight.

8 months agoRework spellchecking, add `lint-spell` (#29106)
silverwind [Fri, 9 Feb 2024 03:59:39 +0000 (04:59 +0100)]
Rework spellchecking, add `lint-spell` (#29106)

- Use maintained fork https://github.com/golangci/misspell
- Rename `mispell-check` to `lint-spell`, add `lint-spell-fix`
- Run `lint-spell` in separate actions step
- Lint more files, fix discovered issues
- Remove inaccurate and outdated info in docs (we do not need GOPATH for
tools anymore)

Maybe later we can add more spellchecking tools, but I have not found
any good ones yet.

8 months agoRefactor parseSignatureFromCommitLine (#29054)
wxiaoguang [Fri, 9 Feb 2024 03:02:53 +0000 (11:02 +0800)]
Refactor parseSignatureFromCommitLine (#29054)

Replace #28849. Thanks to @yp05327 for the looking into the problem.
Fix #28840

The old behavior of newSignatureFromCommitline is not right. The new
parseSignatureFromCommitLine:

1. never fails
2. only accept one format (if there is any other, it could be easily added)

And add some tests.

8 months agoDisplay friendly error message (#29105)
KN4CK3R [Thu, 8 Feb 2024 22:01:19 +0000 (23:01 +0100)]
Display friendly error message (#29105)

`ctx.Error` only displays the text but `ctx.ServerError` renders the
usual error page.

8 months agoUse defaults browserslist (#29098)
silverwind [Thu, 8 Feb 2024 13:49:44 +0000 (14:49 +0100)]
Use defaults browserslist (#29098)

IE usage has dropped enough to not be included in the defaults
browserslist anymore as per https://browsersl.ist/#q=defaults, so we can
use the defaults now.

8 months agoFix push to create with capitalize repo name (#29090)
Lunny Xiao [Thu, 8 Feb 2024 13:25:09 +0000 (21:25 +0800)]
Fix push to create with capitalize repo name (#29090)

Fix #29073

8 months agoOnly delete scheduled workflows when needed (#29091)
Zettat123 [Thu, 8 Feb 2024 13:00:17 +0000 (21:00 +0800)]
Only delete scheduled workflows when needed (#29091)

Fix #29040

`handleSchedules` should be called only if `DetectWorkflows` should
detect schedule workflows

8 months agoRemove unnecessary parameter (#29092)
Lunny Xiao [Thu, 8 Feb 2024 12:31:38 +0000 (20:31 +0800)]
Remove unnecessary parameter (#29092)

The parameter extraConfigs has never been used anywhere. This PR just
removed it. It can be taken back once it's needed.

8 months agoMove vitest setup file to root (#29097)
silverwind [Thu, 8 Feb 2024 12:07:02 +0000 (13:07 +0100)]
Move vitest setup file to root (#29097)

I'm using this convention in other projects and I think it makes sense
for gitea too because the vitest setup file is loaded globally for all
tests, not just ones in web_src, so it makes sense to be in the root.

8 months agoFix incorrect link to swift doc and swift package-registry login command (#29096)
CEnnis91 [Thu, 8 Feb 2024 08:53:44 +0000 (03:53 -0500)]
Fix incorrect link to swift doc and swift package-registry login command (#29096)

Fixes a few mistakes in the Swift package registry documentation.

Syntax for the `package-registry login` command can be found
[here](https://github.com/apple/swift-package-manager/blob/main/Documentation/PackageRegistry/PackageRegistryUsage.md#registry-authentication).
I was not sure the best way to compress all of that information, so I
just focused on making sure the incorrect `package-registry set` command
was fixed.

8 months agoFix swift packages not resolving (#29095)
CEnnis91 [Thu, 8 Feb 2024 06:45:44 +0000 (01:45 -0500)]
Fix swift packages not resolving (#29095)

Fixes #29094

8 months agoFix missing link on outgoing new release notifications (#29079)
Wiktor Kwapisiewicz [Thu, 8 Feb 2024 03:09:15 +0000 (04:09 +0100)]
Fix missing link on outgoing new release notifications (#29079)

Outgoing new release e-mail notifications were missing links to the
actual release. An example from Codeberg.org e-mail:

    <a href=3D"">View it on Codeberg.org</a>.<br/>

This PR adds `"Link"` context property pointing to the release on the
web interface.

The change was tested using `[mailer] PROTOCOL=dummy`.

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>