]> source.dussan.org Git - gitea.git/log
gitea.git
16 months agoUse `CommentList` instead of `[]*Comment` (#24828)
Lunny Xiao [Sun, 21 May 2023 12:48:28 +0000 (20:48 +0800)]
Use `CommentList` instead of `[]*Comment` (#24828)

As title.

16 months agoFix topics deleted via API not being deleted in org page (#24825)
Yarden Shoham [Sun, 21 May 2023 09:03:20 +0000 (12:03 +0300)]
Fix topics deleted via API not being deleted in org page (#24825)

The topics are saved in the `repo_topic` table.
They are also saved directly in the `repository` table.

Before this PR, only `AddTopic` and `SaveTopics` made sure the `topics`
field in the `repository` table was synced with the `repo_topic` table.

This PR makes sure `GenerateTopics` and `DeleteTopic`
also sync the `topics` in the repository table.

`RemoveTopicsFromRepo` doesn't need to sync the data
as it is only used to delete a repository.

Fixes #24820

16 months agoReturn `404` in the API if the requested webhooks were not found (#24823)
Yevhen Pavlov [Sun, 21 May 2023 02:54:28 +0000 (05:54 +0300)]
Return `404` in the API if the requested webhooks were not found (#24823)

Should resolve first point of the issue
https://github.com/go-gitea/gitea/issues/24574

16 months agoDecouple the different contexts from each other (#24786)
wxiaoguang [Sun, 21 May 2023 01:50:53 +0000 (09:50 +0800)]
Decouple the different contexts from each other (#24786)

Replace #16455

Close #21803

Mixing different Gitea contexts together causes some problems:

1. Unable to respond proper content when error occurs, eg: Web should
respond HTML while API should respond JSON
2. Unclear dependency, eg: it's unclear when Context is used in
APIContext, which fields should be initialized, which methods are
necessary.

To make things clear, this PR introduces a Base context, it only
provides basic Req/Resp/Data features.

This PR mainly moves code. There are still many legacy problems and
TODOs in code, leave unrelated changes to future PRs.

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 21 May 2023 00:26:26 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoAdd RTL rendering support to Markdown (#24816)
silverwind [Sat, 20 May 2023 21:02:52 +0000 (23:02 +0200)]
Add RTL rendering support to Markdown (#24816)

Support RTL content in Markdown:

![image](https://github.com/go-gitea/gitea/assets/115237/dedb1b0c-2f05-40dc-931a-0d9dc81f7c97)

Example document:
https://try.gitea.io/silverwind/symlink-test/src/branch/master/bidi-text.md
Same on GitHub:
https://github.com/silverwind/symlink-test/blob/master/bidi-text.md

`dir=auto` enables a browser heuristic that sets the text direction
automatically. It is the only way to get automatic text direction.

Ref: https://codeberg.org/Codeberg/Community/issues/1021

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 20 May 2023 00:22:02 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoUpdate JS dependencies (#24815)
silverwind [Fri, 19 May 2023 21:58:12 +0000 (23:58 +0200)]
Update JS dependencies (#24815)

- Update all JS dependencies
- Remove `@vue/compiler-sfc` as per [this
notice](https://github.com/vuejs/core/tree/main/packages/compiler-sfc#vuecompiler-sfc),
still builds as normal
- Tested build and text/image copy

16 months agoFix duplicate tooltip hiding (#24814)
silverwind [Fri, 19 May 2023 20:12:30 +0000 (22:12 +0200)]
Fix duplicate tooltip hiding (#24814)

A tippy instance's role is actually on `props.role`. This makes
duplicate tooltip hiding work again after
https://github.com/go-gitea/gitea/pull/24688.

16 months agoMute repo names in dashboard repo list (#24811)
Yarden Shoham [Fri, 19 May 2023 17:03:09 +0000 (20:03 +0300)]
Mute repo names in dashboard repo list (#24811)

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/24b80212-4a4d-44a7-99d5-a8c6b207225e)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/565b242a-f65d-450c-b43b-c4539a0f8b28)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoRework label colors (#24790)
silverwind [Fri, 19 May 2023 16:30:24 +0000 (18:30 +0200)]
Rework label colors (#24790)

Introduce `--color-label-fg`, `--color-label-bg` and
`--color-label-hover-bg`, decoupling the label styles from other color
variables. I've set the colors so that non-interactive labels like on
tabs are dark-on-light on light theme, which imho looks better than
previous light-on-dark.

In the screenshot below, the leftmost label has hover, the second one
has active.

<img width="786" alt="Screenshot 2023-05-18 at 12 48 26"
src="https://github.com/go-gitea/gitea/assets/115237/d989bb68-504a-4406-b5f6-419ed9609f90">
<img width="789" alt="Screenshot 2023-05-18 at 13 04 07"
src="https://github.com/go-gitea/gitea/assets/115237/689a281a-a2b7-45e8-a5ee-dafb7a35e105">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoFix max width and margin of comment box on conversation page (#24809)
HesterG [Fri, 19 May 2023 16:02:34 +0000 (00:02 +0800)]
Fix max width and margin of comment box on conversation page (#24809)

Fix regression from #23937

The changes should only be limited to `.conversation-holder
.comment-code-cloud`, otherwise it will affect the `.comment-code-cloud`
in conversation tab

Before:

<img width="962" alt="Screen Shot 2023-05-19 at 18 22 25"
src="https://github.com/go-gitea/gitea/assets/17645053/0db01d04-2581-48f9-b46c-497836b1f12b">

After:

<img width="997" alt="Screen Shot 2023-05-19 at 18 35 01"
src="https://github.com/go-gitea/gitea/assets/17645053/5d14b67b-88c1-46c6-b859-fd41752b3ebb">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoAllow all URL schemes in Markdown links by default (#24805)
Yarden Shoham [Fri, 19 May 2023 15:17:07 +0000 (18:17 +0300)]
Allow all URL schemes in Markdown links by default (#24805)

- Closes #21146
- Closes #16721

## :warning: BREAKING :warning:
This changes the default behavior to now create links for any URL scheme
when the user uses the markdown form for links (`[label](URL)`), this
doesn't affect the rendering of inline links. To opt-out set the
`markdown.CUSTOM_URL_SCHEMES` setting to a list of allowed schemes, all
other schemes (except `http` and `https`) won't be allowed.

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/35fa18ce-7dda-4995-b5b3-3f360f38296d)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/0922216b-0b35-4b77-9919-21a5c21dd5d0)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoSome refactors for issues stats (#24793)
Lunny Xiao [Fri, 19 May 2023 14:17:48 +0000 (22:17 +0800)]
Some refactors for issues stats (#24793)

This PR

- [x] Move some functions from `issues.go` to `issue_stats.go` and
`issue_label.go`
- [x] Remove duplicated issue options `UserIssueStatsOption` to keep
only one `IssuesOptions`

16 months agoImplement actions artifacts (#22738)
FuXiaoHei [Fri, 19 May 2023 13:37:57 +0000 (21:37 +0800)]
Implement actions artifacts (#22738)

Implement action artifacts server api.

This change is used for supporting
https://github.com/actions/upload-artifact and
https://github.com/actions/download-artifact in gitea actions. It can
run sample workflow from doc
https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts.
The api design is inspired by
https://github.com/nektos/act/blob/master/pkg/artifacts/server.go and
includes some changes from gitea internal structs and methods.

Actions artifacts contains two parts:

- Gitea server api and storage (this pr implement basic design without
some complex cases supports)
- Runner communicate with gitea server api (in comming)

Old pr https://github.com/go-gitea/gitea/pull/22345 is outdated after
actions merged. I create new pr from main branch.

![897f7694-3e0f-4f7c-bb4b-9936624ead45](https://user-images.githubusercontent.com/2142787/219382371-eb3cf810-e4e0-456b-a8ff-aecc2b1a1032.jpeg)

Add artifacts list in actions workflow page.

16 months agoFix Actions being enabled accidentally (#24802)
Jason Song [Fri, 19 May 2023 11:35:12 +0000 (19:35 +0800)]
Fix Actions being enabled accidentally (#24802)

Regression of #24536. If the user doesn't explicitly disable Actions, it
will be enabled.

1. Gitea will call `loadRepositoryFrom` before `loadActionsFrom`.

https://github.com/go-gitea/gitea/blob/25d4f95df25dae5226e96e813dde87b071d9155e/modules/setting/setting.go#L234-L237
2. In `loadRepositoryFrom`,
`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` will set
`actions.ENABLED` with `true`.

https://github.com/go-gitea/gitea/blob/25d4f95df25dae5226e96e813dde87b071d9155e/modules/setting/repository.go#L313-L315
3. In `loadActionsFrom`, `rootCfg.Section("actions")` will get a section
with Actions enabled.

https://github.com/go-gitea/gitea/blob/25d4f95df25dae5226e96e813dde87b071d9155e/modules/setting/actions.go#L23-L26

Although the cause of the problem was using `true` by copy-paste
mistake, it also surprised me that
**`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` doesn't
only read, but also write.**

16 months agoChange `add_on` in `keys_ssh.tmpl` (#24803)
Zettat123 [Fri, 19 May 2023 09:20:18 +0000 (17:20 +0800)]
Change `add_on` in `keys_ssh.tmpl` (#24803)

Follow #24562

17 months agoreplace `drone exec` to `act_runner exec` in test README.md (#24791)
a1012112796 [Thu, 18 May 2023 19:48:47 +0000 (03:48 +0800)]
replace `drone exec` to `act_runner exec` in test README.md (#24791)

17 months agoFix OAuth loading state (#24788)
silverwind [Thu, 18 May 2023 11:50:11 +0000 (13:50 +0200)]
Fix OAuth loading state (#24788)

Fix regression from https://github.com/go-gitea/gitea/pull/24740 where
the loading state was not showing because the `oauth-login-image` class
was removed. Replaced the Fomantic loader with a pure CSS loader and
cleaned up the HTML.

Diff:
https://github.com/go-gitea/gitea/pull/24788/files?diff=unified&w=1

![](https://github.com/go-gitea/gitea/assets/115237/b5b4137f-9821-464b-9777-858fe85d9e03)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoRemove duplicated issues options and some more refactors (#24787)
Lunny Xiao [Thu, 18 May 2023 10:45:25 +0000 (18:45 +0800)]
Remove duplicated issues options and some more refactors (#24787)

This PR

- [x] Move some code from `issue.go` to `issue_search.go` and
`issue_update.go`
- [x] Use `IssuesOptions` instead of `IssueStatsOptions` becuase they
are too similiar.
- [x] Rename some functions

17 months agoRevert "Mark `models/fixtures` as generated (#24775)" (#24782)
wxiaoguang [Thu, 18 May 2023 08:12:39 +0000 (16:12 +0800)]
Revert "Mark `models/fixtures` as generated (#24775)" (#24782)

They are not generated in some cases (although they can).

And we should keep an eye on these files when reviewing.

When reviewing, files can be marked as "Viewed" and then it is
collapsed.

17 months agoRemove background on user dashboard filter bar (#24779)
silverwind [Thu, 18 May 2023 07:27:29 +0000 (09:27 +0200)]
Remove background on user dashboard filter bar (#24779)

Was only an issue on arc-green:

### Before
<img width="313" alt="Screenshot 2023-05-17 at 23 33 15"
src="https://github.com/go-gitea/gitea/assets/115237/0f6916c6-c6c3-43c8-84cc-24b0a9800a43">

### After
<img width="310" alt="Screenshot 2023-05-17 at 23 32 52"
src="https://github.com/go-gitea/gitea/assets/115237/207d3d7f-ce6f-4170-b426-e743be760185">

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoEnable two vue eslint rules (#24780)
silverwind [Thu, 18 May 2023 02:00:34 +0000 (04:00 +0200)]
Enable two vue eslint rules (#24780)

These two rules are no longer violated, so we can enable them again.

17 months agoAdd two eslint plugins (#24776)
silverwind [Thu, 18 May 2023 01:14:31 +0000 (03:14 +0200)]
Add two eslint plugins (#24776)

Add these two plugins and autofix issues:

-
[eslint-plugin-no-use-extend-native](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native)
-
[eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)

17 months agoMark `models/fixtures` as generated (#24775)
silverwind [Wed, 17 May 2023 20:59:12 +0000 (22:59 +0200)]
Mark `models/fixtures` as generated (#24775)

Makes diffs like https://github.com/go-gitea/gitea/pull/24676/files more
readable. I'm not sure if those are actually generated, but they are
good to collapse in diffs anyways.

17 months agoFix TestMinioStorageIterator skip message (#24765)
silverwind [Wed, 17 May 2023 16:22:17 +0000 (18:22 +0200)]
Fix TestMinioStorageIterator skip message (#24765)

Followup to https://github.com/go-gitea/gitea/pull/24762, fix this
message.

17 months agoFix missed table name on iterate lfs meta objects (#24768)
Lunny Xiao [Wed, 17 May 2023 15:51:22 +0000 (23:51 +0800)]
Fix missed table name on iterate lfs meta objects (#24768)

17 months agoRevert "Fix missed table name on iterate lfs meta objects" (#24764)
Yarden Shoham [Wed, 17 May 2023 13:20:11 +0000 (16:20 +0300)]
Revert "Fix missed table name on iterate lfs meta objects" (#24764)

This reverts commit 3364092013aa4d5d27ad02806b0f47967c04de18.

It was accidentally pushed to `main` without a review.

17 months agoMake the color of zero-contribution-squares in the activity heatmap more subtle ...
Evur [Wed, 17 May 2023 10:55:34 +0000 (12:55 +0200)]
Make the color of zero-contribution-squares in the activity heatmap more subtle (#24758)

The previous color had a too high contrast with the background.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix missed table name on iterate lfs meta objects
Lunny Xiao [Wed, 17 May 2023 10:26:43 +0000 (18:26 +0800)]
Fix missed table name on iterate lfs meta objects

17 months agoSkip TestMinioStorageIterator on CI (#24762)
Lunny Xiao [Wed, 17 May 2023 10:00:58 +0000 (18:00 +0800)]
Skip TestMinioStorageIterator on CI (#24762)

Fix https://github.com/go-gitea/gitea/pull/24691#issuecomment-1550987681

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoSupport no label/assignee filter and batch clearing labels/assignees (#24707)
Lunny Xiao [Wed, 17 May 2023 09:21:35 +0000 (17:21 +0800)]
Support no label/assignee filter and batch clearing labels/assignees (#24707)

Since milestones has been implemented, this PR will fix #3407

---------

Co-authored-by: Jason Song <i@wolfogre.com>
17 months agoSupport for status check pattern (#24633)
Zettat123 [Wed, 17 May 2023 08:11:13 +0000 (16:11 +0800)]
Support for status check pattern (#24633)

This PR is to allow users to specify status checks by patterns. Users
can enter patterns in the "Status Check Pattern" `textarea` to match
status checks and each line specifies a pattern. If "Status Check" is
enabled, patterns cannot be empty and user must enter at least one
pattern.
Users will no longer be able to choose status checks from the table. But
a __*`Matched`*__ mark will be added to the matched checks to help users
enter patterns.

Benefits:
- Even if no status checks have been completed, users can specify
necessary status checks in advance.
- More flexible. Users can specify a series of status checks by one
pattern.

Before:

![image](https://github.com/go-gitea/gitea/assets/15528715/635738ad-580c-49cd-941d-c721e5b99be4)

After:

![image](https://github.com/go-gitea/gitea/assets/15528715/16aa7b1b-abf1-4170-9bfa-ae6fc9803a82)

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoUpdates to doc (#24757)
Alejandro Leal [Wed, 17 May 2023 05:45:26 +0000 (01:45 -0400)]
Updates to doc (#24757)

## Misspelling fixes to:
- docs/content/doc/administration/config-cheat-sheet.en-us.md
- docs/content/doc/installation/from-source.en-us.md
- docs/content/doc/usage/packages/cargo.en-us.md
- docs/content/doc/usage/packages/storage.en-us.md

---------

Co-authored-by: delvh <dev.lh@web.de>
17 months agoIgnore build for docs only (#24761)
Lunny Xiao [Wed, 17 May 2023 05:42:08 +0000 (13:42 +0800)]
Ignore build for docs only (#24761)

Fix https://github.com/go-gitea/gitea/pull/24530#issuecomment-1550227919

17 months agoFix team members API endpoint pagination (#24754)
Yarden Shoham [Wed, 17 May 2023 00:12:37 +0000 (03:12 +0300)]
Fix team members API endpoint pagination (#24754)

Now it's 1-based instead of 0-based

- Fixes #24747

### Before

![image](https://github.com/go-gitea/gitea/assets/20454870/9b58ecfa-666c-4b78-bd0f-93233efeecbd)

### After

![image](https://github.com/go-gitea/gitea/assets/20454870/103b767a-e02e-4473-9f9f-5a676a61c174)

## :warning: BREAKING :warning:
Previous API consumers may have relied on the 0-based pagination of this
endpoint. The page numbering now starts at 1, as documented.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoMake mailer SMTP check have timed context (#24751)
wxiaoguang [Tue, 16 May 2023 20:55:51 +0000 (04:55 +0800)]
Make mailer SMTP check have timed context (#24751)

Make mailer SMTP check have timed context

Otherwise Gitea may block for long time if the DNS request blocks.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd @garymoon to MAINTAINERS (#24752)
Gary Moon [Tue, 16 May 2023 15:46:46 +0000 (11:46 -0400)]
Add @garymoon to MAINTAINERS (#24752)

Hi all.

I would like to apply to be a maintainer please. I have [four accepted
PRs](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3Agarymoon)
(such as they are), sign my commits, and have MFA enabled everywhere. My
hope is to continue with code contributions where I can (I'm not a
developer, just a wannabe), take some work off kdumont's hands, and
contribute on the infrastructure side where there is room ðŸ’š :tea:

Thank you!

17 months agoSkip TestRepoCommitsStatusParallel on CI (#24741)
silverwind [Tue, 16 May 2023 12:42:16 +0000 (14:42 +0200)]
Skip TestRepoCommitsStatusParallel on CI (#24741)

Related: https://github.com/go-gitea/gitea/issues/22109

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoRespect original content when creating secrets (#24745)
Jason Song [Tue, 16 May 2023 06:49:40 +0000 (14:49 +0800)]
Respect original content when creating secrets (#24745)

Fix #24721.

Follow what GitHub does:
- Don't trim spaces for secrets.
- Newline should be `\n` instead of `\r\n`.

Did some tests with:

```yaml
name: secrets
on: push
jobs:
  show_secrets:
    runs-on: ubuntu-latest
    steps:
      - name: Dump secrets context
        run: echo '${{ toJSON(secrets) }}' | base64
```

`AAAAAA`:
```text
   AAAAAA
AAAAAA

```
`BBBBBB`:
```text

BBBBBB
BBBBBB
```

On GitHub:

<img width="675" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/0ec60652-c2a3-47bb-9f9d-7e81665355a8">

On Gitea (before):

<img width="673" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/cce818bf-5edc-4656-86e1-2c81c304cdb2">

On Gitea (after):

<img width="673" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/0b3b15af-4d48-4bab-a334-4738a1b0eb4a">

17 months agoRemove meta charset from HTML5 documents (#24744)
silverwind [Tue, 16 May 2023 05:13:23 +0000 (07:13 +0200)]
Remove meta charset from HTML5 documents (#24744)

When `<!DOCTYPE html>` is present, the default (and only valid) charset
it `utf-8` so it does not need to be specified.

Also we do serve with HTML with `Content-Type: text/html;
charset=utf-8`, so it is duplicate info anyways.

17 months agoFix WEBP image copying (#24743)
silverwind [Tue, 16 May 2023 04:45:36 +0000 (06:45 +0200)]
Fix WEBP image copying (#24743)

Fix regression from https://github.com/go-gitea/gitea/pull/23801, where
I forgot that the new module will not throw, so the `catch` handlers
were never triggered and in turn, the WEBP was not converted to PNG.

17 months agoReorganize CSS files (#24739)
silverwind [Tue, 16 May 2023 04:13:30 +0000 (06:13 +0200)]
Reorganize CSS files (#24739)

Reorganize various CSS files for clarity, group together by subdirectory
in `index.css`. This reorders some of the rules, but I don't think it
should introduce any issues because of that.

17 months agoDon't run build and test if only docs changed (#24530)
Lunny Xiao [Tue, 16 May 2023 02:53:18 +0000 (10:53 +0800)]
Don't run build and test if only docs changed (#24530)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 16 May 2023 00:23:56 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoRework Oauth login buttons, swap github logo to monocolor (#24740)
silverwind [Mon, 15 May 2023 22:46:51 +0000 (00:46 +0200)]
Rework Oauth login buttons, swap github logo to monocolor (#24740)

Diff without whitespace:
https://github.com/go-gitea/gitea/pull/24740/files?diff=unified&w=1

- Use SVGs for GitHub and GitLab oauth providers
- Replace section wrapping with a divider
- Rework icon rendering, increase size from 32px to 40px

Before:

<img width="853" alt="Screenshot 2023-05-15 at 21 54 23"
src="https://github.com/go-gitea/gitea/assets/115237/6ab5cfb4-46ff-469a-bd1f-06780d4a6a0b">

After (more providers):

<img width="849" alt="Screenshot 2023-05-15 at 21 51 21"
src="https://github.com/go-gitea/gitea/assets/115237/fa84f92f-98e0-4aed-9357-5d62ddd98195">

<img width="856" alt="Screenshot 2023-05-15 at 21 56 45"
src="https://github.com/go-gitea/gitea/assets/115237/d3edd7ed-dadd-4302-aca7-08f20adc220e">

Ref: https://codeberg.org/Codeberg/Community/issues/1023

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoImplement systemd-notify protocol (#21151)
zeripath [Mon, 15 May 2023 22:20:30 +0000 (23:20 +0100)]
Implement systemd-notify protocol (#21151)

This PR adds support for the systemd notify protocol. Several status
messagess are provided. We should likely add a common notify/status
message for graceful.

Replaces #21140

Signed-off-by: Andrew Thornton <art27@cantab.net>
---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: ltdk <usr@ltdk.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoBump vm2 from 3.9.17 to 3.9.18 (#24742)
dependabot[bot] [Mon, 15 May 2023 21:55:56 +0000 (23:55 +0200)]
Bump vm2 from 3.9.17 to 3.9.18 (#24742)

Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.17 to 3.9.18.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/patriksimek/vm2/releases">vm2's
releases</a>.</em></p>
<blockquote>
<h2>3.9.18</h2>
<p><strong>New Features</strong></p>
<p><a
href="https://github.com/patriksimek/vm2/commit/dd81ff616ff528de5dc7a1cf2939de3d3701539d">https://github.com/patriksimek/vm2/commit/dd81ff616ff528de5dc7a1cf2939de3d3701539d</a>:
Add resolver API to create a shared resolver for multiple
<code>NodeVM</code> instances allowing to cache scripts and increase
sandbox startup times.
<a
href="https://github.com/patriksimek/vm2/commit/4d662e34d369b920943eee139ef60fb557666a43">https://github.com/patriksimek/vm2/commit/4d662e34d369b920943eee139ef60fb557666a43</a>:
Allow to pass a function to <code>require.context</code> which is called
with the filename allowing to specify the context pre file. (Thanks to
<a
href="https://github.com/blakebyrnes"><code>@​blakebyrnes</code></a>)</p>
<p><strong>Fixes</strong></p>
<p><a
href="https://github.com/patriksimek/vm2/commit/d88105f99752305c5b8a77b63ddee3ec86912daf">https://github.com/patriksimek/vm2/commit/d88105f99752305c5b8a77b63ddee3ec86912daf</a>:
Fix issue leaking host array through <code>Proxy</code>. (Thanks to <a
href="https://github.com/arkark"><code>@​arkark</code></a> (Takeshi
Kaneko) of GMO Cybersecurity by Ierae, Inc.)
<a
href="https://github.com/patriksimek/vm2/commit/5206ba25afd86ef547a2c9d48d46ca7a9e6ec238">https://github.com/patriksimek/vm2/commit/5206ba25afd86ef547a2c9d48d46ca7a9e6ec238</a>:
Fix issue with <code>inspect</code> being writeable. (Thanks to <a
href="https://github.com/arkark"><code>@​arkark</code></a> (Takeshi
Kaneko) of GMO Cybersecurity by Ierae, Inc.)</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md">vm2's
changelog</a>.</em></p>
<blockquote>
<h2>v3.9.18 (2023-05-15)</h2>
<p>[fix] Multiple security fixes.
[new] Add resolver API to create a shared resolver for multiple
<code>NodeVM</code> instances allowing to cache scripts and increase
sandbox startup times.
[new] Allow to pass a function to <code>require.context</code> which is
called with the filename allowing to specify the context pre file.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/patriksimek/vm2/commit/2f446e5d19e6539b5164b45b1f8bd4ded4dfc085"><code>2f446e5</code></a>
Release 3.9.18</li>
<li><a
href="https://github.com/patriksimek/vm2/commit/587bb1337da2dd78c166f35e6459cce28940d9bf"><code>587bb13</code></a>
Add tests for past vulnerabilities</li>
<li><a
href="https://github.com/patriksimek/vm2/commit/f5a129af752150293f2c2bb58d18a8098a93be93"><code>f5a129a</code></a>
Merge branch 'master' of <a
href="https://github.com/patriksimek/vm2">https://github.com/patriksimek/vm2</a></li>
<li><a
href="https://github.com/patriksimek/vm2/commit/dd81ff616ff528de5dc7a1cf2939de3d3701539d"><code>dd81ff6</code></a>
Merge pull request <a
href="https://redirect.github.com/patriksimek/vm2/issues/519">#519</a>
from XmiliaH/resolver-api</li>
<li><a
href="https://github.com/patriksimek/vm2/commit/af983a8a1eb397c1b955709348f1e812e465db99"><code>af983a8</code></a>
Merge remote-tracking branch 'upstream/master' into resolver-api</li>
<li><a
href="https://github.com/patriksimek/vm2/commit/5206ba25afd86ef547a2c9d48d46ca7a9e6ec238"><code>5206ba2</code></a>
Inspect method should be readonly</li>
<li><a
href="https://github.com/patriksimek/vm2/commit/d88105f99752305c5b8a77b63ddee3ec86912daf"><code>d88105f</code></a>
Ensure host array does not leak through proxy</li>
<li><a
href="https://github.com/patriksimek/vm2/commit/4d662e34d369b920943eee139ef60fb557666a43"><code>4d662e3</code></a>
Merge pull request <a
href="https://redirect.github.com/patriksimek/vm2/issues/521">#521</a>
from ulixee/pathContext</li>
<li><a
href="https://github.com/patriksimek/vm2/commit/1728bdf8d2e59c74264396948394f005e3f9a431"><code>1728bdf</code></a>
chore: simplify default function for path context</li>
<li><a
href="https://github.com/patriksimek/vm2/commit/7d16a56fa5076f8be662ddb04e435bd71802592e"><code>7d16a56</code></a>
Merge branch 'patriksimek:master' into pathContext</li>
<li>Additional commits viewable in <a
href="https://github.com/patriksimek/vm2/compare/3.9.17...3.9.18">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=vm2&package-manager=npm_and_yarn&previous-version=3.9.17&new-version=3.9.18)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/go-gitea/gitea/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
17 months agoRefactor Pull Mirror and fix out-of-sync bugs (#24732)
wxiaoguang [Mon, 15 May 2023 19:02:10 +0000 (03:02 +0800)]
Refactor Pull Mirror and fix out-of-sync bugs (#24732)

The "mirror" table and "repository" table might be out-of-sync in some
cases.

It means that "IsMirror=true" but "Mirror=nil"

This PR removes unnecessary "Mirror" field, rename "Mirror" to
"PullMirror" and fix nil panic bug.

Screenshot of changed templates:

![image](https://github.com/go-gitea/gitea/assets/2114189/c0f2bdfc-5911-43ea-b989-b19619de4235)

![image](https://github.com/go-gitea/gitea/assets/2114189/1078b41a-484f-4c06-8c2f-edb9e658275d)

17 months agoUnification of registration fields order (#24737)
Yevhen Pavlov [Mon, 15 May 2023 18:29:39 +0000 (21:29 +0300)]
Unification of registration fields order (#24737)

Place email filed in same order on all user creation pages.

Registration on installation page (before):

![image](https://github.com/go-gitea/gitea/assets/1969460/b0e6c8e5-4f6f-4225-b365-946036aa6490)

Registration on main page:

![image](https://github.com/go-gitea/gitea/assets/1969460/8bd43ab7-e706-4088-8f64-a61ca5c90d1b)

Create user account on site administration page:

![image](https://github.com/go-gitea/gitea/assets/1969460/ab0a90c4-748d-43aa-b267-432d529888f0)

Registration on installation page (after):

![image](https://github.com/go-gitea/gitea/assets/1969460/1f5e29c2-988c-46d2-960b-11b12789d7a7)

17 months agoSwitch to `@eslint-community/eslint-comments` (#24736)
silverwind [Mon, 15 May 2023 17:29:23 +0000 (19:29 +0200)]
Switch to `@eslint-community/eslint-comments` (#24736)

[eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments)
is unmaintained, switch to the community fork.

See
https://github.com/mysticatea/eslint-plugin-eslint-comments/issues/72
for discussion.

17 months agoDocs for creating a user to run Gitea on Fedora/RHEL/CentOS (#24725)
Jason Song [Mon, 15 May 2023 15:03:38 +0000 (23:03 +0800)]
Docs for creating a user to run Gitea on Fedora/RHEL/CentOS (#24725)

The current command doesn't work on Fedora/RHEL/CentOS.

- `--gecos`: use `--comment` instead.
- `--group`: use `--gid` instead, `--group` means "A list of
supplementary groups" on F/R/C.
- `--disabled-password`: leave `--password` empty instead, "The default
is to disable the password".
- `--home`: use `--home-dir` and `--create-home` instead.

17 months agoUpdate packages overview page (#24730)
Yevhen Pavlov [Mon, 15 May 2023 10:53:50 +0000 (13:53 +0300)]
Update packages overview page (#24730)

Add missed Go package reference to packages overview page

17 months agoMove actions as usage's subdirectory and update comparsion zh-cn version (#24719)
Lunny Xiao [Mon, 15 May 2023 07:36:20 +0000 (15:36 +0800)]
Move actions as usage's subdirectory and update comparsion zh-cn version (#24719)

As title.

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoDocument `redis-cluster` explicitly in config (#24717) 24404/head
Patrick Schratz [Mon, 15 May 2023 05:45:48 +0000 (07:45 +0200)]
Document `redis-cluster` explicitly in config (#24717)

Co-authored-by: delvh <dev.lh@web.de>
17 months agoDon't filter action runs based on state (#24711)
Yarden Shoham [Sun, 14 May 2023 16:04:24 +0000 (19:04 +0300)]
Don't filter action runs based on state (#24711)

We should just show all runs. This removes the filtering altogether.

- Replaces https://github.com/go-gitea/gitea/pull/24553

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/be4fb69a-ea84-44bb-9606-65a0626be721)

![image](https://github.com/go-gitea/gitea/assets/20454870/68942224-e519-43f1-87fe-f3cffef5879a)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/b3c3b200-ad44-4163-86ec-44a76362eae6)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoAdd Go package registry (#24687)
KN4CK3R [Sun, 14 May 2023 15:38:40 +0000 (17:38 +0200)]
Add Go package registry (#24687)

Fixes #7608

This PR adds a Go package registry usable with the Go proxy protocol.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/328feb5c-3df2-4f9d-8eae-fe3126d14c37)

17 months agoFix flash of unstyled content in action view page (#24712)
Yarden Shoham [Sun, 14 May 2023 14:58:59 +0000 (17:58 +0300)]
Fix flash of unstyled content in action view page (#24712)

# Before

![rec](https://github.com/go-gitea/gitea/assets/20454870/32f8e521-f743-4101-bd3c-923fd5abd893)

# After

![rec](https://github.com/go-gitea/gitea/assets/20454870/070721d1-6749-43c1-ac18-d8c58e5f0901)

Ref: https://github.com/go-gitea/gitea/issues/24625

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoClean up various avatar dimensions (#24701)
silverwind [Sun, 14 May 2023 14:15:59 +0000 (16:15 +0200)]
Clean up various avatar dimensions (#24701)

Clean up a few cases where avatar dimensions were overwritten via CSS,
which were no longer needed or were possible to set via HTML width.

Also included are two small fixes:

- Fix one more case of incorrect avatar offset on review timeline
- Vertically center avatars in review sidebar

There is more to be done here, but some of the work depends on Fomantic
`comment` module removal, or in the case of org member lists, a refactor
of the `avatarlink` template to accept a size.

<img width="371" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9c5902fb-2b89-4a7d-a152-60e74c3b2c56">
<img width="306" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/c8d92e2a-91c9-4f4a-a7de-6ae1a6bc0479">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoRemove the parallelizing when loading repo for dashboard (#24705)
wxiaoguang [Sun, 14 May 2023 13:45:47 +0000 (21:45 +0800)]
Remove the parallelizing when loading repo for dashboard (#24705)

Ref: #24638

IMO, parallelizing might run out server resources more quickly. Gitea
shouldn't use a lot of go-routine in a web handler.

And add a comment about how many repositories there could be at most.

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
17 months agoOptimize actions list by removing an unnecessary `git` call (#24710)
Yarden Shoham [Sun, 14 May 2023 12:00:35 +0000 (15:00 +0300)]
Optimize actions list by removing an unnecessary `git` call (#24710)

We already have the default branch so we don't need to make a `git` call
to get it.

17 months agoUpdate cron-translations.yml (#24708)
Lunny Xiao [Sun, 14 May 2023 08:57:23 +0000 (16:57 +0800)]
Update cron-translations.yml (#24708)

Fix cron translations push failure

17 months agoFix run list broken when trigger user deleted (#24706)
Lunny Xiao [Sun, 14 May 2023 08:12:52 +0000 (16:12 +0800)]
Fix run list broken when trigger user deleted (#24706)

17 months agoRemove Fomantic comment module (#24703)
silverwind [Sun, 14 May 2023 04:21:24 +0000 (06:21 +0200)]
Remove Fomantic comment module (#24703)

Remove the comment module and put the styles that we still need into a
separate file, eliminating about 2/3 of the CSS in line count.

17 months agoUpdate to Alpine 3.18 (#24700)
Yevhen Pavlov [Sun, 14 May 2023 01:49:00 +0000 (04:49 +0300)]
Update to Alpine 3.18 (#24700)

This pull request is for updating the base docker images to build with the latest version of Alpine.

17 months agofix minio storage iterator path (#24691)
FuXiaoHei [Sat, 13 May 2023 22:33:25 +0000 (06:33 +0800)]
fix minio storage iterator path (#24691)

minio storage iterator shows different behavior with local fs iterator.

in local fs storage:

``` go
s.IterateObjects("prefix", func(path,obj)
     println(path) // show "prefix/xxx.file"
})
```

in minio storage:

```go
s.IterateObjects("prefix", func(path,obj)
     println(path) // show "xxx.file"
})
```

I think local fs is correct, minio use wrong `basePath` to trim storage
path prefix.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd status indicator on main home screen for each repo (#24638)
Yarden Shoham [Sat, 13 May 2023 21:59:01 +0000 (00:59 +0300)]
Add status indicator on main home screen for each repo (#24638)

It will show the calculated commit status state of the latest commit on
the default branch for each repository in the dashboard repo list

- Closes #15620

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/aa1326c7-43c0-458a-a798-3102c766bcf9)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/8658cc03-2224-442a-b1c8-bf64126e4575)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd test for api team orgnization (#24699)
Lunny Xiao [Sat, 13 May 2023 21:26:35 +0000 (05:26 +0800)]
Add test for api team orgnization (#24699)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoImprove button-ghost, remove tertiary button (#24692)
wxiaoguang [Sat, 13 May 2023 20:38:22 +0000 (04:38 +0800)]
Improve button-ghost, remove tertiary button (#24692)

<img width="474" alt="image"
src="https://github.com/go-gitea/gitea/assets/2114189/7fd231f9-71c3-4769-ba96-37a5b77cf224">

<img width="557" alt="image"
src="https://github.com/go-gitea/gitea/assets/2114189/c9945f61-39b4-4711-aea8-c34ef1d714c5">

<img width="641" alt="image"
src="https://github.com/go-gitea/gitea/assets/2114189/691be76e-74fd-420d-9b9e-ba1f3b08e0b4">

And a page to test buttons:

<details>

<img width="451" alt="image"
src="https://github.com/go-gitea/gitea/assets/2114189/5f61da24-2f36-40ad-a9bb-2205da5f5f04">

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoAdd icon support for safari (#24697)
Lunny Xiao [Sat, 13 May 2023 19:48:56 +0000 (03:48 +0800)]
Add icon support for safari (#24697)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoImprove avatar uploading / resizing / compressing, remove Fomantic card module (...
wxiaoguang [Sat, 13 May 2023 18:59:11 +0000 (02:59 +0800)]
Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653)

Fixes: #8972
Fixes: #24263
And I think it also (partially) fix #24263 (no need to convert) ,
because users could upload any supported image format if it isn't larger
than AVATAR_MAX_ORIGIN_SIZE

The main idea:

* if the uploaded file size is not larger than AVATAR_MAX_ORIGIN_SIZE,
use the origin
* if the resized size is larger than the origin, use the origin

Screenshots:

JPG:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/70e98bb0-ecb9-4c4e-a89f-4a37d4e37f8e)

</details>

APNG:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/9055135b-5e2d-4152-bd72-596fcb7c6671)

![image](https://github.com/go-gitea/gitea/assets/2114189/50364caf-f7f6-4241-a289-e485fe4cd582)

</details>

WebP (animated)

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/f642eb85-498a-49a5-86bf-0a7b04089ae0)

</details>

The only exception: if a WebP image is larger than MaxOriginSize and it
is animated, then current `webp` package can't decode it, so only in
this case it isn't supported. IMO no need to support such case: why a
user would upload a 1MB animated webp as avatar? crazy .....

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix docs documenting invalid `@every` for `OLDER_THAN` cron settings (#24695)
Yarden Shoham [Sat, 13 May 2023 15:22:31 +0000 (18:22 +0300)]
Fix docs documenting invalid `@every` for `OLDER_THAN` cron settings (#24695)

Looks like a copy-paste leftover

- Fixes #20868

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix `organization` field being `null` in `GET /api/v1/teams/{id}` (#24694)
Yarden Shoham [Sat, 13 May 2023 14:47:58 +0000 (17:47 +0300)]
Fix `organization` field being `null` in `GET /api/v1/teams/{id}` (#24694)

Enabled the organization loading flag.

- Fixes #20399

# Before
```json
{
  ...
  "description": "",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

# After
```json
{
  ...
  "description": "",
  "organization": {
    "id": 2,
    "name": "bigorg",
    "full_name": "",
    "avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9",
    "description": "",
    "website": "",
    "location": "",
    "visibility": "public",
    "repo_admin_change_team_access": true,
    "username": "bigorg"
  },
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoUse standard HTTP library to serve files (#24693)
wxiaoguang [Sat, 13 May 2023 14:04:57 +0000 (22:04 +0800)]
Use standard HTTP library to serve files (#24693)

`http.ServeFile/ServeContent` handles `If-xxx`, `Content-Length`,
`Range` and `Etag` correctly

After this PR, storage files (eg: avatar) could be responded with
correct Content-Length.

17 months agoAdd `eslint-plugin-eslint-comments` (#24690)
silverwind [Fri, 12 May 2023 20:38:17 +0000 (22:38 +0200)]
Add `eslint-plugin-eslint-comments` (#24690)

Add
[eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments)
which prevents some abuse related to eslint comments.

17 months agoAdd `eslint-plugin-wc` (#24689)
silverwind [Fri, 12 May 2023 19:15:49 +0000 (21:15 +0200)]
Add `eslint-plugin-wc` (#24689)

Add [eslint-plugin-wc](https://github.com/43081j/eslint-plugin-wc),
another small set of eslint rules covering web components.

17 months agoAdd Alpine package registry (#23714)
KN4CK3R [Fri, 12 May 2023 17:27:50 +0000 (19:27 +0200)]
Add Alpine package registry (#23714)

This PR adds an Alpine package registry. You can follow [this
tutorial](https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package)
to build a *.apk package for testing.

This functionality is similar to the Debian registry (#22854) and
therefore shares some methods. I marked this PR as blocked because it
should be merged after #22854.

![grafik](https://user-images.githubusercontent.com/1666336/227779595-b76163aa-eea1-4a79-9583-775c24ad74e8.png)

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoOnly hide tooltip tippy instances (#24688)
silverwind [Fri, 12 May 2023 16:58:55 +0000 (18:58 +0200)]
Only hide tooltip tippy instances (#24688)

Fix regression from https://github.com/go-gitea/gitea/pull/24648 where
it was hiding non-tooltip tippy instances, like for example in the
review panel which itself is a tippy instance, but with a different
`role`.

17 months agoUpdate JS dependencies (#24685)
silverwind [Fri, 12 May 2023 15:47:48 +0000 (17:47 +0200)]
Update JS dependencies (#24685)

- Update all JS dependencies
- Tested citation and various vue components

Also this includes the fix for
https://github.com/webpack/webpack-cli/issues/3778.

17 months agoRename ".button-link" to ".button-ghost" (#24670)
wxiaoguang [Fri, 12 May 2023 14:58:44 +0000 (22:58 +0800)]
Rename ".button-link" to ".button-ghost" (#24670)

Mainstream frameworks:

* https://getbootstrap.com/docs/5.0/components/buttons/
* https://primer.style/css/components/buttons#link-button
* https://nextui.org/docs/components/button#light
* https://coreui.io/react/docs/components/button/
* https://design-system.hpe.design/components/button
* https://chakra-ui.com/docs/components/button/usage#button-variants
* https://mui.com/material-ui/react-button/

All (at least most?) of them make "link" button have "underline" when
hovering.

So, a "link" is a "link", when it's hovered, it should have the
underline by default. To be strict, Gitea's "button-link" is not
link-style, so it needs a better name.

Actually, for the "plain" button, there are some different approaches:

* Some frameworks just make "default" button as no style (not feasible
in Gitea/Fomantic UI)
* Primer uses "btn-invisible", which is not a proper word
* NextUI uses "light", which is not a proper word, either ...
* CoreUI / ChakraUI uses "ghost", I think this name is acceptable.

Welcome to suggest better name for such button.

Or, we just call it ".button-plain" or ".button-simple", in fact I
prefer such simple and clear name.

17 months agoMake testlogger output "TestLogger" prefix (#24683)
wxiaoguang [Fri, 12 May 2023 14:20:29 +0000 (22:20 +0800)]
Make testlogger output "TestLogger" prefix (#24683)

Make testlogger output "TestLogger" prefix instead of "Unknown Test"
when there is no running test case.

17 months agoSupport migrating storage for actions log via command line (#24679)
Jason Song [Fri, 12 May 2023 13:30:28 +0000 (21:30 +0800)]
Support migrating storage for actions log via command line (#24679)

Close #24677

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd markdown preview to Submit Review Textarea (#24672)
yp05327 [Fri, 12 May 2023 10:53:41 +0000 (19:53 +0900)]
Add markdown preview to Submit Review Textarea (#24672)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/2909352c-b2ab-4d77-b410-9f08c2f5a154)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/9448fa75-e29b-4f95-a30f-03c73c083a83)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoRemove svg.svg class, restore .rss-icon (#24667)
silverwind [Fri, 12 May 2023 10:23:53 +0000 (12:23 +0200)]
Remove svg.svg class, restore .rss-icon (#24667)

Fix regression from https://github.com/go-gitea/gitea/pull/24476 where
the `svg.svg` class misaligns SVG icons across the site and streched
buttons unintentionally in vertical height.

Before (button 30.3px):
<img width="157" alt="Screenshot 2023-05-11 at 22 09 42"
src="https://github.com/go-gitea/gitea/assets/115237/0fd137ab-ab52-4cf8-afca-c45776d526d0">

After (button 30px):
<img width="160" alt="Screenshot 2023-05-11 at 22 09 59"
src="https://github.com/go-gitea/gitea/assets/115237/4b741f4b-0fd2-4fae-9bee-16a7deb098e8">

[vertical-align:
middle](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align)
is not suitable to align icons to text because

> Aligns the middle of the element with the baseline plus half the
x-height of the parent.

Example of `vertical-align: middle` from MDN:

<img width="232" alt="Screenshot 2023-05-11 at 22 29 28"
src="https://github.com/go-gitea/gitea/assets/115237/179fb756-85a1-4cab-8219-1a4958f333e2">

So I think the
[existing](https://github.com/go-gitea/gitea/blob/365bb77a5497d492836bf823cf780c823db27e8c/web_src/css/svg.css#L3)
`vertical-align: text-top` is generally still the best bet:

<img width="241" alt="Screenshot 2023-05-11 at 22 34 24"
src="https://github.com/go-gitea/gitea/assets/115237/0cd6edf5-12c0-4bdb-8771-a900f5ba2d35">

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoSupport SSH for go get (#24664)
rune [Fri, 12 May 2023 09:44:37 +0000 (17:44 +0800)]
Support SSH for go get (#24664)

fix #12192 Support SSH for go get

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: mfk <mfk@hengwei.com.cn>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoDisplay owner of a runner as a tooltip instead of static text (#24377)
yp05327 [Fri, 12 May 2023 08:43:27 +0000 (17:43 +0900)]
Display owner of a runner as a tooltip instead of static text (#24377)

Before:

![image](https://user-images.githubusercontent.com/18380374/234779250-8bbd325c-190e-4a30-ac3e-766498d17df5.png)

After:

![image](https://user-images.githubusercontent.com/18380374/234779094-e232ecba-d9f4-4d62-a702-6d5e4a522782.png)

![image](https://user-images.githubusercontent.com/18380374/234779120-0293af17-a566-4b69-b454-af4e95844e3b.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
17 months agoRemove highlight in repo list (#24675)
yp05327 [Fri, 12 May 2023 08:00:17 +0000 (17:00 +0900)]
Remove highlight in repo list (#24675)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/aa5e9f1f-48ff-4e9f-a693-23a34e390760)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/a4b58a6c-4ea3-4ded-80df-2e650d39a1d3)

private or internal repos have `lock` icon, no need to add highlights to
them.

17 months agoUpdate pin and add pin-slash (#24669) 24225/head
yp05327 [Fri, 12 May 2023 06:38:59 +0000 (15:38 +0900)]
Update pin and add pin-slash (#24669)

Continue #23531
Thanks for the update in https://github.com/primer/octicons/issues/940,
@CameronFoxly

![image](https://github.com/go-gitea/gitea/assets/18380374/bc512b20-b656-4bd7-8e70-3a2b7eca9d65)

![image](https://github.com/go-gitea/gitea/assets/18380374/a3863267-6a7a-48d5-8157-9f361fec3fed)

17 months agoImprove empty notifications display (#24668)
silverwind [Fri, 12 May 2023 04:06:23 +0000 (06:06 +0200)]
Improve empty notifications display (#24668)

- Add icon and padding to empty notification list, center it
- Add icon to header
- Remove border below header

#### Before
<img width="1250" alt="Screenshot 2023-05-11 at 23 34 53"
src="https://github.com/go-gitea/gitea/assets/115237/7c1990a1-e48d-40e5-8762-462d8c3ac0ea">

#### After

<img width="1249" alt="Screenshot 2023-05-12 at 00 24 02"
src="https://github.com/go-gitea/gitea/assets/115237/e0bcdf81-8468-4047-b92c-6625f00a22aa">

17 months agoGitHub Actions cleanups (#24620)
silverwind [Fri, 12 May 2023 01:21:28 +0000 (03:21 +0200)]
GitHub Actions cleanups (#24620)

- Remove actions name where command is descriptive enough
- Use kebab-case instead of snake-case for step names
- Use shorter job names because to make PR checks more readable
- Remove duplicate `checks-backend`

---------

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
17 months agoFix issues list page multiple selection update milestones (#24660)
Lunny Xiao [Thu, 11 May 2023 13:19:42 +0000 (21:19 +0800)]
Fix issues list page multiple selection update milestones (#24660)

Fix #24651

17 months agoMake repo migration cancelable and fix various bugs (#24605)
wxiaoguang [Thu, 11 May 2023 08:25:46 +0000 (16:25 +0800)]
Make repo migration cancelable and fix various bugs (#24605)

Replace #12917

Close #24601
Close #12845

![image](https://github.com/go-gitea/gitea/assets/2114189/39378118-064d-40fb-8396-4579ebf33917)

![image](https://github.com/go-gitea/gitea/assets/2114189/faf37418-191c-46a6-90a8-353141e00e2d)

![image](https://github.com/go-gitea/gitea/assets/2114189/fdc8ee4d-125f-4737-9990-89bcdf9eb388)

![image](https://github.com/go-gitea/gitea/assets/2114189/9a3bd2c2-fe20-4011-81f0-990ed869d139)

---------

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoImprove queue & process & stacktrace (#24636)
wxiaoguang [Thu, 11 May 2023 07:45:47 +0000 (15:45 +0800)]
Improve queue & process & stacktrace (#24636)

Although some features are mixed together in this PR, this PR is not
that large, and these features are all related.

Actually there are more than 70 lines are for a toy "test queue", so
this PR is quite simple.

Major features:

1. Allow site admin to clear a queue (remove all items in a queue)
* Because there is no transaction, the "unique queue" could be corrupted
in rare cases, that's unfixable.
* eg: the item is in the "set" but not in the "list", so the item would
never be able to be pushed into the queue.
* Now site admin could simply clear the queue, then everything becomes
correct, the lost items could be re-pushed into queue by future
operations.
3. Split the "admin/monitor" to separate pages
4. Allow to download diagnosis report
* In history, there were many users reporting that Gitea queue gets
stuck, or Gitea's CPU is 100%
    * With diagnosis report, maintainers could know what happens clearly

The diagnosis report sample:
[gitea-diagnosis-20230510-192913.zip](https://github.com/go-gitea/gitea/files/11441346/gitea-diagnosis-20230510-192913.zip)
, use "go tool pprof profile.dat" to view the report.

Screenshots:

![image](https://github.com/go-gitea/gitea/assets/2114189/320659b4-2eda-4def-8dc0-5ea08d578063)

![image](https://github.com/go-gitea/gitea/assets/2114189/c5c46fae-9dc0-44ca-8cd3-57beedc5035e)

![image](https://github.com/go-gitea/gitea/assets/2114189/6168a811-42a1-4e64-a263-0617a6c8c4fe)

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix missing badges in org settings page (#24654)
yp05327 [Thu, 11 May 2023 06:56:25 +0000 (15:56 +0900)]
Fix missing badges in org settings page (#24654)

Improve #24232

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/e5c5a7b8-e071-4713-b622-5ae8e272d6fd)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/5a9e38b5-384e-46c5-8400-dafebbd08fee)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoOnly show one tippy at a time (#24648)
silverwind [Thu, 11 May 2023 05:40:54 +0000 (07:40 +0200)]
Only show one tippy at a time (#24648)

Because our tippy instances have an `interactiveBorder`, it's possible
to bring up two instances at once, which is undesirable.

<img width="256" alt="Screenshot 2023-05-10 at 23 03 04"
src="https://github.com/go-gitea/gitea/assets/115237/3a9a1775-78c1-46d4-a8a5-503ab7dca0d8">

Prevent this by keeping track of visible tippy instances and hiding
others when one is shown. Tippy also has the [singleton
addon](https://atomiks.github.io/tippyjs/v6/addons/#singleton) for the
same purpose, but it's unsuitable to us because we don't init all
tooltips at once.

17 months agoReenable creating default webhooks. (#24626)
Nick [Thu, 11 May 2023 02:10:57 +0000 (22:10 -0400)]
Reenable creating default webhooks. (#24626)

Fixes #24624

This seems to have been broken in
https://github.com/go-gitea/gitea/pull/21563

Previously, this code read

```
                // Are we looking at default webhooks?
                if ctx.Params(":configType") == "default-hooks" {
                        return &orgRepoCtx{
                                IsAdmin:     true,
                                Link:        path.Join(setting.AppSubURL, "/admin/hooks"),
                                LinkNew:     path.Join(setting.AppSubURL, "/admin/default-hooks"),
                                NewTemplate: tplAdminHookNew,
                        }, nil
                }

                // Must be system webhooks instead
                return &orgRepoCtx{
                        IsAdmin:         true,
                        IsSystemWebhook: true,
                        Link:            path.Join(setting.AppSubURL, "/admin/hooks"),
                        LinkNew:         path.Join(setting.AppSubURL, "/admin/system-hooks"),
                        NewTemplate:     tplAdminHookNew,
                }, nil
```

but was simplified to

```
                return &ownerRepoCtx{
                        IsAdmin:         true,
                        IsSystemWebhook: ctx.Params(":configType") == "system-hooks",
                        Link:            path.Join(setting.AppSubURL, "/admin/hooks"),
                        LinkNew:         path.Join(setting.AppSubURL, "/admin/system-hooks"),
                        NewTemplate:     tplAdminHookNew,
                }, nil
```

In other words, combining the `IsSystemWebhook` check into a one-liner
and forgetting that `LinkNew` also depended on it. This meant the
rendered `<form>` always POSTed to `/admin/system-hooks`, even when you
had GETed `/admin/default-hooks/gitea/new`.

17 months agoKd/fix redis unit test (#24650)
Kyle D [Thu, 11 May 2023 02:09:37 +0000 (22:09 -0400)]
Kd/fix redis unit test (#24650)

Replaces #24641

Currently, unit tests fail when run locally (unless users have minio
instance running). This PR only requires redis unit tests if in CI.

- Only run redis unit tests when `CI` env variable is set
- Add minio as a service in unit tests actions

17 months agoFix typo in act-runner file (#24652)
Kerwin Bryant [Thu, 11 May 2023 01:04:42 +0000 (09:04 +0800)]
Fix typo in act-runner file (#24652)

Misspelled instance_url as intence_url

17 months agoRSS icon fixes (#24476)
silverwind [Wed, 10 May 2023 22:27:02 +0000 (00:27 +0200)]
RSS icon fixes (#24476)

Fix regression from https://github.com/go-gitea/gitea/pull/24471 where
CSS rules for `.icon.grey` were removed which were in use by the RSS
icons.

Gave them their own class instead, removed a wrapper and also fixed
vertical alignment on them. Additionally, did a few related fixes on the
org header for alignment.

Fixes: https://github.com/go-gitea/gitea/issues/24584
<img width="196" alt="Screenshot 2023-05-01 at 22 39 40"
src="https://user-images.githubusercontent.com/115237/235528228-959e2385-c1d2-4d5c-baec-e3784d459653.png">
<img width="216" alt="Screenshot 2023-05-01 at 22 44 20"
src="https://user-images.githubusercontent.com/115237/235528231-95cbff86-5672-48eb-b214-8bdcefa1612c.png">
<img width="120" alt="Screenshot 2023-05-01 at 22 56 36"
src="https://user-images.githubusercontent.com/115237/235529844-b94ab554-3259-4d0c-b040-82aed7d1a111.png">

<img width="372" alt="Screenshot 2023-05-01 at 22 54 25"
src="https://user-images.githubusercontent.com/115237/235529744-1a9c201b-5692-4122-9765-2f201a322a9e.png">
<img width="477" alt="Screenshot 2023-05-01 at 22 55 28"
src="https://user-images.githubusercontent.com/115237/235529748-62188554-9927-42ef-bc94-7052bce266e2.png">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoNotification list enhancements, fix striped tables on dark theme (#24639)
silverwind [Wed, 10 May 2023 21:59:58 +0000 (23:59 +0200)]
Notification list enhancements, fix striped tables on dark theme (#24639)

- Make code block rendering via backticks work
- Remove link color unless hovered
- Remove table stripes and fix stripes rendering on dark theme for other
tables
- Introduce new `button-link` class discussed previously for buttons
that look and act like links and apply it to the two right-side buttons
- Reduce box padding by 8px on each side
- Fix "Mark all read" button margin-right
- brighten `--color-markup-code-block` on arc-green

### Before
<img width="1216" alt="Screenshot 2023-05-10 at 20 00 30"
src="https://github.com/go-gitea/gitea/assets/115237/66da9ec2-dd09-4ef0-8f1d-1822a18b6b43">
<img width="1211" alt="Screenshot 2023-05-10 at 20 00 48"
src="https://github.com/go-gitea/gitea/assets/115237/f48e30a2-9a00-4723-93aa-79b97ca0ba0c">

### After
<img width="1222" alt="Screenshot 2023-05-10 at 20 09 59"
src="https://github.com/go-gitea/gitea/assets/115237/c956e0d0-b3d9-42a4-a3ed-f0431c22bf3f">
<img width="1218" alt="Screenshot 2023-05-10 at 20 05 34"
src="https://github.com/go-gitea/gitea/assets/115237/f72c1628-3961-4c28-9263-07cdf7531316">