]> source.dussan.org Git - gitea.git/log
gitea.git
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)

13 months agoAdd missing translation (#26926)
Lunny Xiao [Wed, 6 Sep 2023 02:13:08 +0000 (10:13 +0800)]
Add missing translation (#26926)

Fix #26923

13 months agoVendor `jquery.are-you-sure` with strict mode fixes (#26901)
silverwind [Wed, 6 Sep 2023 00:02:44 +0000 (02:02 +0200)]
Vendor `jquery.are-you-sure` with strict mode fixes (#26901)

Extract from https://github.com/go-gitea/gitea/pull/25940 and because
https://github.com/go-gitea/gitea/pull/26743 does seem to need more
work.

This will be required if we are to run our JS in [strict
mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode).

Previously, the two variables `$fields` and `$dirtyForms` polluted
`window`:

<img width="1145" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/e0270a0e-b881-4ed7-9cc4-e9ab25c0a2bc">

13 months agoFix the secret regexp pattern on web page (#26910)
Nanguan Lin [Tue, 5 Sep 2023 20:15:19 +0000 (04:15 +0800)]
Fix the secret regexp pattern on web page (#26910)

The error is caused by the web page not handling the post form
failure, which is 400 bad requests in this case.

13 months agoAdd @chenrui333 as maintainer (#26917)
Rui Chen [Tue, 5 Sep 2023 18:47:07 +0000 (14:47 -0400)]
Add @chenrui333 as maintainer (#26917)

relates to https://gitea.com/gitea/homebrew-gitea/pulls/179

Signed-off-by: Rui Chen <rui@chenrui.dev>
13 months agoMove notification interface to services layer (#26915)
Lunny Xiao [Tue, 5 Sep 2023 18:37:47 +0000 (02:37 +0800)]
Move notification interface to services layer (#26915)

Extract from #22266

13 months agofetch emails of currently displayed user on admin page (#26918)
techknowlogick [Tue, 5 Sep 2023 17:56:21 +0000 (13:56 -0400)]
fetch emails of currently displayed user on admin page (#26918)

Currently, this fetches the emails from the user viewing the page. This
PR changes it to show the emails from the user whose page it is.

13 months agoImprove LDAP group config documentation, fixes #21159 (#21227)
Sven Seeberg [Tue, 5 Sep 2023 17:18:53 +0000 (19:18 +0200)]
Improve LDAP group config documentation, fixes #21159 (#21227)

Improve the wording of the LDAP group attributes documentation and
expand the examples.

13 months agoupdate footer link to new landing page (#26916)
techknowlogick [Tue, 5 Sep 2023 16:44:07 +0000 (12:44 -0400)]
update footer link to new landing page (#26916)

as title

Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoRemove `Named` interface (#26913)
KN4CK3R [Tue, 5 Sep 2023 15:58:30 +0000 (17:58 +0200)]
Remove `Named` interface (#26913)

`Named` is implemented by every `Method` and future implementations
should implement the method too.

13 months agoRefactor secrets modification logic (#26873)
KN4CK3R [Tue, 5 Sep 2023 15:21:02 +0000 (17:21 +0200)]
Refactor secrets modification logic (#26873)

- Share code between web and api
- Add some tests

13 months agoAdd missing `reqToken()` to notifications endpoints (#26914)
JakobDev [Tue, 5 Sep 2023 14:43:34 +0000 (16:43 +0200)]
Add missing `reqToken()` to notifications endpoints (#26914)

They currently throw a Internal Server Error when you use them without a
token. Now they correctly return a `token is required` error.

This is no security issue. If you use this endpoints with a token that
don't have the correct permission, you get the correct error. This is
not affected by this PR.

13 months agofeat(API): add routes and functions for managing user's secrets (#26909)
Bo-Yi Wu [Tue, 5 Sep 2023 14:02:50 +0000 (22:02 +0800)]
feat(API): add routes and functions for managing user's secrets (#26909)

- Add routes for creating or updating a user's actions secrets in
`routers/api/v1/api.go`
- Add a new file `routers/api/v1/user/action.go` with functions for
creating or updating a user's secrets and deleting a user's secret
- Modify the `templates/swagger/v1_json.tmpl` file to include the routes
for creating or updating a user's secrets and deleting a user's secret

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
13 months agoMove feed notification service layer (#26908)
Lunny Xiao [Tue, 5 Sep 2023 13:00:52 +0000 (21:00 +0800)]
Move feed notification service layer (#26908)

Extract from #22266

13 months agoExtract common code to new template (#26903)
Kerwin Bryant [Tue, 5 Sep 2023 12:00:28 +0000 (20:00 +0800)]
Extract common code to new template (#26903)

I noticed that the code of several new webhook pages is highly
repetitive, so I pulled out the common parts to a new template, unified
reference, unified maintenance

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
13 months agoMove ui notification to service layer (#26907)
Lunny Xiao [Tue, 5 Sep 2023 11:15:42 +0000 (19:15 +0800)]
Move ui notification to service layer (#26907)

Extract from #22266

13 months agoRemove duplicated notify mail configuration on tests (#26912)
Lunny Xiao [Tue, 5 Sep 2023 10:34:36 +0000 (18:34 +0800)]
Remove duplicated notify mail configuration on tests (#26912)

Extract from #22266

Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoMove indexer notification to service layer (#26906)
Lunny Xiao [Tue, 5 Sep 2023 10:07:57 +0000 (18:07 +0800)]
Move indexer notification to service layer (#26906)

Extract from #22266

13 months agoMove mail notification logic to service layer (#26905)
Lunny Xiao [Tue, 5 Sep 2023 09:26:59 +0000 (17:26 +0800)]
Move mail notification logic to service layer (#26905)

Extract from #22266

13 months agoImprove DeleteByID (#26904)
Lunny Xiao [Tue, 5 Sep 2023 06:11:35 +0000 (14:11 +0800)]
Improve DeleteByID (#26904)

13 months agoUpdate backup instructions to align with archive structure (#26902)
JonRB [Tue, 5 Sep 2023 01:26:12 +0000 (02:26 +0100)]
Update backup instructions to align with archive structure (#26902)

Signed-off-by: JonRB <jon.roadleybattin@gmail.com>
fixes https://github.com/go-gitea/gitea/issues/25878

13 months agoMore fixes for the "commit-body" (#26898) 26050/head
wxiaoguang [Mon, 4 Sep 2023 13:38:59 +0000 (21:38 +0800)]
More fixes for the "commit-body" (#26898)

The changes for "commit-body" in #26877 are not ideal.

The reason is: the "commit-body" is usually a `<pre>`, it has default
margins. In most cases, we do not need that large margin. So, this PR
introduces a general but small margin for all "commit-body" elements.
Then these `gt-m-0` could be removed.

The `:not` selector is not needed, because the `.timeline-item` selector
is already clear enough.

13 months agoShow queue's active worker number (#26896)
wxiaoguang [Mon, 4 Sep 2023 13:07:32 +0000 (21:07 +0800)]
Show queue's active worker number (#26896)

13 months agoRemove CSS `has` selector and improve various styles (#26891)
wxiaoguang [Mon, 4 Sep 2023 10:22:46 +0000 (18:22 +0800)]
Remove CSS `has` selector and improve various styles (#26891)

Replace  #26850

Major changes:

1. Remove all `has` selectors, it is still not supported by firefox.
Actually there could be some more general and clearer approaches
2. Remove `two-toggle-buttons`, the `.ui.buttons` just works well
3. Rewrite the `.ui.buttons` border styles, see the screenshots
4. Remove the "fine-tuning" paddings from the the flex children, they
could layout themselves well.

![image](https://github.com/go-gitea/gitea/assets/2114189/a32ed6f3-60f7-43d5-9492-62c45d2397f6)

![image](https://github.com/go-gitea/gitea/assets/2114189/5cb173c5-c942-4237-8cb4-2697220b3f06)

![image](https://github.com/go-gitea/gitea/assets/2114189/8a1c12b3-a632-48ff-b1a7-a01a4417f821)

![image](https://github.com/go-gitea/gitea/assets/2114189/46bde1bd-9113-4231-965d-6ec9076f6a3b)

13 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 4 Sep 2023 00:23:31 +0000 (00:23 +0000)]
[skip ci] Updated licenses and gitignores

13 months agoUpdate documents to fix some links (#26885)
Lunny Xiao [Sun, 3 Sep 2023 18:45:20 +0000 (02:45 +0800)]
Update documents to fix some links (#26885)

13 months agoclarify aspects of the dump command (#26887)
JonRB [Sun, 3 Sep 2023 18:44:01 +0000 (19:44 +0100)]
clarify aspects of the dump command (#26887)

clarify aspects of the dump command

Possibly closes #26862

---------

Co-authored-by: delvh <dev.lh@web.de>
13 months agoRelocate the `RSS user feed` button (#26882)
BeYonme [Sun, 3 Sep 2023 11:06:59 +0000 (19:06 +0800)]
Relocate the `RSS user feed` button (#26882)

before:

![before](https://github.com/go-gitea/gitea/assets/38558065/e33e0809-91cd-451a-9c36-ab20b9296038)

after:

![after](https://github.com/go-gitea/gitea/assets/38558065/9dbfb0ce-1d0e-4bc8-8502-6b4af0fba220)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
13 months agoUse Go 1.21 and update dependencies (#26878)
wxiaoguang [Sun, 3 Sep 2023 10:34:57 +0000 (18:34 +0800)]
Use Go 1.21 and update dependencies (#26878)

To make sure Gitea's next release's lifecycle could have active Golang
support.

And min/max are builtin now.

13 months agoUpdate docs about attachment path (#26883)
CaiCandong [Sun, 3 Sep 2023 09:40:10 +0000 (17:40 +0800)]
Update docs about attachment path (#26883)

This change was caused by #26271, for configuration as below:
```
[attachment]
ENABLE = true
PATH = data/attachments
MAX_SIZE = 100
MAX_FILES = 5
```
Before #26271, the resolved path is ${AppWorkPath}/${attachments.PATH}
(such as `/var/lib/gitea/data/attachments`)
After #26271, the resolved path is ${AppDataPath}/${attachments.PATH}
(such as `/var/lib/gitea/data/data/attachments`)

Fix  https://github.com/go-gitea/gitea/issues/26864
Follow https://github.com/go-gitea/gitea/pull/26271

13 months agoRefactor "shortsha" (#26877)
wxiaoguang [Sun, 3 Sep 2023 02:58:52 +0000 (10:58 +0800)]
Refactor "shortsha" (#26877)

The old code used complex `if` blocks and strange HTML layouts.

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/7fbee2b8-d150-4e6b-b67e-83400fa290eb)

</details>

This PR refactors the template code and remove legacy CSS styles. The UI
doesn't change much.

![image](https://github.com/go-gitea/gitea/assets/2114189/3e195df9-0ab5-4182-bcb2-bb20cad823f2)

![image](https://github.com/go-gitea/gitea/assets/2114189/f707a49f-be41-4dfe-871f-2869f2230380)

13 months agoFix wrong review requested number (#26784)
Nanguan Lin [Sun, 3 Sep 2023 02:12:38 +0000 (10:12 +0800)]
Fix wrong review requested number (#26784)

Fix the wrong review requested number mentioned by #18808 .
Fix #18808
Before:

![ksnip_20230829-140750](https://github.com/go-gitea/gitea/assets/70063547/0af2055b-6f16-4699-a944-c7186831d7f9)
After:

![ksnip_20230829-141817](https://github.com/go-gitea/gitea/assets/70063547/16633264-20ba-45e3-bfbb-a495ed76a45b)

13 months agoRefactor `og:description` to limit the max length (#26876)
wxiaoguang [Sun, 3 Sep 2023 01:43:29 +0000 (09:43 +0800)]
Refactor `og:description` to limit the max length (#26876)

1. The `og:description` should be "a one to two sentence description of
your object"
* It shouldn't output all the user inputted content -- it would be
pretty huge.
    * Maybe it only needs at most 300 bytes.
2. Do not render commit message as HTML

13 months agoReorder blocks in vue SFCs (#26874)
silverwind [Sat, 2 Sep 2023 14:59:07 +0000 (16:59 +0200)]
Reorder blocks in vue SFCs (#26874)

The [recommended order](https://vuejs.org/guide/scaling-up/sfc.html) for
SFC blocks is script -> template -> style, which we were violating
because template and script were swapped. I do find script first also
easier to read because the imports are on top, letting me immideatly see
a component's dependencies.

This is a pure cut-paste refactor with some removal of some empty lines.

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
13 months agoMake it posible to customize nav text color via css var (#26807)
6543 [Sat, 2 Sep 2023 03:10:41 +0000 (05:10 +0200)]
Make it posible to customize nav text color via css var (#26807)

---
*Sponsored by Kithara Software GmbH*

13 months agoEnable djlint H008 and fix issues (#26869)
silverwind [Fri, 1 Sep 2023 17:32:39 +0000 (19:32 +0200)]
Enable djlint H008 and fix issues (#26869)

Enable `H008 | Attributes should be double quoted` and fix issues.

13 months agoImprove opengraph previews (#26851)
Linus Groh [Fri, 1 Sep 2023 16:59:24 +0000 (18:59 +0200)]
Improve opengraph previews (#26851)

Add more useful Open Graph metadata for commit and file URLs:

- Set `og:title` to the page title, which is a concise summary in both
cases (`<commit message> · <commit hash>` and `<filename> at <branch>`,
respectively)
- Set `og:description` to the commit message body, if available
- Set `og:url` to the relevant URLs instead of the repo URL

Also move the relevant meta tags into a separate template as they now
take up the majority of the base head template.

13 months agoAdd more descriptive error on forgot password page (#26848)
Jack Hay [Fri, 1 Sep 2023 16:15:39 +0000 (12:15 -0400)]
Add more descriptive error on forgot password page (#26848)

## Changes
- Forces flashed error to render immediately when forgot password code
is incorrect or has expired.
- Adds a link back to the `forgot_password` page so that the user can
restart the process (in the event that their link has expired)

13 months agoAllow users with write permissions for issues to add attachments with API (#26837)
Zettat123 [Fri, 1 Sep 2023 15:35:38 +0000 (23:35 +0800)]
Allow users with write permissions for issues to add attachments with API (#26837)

Fixes #24944

Since a user with write permissions for issues can add attachments to an
issue via the the web interface, the user should also be able to add
attachments via the API

13 months agoMove licenses.txt to /assets directory (#26866)
silverwind [Fri, 1 Sep 2023 14:42:33 +0000 (16:42 +0200)]
Move licenses.txt to /assets directory (#26866)

Now that we have the `/assets` directory, we can put`licenses.txt`
directly into it instead of incorrect `/js` path which was previously
only done to avoid reserving a username.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoUse case-insensitive regex for all webpack assets (#26867)
silverwind [Fri, 1 Sep 2023 14:07:37 +0000 (16:07 +0200)]
Use case-insensitive regex for all webpack assets (#26867)

Previously, only some of these regex had the `i` flag and while we can
likely ensure case for our files, these regexes are also used for
third-party files, so it's better to always match insensitively.

13 months agorestrict certificate type for builtin SSH server (#26789)
Earl Warren [Fri, 1 Sep 2023 13:45:22 +0000 (15:45 +0200)]
restrict certificate type for builtin SSH server (#26789)

- While doing some sanity checks over OpenSSH's code for how they handle
certificates authentication. I stumbled on an condition that checks the
certificate type is really an user certificate on the server-side
authentication. This checks seems to be a formality and just for the
sake of good domain seperation, because an user and host certificate
don't differ in their generation, verification or flags that can be
included.
- Add this check to the builtin SSH server to stay close to the
unwritten SSH specification.
- This is an breaking change for setups where the builtin SSH server is
being used and for some reason host certificates were being used for
authentication.
-
(cherry picked from commit de35b141b79a3d6efe2127ed2c73fd481515e481)

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

## :warning: BREAKING :warning:

Like OpenSSH, the built-in SSH server will now only accept SSH user
certificates, not server certificates.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
13 months agofeat(API): add secret deletion functionality for repository (#26808)
Bo-Yi Wu [Fri, 1 Sep 2023 13:02:49 +0000 (21:02 +0800)]
feat(API): add secret deletion functionality for repository (#26808)

- Modify the `CreateOrUpdateSecret` function in `api.go` to include a
`Delete` operation for the secret
- Modify the `DeleteOrgSecret` function in `action.go` to include a
`DeleteSecret` operation for the organization
- Modify the `DeleteSecret` function in `action.go` to include a
`DeleteSecret` operation for the repository
- Modify the `v1_json.tmpl` template file to update the `operationId`
and `summary` for the `deleteSecret` operation in both the organization
and repository sections

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
13 months agoAvoid double-unescaping of form value (#26853)
wxiaoguang [Fri, 1 Sep 2023 12:01:36 +0000 (20:01 +0800)]
Avoid double-unescaping of form value (#26853)

1. The old `prepareQueryArg` did double-unescaping of form value.
2. By the way, remove the unnecessary `ctx.Flash = ...` in
`MockContext`.

Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoMove web/api context related testing function into a separate package (#26859)
wxiaoguang [Fri, 1 Sep 2023 11:26:07 +0000 (19:26 +0800)]
Move web/api context related testing function into a separate package (#26859)

Just like `models/unittest`, the testing helper functions should be in a
separate package: `contexttest`

And complete the TODO:

> // TODO: move this function to other packages, because it depends on
"models" package

13 months agoRemove some unused CSS styles (#26852)
wxiaoguang [Fri, 1 Sep 2023 06:59:38 +0000 (14:59 +0800)]
Remove some unused CSS styles (#26852)

1. `icons`: globally searched, no use in templates.
2. toast's `display: inline-block;`: there is a `display: flex` below.