Commit Graph

19837 Commits (main)

Author SHA1 Message Date
silverwind ca6c0dee2e
Switch `bitnami` images to `bitnamilegacy` on CI (#35402)
As per https://github.com/bitnami/containers/issues/83267, my
understanding is that the `docker.io/bitnami` images will be deleted on
September 29.

To prevent this failure mode, use the images on the `bitnamilegacy` org
instead which are snapshots from when they stopped updating them.
Long-term, we should replace these images with official ones.
2025-09-03 14:17:16 +00:00
Lunny Xiao e96ef97989
Upgrade dependencies (#35384)
- ~Upgrade golang to 1.25~ blocked by the issue
https://github.com/go-swagger/go-swagger/issues/3220
- Upgrade minor versions of most dependencies
- Upgrade github.com/google/go-github version to v74
- Fix meilisearch because of sdk interface change
- Use github.com/Necoro/html2text which is a fork instead of html2text
because of https://github.com/jaytaylor/html2text/issues/67 which
resulted in complie failure.
- Fix some deprecated methods of gitlab go client.
2025-09-02 23:13:38 -04:00
GiteaBot 086ff87e58 [skip ci] Updated translations via Crowdin 2025-09-03 00:32:59 +00:00
GiteaBot 8a534132c8 [skip ci] Updated translations via Crowdin 2025-09-02 00:34:51 +00:00
junoberryferry ec75bdbe68
Use github.com/mholt/archives replace github.com/mholt/archiver (#35390)
Fix #32620

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: junoberryferry <user@example.tld>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-01 19:40:12 +00:00
Lunny Xiao 1717af72c4
Move some functions from package git to gitrepo (#33910)
Follow #33874
2025-09-01 19:13:18 +00:00
Lunny Xiao d2e994db2c
Move git config/remote to gitrepo package and add global lock to resolve possible conflict when updating repository git config file (#35151)
Partially fix #32018 

`git config` and `git remote` write operations create a temporary file
named `config.lock`. Since these operations are not atomic, they must
not be run in parallel. If two requests attempt to modify the same
repository concurrently—such as during a compare operation—one may fail
due to the presence of an existing `config.lock` file.

In cases where `config.lock` is left behind due to an unexpected program
exit, a global lock mechanism could allow us to safely remove the stale
lock file when a related error is detected. While this behavior is not
yet implemented in this PR, it is planned for a future enhancement.

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-01 18:47:04 +00:00
Lunny Xiao 4e1b8db1fc
Move HasWiki to repository service package (#33912)
Move HasWiki out of the models package to avoid referencing the absolute
wiki path directly.
2025-09-01 11:12:58 -07:00
Michal Suchánek ea96ff6b0c
Rename UpdateBranch API to RenameBranch API (#35374)
Discussed in #35368, originally implemented in #32433
2025-09-01 16:12:05 +00:00
GiteaBot fd7ebaf427 [skip ci] Updated translations via Crowdin 2025-09-01 00:43:05 +00:00
confusedsushi dca375aad2
when sorting issues by nearest due date, issues without due date should be sorted ascending (#35267)
When sorting issues and pull requests by the nearest due date, the
issues and PRs without a due date are currently sorted _descending_ by
their creation date. This seems counter intuitive to me. When sorting by
nearest due date I want to see the issues/PRs in the order they should
be worked on. For issues/PRs without a due date that order should be
first come first served rather than last come first served.

This PR now changes the ordering of issues/PRs which don't have a due
date to _ascending_ by their creation date. So that the oldest is shown
first and the newest last.

This now also makes the sort order nearest due date a true opposite to
farthest due date. At farthest due date the newest is shown first and
the oldest last.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-08-29 19:05:18 -07:00
GiteaBot fe7883c54f [skip ci] Updated translations via Crowdin 2025-08-30 00:32:53 +00:00
Lunny Xiao 0c6326e6ab
Upgrade xz to v0.5.15 (#35377) 2025-08-29 17:44:33 +00:00
wxiaoguang 1f50048ac9
Refactor db package (#35380)
Remove unnecessary code
2025-08-30 01:04:06 +08:00
Lunny Xiao aef4a3514c
Remove the duplicated function GetTags (#35375)
This PR removes the GetTags function from the git module and keeps only
GetTagInfos. All previous usages of GetTags have been replaced with
database-based tag functions.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-08-29 01:11:42 +00:00
GiteaBot 09c3189ab7 [skip ci] Updated translations via Crowdin 2025-08-29 00:34:50 +00:00
Fabian Meyer e19d0e4f56
Allow foreachref parser to grow its buffer (#35365)
Fixes #35221, let the scanner's buffer grow up to 4x (256 kiB), and add an error check

---------

Signed-off-by: Fabian Meyer <fabian.meyer@lawo.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-08-28 10:18:54 +00:00
wxiaoguang dca1af7cad
Remove global context from db package (#35371) 2025-08-28 09:44:02 +00:00
Lunny Xiao fb056bf4ed
Use gitrepo.SetDefaultBranch when set default branch of wiki repository (#33911) 2025-08-28 06:06:39 +00:00
Lunny Xiao 7636d581d9
Deleting branch could delete broken branch which has database record but git branch is missing (#35360)
For some reasons, branches between database and git are not synced. If a
branch exists in database but not in the git, it should be able to be
deleted.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-08-27 22:32:22 -07:00
wxiaoguang 0cbaa0b662
Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
cui 7aef7ea2d4
Refactor to use reflect.TypeFor (#35370) 2025-08-27 20:13:31 -07:00
GiteaBot 89cc9663f8 [skip ci] Updated translations via Crowdin 2025-08-28 00:34:46 +00:00
wxiaoguang 60246730b5
Remove wrong "git.DefaultContext" (#35364) 2025-08-27 16:31:21 +00:00
wxiaoguang e837c998b7
Fix context usages (#35348) 2025-08-27 11:00:01 +00:00
LyricWulf da5ce5c8e7
Instance signing rule `pubkey` should allow all public keys, not just GPG (#35357)
Instance signing rule `pubkey` is described as "Only sign if the user
has a public key", however if the user only has SSH public keys, this
check will fail, as it only checks for GPG keys.

Changed the `pubkey` checks to call a helper `userHasPubkeys` which
sequentially checks for GPG, then SSH keys.

Related #34341

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-08-26 15:06:37 -07:00
Lunny Xiao c4fbccc4ec
Allow deleting comment with content via API like web did (#35346)
Fix #35296
2025-08-25 10:43:11 +00:00
NorthRealm c7b99c8cc7
Prevent duplicate actions email (#35215)
Trying to prevent duplicate action emails by adding an extra check on job status.

---------

Signed-off-by: NorthRealm <155140859+NorthRealm@users.noreply.github.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
2025-08-24 09:30:56 -07:00
techknowlogick ed8d4dc37a
rename nightly docker tag for main branch (#35344)
fixes https://github.com/go-gitea/gitea/issues/35338
2025-08-24 13:40:50 +08:00
Lunny Xiao 3a969a58c2
Fix atom/rss mixed error (#35345) 2025-08-23 22:29:52 +00:00
techknowlogick a2d88cd597
Remove deprecated auth sources (#35272)
Entra ID users should use the OIDC oauth2 provider.

They will still be shown if the instance has a previous Azure AD source
configured.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-08-23 20:39:05 +00:00
Lunny Xiao e1fd9e3cd1
Always return the relevant status information, even if no status exists. (#35335) 2025-08-23 18:48:44 +00:00
GiteaBot 4b19e292b9 [skip ci] Updated translations via Crowdin 2025-08-23 00:34:05 +00:00
Lunny Xiao 0739595dcd
Upgrade mermaid from 11.9.0 to 11.10.0 (#35329) 2025-08-22 12:53:09 +02:00
Ilya Nurullin e844a41248
Use configurable remote name for git commands (#35172)
Closes #19403, and makes it possible to use any remote name in code
snippets for an empty repository and pull request.
This change is very helpful to me, because I always use different name
for my gitea remote.

Uses setting config module to store the value. Default is `origin` for
backward compatibility.

### Screenshots
<details>
<summary>Empty repo</summary>
<img width="791" height="398" alt="image"
src="https://github.com/user-attachments/assets/7214053d-a8dd-4e77-8c9d-78936d9859e0"
/>
</details>

<details>
<summary>Pull Request</summary>
<img width="591" height="452" alt="image"
src="https://github.com/user-attachments/assets/ebc3d25c-5d6d-481d-819d-9706af3c5594"
/>
</details>

<details>
<summary>Settings page</summary>
<img width="1438" height="839" alt="image"
src="https://github.com/user-attachments/assets/d92bfa2c-7adc-4efe-95fa-0c55ad13b3f5"
/>
</details>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-08-21 10:14:35 -07:00
Lunny Xiao c0f24bd803
Move organization's visibility change to danger zone. (#34814)
<img width="1185" alt="image"
src="https://github.com/user-attachments/assets/d48c4db2-df7c-43b3-986c-62e042190a51"
/>

<img width="829" alt="image"
src="https://github.com/user-attachments/assets/772b8a14-6837-41f2-9d78-9f0489ef1c7d"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-08-20 20:57:42 -07:00
Lunny Xiao 709535c506
Fix some overflows in test (#35315)
Fix #35311
2025-08-20 15:20:22 +00:00
eric-j-ason c4b70c57bc
exit with success when already up to date (#35312)
Exit `upgrade.sh` with status 0 (instead of status 1) when the installed
Gitea is already on the latest version and nothing needs to be done.

Fixes #35309
2025-08-19 11:49:01 -07:00
silverwind 9790f128cc
Update to golangci-lint@v2.4.0 (#35310)
Adds go 1.25 support. No new issues discovered.

https://github.com/golangci/golangci-lint/releases
2025-08-19 17:23:47 +00:00
Jackson Stewart 463016b317
Upgrade devcontainer go version to 1.24.6 (#35298)
Addresses go version mismatch when using the devcontainer as a result of
[this
commit](793815adf7)
(bumps Go version from 1.24.5 to 1.24.6)

The current official devcontainer Go image used in this repository
(`1.24-bookworm`) uses 1.24.5 and sets GOTOOLCHAIN to local. This PR
overrides it to auto so that build commands automatically update to the
correct version.

---------

Signed-off-by: Jackson Stewart <jaxtew@pm.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2025-08-19 11:38:12 +00:00
6543 57b8441745
Refactor smal code snippeds in models/issues/pull.go (#35301)
just code refactor nits
2025-08-18 21:23:40 +00:00
Kerwin Bryant 4ea8f33ae6
fix: remove duplicate IDs (#35210)
Signed-off-by: Kerwin Bryant <kerwin612@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2025-08-18 22:45:15 +02:00
Lunny Xiao d782cad7f8
Add start time on perf trace because it seems some steps haven't been recorded. (#35282)
The new trace log looks like
```
http start=2025-08-14 15:03:04 duration=0.6978s http.route=/
  http.func start=2025-08-14 15:03:04 duration=0.6978s func=common.ForwardedHeadersHandler.ForwardedHeaders
    http.func start=2025-08-14 15:03:04 duration=0.6978s func=routing.(*requestRecordsManager).handler-fm
      http.func start=2025-08-14 15:03:04 duration=0.6978s func=gzhttp.NewWrapper
        http.func start=2025-08-14 15:03:04 duration=0.6975s func=session.Sessioner
          http.func start=2025-08-14 15:03:04 duration=0.6973s func=context.Contexter
```
2025-08-18 15:17:19 +00:00
6543 2872984919
nix dev shell add zip (#35300)
as zip is needed in our makefile and not installed on nixos by default
2025-08-18 10:51:16 -04:00
GiteaBot 6619b1ed2b [skip ci] Updated translations via Crowdin 2025-08-18 00:40:58 +00:00
LePau 08a7e65c84
Fix LFS range size header response (#35277)
Fix #35276

Signed-off-by: LePau <101608950+LePau@users.noreply.github.com>
2025-08-16 16:51:45 +00:00
wxiaoguang 621f2fcadb
Skip "parentsigned" check when the repo is empty (#35292)
Fix #35280
2025-08-16 19:24:30 +03:00
GiteaBot 04017f259b [skip ci] Updated translations via Crowdin 2025-08-16 00:35:49 +00:00
Alex Blackie 9549c6641a
Fix GitHub release assets URL validation (#35287)
GitHub changed where the attachments on releases are stored, which means
repo migrations with releases now fail because the redirect URLs don't
match the base URL validation. We need to update the base URL check to
check for the `release-assets` subdomain as well.
2025-08-15 17:50:05 -04:00
techknowlogick 5cca69517d
nix flake use go1.25 (#35288) 2025-08-16 02:47:39 +08:00