Commit graph

16666 commits

Author SHA1 Message Date
merlleu e6a059a3d0
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)
2023-09-13 12:14:10 +08:00
JakobDev aaeec2a392
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.
2023-09-13 10:37:54 +08:00
wxiaoguang 8ecdc93f8b
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/"
2023-09-13 01:18:52 +00:00
GiteaBot 7d56459c6c [skip ci] Updated translations via Crowdin 2023-09-13 00:22:36 +00:00
techknowlogick 3bebcb2e9c
bump rootful to 16gb 2023-09-12 15:26:41 -04:00
techknowlogick 2abbc43dff
setup go in the nightly release pipeline 2023-09-12 13:36:15 -04:00
techknowlogick c892ab0600
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)
2023-09-12 13:33:45 -04:00
wxiaoguang 739e47cd80
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)
2023-09-12 16:44:48 +00:00
techknowlogick e6b68c579b
Use Actuated.dev runner for nightly builds 2023-09-12 12:15:05 -04:00
Sienna Lloyd e986265ecb
update snap package (#27021) 2023-09-12 12:47:53 +00:00
jladbrook e33f112e01
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.
2023-09-12 12:26:51 +00:00
JakobDev e481638010
Add more package registry paths to the labeler (#27032)
Found this while working on #26960
2023-09-12 02:29:09 -04:00
KN4CK3R 591f586bf1
Extract auth middleware from service (#27028)
Related #27027

Extract the router logic from `services/auth/middleware.go` into
`routers/web` <-> `routers/common` <-> `routers/api`.
2023-09-12 08:15:16 +02:00
Earl Warren 7818121d50
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
2023-09-12 10:19:39 +08:00
GiteaBot f599814001 [skip ci] Updated translations via Crowdin 2023-09-12 00:21:32 +00:00
wxiaoguang 1875362383
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)
2023-09-11 17:06:05 +00:00
Lunny Xiao ebff0513db
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 .
2023-09-11 10:14:01 +00:00
MomentQYC 598465eb43
fix: typo (#27009) 2023-09-11 09:30:18 +00:00
wxiaoguang 998cea5888
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)
2023-09-11 17:03:51 +08:00
silverwind 6d96f0b0d1
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>
2023-09-11 10:25:10 +02:00
GiteaBot 148c9c4b05 [skip ci] Updated translations via Crowdin 2023-09-11 00:22:57 +00:00
silverwind 3442ea62cd
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>
2023-09-10 19:54:20 +00:00
wxiaoguang e7745c94f8
Fix INI parsing for value with trailing slash (#26995)
Fix #26977 (a temp fix)
2023-09-10 16:15:51 +00:00
Infinoid de68953bac
Correct the database.LOG_SQL default value in config cheat sheet (#26997)
The default is false, fix the docs to reflect that.

Fixes: #26989
2023-09-10 15:45:06 +00:00
wxiaoguang dd6e8ab57b
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
2023-09-10 18:27:23 +08:00
GiteaBot a20e0affba [skip ci] Updated translations via Crowdin 2023-09-10 00:23:48 +00:00
silverwind 539ecc24a3
Update chroma to v2.9.1 (#26990) 2023-09-09 14:37:38 +00:00
wxiaoguang 58abd4f06c
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.
2023-09-09 20:23:57 +08:00
GiteaBot 049b9f3718 [skip ci] Updated translations via Crowdin 2023-09-09 00:21:42 +00:00
Lunny Xiao e3ed67859a
Move some functions to service layer (#26969) 2023-09-08 21:09:23 +00:00
silverwind b8ad558c93
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.
2023-09-08 15:36:40 -04:00
silverwind 4693bdbda0
Chroma color tweaks (#26978) 2023-09-08 11:03:01 -05:00
Lunny Xiao 9c0a3532a4
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">
2023-09-08 23:01:19 +08:00
wxiaoguang ffa4949eaa
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>
2023-09-08 13:57:18 +00:00
wxiaoguang 4807f7be22
Clarify the git command Stdin hanging problem (#26967) 2023-09-08 13:20:38 +00:00
Lunny Xiao bafe1334c6
Add v1.20.4 changelog (#26974)
frontport from #26966

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-09-08 10:32:26 +00:00
wxiaoguang 80d14b8f4a
Check newly added node type before "attachDirAuto" (#26972) 2023-09-08 18:17:08 +08:00
zareck 4e240f2304
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>
2023-09-08 05:22:43 +00:00
Lunny Xiao 4f32abaf94
move repository deletion to service layer (#26948)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-09-08 04:51:15 +00:00
silverwind 3c0c279658
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>
2023-09-07 22:24:06 -04:00
silverwind f9abb6ade2
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.
2023-09-07 20:50:10 -04:00
GiteaBot 6cbbd51ad4 [skip ci] Updated translations via Crowdin 2023-09-08 00:21:56 +00:00
silverwind cfa3527118
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.
2023-09-07 21:30:03 +00:00
Jack Hay 1a9953348c
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.
2023-09-07 14:50:45 +00:00
CaiCandong 30cea70dd8
Refactor dashboard/feed.tmpl (#26956)
- ~~Refactor `ActionType` to `models/activities/action_type.go`~~
- Replace the magic number in `feed.tmlp` with `InAction`
2023-09-07 16:23:13 +02:00
Lunny Xiao f20e317d6d
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>
2023-09-07 13:35:45 +00:00
CaiCandong a78c2eae24
Replace util.SliceXxx with slices.Xxx (#26958) 2023-09-07 09:37:47 +00:00
Lunny Xiao e97e883ad5
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>
2023-09-07 08:31:46 +00:00
wxiaoguang 1221221595
Add "dir=auto" for input/textarea elements by default (#26735)
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-07 08:00:20 +00:00
Lunny Xiao d1dca38a2a
Fix schedule actions still running even if workflow disalbed (#26939)
Fix #26782
2023-09-07 10:25:46 +08:00