Commit Graph
21616 Commits
Author SHA1 Message Date
CopilotGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>techknowlogicktechknowlogicksilverwind
484981fd74 enhance(acme): add configurable ACME profile (#39375)
Adds server-side ACME profile configuration so operators can select a
non-default ACME profile. This covers issuers such as Let's Encrypt
where raw-IP certificate issuance requires the `shortlived` profile.

Fixes: #39374
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techknowlogick <164197+techknowlogick@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-09-24 10:30:25 +00:00
defc9d5ca3 fix(git): keep leading dashes in git grep search patterns (#39404)
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-24 09:46:24 +00:00
19ae1f842b refactor: fix go vet errors related to composite literals (#39341)
Fix these `go vet` errors which I stumbled upon because AI likes to run
`go vet` standalone and `go vet` does not understand `//nolint` like
golangci does, so it produced confusing output.

Co-authored-by: bircni <bircni@icloud.com>
2026-09-24 09:17:25 +00:00
72243bead7 fix(indexer): index full file paths and real offsets in bleve (#39405)
The bleve path token filter added in
https://github.com/go-gitea/gitea/pull/32210 never generated the full
path of a file, so searching a file by its path (e.g. `potato/ham`)
found nothing. It also gave the path tokens made-up offsets instead of
their position in the path.

The filter is replaced by a tokenizer that emits the raw path suffixes
starting at each segment and word (`potato/ham.md`, `ham.md`). Paths
below the root now match too, as do names containing `-` or spaces and
dotfiles. An exact file name also ranks above files inside a directory
with the same name.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-24 07:57:42 +00:00
8b46a956d8 perf(references): scan only the keyword window before a reference (#39396)
Fixes https://github.com/go-gitea/gitea/issues/39395

`findActionKeywords` ran the close and reopen keyword patterns over all
content before each reference, making `FindAllIssueReferences` quadratic
on comments and commit messages. The patterns are anchored at the
reference, so only the last few bytes can match. Scan only that window,
sized from the longest keyword with room for `(?i)` matching wider runes
like `ſ` for `s`.

`"#1 "` repeated 4000 times: 2.04 s before, 16 ms after.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-24 07:12:02 +00:00
GiteaBot 2177969aba [skip ci] Updated translations via Crowdin 2026-09-24 00:54:31 +00:00
wxiaoguangandGitHub f14cedc4fa refactor: "install" page (#39400)
1. remove useless options
2. set AppDataPath instead of repo root path
3. make "disable self-registration" default enabled
4. avoid writing corrupted ini file
5. avoid auto-sign-in the existing admin user
2026-09-23 23:14:31 +00:00
wxiaoguangandGitHub 71065941a9 fix: use correct content-type for container registry response (#39398)
spec:
https://github.com/opencontainers/distribution-spec/blob/main/spec.md

* `/v2/<name>/manifests/<reference>`: media type
* `/v2/<name>/blobs/<digest>` : binary content (spec doesn't require
content type)
2026-09-23 18:45:56 +00:00
EvenandGitHub 06e334121f fix(user): allow unblocking users promoted to admin (#39192)
Fixes #39189.

`IsUserBlockedBy` intentionally treats admin users as not blocked, but
`CanUnblockUser` was also using it to determine whether a blocking
relationship exists. If a previously blocked user is later promoted to
admin, the existing `user_blocking` record remains but can no longer be
removed.

This change separates those two concerns by adding `HasBlocking` for
checking the persisted blocking relationship. `CanUnblockUser` uses that
relationship check while `IsUserBlockedBy` keeps its existing admin-user
behavior.

A regression test verifies that an admin is still not considered blocked
while an existing blocking relationship can still be unblocked.
2026-09-23 16:54:12 +00:00
191287d8be fix(repo): commit page fails to render unsigned commits with a different committer (#39381)
Since #39229 the commit page header dereferences
`.Verification.CommittingUser` when the committer is not the author.
`Verification` is `nil` for unsigned commits (see `repo.Diff`), so
opening such a commit — a rebased or cherry-picked one, for example —
logs a template error and the page comes out truncated:

```
Render failed: failed to render template: repo/commit_page, error: template error: builtin(bindata):repo/commit_page:138:22 : executing "repo/commit_page" at <.Verification.CommittingUser>: nil pointer evaluating interface {}.CommittingUser
```

This guards the access and adds an integration test that creates a
commit with distinct author and committer identities and checks the page
renders completely (the status stays 200 on a mid-render failure, so the
test looks at the body).

_The fix was worked out with help from an AI assistant; I reviewed and
tested it myself._

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-23 14:34:19 +00:00
wxiaoguangandGitHub 08149f9bec refactor: make git http respond error message (#39390)
* Refactor some bad smells in legacy code
* Fix #37999: instead of creating an empty (undesired) wiki page, just tell users to create a wiki page first
2026-09-23 08:51:58 +00:00
wxiaoguangandGitHub 6146a4869e fix: use clearer message for ldap auth failure (#39392)
* fix #34942

log: `user does not exist ...: not in LDAP database or invalid password`
2026-09-23 16:30:58 +08:00
CopilotandGitHub 8164130349 fix(markup): raise KaTeX MAX_CHARS limit to 10000 (#39387) 2026-09-22 15:12:56 +00:00
wxiaoguangandGitHub 7637b1b816 chore: refactor StaticRootPath (#39384)
When need to use some settings in testing code, always call `SetupGiteaTestEnv`
2026-09-22 22:49:36 +08:00
GiteaBot de5913d647 [skip ci] Updated translations via Crowdin 2026-09-22 00:54:27 +00:00
GiteabotandGitHub fc28937a8d chore(deps): update dependencies (#39367) 2026-09-21 12:23:03 -04:00
GiteaBot 9b6a82d7e1 [skip ci] Updated translations via Crowdin 2026-09-21 00:59:22 +00:00
GiteaBot 9ae7ea7ec6 [skip ci] Updated translations via Crowdin 2026-09-20 01:00:17 +00:00
cdf786ce92 fix: pass merge commit messages to git via stdin (#39269)
`git commit --message=` passes the merge message as a single argument,
which Linux caps at 128 KiB and Windows at 32 KiB for the whole command
line. Long messages failed with `argument list too long` and the merge
box toast showed the raw HTML 500 page.

Pass the message via `--file=-` on stdin instead, and answer
fetch-action requests with JSON on server errors so the toast shows the
error text. Limits merge commit messages to 512KB which could be
extended or made configurable later.

Fixes: https://github.com/go-gitea/gitea/issues/39261
Fixes: https://github.com/go-gitea/gitea/issues/30276
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-19 13:04:53 +00:00
cc34c26172 fix(migrations): preserve SHA-256 pull request commit IDs (#39343)
* Fixes #39339

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-19 12:41:41 +00:00
GiteaBot 2a3d047339 [skip ci] Updated translations via Crowdin 2026-09-19 00:53:07 +00:00
a5a645824f chore: remove CLAUDE.md (#39360)
Ref:
https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#21277

Co-authored-by: Claude (Opus 5) <noreply@anthropic.com>
2026-09-18 17:51:39 -07:00
silverwindandGitHub 309c872ce5 chore: update eslint plugins and configure new unicorn rules (#39357)
Update all eslint plugins and configure the new unicorn rules.

The new unicorn CSS rules stay off because stylelint already covers most
of them.

`unicorn/prefer-iterator-helpers` is disabled because it forces too-new
browser requirements onto Gitea.

No new violations in the code.
2026-09-18 23:58:36 +00:00
0a8b24c2b3 docs: document NOTICE_ON_SUCCESS for every cron task (#39352)
`app.example.ini` documented cron success notices with keys Gitea does
not read:

1. `[cron.update_checker]` had `ENABLE_SUCCESS_NOTICE`, which never
existed.
2. Six sections still had `NO_SUCCESS_NOTICE`, removed in
https://github.com/go-gitea/gitea/pull/19221. Its `false` value also
implied notices were on, while the default is off.

Cron sections map onto `BaseConfig`, whose `NoticeOnSuccess` binds to
`NOTICE_ON_SUCCESS`. This documents that key for every cron task, adds
it to four sections that omitted it, and fixes the "Notice if not
success" descriptions that inverted its meaning.

Signed-off-by: Roshan Ramani <roshanramani.dev@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-09-18 23:53:59 +00:00
3296046b4a fix: focus confirm button and use red for delete confirmations (#39350)
Fixes https://github.com/go-gitea/gitea/issues/39347

1. Focus the confirm button in generic confirm modals so `Enter` runs
the highlighted action.
2. Delete actions that lacked the risky flag now get it, so their
confirm button is red.

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-09-18 19:42:22 +00:00
fce7b9d531 fix: package registry keypair creation race (#39319)
Alpine, arch, debian, and rpm package types have a race in key creation.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-09-18 18:30:27 +00:00
b27e7d0289 enhance: improve issue-pattern capture groups and support both internal&external trackers enabled (#39354)
* Fix #39351
* Fix #17621
* Fix #34881

By the way, fix error handling bugs in `updateRepoUnits`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-18 08:53:45 -07:00
silverwindandGitHub 85eaf5c71c refactor(api): convert bot accounts through the admin user edit endpoint (#39355)
Follow-up to https://github.com/go-gitea/gitea/pull/38966. Replaces the
unreleased `POST /admin/users/{username}/convert-type` endpoint with a
`type` field on `PATCH /admin/users/{username}`.
2026-09-18 17:11:56 +02:00
3bec08f998 feat: manage bot accounts from the admin UI, API and CLI (#38966)
Adds first-class bot accounts (`UserTypeBot`): local, password-less
users for automation that authenticate only with access tokens.

1. Admin UI: create bots, filter users by type, manage a bot's access
tokens, convert between user and bot
2. API: `POST /admin/users/{username}/convert-type`, and user objects
gain a GitHub-compatible `type` (`User`, `Organization`, `Bot`)
3. CLI: `gitea admin user change-type`, `--user-type` accepts `User` or
`Bot` case-insensitively
4. Converting keeps the password, 2FA, OAuth2 grants and access tokens,
and since sign-in rejects bots, converting back restores the account.
Only local, non-admin accounts can be converted, and conversions are
audited
5. Session, reverse proxy, SSPI, external source and password reset
sign-in reject non-individual users, so a bot never gets an interactive
session
6. Bots receive no notifications or emails

Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: joestump <joe@joestump.net>
Co-authored-by: Joe Stump <joe@stu.mp>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2026-09-18 12:43:36 +00:00
silverwindandGitHub db7dbd5a6b test: stop tests from writing into ~/.ssh (#39348) 2026-09-18 17:07:45 +08:00
GiteaBot 6400c1545e [skip ci] Updated translations via Crowdin 2026-09-18 00:54:14 +00:00
silverwindandGitHub 2b10f77e42 enhance: update mermaid to v12 (#39331)
Update to [mermaid
v12](https://github.com/mermaid-js/mermaid/releases#release-mermaid@12.0.0),
ELK is now the default layout so the plugin and all supporting code is
gone.

Layout switching to previous `dagre` layout via frontmatter works as
expected. Diagrams use the new `neo` default look which renders them
slightly different (smaller boxes) then the `classic` look that was
default in v11.

The `neo` look got some tweaks to remove shadows and gradient to look
better. Also did some related refactors and mermaid dragging now works
on touch devices too.
2026-09-17 23:28:51 +00:00
Roshan RamaniandGitHub c0c573f7af docs: correct ALLOW_LOCALNETWORKS description in app.example.ini (#39240)
Fixes the `app.example.ini` half of #39224.

The comment says:

> If a domain is allowed by `ALLOWED_DOMAINS`, this option will be
ignored.

That is no longer true. `checkByAllowBlockList` in
`services/migrations/migrate.go` consults the block list **first** and
returns immediately:

```go
if blockList.MatchHostName(hostName) || ipBlocked {
    return &git.ErrInvalidCloneAddr{Host: hostName, IsPermissionDenied: true}
}
// if we have an allow-list, check the allow-list before return to get the more accurate error
if !allowList.IsEmpty() { ... }
```

`IsMigrateURLAllowed` resolves the host with `net.LookupIP` and passes
the addresses in, so with `ALLOW_LOCALNETWORKS = false` a host that
appears in `ALLOWED_DOMAINS` is still rejected once any resolved address
is private or loopback — the allow list never gets a look. The reporter
traced this to the validation hardening in #38324 / #38400, and the code
matches their description.

The new wording states the precedence rather than the old override
claim.

Scope: this only covers `custom/conf/app.example.ini`, which lives here.
The same stale sentence is on the config cheat sheet in `gitea/docs`
(both the English and zh-cn pages) per the issue; that is a separate
repository.

Assisted-by: Claude, via Claude Code
2026-09-17 12:23:40 -07:00
4892a55e29 enhance: allow attribute-less MathML elements and complete the Core allowlist (#39337)
Follow-up to https://github.com/go-gitea/gitea/pull/38034.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-17 13:18:33 +00:00
Zhaoqi XuandGitHub be7cde7539 fix(repo): surface unrelated histories on Sync Fork (#39258)
Sync Fork already maps merge conflicts to a JSON error. Unrelated
histories still went through `ServerError`, so the UI showed a 500 HTML
snippet instead of the same user-facing message PR merge already uses
(`repo.pulls.unrelated_histories`).

The API path returned 500 for the same git error; PR merge returns 409.
Match that.

Fixes #36772

AI assistance was used to locate the handler gap and draft the mapping.
I reviewed and take responsibility for the change.

Signed-off-by: Zhaoqi Xu <lzy00419@outlook.com>
2026-09-17 12:25:43 +00:00
silverwindandGitHub afb7edef07 refactor: replace AWS SDK with a REST client for CodeCommit migration (#39330)
Replace `aws-sdk-go-v2` in the CodeCommit migration with a minimal REST
client for the four read-only API calls it uses. Binary shrinks by ~3.1
MB.

Mock data was recorded against live from a AWS CodeCommit repo and then
anonymized.

Also stop storing the repo description as the default branch which fixes
below issue. All comments in
https://github.com/go-gitea/gitea/issues/34627 are addressed, the merge
metadata was fixed earlier in
https://github.com/go-gitea/gitea/pull/34645.

Fixes: https://github.com/go-gitea/gitea/issues/34627
2026-09-17 09:58:05 +00:00
silverwindandGitHub e77d3bffae perf(frontend): enable vite module preload (#39332)
`modulePreload: false` came in with the webpack to vite migration, when
chunks were cache-busted through import maps. With content-hashed chunks
that reason is gone. Vite's default makes every lazy import preload its
whole static dependency tree in parallel instead of the browser
discovering it one level per round trip, which renders lazy features like
mermaid, the code editor and the activity charts noticeably faster on
real-world latency without changing chunks or requests.

Assisted-by: Claude Code:claude-opus-5
2026-09-17 11:22:53 +02:00
GiteaBot f0d2195998 [skip ci] Updated translations via Crowdin 2026-09-17 00:54:44 +00:00
b2e11ddb37 fix: add default timeout and handle errors for HaveIBeenPwned API (#39316)
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-16 20:41:57 +02:00
7ebb2caa9e fix(user): unify email validation for registration and settings (#39304)
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-16 17:34:41 +00:00
c6c671e113 refactor: replace Azure Blob SDK with a REST client (#39315)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-16 17:06:00 +02:00
wxiaoguangandGitHub f0a535b641 build(gogit): disable gogit builds for stable releases (#39324) 2026-09-16 13:36:10 +00:00
silverwindandGitHub 2b6500aca4 test(e2e): log out to switch users in pr-review test (#39328) 2026-09-16 15:32:02 +02:00
c04802b6b3 enhance: support ETag on streamed repository archives, support If-None-Match: * (#39289)
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 5) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-16 12:30:22 +02:00
31b4d79a84 fix: match install page update checker setting with app.ini (#39317)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-16 07:47:34 +00:00
silverwindandGitHub 7efd24b28f fix(actions): use gitea's clock for actions durations (#39323) 2026-09-16 06:53:15 +00:00
GiteaBot 62945266d4 [skip ci] Updated translations via Crowdin 2026-09-16 00:55:08 +00:00
a583a30d4a enhance(notifications): mark current notification page as read (#39294)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-16 00:31:16 +00:00
silverwindandGitHub f9d3268dbe fix(actions): never show negative running durations (#39322) 2026-09-15 21:33:17 +02:00
812191c0f9 fix: classify git failures on stderr, restrict migration failure detail (#39010)
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-09-15 10:59:34 +02:00