]> source.dussan.org Git - gitea.git/log
gitea.git
14 months agoAdd `Retry` button when creating a mirror-repo fails (#26228)
Kerwin Bryant [Fri, 4 Aug 2023 02:21:32 +0000 (10:21 +0800)]
Add `Retry` button when creating a mirror-repo fails (#26228)

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

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

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

---------

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

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

As title.

It will be displayed in:

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

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

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

**Screenshots:**
Not stale review:

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

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

fixes #26306

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

(cherry picked from commit 5b9d34ed115c9ef24012b8027959ea0afdcb4e2d)

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

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

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

(cherry picked from commit 6b3528920fbf18c41d6aeb95498af48443282370)

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

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

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

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

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

(cherry picked from commit 3adb9ae6009ff3ddebaed4875e086343f668ef7b)

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

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

(cherry picked from commit 473862a1d599382ca022482e2e044025872d240b)

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

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

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

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

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

### On hover

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

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

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

</details>
Fixes #21295

---------

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

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

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

Closes #26263

We have to pass the date without the time.

# Before

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

# After

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

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

Related to #26239

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

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

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

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

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

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

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

A devtest section with the new style is also available.

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

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

</details>

---------

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

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

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

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

Also fixes some layout bugs introduced by a previous PR.

---------

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

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

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

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

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

Fix #24662.

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

## Background

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

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

## Major changes

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

---------

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

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

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

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

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

fixed #25990

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

---------

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

as title

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

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

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

As title

Before:

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

After:

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

fix #26189

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

Fix #25934

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

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

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

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

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

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

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

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

## Screenshots

### The commit dropdown

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

### Selecting a commit range

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

### Show changes of a single commit only

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

### Show changes of a commit range

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

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

---------

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

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

---------

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

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

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

Fix #25951

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

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

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

Fixes #25918

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

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

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

fyi @lunny

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

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

(cherry picked from commit a201f2f1896c1a086f3e37f86b1306d44c07f2e4)

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

---------

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

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

(cherry picked from commit 9753c7e4b8490b8f1e3d19cb06187503b88afb88)

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

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

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

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

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

After

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

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

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

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

Closes #25152

## Screenshots

### Initial

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

### Loaded

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

---------

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

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

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

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

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

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

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

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

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

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

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

Fixes #25953

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

14 months agoFix typos in Contributing.md (#26170)
Niko Hoffrén [Wed, 26 Jul 2023 19:14:13 +0000 (22:14 +0300)]
Fix typos in Contributing.md (#26170)

Fixed typos considering CONTRIBUTING.md.

This line:
GitHub API compatability #github-api-compatability
changed to:
GitHub API compatibility #github-api-compatibility

and this line:
GitHub API compatability
changed to:
GitHub API compatibility

14 months agoDisable download action logs button when there's no logs (#26114)
yp05327 [Wed, 26 Jul 2023 18:51:26 +0000 (03:51 +0900)]
Disable download action logs button when there's no logs (#26114)

If there's no logs, you can also click the download button, then you
will get `job is not started` page

![image](https://github.com/go-gitea/gitea/assets/18380374/c0dad309-1fb9-4505-99da-bf0038423744)
https://gitea.com/yp05327/testrepo/actions/runs/38

After:
If there's no steps displayed, the download button will be disabled.

![image](https://github.com/go-gitea/gitea/assets/18380374/5f51ba70-3d0b-46d8-ad77-f02c4c8fa52c)

14 months agoRe-add static images to docs (#26167)
John Olheiser [Wed, 26 Jul 2023 14:25:39 +0000 (09:25 -0500)]
Re-add static images to docs (#26167)

https://github.com/go-gitea/gitea/pull/26051 I accidentally rebased
locally without my re-addition for these files, so they were missed in
the merge, but only for `main`.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
14 months agoUpdate email-setup.en-us.md (#26068)
Felix Victor [Wed, 26 Jul 2023 13:50:15 +0000 (15:50 +0200)]
Update email-setup.en-us.md (#26068)

The setting `MAILER_TYPE` is deprecated.
According to the config cheat sheet, it should be `PROTOCOL`.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
14 months agoImprove display of Labels/Projects/Assignees sort options (#25886)
yp05327 [Wed, 26 Jul 2023 13:00:50 +0000 (22:00 +0900)]
Improve display of Labels/Projects/Assignees sort options (#25886)

Labels:
Before: (no highlights)

![image](https://github.com/go-gitea/gitea/assets/18380374/88ffbff0-1b14-4d93-810d-f2ce2b2d7321)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/ab7b665b-d17c-4acd-a681-64cbb67ae460)

![image](https://github.com/go-gitea/gitea/assets/18380374/19f8a0d0-ad5f-4dbf-b45a-1001e60a8399)

Projects:
Before: (no highlights)

![image](https://github.com/go-gitea/gitea/assets/18380374/2079e6a8-8801-4662-acda-e248f115462f)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/7180a086-68be-49c4-bb29-3d05454fb41d)

![image](https://github.com/go-gitea/gitea/assets/18380374/3c5a791f-1852-4957-89b8-10940c672e10)

Assignee:
Before: (no highlights)

![image](https://github.com/go-gitea/gitea/assets/18380374/09273636-d9b1-4144-9533-2ce66cab8c49)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/24bd0cfe-b589-4c8a-be67-74f242dda6d3)

![image](https://github.com/go-gitea/gitea/assets/18380374/7476be73-5201-4330-82e2-44b0b5080f71)

14 months agoFix wrong branch name in rename branch modal (#26146)
yp05327 [Wed, 26 Jul 2023 11:26:17 +0000 (20:26 +0900)]
Fix wrong branch name in rename branch modal (#26146)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/b4dc68e8-b85b-4097-a432-940e291ac582)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/7e692dd2-6b8b-4ba5-a251-ae4b9b917492)

14 months agoDoc update swagger doc for POST /orgs/{org}/teams (#26155)
caicandong [Wed, 26 Jul 2023 10:22:56 +0000 (18:22 +0800)]
Doc update swagger doc for POST /orgs/{org}/teams  (#26155)

close #26111

14 months agoFix UI regression of asciinema player (#26159)
Jason Song [Wed, 26 Jul 2023 09:46:59 +0000 (17:46 +0800)]
Fix UI regression of asciinema player (#26159)

It was caused by updating `asciinema-player`, the upstream changed the
CSS class prefix:
`https://github.com/asciinema/asciinema-player/commit/40505e479e8ba6833f178a3b7e85503c72491614`

<details>
<summary>Before:</summary>

<img width="1320" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/b91a2cf5-c1da-43d6-bac2-bc278728b11e">

</details>

<details>
<summary>After:</summary>

<img width="1311" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/c9872d25-e0bb-43d4-8b1e-d87c6b03c0a2">

</details>

14 months agorefactor improve NoBetterThan (#26126)
caicandong [Wed, 26 Jul 2023 08:52:07 +0000 (16:52 +0800)]
refactor improve NoBetterThan (#26126)

- The `NoBetterThan` function can only handle comparisons between
"pending," "success," "error," and "failure." For any other comparison,
we directly return false. This prevents logic errors like the one in
#26121.
- The callers of the `NoBetterThan` function should also avoid making
incomparable calls.

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
14 months agoUpdate Chinese documents (#26139)
Upstream8022 [Wed, 26 Jul 2023 07:28:44 +0000 (15:28 +0800)]
Update Chinese documents (#26139)

Update part of the documents, translate English to Chinese.

14 months agoFix bugs in LFS meta garbage collection (#26122)
Zettat123 [Wed, 26 Jul 2023 07:02:53 +0000 (15:02 +0800)]
Fix bugs in LFS meta garbage collection (#26122)

This PR

- Fix #26093. Replace `time.Time` with `timeutil.TimeStamp`
- Fix #26135. Add missing `xorm:"extends"` to `CountLFSMetaObject` for
LFS meta object query
- Add a unit test for LFS meta object garbage collection

14 months agoMove web JSON functions to web context and simplify code (#26132)
wxiaoguang [Wed, 26 Jul 2023 06:04:01 +0000 (14:04 +0800)]
Move web JSON functions to web context and simplify code (#26132)

The JSONRedirect/JSONOK/JSONError functions were put into "Base" context
incorrectly, it would cause abuse.

Actually, they are for "web context" only, so, move them to the correct
place.

And by the way, use them to simplify old code: +75 -196

14 months agoOnly show newly pushed branches message in the same repository (#26148)
Zettat123 [Wed, 26 Jul 2023 05:26:31 +0000 (13:26 +0800)]
Only show newly pushed branches message in the same repository (#26148)

Partly fixes #26130

This is a quick fix. #25812 will fully fix the bug.

14 months agoDocusaurus-ify (#26051)
John Olheiser [Wed, 26 Jul 2023 04:53:13 +0000 (23:53 -0500)]
Docusaurus-ify (#26051)

This PR cleans up the docs in a way to make them simpler to ingest by
our [docs repo](https://gitea.com/gitea/gitea-docusaurus).

1. It includes all of the sed invocations our ingestion did, removing
the need to do it at build time.
2. It replaces the shortcode variable replacement method with
`@variable@` style, simply for easier sed invocations when required.
3. It removes unused files and moves the docs up a level as cleanup.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
14 months agoDisplay deprecated warning in admin panel pages as well as in the log file (#26094)
Lunny Xiao [Wed, 26 Jul 2023 03:53:37 +0000 (11:53 +0800)]
Display deprecated warning in admin panel pages as well as in the log file (#26094)

This PR includes #26007 's changes but have a UI to prompt administrator
about the deprecated settings as well as the log or console warning.
Then users will have enough time to notice the problem and don't have
surprise like before.

<img width="1293" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/c33355f0-1ea7-4fb3-ad43-cd23cd15391d">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoRemove "misc" scope check from public API endpoints (#26134)
wxiaoguang [Wed, 26 Jul 2023 02:53:31 +0000 (10:53 +0800)]
Remove "misc" scope check from public API endpoints (#26134)

Fix #26035

14 months agoFix LFS object list style (#26133)
wxiaoguang [Wed, 26 Jul 2023 02:00:52 +0000 (10:00 +0800)]
Fix LFS object list style (#26133)

Close #26104 . Only a quick fix, the UI is not perfect.

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/7b10d42d-8317-4d99-80f9-b6c5fe05c17e)

![image](https://github.com/go-gitea/gitea/assets/2114189/b43f1242-61a0-45e3-98b7-aa74b29f3813)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/a8d27f70-781d-4702-866f-a56df6dd6c0a)

![image](https://github.com/go-gitea/gitea/assets/2114189/379274e7-c67b-4c11-9cee-28a298b4ff5a)

</details>

14 months agoDrop the correct deleted branch table (#26028)
yp05327 [Wed, 26 Jul 2023 00:41:33 +0000 (09:41 +0900)]
Drop the correct deleted branch table (#26028)

There's a typo in #22743
The correct table name is `deleted_branch` not `deleted_branches`

14 months agoFix CLI allowing creation of access tokens with existing name (#26071)
Yarden Shoham [Tue, 25 Jul 2023 23:06:11 +0000 (02:06 +0300)]
Fix CLI allowing creation of access tokens with existing name (#26071)

We are now:
- Making sure there is no existing access token with the same name
- Making sure the given scopes are valid (we already did this before but
now we have a message)

The logic is mostly taken from
https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/routers/api/v1/user/app.go#L101-L123

Closes #26044

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
14 months agoFix incorrect router logger (#26137)
wxiaoguang [Tue, 25 Jul 2023 22:21:09 +0000 (06:21 +0800)]
Fix incorrect router logger (#26137)

A low-level mistake:

* `log.Info` is global `Info` function, which calls "default" logger
* `logger.Info` is the for router's logger

14 months agoIncrease table cell horizontal padding (#26140)
silverwind [Tue, 25 Jul 2023 21:54:20 +0000 (23:54 +0200)]
Increase table cell horizontal padding (#26140)

Extract from https://github.com/go-gitea/gitea/pull/26043, just the
padding increase.

Before and After (hard to notice, but it's there):
<img width="427" alt="Screenshot 2023-07-25 at 19 37 12"
src="https://github.com/go-gitea/gitea/assets/115237/9543dcda-eccb-4739-b7dd-06b076108ab4">
<img width="420" alt="Screenshot 2023-07-25 at 19 37 26"
src="https://github.com/go-gitea/gitea/assets/115237/0a9c3724-81a1-4c67-a13b-4b728a51fc3a">

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoUpdate xorm version (#26128)
Lunny Xiao [Tue, 25 Jul 2023 20:27:44 +0000 (04:27 +0800)]
Update xorm version (#26128)

Test new xorm version compatible with Gitea

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
14 months agoFix UI for release tag page / wiki page / subscription page (#25948)
puni9869 [Tue, 25 Jul 2023 17:53:16 +0000 (23:23 +0530)]
Fix UI for release tag page / wiki page / subscription page (#25948)

Agenda:
This PR contains UI fixes for release tag page / wiki page /
subscription page.
Here is the list of changes made in this PR.
1. Release tag page
a. In the New Release page the whole ui got change. Now it is covering
in full page page with mobile view port. Description about the release
the editor preview now has a min-height. and the check boxes for
`Prerelease` and option are left aligned. Couple of divider are added.

2. Subscription page:
a. In the subscription page the ui was distorted in mobile view. Now its
fix. Couple of unused styles were removed.

3. Create Wiki page:-
a. In the page the preview of markdown is now contains a fix min-height
so this it will not distorted in desktop view and a divider is added
before action buttons. Couple of unused styles were removed.

# Before

## Release page

<img width="1391" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/319dec2e-08cf-40c5-920a-d651930ee28e">

<img width="494" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/03249f40-2d36-4552-bb93-43832aac2f8b">

<img width="1390" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/bf8b2d31-4857-480b-abd9-66a3ae6e24d8">

<img width="484" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c3a58210-a337-4c8e-89a6-edb3975986bb">

Editor
<img width="958" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/3bdd299d-d12b-4774-ace9-7184b1a57b18">

Editor preview
<img width="1293" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2b61c528-c018-4800-ab86-07aae56adecd">

<img width="484" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/ff7bc5ee-9dc0-4f78-a0b1-94277ab27700">

#### After
<img width="1439" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/94f7e073-5977-40bd-98ef-0711ed0815cc">

<img width="1384" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/83e3105f-c1ee-4329-b90f-8bb724dac50f">
<img width="1440" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/05f024a5-52eb-4072-8599-d6ca12f6fad1">
<img width="1387" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c73f069b-572a-4a13-aaa9-fc5b4dd3420d">

<img width="1440" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2f98f012-8e64-4a12-9595-5acdef18f85c">

Markdown preview change
<img width="1368" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/31e583ec-48f6-4f1a-8b56-0164fcb127a5">

Wiki page

Before
<img width="1393" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/9c9cfdf6-3c2a-4f47-883b-76624d96f9a0">
<img width="499" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/522ad573-1ad2-4fa2-8bf7-48a3dded14e7">

Preview of mark down.
<img width="488" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/998f3c25-9fca-43c8-b1ff-648aab291727">

Footer
<img width="490" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/89c6cf4e-4599-4403-bac8-285efdd9361a">

After

<img width="1389" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/1ee0fc72-f864-44c0-b2e4-e0e8a8470204">
<img width="498" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/b35b9a5d-8e26-4869-a6ed-6cef1f4a87a6">
<img width="499" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/b40bcbaa-fca6-42ab-9556-f950811b565d">

Preview tab block has min-height
<img width="1392" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/4a53d6c2-596c-423a-91b1-533cef734f93">

Mobile view
<img width="496" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c5ffc4c9-3c21-4cad-bc32-2ea3f0644a08">

<img width="497" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/08dd560f-4333-41ec-95b9-8154910d2254">
<img width="496" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/9fba8f55-727b-4756-a4a6-2070c719b15b">

## Subscription page

### Before

<img width="1393" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/0a7d561b-f56c-4ebe-93bd-952abecd437f">

<img width="492" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/4dc44d0c-ea81-4130-8afb-8f271c029e8a">

After
<img width="1394" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/a3567e30-2b5b-49d6-9ecb-2ab481ea4d36">

<img width="494" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/024da9e2-dfc4-4672-95cc-a6ac034d9712">

<img width="508" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/b748ecea-427c-4f8b-a1bf-08f82f9a42e6">

14 months agoadded ssh mirror workaround description (#26096)
thigg [Tue, 25 Jul 2023 16:06:35 +0000 (18:06 +0200)]
added ssh mirror workaround description (#26096)

related #1635 #18159

This will probably be obsolete at some point, but it should not break
anything and it may help some users

14 months agoImprove "gitea doctor" sub-command and fix "help" commands (#26072)
wxiaoguang [Tue, 25 Jul 2023 14:38:27 +0000 (22:38 +0800)]
Improve "gitea doctor" sub-command and fix "help" commands (#26072)

Replace #21790

And close #25965 by the way (it needs a separate fix for 1.20)

Major changes:

1. Move "gitea convert" to "gitea doctor conver". The old "gitea doctor"
still works as a hidden sub-command (to avoid breaking)
2. Do not write "doctor.log" by default, it's not useful in most cases
and causes bugs like 25965
3. Improve documents
4. Fix the "help" commands. Before, the "./gitea doctor" can't show the
sub-command help correctly (regression of the last cli/v2 refactoring)

After this PR:

```
./gitea help # show all sub-commands for the app
./gitea doctor # show the sub-commands for the "doctor"
./gitea doctor help # show the sub-commands for the "doctor", as above
```

14 months agoFix wrong commit status in web ui (#26121)
yp05327 [Tue, 25 Jul 2023 12:46:02 +0000 (21:46 +0900)]
Fix wrong commit status in web ui (#26121)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/8c5643b5-5c16-4674-9fe6-9e7fa2dda0b9)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/caf8891b-14df-418d-a7eb-977b54b9e9be)

There's a bug in the recent logic, `CalcCommitStatus` will always return
the first item of `statuses` or error status, because `state` is defined
with default value which should be `CommitStatusSuccess`

Then
``` golang
if status.State.NoBetterThan(state) {
```
this `if` will always return false unless `status.State =
CommitStatusError` which makes no sense.
So `lastStatus` will always be `nil` or error status.
Then we will always return the first item of `statuses` here or only
return error status, and this is why in the first picture the commit
status is `Success` but not `Failure`.

https://github.com/go-gitea/gitea/blob/af1ffbcd63569df8646b20c524378f25710f129e/models/git/commit_status.go#L204-L211

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoremove IsWarning in tmpl (#26120)
caicandong [Tue, 25 Jul 2023 12:09:01 +0000 (20:09 +0800)]
remove IsWarning in  tmpl (#26120)

This problem occurs because in #25839, the warning status has been
removed, but there is something in the tmpl that hasn't been changed.
related #25839
close #26118

14 months agoFix minor capitalization error in string (#26100)
Panagiotis "Ivory" Vasilopoulos [Tue, 25 Jul 2023 11:00:32 +0000 (11:00 +0000)]
Fix minor capitalization error in string (#26100)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoImprove commit graph alignment and truncating (#26112)
wxiaoguang [Tue, 25 Jul 2023 10:17:41 +0000 (18:17 +0800)]
Improve commit graph alignment and truncating (#26112)

Fix #26101

![image](https://github.com/go-gitea/gitea/assets/2114189/7507d201-822e-4534-8b20-e659d56b1268)

14 months agoFix wrong workflow status when rerun a job in an already finished workflow (#26119)
yp05327 [Tue, 25 Jul 2023 09:13:36 +0000 (18:13 +0900)]
Fix wrong workflow status when rerun a job in an already finished workflow (#26119)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/fb687592-b117-4cd5-b076-2ca5ca847ea4)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/c9b0683e-e81d-410b-8c35-fbe54327fab4)

After workflow finished, if you rerun a single job, the workflow status
will become to `Running` which is not correct as no jobs are running in
this workflow.

14 months agoAllow Organisations to have a E-Mail (#25082)
JakobDev [Tue, 25 Jul 2023 08:26:27 +0000 (10:26 +0200)]
Allow Organisations to have a E-Mail (#25082)

Resolves #25057

This adds a E-Mail field to Organisations. The E-Mail is just shown on
the Profile when it is visited by a logged in User. The E-mail is not
used for something else.

**Screenshots:**

![grafik](https://github.com/go-gitea/gitea/assets/15185051/a8d622b3-7278-4c08-984b-9c5ebfdb5471)

![grafik](https://github.com/go-gitea/gitea/assets/15185051/6dcb1dd7-d04b-49eb-bc96-6582cfe9757b)

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: Denys Konovalov <privat@denyskon.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
14 months agodoc sync authentication.md to zh-cn (#26117)
caicandong [Tue, 25 Jul 2023 07:52:55 +0000 (15:52 +0800)]
doc sync authentication.md to zh-cn (#26117)

as title

14 months agoFix loading `LFS_JWT_SECRET` from wrong section (#26109)
Jason Song [Tue, 25 Jul 2023 05:06:31 +0000 (13:06 +0800)]
Fix loading `LFS_JWT_SECRET` from wrong section (#26109)

Regression of #25408.

`LFS_JWT_SECRET_URI` and `LFS_JWT_SECRET` are under the `server`
section, not `lfs`.

So each time gitea restarts, it resets `LFS_JWT_SECRET`.

<img width="1378" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/527ec9b9-eea2-4334-a274-6d1471456edd">

14 months agoAvoid writing config file if not installed (#26107)
wxiaoguang [Tue, 25 Jul 2023 04:03:41 +0000 (12:03 +0800)]
Avoid writing config file if not installed (#26107)

Just like others (oauth2 secret, internal token, etc), do not generate
if no install lock

14 months agoImplement auto-cancellation of concurrent jobs if the event is push (#25716)
Bo-Yi Wu [Tue, 25 Jul 2023 03:15:55 +0000 (11:15 +0800)]
Implement auto-cancellation of concurrent jobs if the event is push (#25716)

- cancel running jobs if the event is push
- Add a new function `CancelRunningJobs` to cancel all running jobs of a
run
- Update `FindRunOptions` struct to include `Ref` field and update its
condition in `toConds` function
- Implement auto cancellation of running jobs in the same workflow in
`notify` function

related task: https://github.com/go-gitea/gitea/pull/22751/

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: delvh <dev.lh@web.de>
14 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 25 Jul 2023 00:27:42 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

14 months agodoc guide the user to create the appropriate level runner (#26091)
caicandong [Mon, 24 Jul 2023 14:39:10 +0000 (22:39 +0800)]
doc guide the user to create the appropriate level runner (#26091)

close #26045

14 months agoFix handling of Debian files with trailing slash (#26087)
KN4CK3R [Mon, 24 Jul 2023 14:19:44 +0000 (16:19 +0200)]
Fix handling of Debian files with trailing slash (#26087)

Fixes #26022

- Fix handling of files with trailing slash
- Fix handling of duplicate package file errors
- Added test for both

14 months agofix Missing 404 swagger response docs for /admin/users/{username} (#26086)
caicandong [Mon, 24 Jul 2023 08:48:44 +0000 (16:48 +0800)]
fix Missing 404 swagger response docs for /admin/users/{username} (#26086)

close #26079

14 months agoAllow the use of alternative net.Listener implementations by downstreams (#25855)
idk [Mon, 24 Jul 2023 07:18:17 +0000 (03:18 -0400)]
Allow the use of alternative net.Listener implementations by downstreams (#25855)

This is a simple PR which moves the `GetListener` function to a
`DefaultGetListener` function, and changes `GetListener` to be a
variable which by default points to the `DefaultGetListener` function.
This allows people who may exist quasi-downstream of Gitea to create
alternate "GetListener" functions, with identical signatures, which
return different implementations of the `net.Listener` interface. This
approach is expressly intended to be non-invasive and have the least
possible impact on the gitea codebase. A previous version of this idea
was rejected before: https://github.com/go-gitea/gitea/issues/15544 but
because of issues like: https://github.com/go-gitea/gitea/issues/22335 I
**really** think that recommending people configure proxies by hand is
exactly the wrong way to do things(This is why there is a Tor Browser.).
This tiny change lets me put proper hidden service configuration into
single `i2p.go` file which lives in `modules/graceful/` and which never
has to be checked in to your codebase or affect your dependencies or
bloat your project in any way, it can live on a branch in my fork and
I'll fast-forward every release and never the twain shall meet.

The main use-case for this is to listen on Peer-to-Peer networks and
Hidden Services directly without error-prone and cumbersome
port-forwarding configuration. For instance, I might implement an
"I2PGetListener" as follows:

```Go
// adapted from i2p.go which is unchecked-in in my modules/graceful/ directory
import "github.com/eyedeekay/onramp"

var garlic = &onramp.Garlic{}

func I2PGetListener(network, address string) (net.Listener, error) {
// Add a deferral to say that we've tried to grab a listener
defer GetManager().InformCleanup()
switch network {
case "tcp", "tcp4", "tcp6", "i2p", "i2pt":
return garlic.Listen()
case "unix", "unixpacket":
// I2P isn't really a replacement for the stuff you use Unix sockets for and it's also not an anonymity risk, so treat them normally
unixAddr, err := net.ResolveUnixAddr(network, address)
if err != nil {
return nil, err
}
return GetListenerUnix(network, unixAddr)
default:
return nil, net.UnknownNetworkError(network)
}
}
```

I could then substitute that GetListener function and be 50% of the way
to having a fully-functioning gitea-over-hidden-services instance
without any additional configuration(The other 50% doesn't require any
code-changes on gitea's part).

There are 2 advantages here, one being convenience, first this turns
hidden services into a zero-configuration option for self-hosting gitea,
and second safety, these Go libraries are passing around
hidden-service-only versions of the net.Addr struct, they're using
hidden-service-only versions of the sockets, which are both expressly
designed to never require access to any information outside the hidden
service network, manipulating the application so it reveals information
about the host becomes much more difficult, and some attacks become
nearly impossible. It also opens up TLS-over-Hidden Services support
which is niche right now, of course, but in a future where gitea
instances federate if hidden services want to be part of the federation
they're probably going to need TLS certificates. They don't need to be
painful to set up.

This doesn't fix an open issue, but it might affect:
- https://github.com/go-gitea/gitea/issues/22335 - my `i2p.go` file
actually has a mod that fixes this but it requires adding a handful of
new dependencies to gitea and isn't compatible with the normal way you
guys recommend using a proxy so I don't think it's ready to send to you
as a PR, but if I can find a non-invasive way to fix it I will.
 - https://github.com/go-gitea/gitea/issues/18240

I hereby agree to the Code of Conduct published here:
https://github.com/go-gitea/gitea/blob/8b89563bf1031089a218e6d05dc61047281b35ee/CODE_OF_CONDUCT.md
I have read and understood the recommendations published here:
https://github.com/go-gitea/gitea/blob/8b89563bf1031089a218e6d05dc61047281b35ee/CONTRIBUTING.md

Thank you for your consideration.

---------

Co-authored-by: eyedeekay <idk@mulder>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoAdd missing default value for some Bool cli flags (#26082)
wxiaoguang [Mon, 24 Jul 2023 06:49:18 +0000 (14:49 +0800)]
Add missing default value for some Bool cli flags (#26082)

In #25959 I forgot to add default values to some Bool flags (which were
BoolT in cli/v1, BoolT means default to be true)

This PR adds the default "Value" for them.

```
./cmd/manager_logging.go: }, cli.BoolTFlag{
./cmd/manager_logging.go- Name:  "rotate, r",
./cmd/manager_logging.go- Usage: "Rotate logs",
--
./cmd/manager_logging.go: }, cli.BoolTFlag{
./cmd/manager_logging.go- Name:  "daily, d",
./cmd/manager_logging.go- Usage: "Rotate logs daily",
--
./cmd/manager_logging.go: }, cli.BoolTFlag{
./cmd/manager_logging.go- Name:  "compress, z",
./cmd/manager_logging.go- Usage: "Compress rotated logs",
--
./cmd/admin.go: cli.BoolTFlag{
./cmd/admin.go- Name:  "force-smtps",
./cmd/admin.go- Usage: "SMTPS is always used on port 465. Set this to force SMTPS on other ports.",
--
./cmd/admin.go: cli.BoolTFlag{
./cmd/admin.go- Name:  "skip-verify",
./cmd/admin.go- Usage: "Skip TLS verify.",
--
./cmd/admin.go: cli.BoolTFlag{
./cmd/admin.go- Name:  "disable-helo",
./cmd/admin.go- Usage: "Disable SMTP helo.",
--
./cmd/admin.go: cli.BoolTFlag{
./cmd/admin.go- Name:  "skip-local-2fa",
./cmd/admin.go- Usage: "Skip 2FA to log on.",
--
./cmd/admin.go: cli.BoolTFlag{
./cmd/admin.go- Name:  "active",
./cmd/admin.go- Usage: "This Authentication Source is Activated.",
```

14 months agoReduce unnecessary DB queries for Actions tasks (#25199)
sillyguodong [Mon, 24 Jul 2023 06:11:27 +0000 (14:11 +0800)]
Reduce unnecessary DB queries for Actions tasks (#25199)

Close #24544

Changes:

- Create `action_tasks_version` table to store the latest version of
each scope (global, org and repo).
- When a job with the status of `waiting` is created, the tasks version
of the scopes it belongs to will increase.
- When the status of a job already in the database is updated to
`waiting`, the tasks version of the scopes it belongs to will increase.
- On Gitea side, in `FeatchTask()`, will try to query the
`action_tasks_version` record of the scope of the runner that call
`FetchTask()`. If the record does not exist, will insert a row. Then,
Gitea will compare the version passed from runner to Gitea with the
version in database, if inconsistent, try pick task. Gitea always
returns the latest version from database to the runner.

Related:

- Protocol: https://gitea.com/gitea/actions-proto-def/pulls/10
- Runner: https://gitea.com/gitea/act_runner/pulls/219

14 months agoUse stderr as fallback if the log file can't be opened (#26074)
wxiaoguang [Mon, 24 Jul 2023 04:57:21 +0000 (12:57 +0800)]
Use stderr as fallback if the log file can't be opened (#26074)

If the log file can't be opened, what should it do? panic/exit? ignore
logs? fallback to stderr?

It seems that "fallback to stderr" is slightly better than others ....

14 months agoMake organization redirect warning more clear (#26077)
Panagiotis "Ivory" Vasilopoulos [Mon, 24 Jul 2023 04:17:32 +0000 (04:17 +0000)]
Make organization redirect warning more clear (#26077)

14 months agoReplace gogs/cron with go-co-op/gocron (#25977)
Chongyi Zheng [Mon, 24 Jul 2023 04:13:41 +0000 (23:13 -0500)]
Replace gogs/cron with go-co-op/gocron (#25977)

Replace `github.com/gogs/cron` with `github.com/go-co-op/gocron` as the
former package is not maintained for many years.

---------

Co-authored-by: delvh <dev.lh@web.de>