Commit Graph

5052 Commits

Author SHA1 Message Date
Guillaume
748b731612
Improve button layout on small screens (#33633)
Fix #33160 

Better "New Repository" & "New Migration" buttons on home page.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-18 11:02:40 +00:00
Lunny Xiao
69de5a65c2
Fix project issues list and counting (#33594)
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-17 05:14:56 +00:00
Lunny Xiao
5df9fd3e9c
Add API to support link package to repository and unlink it (#33481)
Fix #21062

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
2025-02-16 19:18:00 -08:00
Sveinn Thorarinsson
62389dd08b
add spacing between sign in button's icon and text (#33609)
This pull request edits the head_navbar template and adds spacing
between the icon and the text inside the sign in button of the navbar
(button which displays at the top right of Gitea's pages when the user
is not signed in).

It bugged me that there was no spacing between the button's contents so
I test ran this change quickly on my server and thought it looked a lot
better, so decided to make this pull request. Up to you to decide if you
agree that it looks better :)
2025-02-16 11:27:31 +00:00
ChristopherHX
2b8cfb557d
Artifacts download api for artifact actions v4 (#33510)
* download endpoint has to use 302 redirect
* fake blob download used if direct download not possible
* downloading v3 artifacts not possible

New repo apis based on GitHub Rest V3
- GET /runs/{run}/artifacts (Cannot use run index of url due to not
being unique)
- GET /artifacts
- GET + DELETE /artifacts/{artifact_id}
- GET /artifacts/{artifact_id}/zip
- (GET /artifacts/{artifact_id}/zip/raw this is a workaround for a http
302 assertion in actions/toolkit)
- api docs removed this is protected by a signed url like the internal
artifacts api and no longer usable with any token or swagger
  - returns http 401 if the signature is invalid
    - or change the artifact id
    - or expired after 1 hour

Closes #33353
Closes #32124

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-16 08:32:54 +08:00
wxiaoguang
f58f5bb3d8
Avoid duplicate SetContextValue call (#33564)
And fix FIXME and TODO
2025-02-12 14:25:46 +08:00
jason19970210
e3adb686bb
enhancement: add additional command hints for PowerShell & CMD (#33548)
- resolving wrong signature calculations for SSH key verification

Fixed #22693

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2025-02-11 04:14:37 +08:00
wxiaoguang
30993e9508
Feature: Support workflow event dispatch via API (#33545)
Fix: https://github.com/go-gitea/gitea/issues/31765 (Re-open #32059)

---------

Co-authored-by: Bence Santha <git@santha.eu>
Co-authored-by: Bence Sántha <7604637+bencurio@users.noreply.github.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
2025-02-11 03:05:42 +08:00
Kerwin Bryant
085f273d19
Optimize the dashboard (#32990)
before:

![image](https://github.com/user-attachments/assets/d0b432e4-a521-4540-a489-d18b9c265674)

after:

![image](https://github.com/user-attachments/assets/dbb8b387-d150-41e2-b12b-f9d8450e36d7)
-----

![image](https://github.com/user-attachments/assets/40dcd71e-344b-4043-9811-77227c71aed9)
-----

Optimize the dashboard by adding welcoming messages or quick action
entry points (such as adding a new repository or organization) to ensure
that new users are not greeted by a blank page upon logging in.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-11 01:24:34 +08:00
wxiaoguang
704b65e012
Revert "Feature: Support workflow event dispatch via API (#32059)" (#33541)
This reverts commit 523751dc82.
2025-02-10 17:44:42 +08:00
Bence Sántha
523751dc82
Feature: Support workflow event dispatch via API (#32059)
ref: https://github.com/go-gitea/gitea/issues/31765

---------

Signed-off-by: Bence Santha <git@santha.eu>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
2025-02-10 05:23:57 +08:00
Kerwin Bryant
a52720b5b4
Add "No data available" display when list is empty (#33517)
Add a "No data available" message to be displayed when the list has no
data. This improves the user experience by providing clear feedback in
an empty state.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-09 00:13:41 +08:00
mscherer
063c23e1bc
Add a option "--user-type bot" to admin user create, improve role display (#27885)
Partially solve #13044

Fix #33295

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-07 08:41:55 +00:00
Kerwin Bryant
40426addfa
Add cropping support when modifying the user/org/repo avatar (#33498)
Fixed #33321

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-06 21:07:44 +08:00
John Smith
a025fa70ab
Add alphabetical project sorting (#33504)
Fixes #33500
2025-02-05 19:09:43 +00:00
Henrique Corrêa
d0f4e92563
Reject star-related requests if stars are disabled (#33208)
This PR fixes #33205.

If stars are disabled:
* The `.../repo/stars` page returns a 403 Forbidden error
* Star-related API endpoints return a 403 Forbidden error saying `Stars are disabled.`
* Same for action endpoints

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-04 13:21:23 +08:00
Lunny Xiao
a4676db7dd
Fix commit status events (#33320)
Fix #32873 
Fix #33201 
~Fix #33244~
~Fix #33302~

depends on ~#33396~

A part of this PR should be backported to v1.23 manually.
2025-02-04 03:25:59 +00:00
Typed SIGTERM
50873c1925
Correct bot label vertical-align (#33477) 2025-02-02 18:42:30 +00:00
K Kovacs
34692a20b1
Worktime tracking for the organization level (#19808)
Dear Gitea team,

first of all, thanks for the great work you're doing with this project.

I'm planning to introduce Gitea at a client site, and noticed that while
there is time recording, there are no project-manager-friendly reports
to actually make use of that data, as were also mentioned by others in
#4870 #8684 and #13531.

Since I had a little time last weekend, I had put together something
that I hope to be a useful contribution to this great project (while of
course useful for me too).

This PR adds a new "Worktime" tab to the Organisation level. There is a
date range selector (by default set to the current month), and there are
three possible views:

- by repository,
- by milestone, and
- by team member.

Happy to receive any feedback!

There are several possible future improvements of course (predefined
date ranges, charts, a member time sheet, matrix of repos/members, etc)
but I hope that even in this relatively simple state this would be
useful to lots of people.

<img width="1161" alt="Screen Shot 2022-05-25 at 22 12 58"
src="https://user-images.githubusercontent.com/118010/170366976-af00c7af-c4f3-4117-86d7-00356d6797a5.png">

Keep up the good work!

Kristof

---------

Co-authored-by: user <user@kk-git1>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-03 01:51:12 +08:00
Typed SIGTERM
47bf836310
Update feishu icon (#33470) 2025-02-01 14:08:32 +00:00
Bruno Sofiato
040c830dec
Inclusion of rename organization api (#33303)
This adds an endpoint (`/orgs/{org}/rename`) to rename organizations.

I've modeled the endpoint using the rename user endpoint --
`/admin/users/{username}/rename` -- as base.

It is the 1st time I wrote a new API endpoint (I've tried to follow the
rename users endpoint code while writing it). So feel free to ping me if
there is something wrong or missing.

Resolves #32995

---------

Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-01 00:59:49 +00:00
wxiaoguang
1ab5938e82
Hide/disable unusable UI elements when a repository is archived (#33459)
And by the way, remove some jQuery code
2025-01-31 20:47:31 +08:00
wxiaoguang
b57d9f41d4
Fix issue sidebar dropdown keyboard support (#33447)
Just a quick fix, fix #33444
2025-01-30 22:54:50 +00:00
Lunny Xiao
f88dbf86b3
Refactor repository transfer (#33211)
- Both have `RejectTransfer` and `CancelTransfer` because the permission
checks are not the same. `CancelTransfer` can be done by the doer or
those who have admin permission to access this repository.
`RejectTransfer` can be done by the receiver user if it's an individual
or those who can create repositories if it's an organization.

- Some tests are wrong, this PR corrects them.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-30 05:40:44 +00:00
wxiaoguang
256b94e9e9
Support choose email when creating a commit via web UI (#33432)
Initial PR for #24469
2025-01-30 01:24:57 +00:00
Lunny Xiao
3e7ec826d3
Add missed auto merge feed message on dashboard (#33309) 2025-01-26 18:33:05 +00:00
wxiaoguang
6a516a0d14
Do not show unnecessary commit sign lock icon (#33387)
Fix #33385
2025-01-25 19:32:35 +08:00
silverwind
642e8c1122
Repo homepage styling tweaks (#33289)
Reduce it to a value that results in `.repo-home-sidebar-top` and
`.repo-home-sidebar-bottom` having 240px content width, the same as
GitHub.

Before:
<img width="1333" alt="Screenshot 2025-01-15 at 18 28 34"
src="https://github.com/user-attachments/assets/cf0fa21b-87be-40e3-a6cd-26d146bce9cc"
/>

After:
<img width="1330" alt="Screenshot 2025-01-15 at 18 28 27"
src="https://github.com/user-attachments/assets/28acd837-10f4-4176-b8a0-510cd28c8b8d"
/>
2025-01-24 17:35:28 +00:00
Typed SIGTERM
9e028d8d57
Fix comment header padding (#33377) 2025-01-25 01:09:57 +08:00
Lunny Xiao
e94f37f95e
Refactor webhook events (#33337)
Extract from #33320

This PR uses a map instead of a struct to store webhook event
information. It removes many duplicated functions and makes the logic
clearer.
2025-01-23 18:53:06 +00:00
yp05327
a0b3d9add0
Support disable passkey auth (#33348)
Fix #33314

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-22 22:58:36 +00:00
silverwind
abe743df79
Fix code button alignment (#33345)
Fixes: https://github.com/go-gitea/gitea/issues/33344

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-22 02:24:27 +00:00
wxiaoguang
7069369e03
Support performance trace (#32973)
1. Add a OpenTelemetry-like shim-layer to collect traces
2. Add a simple builtin trace collector and exporter, end users could
download the diagnosis report to get the traces.

This PR's design is quite lightweight, no hard-dependency, and it is
easy to improve or remove. We can try it on gitea.com first to see
whether it works well, and fine tune the details.

---------

Co-authored-by: silverwind <me@silverwind.io>
2025-01-21 18:57:07 +00:00
wxiaoguang
39de2955fd
Improve sync fork behavior (#33319)
Fix #33271

Suppose there is a `branch-a` in fork repo:

1. if `branch-a` exists in base repo: try to sync `base:branch-a` to `fork:branch-a`
2. if `branch-a` doesn't exist in base repo: try to sync `base:main` to `fork:branch-a`
2025-01-20 15:17:47 +08:00
CrimsonEdgeHope
1928918c35
Fix Account linking page (#33325)
Fix password form missing whilst linking account even with
`ENABLE_PASSWORD_SIGNIN_FORM = true`.

Remove redundant empty box in account linking sign up page when
`LinkAccountMode` is true.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-19 20:37:22 +08:00
Chai-Shi
55e0756c68
Fix push message behavior (#33215)
Fixes #32769 by the logic from pr #33192

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-17 19:37:17 +00:00
wxiaoguang
3b839f8dc0
Trivial fixes (#33304)
1. the error check was added for go-git, it was caused by the empty `.keep` file in the test fixtures.
2. use `PostFormValue` instead of `PostForm.Get` (`Get` needs to parse the form ahead)
3. fix incorrect container text (it should show "Images" in the header but not "OS/Arch")
4. align maven xml
5. fix closed PR color&icon
2025-01-17 08:55:02 +00:00
wxiaoguang
cfc6e21f06
Fix incorrect ref usages (#33301)
Fix #33297

By the way, improve some locales
2025-01-16 13:52:21 +00:00
wxiaoguang
6659a381ea
Fix closed dependency title (#33285)
Fix #33283
2025-01-15 23:38:03 +08:00
wxiaoguang
f6dbf0e7b3
Fix incorrect TagName/BranchName usages (#33279)
Add add a new test
2025-01-15 17:34:55 +08:00
wxiaoguang
fcd096231a
Simplify context ref name (#33267) 2025-01-15 11:15:47 +08:00
wxiaoguang
1299fdb084
Add a confirm dialog for "sync fork" (#33270)
Try to quickly fix #33264
2025-01-14 18:30:43 +00:00
wxiaoguang
5eff19a77a
Fix sidebar milestone link (#33269)
Fix  #33266
2025-01-14 13:01:53 -05:00
yp05327
3a749fc816
Fix 500 error when error occurred in migration page (#33256)
The template should be `repo/migrate/{service type}`
But input element `service` is not in the form.

Related: #33081

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-14 06:29:44 +00:00
wxiaoguang
a98a836e76
Support public code/issue access for private repositories (#33127)
Close #8649, close #639 (will add "anonymous access" in following PRs)
2025-01-14 01:53:34 +00:00
Kemal Zebari
ecd463c2f1
Validate that the tag doesn't exist when creating a tag via the web (#33241)
Found while investigating #33210.

This line no longer makes sense because the form field "TagName" is
required, so this would mean that this code path would never be covered.
Because it isn't covered, we end up going down the "update release"
logic where we eventually set `Release.IsTag` to false (meaning it will
now be treated as a release instead of a tag).

This snapshot rewrites the condition to ensure that we aren't trying to
create a tag that already exists.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-01-14 09:27:35 +08:00
Michael B.
a90af22003
Let API create and edit system webhooks, attempt 2 (#33180)
This PR fixes inconsistencies between system and default webhooks in the
Gitea API. (See also #26418)
- A system webhook is a webhook that captures events for all
repositories.
- A default webhook is copied to a new repository when it is created. 

Before this PR `POST /api/v1/admin/hooks/` creates default webhooks (if
not configured otherwise) and `GET /api/v1/admin/hooks/` returns system
webhooks.

The PR introduces an optional query parameter to `GET
/api/v1/admin/hooks/` to enable selecting if either default, system or
both kind of webhooks should be retrieved. By default the flag is set to
return system webhooks keep current behaviour.

## Examples

### System Webhooks

#### Create

```
POST /api/v1/admin/hooks/

{
  "type": "gitea",
  "active": false,
  "branch_filter": "*",
  "events": [ "create", "..." ],
  "config": {
    "url": "http://...",
    "content_type": "json",
    "secret": "secret",
    "is_system_webhook": true // <-- controls hook type
  }
}
```

#### List
```
GET/api/v1/admin/hooks?type=system //type argument is optional here since it's the default
```

#### Others
The other relevant endpoints work as expected by referencing the hook by
id
```
GET /api/v1/admin/hooks/:id
PATCH /api/v1/admin/hooks/:id
DELETE /api/v1/admin/hooks/:id
```


### Default Webhooks

#### Create
```
POST /api/v1/admin/hooks/

{
  "type": "gitea",
  "active": false,
  "branch_filter": "*",
  "events": [ "create", "..." ],
  "config": {
    "url": "http://...",
    "content_type": "json",
    "secret": "secret",
    "is_system_webhook": false // optional, as false is the default value
  }
}
```

#### List
```
GET/api/v1/admin/hooks?type=default
```

#### Others
The other relevant endpoints work as expected by referencing the hook by
id
```
GET /api/v1/admin/hooks/:id
PATCH /api/v1/admin/hooks/:id
DELETE /api/v1/admin/hooks/:id
```
2025-01-13 17:17:39 +00:00
wxiaoguang
81352542fd
Refactor context RefName and RepoAssignment (#33226)
The `ctx.Repo.RefName` was used to be a "short name", it causes a lot of
ambiguity.

This PR does some refactoring and use `RefFullName` to replace the
legacy `RefName`, and simplify RepoAssignment
2025-01-13 01:07:05 +00:00
wxiaoguang
9024b79933
Remove unused CSS styles and move some styles to proper files (#33217) 2025-01-12 05:16:22 +00:00
wxiaoguang
a068462ac0
Refactor context repository (#33202) 2025-01-12 03:39:46 +00:00