19422 Commits

Author SHA1 Message Date
Tobias Balle-Petersen
e67f74efc8
fix: do not return archive download URLs in API if downloads are disabled (#34324)
If archive downloads are are disabled using
_DISABLE_DOWNLOAD_SOURCE_ARCHIVES_, archive links are still returned by
the API.

This PR changes the data returned, so the fields _zipball_url_ and
_tarball_url_ are omitted if archive downloads have been disabled.

Resolve #32159
2025-04-30 10:06:37 -07:00
wxiaoguang
ba5c3f8087
Fix some dropdown problems on the issue sidebar (#34308)
Also fix #34300
2025-04-30 02:00:36 +00:00
GiteaBot
ce6699db01 [skip ci] Updated translations via Crowdin 2025-04-30 00:35:28 +00:00
Kerwin Bryant
1f52304f90
Fix button alignments (#34307)
Continue with #34206.
2025-04-29 16:57:47 +00:00
Mingzhu Yan
7bd2ce7109
fix go version (#34299)
go cmd will download and cache a copy of the Go toolchain, go1.24 is not
a valid version since https://github.com/golang/go/issues/57631.
2025-04-29 12:24:53 +00:00
Lunny Xiao
648df8a5e1
Fix the ci build (#34309)
Fix
https://github.com/go-gitea/gitea/actions/runs/14722306878/job/41318217870

A fork has been created under https://gitea.com/gitea/go-xsd-duration
2025-04-28 20:47:16 -07:00
Kerwin Bryant
2b76993415
support the open-icon of folder (#34168)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-28 19:51:32 -07:00
Lunny Xiao
44d7d2973a
Fix wrong review requests when updating the pull request (#34286)
Fix #34224

The previous implementation in #33744 will get the pushed commits
changed files. But it's not always right when push a merged commit. This
PR reverted the logic in #33744 and will always get the PR's changed
files and get code owners.
v1.25.0-dev
2025-04-28 22:57:56 +00:00
wxiaoguang
0148d03f21
Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187)
Fix #880

Design:

1. A global setting `security.TWO_FACTOR_AUTH`.
* To support org-level config, we need to introduce a better "owner
setting" system first (in the future)
2. A user without 2FA can login and may explore, but can NOT read or
write to any repositories via API/web.
3. Keep things as simple as possible.
* This option only aggressively suggest users to enable their 2FA at the
moment, it does NOT guarantee that users must have 2FA before all other
operations, it should be good enough for real world use cases.
* Some details and tests could be improved in the future since this
change only adds a check and seems won't affect too much.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-04-28 15:31:59 -07:00
ChristopherHX
4ed07244b9
actions artifacts api list/download check status upload confirmed (#34273)
* fixes a fixture status to upload confirmed
* add another fixture as noise to break tests as soon they are exposed
to api
* v4 delete test added check that artifact is no longer visible in
internal api with status pending delete
* removal of http 404 on empty list: actions/upload-artifact@v4 now
backoff on http 404 of ListArtifacts endpoint
* fixes artifacts with pending delete etc. are able to be found and
downloaded if the storage is not freed
2025-04-28 16:31:53 +00:00
Kerwin Bryant
533b8b2d3d
Fix button alignments (#34276)
Continue with #34206.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-04-27 19:39:03 +00:00
Lunny Xiao
0376c09fc2
Update token creation API swagger documentation (#34288)
Fix #34231
2025-04-27 05:32:15 +00:00
GiteaBot
bf8f111f53 [skip ci] Updated translations via Crowdin 2025-04-27 00:38:03 +00:00
Lunny Xiao
44ece1e6f3
Explicitly not update indexes when sync database schemas (#34281)
Fix #34275

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-26 09:50:45 -07:00
silverwind
27ff5e2e84
Introduce --page-space-bottom at 64px (#30692)
Previously we would always leave 80px space before the page footer, but
this is problematic with small viewport heights on projects page for
example. I think it' ideal that we use `--page-spacing` which is already
in use for spacing on top of the page.

The `secondary-nav` margin is also adjusted as I see no value why this
shouldn't be the same value.
2025-04-25 10:53:26 -07:00
GiteaBot
8cea1aeea5 [skip ci] Updated translations via Crowdin 2025-04-25 00:35:36 +00:00
Brecht Van Lommel
a9343896f4
Option to delay conflict checking of old pull requests until page view (#27779)
`[repository.pull-request] DELAY_CHECK_FOR_INACTIVE_DAYS` is a new
setting to delay the mergeable check for pull requests that have been
inactive for the specified number of days.

This avoids potentially long delays for big repositories with many pull
requests. and reduces system load overall when there are many
repositories or pull requests.

When viewing the PR, checking will start immediately and the PR merge
box will automatically reload when complete. Accessing the PR through
the API will also start checking immediately.

The default value of `7` provides a balance between system load, and
keeping behavior similar to what it was before both for users and API
access. With `0` all conflict checking will be delayed, while `-1`
always checks immediately to restore the previous behavior.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-24 19:26:57 +00:00
wxiaoguang
d1ad8e1e80
Update unrs-resolver (#34279) 2025-04-24 14:02:38 +02:00
Lunny Xiao
e73c1139ac
Fix panic when comment is nil (#34257)
Fix #34254
2025-04-24 01:58:00 +00:00
wxiaoguang
e625250ffc
Fix various trivial frontend problems (#34263)
1. Fix #20606
2. Fix #34246
3. Fix missing spaces, fix misspells, no visual change.
4. Fix missing "not-mobile", fix #34265

---------

Co-authored-by: silverwind <me@silverwind.io>
2025-04-24 09:11:54 +08:00
wxiaoguang
58d2a87c6c
update go&js dependencies (#34262) 2025-04-23 21:22:40 +00:00
wxiaoguang
b758241f28
Fix runner list tmpl (#34270)
Fix  #34269

And fix some layout problems.
2025-04-23 15:34:18 +00:00
wxiaoguang
8aee07a064
Improve "not found" error messages for API (#34267)
Make the message clear, for example: #34266
2025-04-23 17:42:50 +08:00
Kerwin Bryant
c2c04ffff7
Add fullscreen mode as a more efficient operation way to view projects (#34081)
Maybe fix #33482, maybe fix #34015

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-23 13:42:22 +08:00
GiteaBot
04fab1818b [skip ci] Updated translations via Crowdin 2025-04-23 00:34:59 +00:00
wxiaoguang
4832cb9e27
Display when a release attachment was uploaded (#34261)
Fix #34260
2025-04-22 23:03:49 +08:00
badhezi
1b1d53ab89
Fix Set Email Preference dropdown and button placement (#34255)
Resolves https://github.com/go-gitea/gitea/issues/34209

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-22 10:24:29 +00:00
GiteaBot
310fdeb453 [skip ci] Updated translations via Crowdin 2025-04-22 00:35:41 +00:00
Kerwin Bryant
714245844f
Update compare.tmpl (#34251)
before:

![1745215925689](https://github.com/user-attachments/assets/36a02f59-b23e-444c-b00a-dd69b81dd910)

after:

![1745215793514](https://github.com/user-attachments/assets/d3f7c228-923a-40bd-9f4c-353947478d0f)
2025-04-21 23:14:38 +00:00
wxiaoguang
9705adb27f
Make public URL generation configurable (#34250)
Follow up #32564

Co-authored-by: Jannis Pohl <838818+jannispl@users.noreply.github.com>
Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
2025-04-22 06:49:37 +08:00
Denys Konovalov
9a071a596f
Add API endpoint to request contents of multiple files simultaniously (#34139)
Adds an API POST endpoint under `/repos/{owner}/{repo}/file-contents`
which receives a list of paths and returns a list of the contents of
these files.

This API endpoint will be helpful for applications like headless CMS
(reference: https://github.com/sveltia/sveltia-cms/issues/198) which
need to retrieve a large number of files by reducing the amount of
needed API calls.

Close #33495

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-22 01:20:11 +08:00
YaFou
e947f309b1
Add API routes to lock and unlock issues (#34165)
This pull request adds a GitHub-compatible API endpoint to lock and
unlock an issue.

The following routes exist now:
- `PUT /api/v1/repos/{owner}/{repo}/issues/{id}/lock` to lock an issue
- `DELETE /api/v1/repos/{owner}/{repo}/issues/{id}/lock` to unlock an issue

Fixes #33677
Fixes #20012

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-21 00:43:43 +00:00
Jannis Pohl
d1a3bd6814
Make ROOT_URL support using request Host header (#32564)
Resolve #32554

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-20 11:43:48 +00:00
Dejan Kitic
af6be75adb
Valid email address should only start with alphanumeric (#28174)
This fixes issue #27847 where regular expression allowed email address
to start with special symbols. Valid email addresses should start with
alphanumeric character, and as such will be rendered as email.

Added test cases from the bug report to validate, such input will not be
rendered anymore as email address.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-20 19:18:14 +08:00
Lunny Xiao
6d3c6741ec
Fix notify watch failure when the content is too long (#34233)
Fix #28193

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-20 02:49:57 +00:00
Eric Hawicz
166ec1b4c3
Add "--fullname" arg to gitea admin user create (#34241)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-19 23:36:30 +08:00
wxiaoguang
c9aa9068b3
Fix various UI problems (#34243)
Also fix #34242
2025-04-19 08:43:22 +00:00
D
eda6d65818
markup: improve code block readability and isolate copy button (#34009)
Fix #33197

Improve the rendering of code blocks in markdown content 
for better readability and UI stability across screen sizes.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-19 05:53:39 +00:00
Kemal Zebari
f0544dbfca
Don't assume the default wiki branch is master in the wiki API (#34244)
Resolves #34218.

In the recent past, the default wiki branch was made to be changeable.
This change reflects this.
2025-04-19 03:13:00 +00:00
GiteaBot
8b7c0d8f8d [skip ci] Updated translations via Crowdin 2025-04-19 00:32:56 +00:00
Kerwin Bryant
aeb7005245
Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00
ChristopherHX
21b43fce08
Actions Runner rest api (#33873)
Implements runner apis based on
https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization

- Add Post endpoints for registration-token, google/go-github revealed
this as problem
  - We should deprecate Get Endpoints, leaving them for compatibility
- Get endpoint of admin has api path /admin/runners/registration-token
that feels wrong, /admin/actions/runners/registration-token seems more
consistent with user/org/repo api
- Get Runner Api
- List Runner Api
- Delete Runner Api

- Tests admin / user / org / repo level endpoints

Related to #33750 (implements point 1 and 2)
Via needs discovered in #32461, this runner api is needed to allow
cleanup of runners that are deallocated without user interaction.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-18 15:22:41 +00:00
wxiaoguang
ba0deab616
Fix some trivial problems (#34237)
1. Using existing "content" variable in `swift.go`
2. Do not report 500 server error in `GetPullDiffStats` middleware,
otherwise a PR missing ref won't be able to view.
3. Fix the abused "label button" when listing commits, there was too
much padding space, see the screenshot below.
2025-04-18 22:56:50 +08:00
Wolfgang Reithmeier
2683adfcb4
Swift files can be passed either as file or as form value (#34068)
Fix #33990

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-18 20:09:56 +08:00
Kerwin Bryant
dd0caf7e16
Fix various misalignments and overflows (#34227)
---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-17 10:32:41 +00:00
Lunny Xiao
42f45f1489
Update net package (#34228) 2025-04-17 06:06:58 -04:00
Kerwin Bryant
bde014e46d
Fix button alignments and remove unnecessary styles (#34206)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-16 08:14:10 +00:00
badhezi
a4f22a3e80
Fix project board links to related Pull Requests (#34213)
Resolves https://github.com/go-gitea/gitea/issues/34181
2025-04-16 07:31:33 +00:00
Kerwin Bryant
e8c42ae601
Fix empty repo clone panel border (#34219)
Remove duplicate border

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-16 07:05:40 +00:00
Hyungsub (Danny) Kim
dcfa42dd8f
Fix: quoted replies incorrectly render user input as part of the quote (#34216)
Updated the quote insertion logic so that it adds one more line break
(`\n`) work like Github. This way, the cursor lands on a new line and
the user's reply is no longer interpreted as part of the quote.

Fixes #34177
2025-04-16 14:32:58 +08:00