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

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 1 Sep 2023 00:24:05 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoMinor dashboard tweaks, fix flex-list margins (#26829)
silverwind [Thu, 31 Aug 2023 21:28:45 +0000 (23:28 +0200)]
Minor dashboard tweaks, fix flex-list margins (#26829)

Some small dashboard tweaks:

- Remove margin-bottom from divider so first item does not appear to
have un-equal margins
- Restore previous icon color
- Add slight margin-right to icon

Before:
<img width="783" alt="Screenshot 2023-08-31 at 00 10 28"
src="https://github.com/go-gitea/gitea/assets/115237/b75f70d7-8704-4afb-866d-fea0484c52d4">

After:
<img width="783" alt="Screenshot 2023-08-31 at 00 10 08"
src="https://github.com/go-gitea/gitea/assets/115237/50ed0c47-6f7c-449e-a054-13091369d43f">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoUpdate team invitation email link (#26550)
Jack Hay [Thu, 31 Aug 2023 16:26:13 +0000 (12:26 -0400)]
Update team invitation email link (#26550)

Co-authored-by: Kyle D <kdumontnu@gmail.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
13 months agoRedirect from `{repo}/issues/new` to `{repo}/issues/new/choose` when blank issues...
JakobDev [Thu, 31 Aug 2023 15:36:25 +0000 (17:36 +0200)]
Redirect from `{repo}/issues/new` to `{repo}/issues/new/choose` when blank issues are disabled (#26813)

You can currently visit `{repo}/issues/new` and create a blank issue,
even if it's disabled. This PR fixes this,

Fixes https://codeberg.org/forgejo/forgejo/issues/1356

Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoRemove "TODO" tasks from CSS file (#26835)
wxiaoguang [Thu, 31 Aug 2023 10:49:53 +0000 (18:49 +0800)]
Remove "TODO" tasks from CSS file (#26835)

1. Use `gt-invisible` instead of `invisible`.
2. Use `gt-word-break` instead of `dont-break-out` (there is a slight
different "hyphens", but I think it won't affect too much since it is
only used for the "full name").
3. Remove `.small.button:has(svg)` , now our buttons could layout SVG
correctly, and actually I didn't see this CSS class is used in code.

13 months agoUser details page (#26713)
Denys Konovalov [Thu, 31 Aug 2023 09:21:18 +0000 (11:21 +0200)]
User details page (#26713)

This PR implements a proposal to clean up the admin users table by
moving some information out to a separate user details page (which also
displays some additional information).

Other changes:
- move edit user page from `/admin/users/{id}` to
`/admin/users/{id}/edit` -> `/admin/users/{id}` now shows the user
details page
- show if user is instance administrator as a label instead of a
separate column
- separate explore users template into a page- and a shared one, to make
it possible to use it on the user details page
- fix issue where there was no margin between alert message and
following content on admin pages

<details>

<summary>Screenshots</summary>

![grafik](https://github.com/go-gitea/gitea/assets/47871822/1ad57ac9-f20a-45a4-8477-ffe572a41e9e)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/25786ecd-cb9d-4c92-90f4-e7f4292c073b)

</details>

Partially resolves #25939

---------

Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoRender code blocks in repo description (#26830)
silverwind [Thu, 31 Aug 2023 05:01:01 +0000 (07:01 +0200)]
Render code blocks in repo description (#26830)

Backtick syntax now works in repo description too. Also, I replaced the
CSS for this was a new single class, making it more flexible and not
dependent on a parent. Also, very slightly reduced font size from 16.8px
to 16px.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoRemove joinPaths function (#26833)
silverwind [Thu, 31 Aug 2023 02:46:44 +0000 (04:46 +0200)]
Remove joinPaths function (#26833)

Extract from https://github.com/go-gitea/gitea/pull/25940.

`assetUrlPrefix` is guaranteed to not contain trailing slashes, making
this function unneeded.

13 months agoRemove polluted `.ui.right` (#26825)
wxiaoguang [Thu, 31 Aug 2023 02:29:59 +0000 (10:29 +0800)]
Remove polluted `.ui.right` (#26825)

Each change is tested manually line by line. There are too many changes
so I can't share dozens of screenshots.

In short:

1. `ui right` could be still used in `ui top attached header`, because
there is a special case.
2. A lot of `ui right` are just no-op, so they can be removed safely.
3. Some of the `ui right` should be replaced by `gt-float-right` (to
avoid breaking, leave them to the future).
4. A few of the `ui right` could be rewritten by flex.

13 months agoSync tags when adopting repos (#26816)
Zettat123 [Thu, 31 Aug 2023 01:42:42 +0000 (09:42 +0800)]
Sync tags when adopting repos (#26816)

Fixes #26138

Sync the tags into database when adopting repos

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
13 months agorm comment about hugo (#26832)
techknowlogick [Thu, 31 Aug 2023 01:09:11 +0000 (21:09 -0400)]
rm comment about hugo (#26832)

13 months agoFix filename for .spectral.yaml (#26828)
silverwind [Thu, 31 Aug 2023 00:41:37 +0000 (02:41 +0200)]
Fix filename for .spectral.yaml (#26828)

Mixed up yml vs. yaml previously.

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 31 Aug 2023 00:22:07 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoCheck blocklist for emails when adding them to account (#26812)
techknowlogick [Wed, 30 Aug 2023 15:46:49 +0000 (11:46 -0400)]
Check blocklist for emails when adding them to account (#26812)

13 months agoRemove polluted ".ui.left" style (#26809)
wxiaoguang [Wed, 30 Aug 2023 13:46:24 +0000 (21:46 +0800)]
Remove polluted ".ui.left" style (#26809)

13 months agoRemove fomantic `text` module (#26777)
delvh [Wed, 30 Aug 2023 10:37:17 +0000 (12:37 +0200)]
Remove fomantic `text` module (#26777)

Corollary to #26775:
All selectors I found that are actually used and not necessarily present
in the current code have been copied to `web_src/css/base.css`.
Everything else should be a clean removal.

13 months agoUse `Set[Type]` instead of `map[Type]bool/struct{}`. (#26804)
KN4CK3R [Wed, 30 Aug 2023 06:55:25 +0000 (08:55 +0200)]
Use `Set[Type]` instead of `map[Type]bool/struct{}`. (#26804)

13 months agoFix verifyCommits error when push a new branch (#26664)
CaiCandong [Wed, 30 Aug 2023 02:27:53 +0000 (10:27 +0800)]
Fix verifyCommits error when push a new branch (#26664)

> ### Description
> If a new branch is pushed, and the repository has a rule that would
require signed commits for the new branch, the commit is rejected with a
500 error regardless of whether it's signed.
>
> When pushing a new branch, the "old" commit is the empty ID
(0000000000000000000000000000000000000000). verifyCommits has no
provision for this and passes an invalid commit range to git rev-list.
Prior to 1.19 this wasn't an issue because only pre-existing individual
branches could be protected.
>
> I was able to reproduce with
[try.gitea.io/CraigTest/test](https://try.gitea.io/CraigTest/test),
which is set up with a blanket rule to require commits on all branches.

Fix #25565
Very thanks to @Craig-Holmquist-NTI for reporting the bug and suggesting
an valid solution!

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
13 months agoFix Uint8Array comparisons and update vitest (#26805)
silverwind [Wed, 30 Aug 2023 01:56:44 +0000 (03:56 +0200)]
Fix Uint8Array comparisons and update vitest (#26805)

Compare those `Uint8Array` via conversion to Array which are properly
comparable, so that we don't have to worry about whether `TextEncoder`
and `UInt8Array` from the environment are compatible or not.

---------

Co-authored-by: delvh <dev.lh@web.de>
13 months agoAdd various missing files-changed dependencies (#26799)
silverwind [Wed, 30 Aug 2023 01:40:13 +0000 (03:40 +0200)]
Add various missing files-changed dependencies (#26799)

We were missing a number of config files like `.golangci.yml` in the
dependencies for the pull request pipelines, which resulted in the
linting not running for https://github.com/go-gitea/gitea/pull/26786
because only `.golangci.yml` had changed.

13 months agoImprove flex list item padding (#26779)
wxiaoguang [Tue, 29 Aug 2023 23:13:30 +0000 (07:13 +0800)]
Improve flex list item padding (#26779)

Replace #26761

It's better to keep children elements simple, and let parent containers
layout the necessary padding/margin.

The old `not(:last-child)` and `.flex-item + .flex-item` are not easy to
maintain (for example, what if the developer would like to use a "tiny
height" item?)

The old approach also makes some UI look strange because the first item
doesn't have proper padding-top.

In this PR, we just simply use `.flex-item { padding: ... }`:

* Developers could manually set the item height they want easily
* It's easier to make it work with various containers -- with padding
(`ui segment`) and without padding (`div`)

And added more samples/examples.

![image](https://github.com/go-gitea/gitea/assets/2114189/719ea712-0241-4426-b67f-5723993c4ed7)

Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoInclude the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759)
js6pak [Tue, 29 Aug 2023 22:13:16 +0000 (00:13 +0200)]
Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759)

Include `GITHUB_TOKEN`/`GITEA_TOKEN` secrets for actions triggered by
pull requests

This makes it consistent with the environment variables which you can
already access

```shell
echo env: $GITHUB_TOKEN
echo expression: ${{ secrets.GITHUB_TOKEN }}
```
before

![image](https://github.com/go-gitea/gitea/assets/35262707/b6f750f6-3995-40f0-b8aa-df01e7997c37)
after

![image](https://github.com/go-gitea/gitea/assets/35262707/ab74464b-7638-458a-afd5-f39e6101d2cf)

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Giteabot <teabot@gitea.io>
13 months agofeat(API): add route and implementation for creating/updating repository secret ...
Bo-Yi Wu [Tue, 29 Aug 2023 20:54:49 +0000 (04:54 +0800)]
feat(API): add route and implementation for creating/updating repository secret (#26766)

spec:
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret

- Add a new route for creating or updating a secret value in a
repository
- Create a new file `routers/api/v1/repo/action.go` with the
implementation of the `CreateOrUpdateSecret` function
- Update the Swagger documentation for the `updateRepoSecret` operation
in the `v1_json.tmpl` template file

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoReplace deprecated `elliptic.Marshal` (#26800)
Chongyi Zheng [Tue, 29 Aug 2023 20:19:40 +0000 (16:19 -0400)]
Replace deprecated `elliptic.Marshal` (#26800)

In PR #26786, the Go version for golangci-lint is bumped to 1.21. This
causes the following error:

```
models/migrations/v1_16/v210.go:132:23: SA1019: elliptic.Marshal has been deprecated since Go 1.21: for ECDH, use the crypto/ecdh package. This function returns an encoding equivalent to that of PublicKey.Bytes in crypto/ecdh. (staticcheck)
                                        PublicKey:       elliptic.Marshal(elliptic.P256(), parsed.PubKey.X, parsed.PubKey.Y),
```

The change now uses [func (*PublicKey)
ECDH](https://pkg.go.dev/crypto/ecdsa#PublicKey.ECDH), which is added in
Go 1.20.