]> source.dussan.org Git - gitea.git/log
gitea.git
13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 17 Sep 2023 00:24:27 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoSupport `.git-blame-ignore-revs` file (#26395)
KN4CK3R [Sat, 16 Sep 2023 17:42:34 +0000 (19:42 +0200)]
Support `.git-blame-ignore-revs` file (#26395)

Closes #26329

This PR adds the ability to ignore revisions specified in the
`.git-blame-ignore-revs` file in the root of the repository.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/9e91be0c-6e9c-431c-bbe9-5f80154251c8)

The banner is displayed in this case. I intentionally did not add a UI
way to bypass the ignore file (same behaviour as Github) but you can add
`?bypass-blame-ignore=true` to the url manually.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoAdd `RemoteAddress` to mirrors (#26952)
KN4CK3R [Sat, 16 Sep 2023 16:03:02 +0000 (18:03 +0200)]
Add `RemoteAddress` to mirrors (#26952)

This PR adds a new field `RemoteAddress` to both mirror types which
contains the sanitized remote address for easier (database) access to
that information. Will be used in the audit PR if merged.

13 months agoUpgrading the actions/checkout@4 (#27096)
puni9869 [Sat, 16 Sep 2023 15:06:27 +0000 (20:36 +0530)]
Upgrading the actions/checkout@4 (#27096)

as title
..Upgrading the actions/checkout@4

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
13 months agoNext round of `db.DefaultContext` refactor (#27089)
JakobDev [Sat, 16 Sep 2023 14:39:12 +0000 (16:39 +0200)]
Next round of `db.DefaultContext` refactor (#27089)

Part of #27065

13 months agoUi correction in mobile view nav bar left aligned items. (#27046)
puni9869 [Sat, 16 Sep 2023 14:09:25 +0000 (19:39 +0530)]
Ui correction in mobile view nav bar left aligned items. (#27046)

As title
From the long time I was looking for this UI, Now its the time to fix
it.

Before
<img width="252" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/963f2cb4-5cfd-4a14-ab85-88e25c3daef5">

<img width="502" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/58453ef1-2555-4568-95d0-5293055b33b8">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoAdd missing deps to files-changed (#27100)
silverwind [Sat, 16 Sep 2023 13:23:06 +0000 (15:23 +0200)]
Add missing deps to files-changed (#27100)

The `docs` and `yaml` actions categories need to run when the
dependencies `markdownlin-cli` or `yamllint` change, so add those to the
list of dependencies for these actions.

Fixes: https://github.com/go-gitea/gitea/issues/27098
13 months agoUse db.WithTx for AddTeamMember to avoid ctx abuse (#27095)
wxiaoguang [Sat, 16 Sep 2023 12:54:23 +0000 (20:54 +0800)]
Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095)

Compare with ignoring spaces:
https://github.com/go-gitea/gitea/pull/27095/files?diff=split&w=1

13 months agoDrop Node.js 16 and update js dependencies (#27094)
Chongyi Zheng [Sat, 16 Sep 2023 11:36:35 +0000 (07:36 -0400)]
Drop Node.js 16 and update js dependencies (#27094)

- Drop Node.js 16 since it reached EOL
- Upgrade js dependencies
- Two packages have major version bump
  - `updates`: require node 18
- `eslint-plugin-array-func`: require `eslint` 8.40.0, which is
satisfied
- Run `make svg` for `@primer/octicons` update

13 months agoFix NPE when editing OAuth2 applications (#27078) 26212/head
JakobDev [Sat, 16 Sep 2023 09:13:26 +0000 (11:13 +0200)]
Fix NPE when editing OAuth2 applications (#27078)

Fixes #27072

It looks like there are some cases where `ContextUser` is not set here

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
13 months agoUse `print` instead of `printf` (#27093)
KN4CK3R [Sat, 16 Sep 2023 03:51:54 +0000 (05:51 +0200)]
Use `print` instead of `printf` (#27093)

A bit more performant when we only use it for appending strings.

13 months agoAdd tests for db indexer in indexer_test.go (#27087)
Nanguan Lin [Sat, 16 Sep 2023 03:15:21 +0000 (11:15 +0800)]
Add tests for db indexer in indexer_test.go (#27087)

As described in the title.
Some points:
1. Why need those tests?
Because `buildIssueOverview` is not well tested, there are several
continuous bugs in the issue overview webpage.
2. Why in indexer_test.go?
It's hard to put those tests in `./modules/indexer/issue/db/db_test.go`
because those tests need 'real' data in db mocked by fixtures instead of
random data in `./modules/indexer/issue/internal/tests`. When using
'real' data(`unittest.PrepareTestDatabase`), `InitIssueIndexer` and the
package `init()` function of `indexer` are required to init indexer.
3. Why only db?
The other three indexer engines are well tested by random data and it's
okay to also test them with 'real' data in db mocked by fixtures. Any
follow-up PR is welcome.
4. Those tests are really basic, any more complicated tests are welcome.
5. I think it's also necessary to add tests in `TestAPISearchIssues`
in`api_test_issue.go` and `TestIssues` in `home_test.go`

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 16 Sep 2023 00:21:59 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoAllow empty Conan files (#27092)
KN4CK3R [Fri, 15 Sep 2023 23:14:36 +0000 (01:14 +0200)]
Allow empty Conan files (#27092)

Fixes #27090

Looks like the Conan upload process has changed since last year. The
empty uploads don't occur anymore.

13 months agoActions are no longer experimental, so enable them by default (#27054)
Lunny Xiao [Fri, 15 Sep 2023 06:43:39 +0000 (14:43 +0800)]
Actions are no longer experimental, so enable them by default (#27054)

This PR makes the actions enabled by default, so people will find it
easier to enable actions in repository setting.

13 months agoUpdate brew installation documentation since gitea moved to brew core package (#27070)
Lunny Xiao [Fri, 15 Sep 2023 06:14:24 +0000 (14:14 +0800)]
Update brew installation documentation since gitea moved to brew core package (#27070)

ref: https://gitea.com/gitea/homebrew-gitea/pulls/178

13 months agoMore refactoring of `db.DefaultContext` (#27083)
JakobDev [Fri, 15 Sep 2023 06:13:19 +0000 (08:13 +0200)]
More refactoring of `db.DefaultContext` (#27083)

Next step of #27065

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 15 Sep 2023 00:22:32 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoReduce usage of `db.DefaultContext` (#27073)
JakobDev [Thu, 14 Sep 2023 17:09:32 +0000 (19:09 +0200)]
Reduce usage of `db.DefaultContext` (#27073)

Part of #27065

This reduces the usage of `db.DefaultContext`. I think I've got enough
files for the first PR. When this is merged, I will continue working on
this.

Considering how many files this PR affect, I hope it won't take to long
to merge, so I don't end up in the merge conflict hell.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoRemove the useless function `GetUserIssueStats` and move relevant tests to `indexer_t...
Nanguan Lin [Thu, 14 Sep 2023 16:35:53 +0000 (00:35 +0800)]
Remove the useless function `GetUserIssueStats` and move relevant tests to `indexer_test.go` (#27067)

Since the issue indexer has been refactored, the issue overview webpage
is built by the `buildIssueOverview` function and underlying
`indexer.Search` function and `GetIssueStats` instead of
`GetUserIssueStats`. So the function is no longer used.
I moved the relevant tests to `indexer_test.go` and since the search
option changed from `IssueOptions` to `SearchOptions`, most of the tests
are useless now.
We need more tests about the db indexer because those tests are highly
connected with the issue overview webpage and now this page has several
bugs.
Any advice about those test cases is appreciated.

---------

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
13 months agoFix issue templates when blank isses are disabled (#27061)
JakobDev [Thu, 14 Sep 2023 14:20:16 +0000 (16:20 +0200)]
Fix issue templates when blank isses are disabled (#27061)

Fixes #27060

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
13 months agoDisplay all user types and org types on admin management UI (#27050)
Lunny Xiao [Thu, 14 Sep 2023 06:53:36 +0000 (14:53 +0800)]
Display all user types and org types on admin management UI (#27050)

Follow #24026

<img width="1049" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/d3fc5159-b5e7-411a-b6f8-4a111a027e6b">

---------

Co-authored-by: delvh <dev.lh@web.de>
13 months agoApply lng2020 to maintainers (#27068)
Nanguan Lin [Thu, 14 Sep 2023 04:10:12 +0000 (12:10 +0800)]
Apply lng2020 to maintainers (#27068)

Hi all,

I've very much enjoyed working on Gitea and was hoping to make it
official by requesting maintainership.

My [merged PRs
list](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+sort%3Aupdated-desc+author%3Alng2020+is%3Amerged)

13 months agoFix incorrect default branch label while switching between branches (#27053)
yp05327 [Thu, 14 Sep 2023 03:54:25 +0000 (12:54 +0900)]
Fix incorrect default branch label while switching between branches (#27053)

Fix #27008

13 months agoset version in snapcraft yaml
techknowlogick [Thu, 14 Sep 2023 03:20:46 +0000 (23:20 -0400)]
set version in snapcraft yaml

13 months agoReplace 'userxx' with 'orgxx' in all test files when the user type is org (#27052)
Nanguan Lin [Thu, 14 Sep 2023 02:59:53 +0000 (10:59 +0800)]
Replace 'userxx' with 'orgxx' in all test files when the user type is org  (#27052)

Currently 'userxx' and 'orgxx' are both used as username in test files
when the user type is org, which is confusing. This PR replaces all
'userxx' with 'orgxx' when the user type is org(`user.type==1`).
Some non-trivial changes
1. Rename `user3` dir to `org3` in `tests/git-repositories-meta`
2. Change `end` in `issue reference` because 'org3' is one char shorter
than 'user3'

![ksnip_20230913-112819](https://github.com/go-gitea/gitea/assets/70063547/442988c5-4cf4-49b8-aa01-4dd6bf0ca954)
3. Change the search result number of `user/repo2` because
`user3/repo21` can't be searched now

![ksnip_20230913-112931](https://github.com/go-gitea/gitea/assets/70063547/d9ebeba4-479f-4110-9a85-825efbc981fd)
4. Change the first org name getting from API because the result is
ordered by alphabet asc and now `org 17` is before `org25`
![JW8U7NIO(J$H
_YCRB36H)T](https://github.com/go-gitea/gitea/assets/70063547/f55a685c-cf24-40e5-a87f-3a2327319548)
![)KFD411O4I8RB5ZOH7E0
Z3](https://github.com/go-gitea/gitea/assets/70063547/a0dc3299-249c-46f6-91cb-d15d4ee88dd5)

Other modifications are just find all and replace all.
Unit tests with SQLite are all passed.

---------

Co-authored-by: caicandong <1290147055@qq.com>
13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 14 Sep 2023 00:22:27 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoLoad reviewer before sending notification (#27063)
sebastian-sauer [Wed, 13 Sep 2023 19:48:36 +0000 (21:48 +0200)]
Load reviewer before sending notification (#27063)

The
[template](https://github.com/go-gitea/gitea/blob/main/templates/mail/issue/default.tmpl#L51)
uses the Reviewer.Name property - this was not loaded.

Fixes #27035

13 months agobump all nightly builds to 16gb
techknowlogick [Wed, 13 Sep 2023 14:43:03 +0000 (10:43 -0400)]
bump all nightly builds to 16gb

13 months agoShow the repo count in code tab on both user profile and org page. (#27048)
puni9869 [Wed, 13 Sep 2023 10:47:35 +0000 (16:17 +0530)]
Show the repo count in code tab on both user profile and org page. (#27048)

as title

Screenshot before
User Profile page
<img width="1367" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/24e79689-ba2f-4c85-b591-fe5621746965">

after
<img width="1346" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/754a7ee8-c2f0-424d-9ba8-be38a48140aa">

Org page
<img width="1354" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c96178d8-664f-45c5-a162-f4df5690d9d0">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoFix Fomantic's line-height causing vertical scrollbars to appear (#26961)
Kerwin Bryant [Wed, 13 Sep 2023 09:08:45 +0000 (17:08 +0800)]
Fix Fomantic's line-height causing vertical scrollbars to appear (#26961)

Before:

![before](https://github.com/go-gitea/gitea/assets/3371163/bc5a3b20-3490-4e14-ab1d-2fcfbc4a2e20)

After:

![after](https://github.com/go-gitea/gitea/assets/3371163/70e8be6a-11a2-46af-9e1e-78ac153cd2a4)

---

1. **Remove the scroll bar exception that in the a tag**
2. **Reduce the actual width of the a tag to the actual width of the
content**

![c363a5b5883e105a0c65d7337893b50](https://github.com/go-gitea/gitea/assets/3371163/789d9b83-ad14-46d2-8a1b-df551a063f6a)
As shown in the screenshot, the red box area should not be clickable

13 months agoDashboard context dropdown position fix on landing page in mobile view. (#27047)
puni9869 [Wed, 13 Sep 2023 07:15:36 +0000 (12:45 +0530)]
Dashboard context dropdown position fix on landing page in mobile view. (#27047)

as title.

Screensots

before

![image](https://github.com/go-gitea/gitea/assets/80308335/d72da379-1fb1-4d75-9f3e-f70e06ad4065)

after

![image](https://github.com/go-gitea/gitea/assets/80308335/110ea806-feed-4947-bf56-2985b1e1ec5f)

13 months agofix media description render for orgmode (#26895)
Earl Warren [Wed, 13 Sep 2023 05:44:59 +0000 (07:44 +0200)]
fix media description render for orgmode (#26895)

- In org mode you can specify an description for media via the following
syntax `[[description][media link]]`. The description is then used as
title or alt.
- This patch fixes the rendering of the description by seperating the
description and non-description cases and using `org.String()`.
- Added unit tests.
- Inspired by
https://github.com/niklasfasching/go-org/blob/6eb20dbda93cb88c3503f7508dc78cbbc639378f/org/html_writer.go#L406-L427
- Resolves https://codeberg.org/Codeberg/Community/issues/848

(cherry picked from commit 8b8aab83113b34bade61964e2097ed497abc39e9)

Co-authored-by: Gusted <postmaster@gusted.xyz>
13 months agoShow OpenID Connect and OAuth on signup page (#20242)
Dmitry Sharshakov [Wed, 13 Sep 2023 05:14:21 +0000 (08:14 +0300)]
Show OpenID Connect and OAuth on signup page (#20242)

Fix #19809

---------

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Co-authored-by: jackHay22 <jack@allspice.io>
13 months agoUpdate status and code index after changing the default branch (#27018)
Nanguan Lin [Wed, 13 Sep 2023 04:43:31 +0000 (12:43 +0800)]
Update status and code index after changing the default branch (#27018)

Fix #26723
Add `ChangeDefaultBranch` to the `notifier` interface and implement it
in `indexerNotifier`. So when changing the default branch,
`indexerNotifier` sends a message to the `indexer queue` to update the
index.

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
13 months agoadd sparse url in cargo package guide (#26937)
merlleu [Wed, 13 Sep 2023 04:14:10 +0000 (06:14 +0200)]
add sparse url in cargo package guide (#26937)

Hello,

The current package guide for cargo gives you only the git index, with
the HTTP Index stabilized being used as default for crates.io and being
better for most use-cases.

However, it's not documented that gitea supports the sparse spec, and it
does not require the _crates-index git repo for the sparse api.

I personally think we should push users to use the sparse instead of the
git repository. (Even let users disable crates-index repos if they only
want to use sparse)

13 months agoAdd missing 404 response to Swagger (#27038)
JakobDev [Wed, 13 Sep 2023 02:37:54 +0000 (04:37 +0200)]
Add missing 404 response to Swagger (#27038)

Most middleware throw a 404 in case something is not found e.g. a Repo
that is not existing. But most API endpoints don't include the 404
response in their documentation. This PR changes this.

13 months agoFix object storage path handling (#27024)
wxiaoguang [Wed, 13 Sep 2023 01:18:52 +0000 (09:18 +0800)]
Fix object storage path handling (#27024)

Object storage path rules:

* No single `/` or `.`, use empty string for root path
* Need to use trailing `/` for a list prefix to distinguish a "dir/"

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 13 Sep 2023 00:22:36 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

13 months agobump rootful to 16gb
techknowlogick [Tue, 12 Sep 2023 19:26:41 +0000 (15:26 -0400)]
bump rootful to 16gb

13 months agosetup go in the nightly release pipeline
techknowlogick [Tue, 12 Sep 2023 17:36:15 +0000 (13:36 -0400)]
setup go in the nightly release pipeline

13 months agoSpeed up nightly builds (#27045)
techknowlogick [Tue, 12 Sep 2023 17:33:45 +0000 (13:33 -0400)]
Speed up nightly builds (#27045)

* Rootless/ful docker images build separately
* Vendor go modules outside docker to speed up the build

Thanks to Alex Ellis for these suggestions (and actuated runner build
time)

13 months agoImprove repo/user/org search (#27030)
wxiaoguang [Tue, 12 Sep 2023 16:44:48 +0000 (00:44 +0800)]
Improve repo/user/org search  (#27030)

* Fix a regression from #26809 (the `data-org` is missing)
* Remove unnecessary style

Screenshots:

![image](https://github.com/go-gitea/gitea/assets/2114189/3f5cf628-db7f-4705-898a-7a4a1fbfbba8)

![image](https://github.com/go-gitea/gitea/assets/2114189/453d1fad-1090-4524-bf45-6c5da2465f04)

![image](https://github.com/go-gitea/gitea/assets/2114189/f14d9808-7596-42c8-84b4-0d57a0bf2278)

13 months agoUse Actuated.dev runner for nightly builds
techknowlogick [Tue, 12 Sep 2023 16:15:05 +0000 (12:15 -0400)]
Use Actuated.dev runner for nightly builds

13 months agoupdate snap package (#27021)
Sienna Lloyd [Tue, 12 Sep 2023 12:47:53 +0000 (06:47 -0600)]
update snap package (#27021)

13 months agoresolve issue with sort icons on admin/users and admin/runners (#24360)
jladbrook [Tue, 12 Sep 2023 12:26:51 +0000 (13:26 +0100)]
resolve issue with sort icons on admin/users and admin/runners (#24360)

Fixes #24327 to avoid the sort icon changing the table header over
multiple lines and adds missing sort icons on the runners page.

13 months agoAdd more package registry paths to the labeler (#27032)
JakobDev [Tue, 12 Sep 2023 06:29:09 +0000 (08:29 +0200)]
Add more package registry paths to the labeler (#27032)

Found this while working on #26960

13 months agoExtract auth middleware from service (#27028)
KN4CK3R [Tue, 12 Sep 2023 06:15:16 +0000 (08:15 +0200)]
Extract auth middleware from service (#27028)

Related #27027

Extract the router logic from `services/auth/middleware.go` into
`routers/web` <-> `routers/common` <-> `routers/api`.

13 months agoS3: log human readable error on connection failure (#26856)
Earl Warren [Tue, 12 Sep 2023 02:19:39 +0000 (04:19 +0200)]
S3: log human readable error on connection failure (#26856)

Should BucketExists (HeadBucket) fail because of an error related to
the connection rather than the existence of the bucket, no information
is available and the admin is left guessing.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html

> This action is useful to determine if a bucket exists and you have
> permission to access it. The action returns a 200 OK if the bucket
> exists and you have permission to access it.
>
> If the bucket does not exist or you do not have permission to access
> it, the HEAD request returns a generic 400 Bad Request, 403
> Forbidden or 404 Not Found code. A message body is not included, so
> you cannot determine the exception beyond these error codes.

GetBucketVersioning is used instead and exclusively dedicated to
asserting if using the connection does not return a BadRequest.
If it does the NewMinioStorage logs an error and returns. Otherwise
it keeps going knowing that BucketExists is not going to fail for
reasons unrelated to the existence of the bucket and the permissions
to access it.

(cherry picked from commit d1df4b3bc62e5e61893a923f1c4b58f084eb03af)

Refs: https://codeberg.org/forgejo/forgejo/issues/1338

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 12 Sep 2023 00:21:32 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoFix "delete" modal dialog for issue/PR (#27015)
wxiaoguang [Mon, 11 Sep 2023 17:06:05 +0000 (01:06 +0800)]
Fix "delete" modal dialog for issue/PR (#27015)

Close #27012

By the way, rename the single-word ID to a long ID.

![image](https://github.com/go-gitea/gitea/assets/2114189/9f05ecc3-0a3d-4612-85e0-da60f7a45d2e)

![image](https://github.com/go-gitea/gitea/assets/2114189/9133808c-bd89-4265-99c5-83b986bd266f)

13 months agoFix context cache bug & enable context cache for dashabord commits' authors (#26991)
Lunny Xiao [Mon, 11 Sep 2023 10:14:01 +0000 (18:14 +0800)]
Fix context cache bug & enable context cache for dashabord commits' authors (#26991)

Unfortunately, when a system setting hasn't been stored in the database,
it cannot be cached.
Meanwhile, this PR also uses context cache for push email avatar display
which should avoid to read user table via email address again and again.

According to my local test, this should reduce dashboard elapsed time
from 150ms -> 80ms .

13 months agofix: typo (#27009)
MomentQYC [Mon, 11 Sep 2023 09:30:18 +0000 (17:30 +0800)]
fix: typo (#27009)

13 months agoUse secure cookie for HTTPS sites (#26999)
wxiaoguang [Mon, 11 Sep 2023 09:03:51 +0000 (17:03 +0800)]
Use secure cookie for HTTPS sites (#26999)

If the AppURL(ROOT_URL) is an HTTPS URL, then the COOKIE_SECURE's
default value should be true.

And, if a user visits an "http" site with "https" AppURL, they won't be
able to login, and they should have been warned. The only problem is
that the "language" can't be set either in such case, while I think it
is not a serious problem, and it could be fixed easily if needed.

![image](https://github.com/go-gitea/gitea/assets/2114189/7bc9a859-dcc1-467d-bc7c-1dd6a10389e3)

13 months agoAdd fetch wrappers, ignore network errors in actions view (#26985)
silverwind [Mon, 11 Sep 2023 08:25:10 +0000 (10:25 +0200)]
Add fetch wrappers, ignore network errors in actions view (#26985)

1. Introduce lightweight `fetch` wrapper functions that automatically
sets csfr token, content-type and use it in `RepoActionView.vue`.
2. Fix a specific issue on `RepoActionView.vue` where a fetch network
error is shortly visible during page reload sometimes. It can be
reproduced by F5-in in quick succession on the actions view page and was
also producing a red error box on the page.

Once approved, we can replace all current `fetch` uses in UI with this
in another PR.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 11 Sep 2023 00:22:57 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoAdd some more labels to labeler (#26987)
silverwind [Sun, 10 Sep 2023 19:54:20 +0000 (21:54 +0200)]
Add some more labels to labeler (#26987)

- Add more automatic labels
- Consistently use `**` glob for recursive directory globs.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
13 months agoFix INI parsing for value with trailing slash (#26995)
wxiaoguang [Sun, 10 Sep 2023 16:15:51 +0000 (00:15 +0800)]
Fix INI parsing for value with trailing slash (#26995)

Fix #26977 (a temp fix)

13 months agoCorrect the database.LOG_SQL default value in config cheat sheet (#26997)
Infinoid [Sun, 10 Sep 2023 15:45:06 +0000 (11:45 -0400)]
Correct the database.LOG_SQL default value in config cheat sheet (#26997)

The default is false, fix the docs to reflect that.

Fixes: #26989
13 months agoImprove "language stats" UI (#26968)
wxiaoguang [Sun, 10 Sep 2023 10:27:23 +0000 (18:27 +0800)]
Improve "language stats" UI (#26968)

Before:

* The layout is quite complex
* The UI flickers when switch the stats (https://try.gitea.io/)

After:

* Simplify the code
* The UI doesn't flicker

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 10 Sep 2023 00:23:48 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoUpdate chroma to v2.9.1 (#26990)
silverwind [Sat, 9 Sep 2023 14:37:38 +0000 (16:37 +0200)]
Update chroma to v2.9.1 (#26990)

13 months agoImprove issue list layout (#26983)
wxiaoguang [Sat, 9 Sep 2023 12:23:57 +0000 (20:23 +0800)]
Improve issue list layout (#26983)

Align everything with a new layout.

* Use "baseline" for some special elements, the "flex-item-icon" is for
the issue list only at the moment and I think it should be general
enough now (but not using "flex-item-leading" anymore in this case).
* Make the labels stretch themselves.

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 9 Sep 2023 00:21:42 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoMove some functions to service layer (#26969)
Lunny Xiao [Fri, 8 Sep 2023 21:09:23 +0000 (05:09 +0800)]
Move some functions to service layer (#26969)

13 months agoLock yamllint and update indirect python deps (#26979)
silverwind [Fri, 8 Sep 2023 19:36:40 +0000 (21:36 +0200)]
Lock yamllint and update indirect python deps (#26979)

I forgot to lock `yamllint` to exact version, so did that and
regenerated `poetry.lock` as well.

13 months agoChroma color tweaks (#26978)
silverwind [Fri, 8 Sep 2023 16:03:01 +0000 (18:03 +0200)]
Chroma color tweaks (#26978)

13 months agoAdd a new column schedule_id for action_run to track (#26975)
Lunny Xiao [Fri, 8 Sep 2023 15:01:19 +0000 (23:01 +0800)]
Add a new column schedule_id for action_run to track (#26975)

Fix #26971

And the UI now will display it's scheduled but not triggered by a push.

<img width="954" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/d211845c-457e-4c3e-af1f-a0d654d3f365">

13 months agoImprove flex list UI (#26970)
wxiaoguang [Fri, 8 Sep 2023 13:57:18 +0000 (21:57 +0800)]
Improve flex list UI (#26970)

1. There is already `gt-ac`, so no need to introduce `flex-item-center`
2. The `flex-item-baseline` and `.flex-item-icon svg { margin-top: 1px
}` seem to be a tricky patch, they don't resolve the root problem, and
still cause misalignment in some cases.
* The root problem is: the "icon" needs to align with the sibling
"title"
    * So, make the "icon" and the "title" both have the same height
3. `flex-text-inline` could only be used if the element is really
"inline", otherwise its `vertical-align` would make the box size change.
In most cases, `flex-text-block` is good enough.

![image](https://github.com/go-gitea/gitea/assets/2114189/1b7acfc2-b1c7-4e9c-a983-2fa932026479)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoClarify the git command Stdin hanging problem (#26967)
wxiaoguang [Fri, 8 Sep 2023 13:20:38 +0000 (21:20 +0800)]
Clarify the git command Stdin hanging problem (#26967)

13 months agoAdd v1.20.4 changelog (#26974)
Lunny Xiao [Fri, 8 Sep 2023 10:32:26 +0000 (18:32 +0800)]
Add v1.20.4 changelog (#26974)

frontport from #26966

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
13 months agoCheck newly added node type before "attachDirAuto" (#26972)
wxiaoguang [Fri, 8 Sep 2023 10:17:08 +0000 (18:17 +0800)]
Check newly added node type before "attachDirAuto" (#26972)

13 months agoExpanding documentation in queue.go (#26889)
zareck [Fri, 8 Sep 2023 05:22:43 +0000 (02:22 -0300)]
Expanding documentation in queue.go (#26889)

A set of terminology, along with a broader description, can help more
people engage with the Gitea queue system, providing insights and
ensuring its correct use.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agomove repository deletion to service layer (#26948)
Lunny Xiao [Fri, 8 Sep 2023 04:51:15 +0000 (12:51 +0800)]
move repository deletion to service layer (#26948)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoAdd `yamllint` (#26965)
silverwind [Fri, 8 Sep 2023 02:24:06 +0000 (04:24 +0200)]
Add `yamllint` (#26965)

So that https://github.com/go-gitea/gitea/pull/26964 does not happen
again. Merge this after that PR. Config is based on
[node's](https://github.com/nodejs/node/blob/main/.yamllint.yaml).

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
13 months agoFix yaml quoting (#26964)
silverwind [Fri, 8 Sep 2023 00:50:10 +0000 (02:50 +0200)]
Fix yaml quoting (#26964)

Yaml [does not
like](https://github.com/go-gitea/gitea/actions/runs/6115139962/job/16598147278?pr=26568)
keys that start with `*` so let's quote all globs.

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 8 Sep 2023 00:21:56 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoAdd `actions/labeler` (#26962)
silverwind [Thu, 7 Sep 2023 21:30:03 +0000 (23:30 +0200)]
Add `actions/labeler` (#26962)

Implements https://github.com/GiteaBot/gitea-backporter/issues/93 using
[`actions/labeler`](https://github.com/actions/labeler). Very basic
configuration, can be extended later.

13 months agoTeam invite url fix when registration disabled (#26950)
Jack Hay [Thu, 7 Sep 2023 14:50:45 +0000 (10:50 -0400)]
Team invite url fix when registration disabled (#26950)

This is a follow-on to https://github.com/go-gitea/gitea/pull/26550 and
fixes the case where the team invite links to the registration page if
it is disabled in settings.

13 months agoRefactor dashboard/feed.tmpl (#26956)
CaiCandong [Thu, 7 Sep 2023 14:23:13 +0000 (22:23 +0800)]
Refactor dashboard/feed.tmpl (#26956)

- ~~Refactor `ActionType` to `models/activities/action_type.go`~~
- Replace the magic number in `feed.tmlp` with `InAction`

13 months agoImprove hint when uploading a too large avatar (#26935)
Lunny Xiao [Thu, 7 Sep 2023 13:35:45 +0000 (21:35 +0800)]
Improve hint when uploading a too large avatar (#26935)

Fix #26390

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
13 months agoReplace `util.SliceXxx` with `slices.Xxx` (#26958)
CaiCandong [Thu, 7 Sep 2023 09:37:47 +0000 (17:37 +0800)]
Replace `util.SliceXxx`  with `slices.Xxx`  (#26958)

13 months agoAdd reverseproxy auth for API back with default disabled (#26703)
Lunny Xiao [Thu, 7 Sep 2023 08:31:46 +0000 (16:31 +0800)]
Add reverseproxy auth for API back with default disabled (#26703)

This feature was removed by #22219 to avoid possible CSRF attack.

This PR takes reverseproxy auth for API back but with default disabled.

To prevent possbile CSRF attack, the responsibility will be the
reverseproxy but not Gitea itself.

For those want to enable this `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`,
they should know what they are doing.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoAdd "dir=auto" for input/textarea elements by default (#26735)
wxiaoguang [Thu, 7 Sep 2023 08:00:20 +0000 (16:00 +0800)]
Add "dir=auto" for input/textarea elements by default (#26735)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoFix schedule actions still running even if workflow disalbed (#26939)
Lunny Xiao [Thu, 7 Sep 2023 02:25:46 +0000 (10:25 +0800)]
Fix schedule actions still running even if workflow disalbed (#26939)

Fix #26782

13 months agoFix the missing repo count (#26942)
Nanguan Lin [Thu, 7 Sep 2023 01:44:47 +0000 (09:44 +0800)]
Fix the missing repo count (#26942)

The commit
(https://github.com/go-gitea/gitea/commit/958d148043a6ace08776b1fd5ec0a5859144dea0)
forgot two pages :stuck_out_tongue_closed_eyes:

![ksnip_20230906-182626](https://github.com/go-gitea/gitea/assets/70063547/6da529e9-3028-46fb-8065-abfd804a078b)
BTW, the `leave` button is in a weird position

13 months agoImprove SSH Key / GPG Key / Deploy Key UI (#26949)
wxiaoguang [Thu, 7 Sep 2023 01:13:11 +0000 (09:13 +0800)]
Improve SSH Key / GPG Key / Deploy Key UI (#26949)

1. In many cases, the `flex-list` has previous and next `gt-hidden`
siblings, so relax the CSS selector to remove all ".segument .flex-list"
paddings.
2. Make the "Add key" button can toggle
3. Move help message into the related segment(panel). Otherwise users
would misread the message, eg: the SSH help seemed for GPG because they
are so near
4. Move modal element into the segment element, otherwise it affects the
layout

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 7 Sep 2023 00:22:15 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoUpdate nginx recommendations (#26924)
silverwind [Wed, 6 Sep 2023 17:49:45 +0000 (19:49 +0200)]
Update nginx recommendations (#26924)

- `Connection` and `Upgrade` [needed for
websockets](https://www.nginx.com/blog/websocket-nginx/)
- ~~`X-Real-IP` unnecessary and duplicate with `X-Forwarded-For`. [chi
checks both
headers](https://github.com/go-chi/chi/blob/master/middleware/realip.go),
but XFF is definitely the more "standard" one.~~

13 months agodocs: Update Profile README information (#26947)
Panagiotis "Ivory" Vasilopoulos [Wed, 6 Sep 2023 14:22:50 +0000 (14:22 +0000)]
docs: Update Profile README information (#26947)

Follow-up of https://github.com/go-gitea/gitea/pull/26295

13 months agoFix scoped label layout (#26932)
wxiaoguang [Wed, 6 Sep 2023 12:22:38 +0000 (20:22 +0800)]
Fix scoped label layout (#26932)

Fix #26931

13 months agoMove createrepository from module to service layer (#26927)
Lunny Xiao [Wed, 6 Sep 2023 12:08:51 +0000 (20:08 +0800)]
Move createrepository from module to service layer (#26927)

Repository creation depends on many models, so moving it to service
layer is better.

13 months agoAdd a documentation note for Windows Service (#26938)
KazzmanK [Wed, 6 Sep 2023 11:14:12 +0000 (14:14 +0300)]
Add a documentation note for Windows Service (#26938)

Service may fail to start at boot time with timeout
Resolves #26934

Co-authored-by: Nikolay Kobzarev <n.kobzarev@aeronavigator.ru>
13 months agoallow "latest" to be used in release vTag when downloading file (#26748)
merlleu [Wed, 6 Sep 2023 11:06:04 +0000 (13:06 +0200)]
allow "latest" to be used in release vTag when downloading file (#26748)

Hello,

In the discord I saw
[someone](https://discord.com/channels/322538954119184384/1069795723178160168/1145061200644800514)
complaining that you can't use the "latest" keyword as release tag to
download a specific file:
In his example:

https://www.uberwald.me/gitea/public/fvtt-ecryme/releases/latest/system.json

However the latest keyword works for the release page, so I think it's a
good thing to implement this on the release attachment download url too.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoExtract common code to new template (#26933)
Kerwin Bryant [Wed, 6 Sep 2023 10:11:06 +0000 (18:11 +0800)]
Extract common code to new template (#26933)

Same as #26903

13 months agoShow always repo count in header (#26842)
JakobDev [Wed, 6 Sep 2023 09:34:26 +0000 (11:34 +0200)]
Show always repo count in header (#26842)

A few pages don't load the repo count of an user/org, so it is not shown
in the header. This happens mostly on org pages, but the package
settings applies to the user page as well.

Before:
![Screenshot 2023-08-31 at 12-45-36 Gitea Git with a cup of
tea](https://github.com/go-gitea/gitea/assets/15185051/14a59998-2cf9-4771-82f4-5d1d6fcb31f4)

After:

![grafik](https://github.com/go-gitea/gitea/assets/15185051/ff055aa0-7cde-49be-9522-437bf970be1d)

Seen on #26826
Regression of #25928

13 months agoShow always repo count in header (#26842)
JakobDev [Wed, 6 Sep 2023 08:49:36 +0000 (10:49 +0200)]
Show always repo count in header (#26842)

A few pages don't load the repo count of an user/org, so it is not shown
in the header. This happens mostly on org pages, but the package
settings applies to the user page as well.

Before:
![Screenshot 2023-08-31 at 12-45-36 Gitea Git with a cup of
tea](https://github.com/go-gitea/gitea/assets/15185051/14a59998-2cf9-4771-82f4-5d1d6fcb31f4)

After:

![grafik](https://github.com/go-gitea/gitea/assets/15185051/ff055aa0-7cde-49be-9522-437bf970be1d)

Seen on #26826
Regression of #25928

13 months agoArtifacts retention and auto clean up (#26131)
FuXiaoHei [Wed, 6 Sep 2023 07:41:06 +0000 (15:41 +0800)]
Artifacts retention and auto clean up (#26131)

Currently, Artifact does not have an expiration and automatic cleanup
mechanism, and this feature needs to be added. It contains the following
key points:

- [x] add global artifact retention days option in config file. Default
value is 90 days.
- [x] add cron task to clean up expired artifacts. It should run once a
day.
- [x] support custom retention period from `retention-days: 5` in
`upload-artifact@v3`.
- [x] artifacts link in actions view should be non-clickable text when
expired.

13 months agoFix UI anomalies (#26929)
Kerwin Bryant [Wed, 6 Sep 2023 07:00:45 +0000 (15:00 +0800)]
Fix UI anomalies (#26929)

13 months agoFix the display of org level badges (#26504)
yp05327 [Wed, 6 Sep 2023 06:38:14 +0000 (15:38 +0900)]
Fix the display of org level badges  (#26504)

Follow #24654 #22705 #24232

In some pages we still have missing badges, for example:

![image](https://github.com/go-gitea/gitea/assets/18380374/f57fae6d-95ad-4996-8881-160c9cd27768)

![image](https://github.com/go-gitea/gitea/assets/18380374/11e86d43-b715-4d14-bdf0-51bf8b5c7b01)

![image](https://github.com/go-gitea/gitea/assets/18380374/61c514e7-d8f6-4c93-a61f-60604619e3a7)