20240 Commits

Author SHA1 Message Date
silverwind
224b7881d9 Forbid localStorage access in eslint (#36461)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-container (push) Waiting to run
Followup to
59f812bc1c,
enforce using our localStorage wrapper in eslint.

Also did a few tweaks in the eslint config, like removing the incomplete
list of globals, this is a non-issue with typescript.

---------

Signed-off-by: silverwind <me@silverwind.io>
2026-01-27 19:59:51 +00:00
Lunny Xiao
1463426a27 Use merge tree to detect conflicts when possible (#36400)
In Git 2.38, the `merge-tree` command introduced the `--write-tree`
option, which works directly on bare repositories. In Git 2.40, a new parameter `--merge-base` introduced so we require Git 2.40 to use the merge tree feature.

This option produces the merged tree object ID, allowing us to perform
diffs between commits without creating a temporary repository. By
avoiding the overhead of setting up and tearing down temporary repos,
this approach delivers a notable performance improvement.

It also fixes a possible situation that conflict files might be empty
but it's a conflict status according to
https://git-scm.com/docs/git-merge-tree#_mistakes_to_avoid

Replace #35542

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-27 11:57:20 -08:00
GiteaBot
125257eacf [skip ci] Updated translations via Crowdin 2026-01-27 00:42:45 +00:00
silverwind
59f812bc1c Fix and enhance comment editor monospace toggle (#36181)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
Fixes: https://github.com/go-gitea/gitea/issues/36175

1. Correctly apply setting on textareas spawned by comment edit
3. When changing the setting, apply it to all textareas on the current page

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-26 14:19:47 +00:00
wxiaoguang
4c8f6dfa4e Support rendering OpenAPI spec (#36449)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Fix #20852
2026-01-26 10:34:38 +08:00
Moritz Jörg
89bfddc5c2 Normalize guessed languages for code highlighting (#36450)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
For when Enry correctly recognized the language, but returns the
language name in a way that isn't recognized by chroma.

Resolves https://github.com/go-gitea/gitea/issues/22443

---------

Co-authored-by: Moritz Jörg <moritz.jorg@oceanbox.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-25 14:02:16 +00:00
silverwind
12a81d38c1 Add knip linter (#36442)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
This adds [knip](https://github.com/webpro-nl/knip), a tool to find
unused files, dependencies and exports in JS. Fixed all discovered
issues.

1. knip apparently has some issue resolving imports from `d.ts` to `.ts`
so I worked around it by moving the two affected types to where they are
used.
2. I don't know why `modules/fomantic/dropdown.ts` had a new typescript
error, but I fixed it.
3. Use named export for `EsbuildPlugin`, I think this was added
recently.
2026-01-24 12:52:13 +00:00
wxiaoguang
ddc9d29713 Fix various bugs (#36446)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
* Fix #36409
* Fix #36322
* Fix #30101
* Fix #36317

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-24 11:30:47 +00:00
silverwind
a608b9e1e3 Update tool dependencies (#36445)
Updates all dependencies in `Makefile`. The go fix was done
automatically, I just altered the variable name.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-24 09:58:28 +01:00
silverwind
5925433fe6 Update JS dependencies, adjust webpack config, misc fixes (#36431)
1. Upgrade to [jQuery
4.0](https://blog.jquery.com/2026/01/17/jquery-4-0-0/). Two of the
removed APIs are in use by fomantic, but there are [polyfills
present](a3a3e581aa/web_src/fomantic/build/components/dropdown.js (L15-L17))
so it continues to work.
2. Remove manual naming of webpack chunks. I was running into below
webpack error and I see no reason for this manual chunk naming which is
prone to naming collisions. Also, the webpack build now shows all output
assets. This change will result in longer asset filenames, but webpack
should now be able to guarentee that the names are without collisions.
    ````
    ERROR in SplitChunksPlugin
    Cache group "defaultVendors" conflicts with existing chunk.
Both have the same name "--------" and existing chunk is not a parent of
the selected modules.
Use a different name for the cache group or make sure that the existing
chunk is a parent (e. g. via dependOn).
    HINT: You can omit "name" to automatically create a name.
BREAKING CHANGE: webpack < 5 used to allow to use an entrypoint as
splitChunk. This is no longer allowed when the entrypoint is not a
parent of the selected modules.
Remove this entrypoint and add modules to cache group's 'test' instead.
If you need modules to be evaluated on startup, add them to the existing
entrypoints (make them arrays). See migration guide of more info.
3. Fix test issue related to `p > div` which is invalid as per HTML spec
because `div` is not [phrasing
content](https://html.spec.whatwg.org/multipage/dom.html#phrasing-content-2)
and therefor can not be a descendant of `p`. This is related to
https://github.com/capricorn86/happy-dom/pull/2007.
4. Add webpack globals
5. Remove obsolete docs glob
6. fix security issue for `seroval` package
7. disable [vitest isolate](https://vitest.dev/config/isolate.html) for
30% faster JS tests, which are all pure.
2026-01-24 07:35:46 +00:00
lif
4ed43c2a32 fix: Improve image captcha contrast for dark mode (#36265)
## Summary
This PR fixes #36255

The image captcha was using random colors which often resulted in poor
contrast against dark backgrounds, making it difficult or impossible for
users to read in dark mode.

## Changes
- Added a custom color palette to the image captcha configuration in
`services/context/captcha.go`
- The palette uses high-contrast colors (bright red, blue, green,
yellow, purple, and dark blue-gray) that provide good visibility in both
light and dark themes
- This improves accessibility and user experience without changing any
existing functionality

## Testing
- Builds successfully
- All existing tests pass
- The color palette is properly supported by the upstream
`gitea.com/go-chi/captcha` library

---
Generated with Claude Code

---------

Signed-off-by: majiayu000 <1835304752@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-01-24 05:41:51 +00:00
wxiaoguang
9de659437e Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
silverwind
47717d4435 Add documentation for markdown anchor post-processing (#36443)
See discussion in https://github.com/go-gitea/gitea/pull/36284.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-24 05:31:57 +01:00
Heath Dutton🕴️
0f78b99998 Fix markup heading parsing, fix emphasis parsing (#36284)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Fixes #36106, fix #17958

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-23 20:24:58 +00:00
Lunny Xiao
cfd7218395 Front port changelog for 1.25.4 (#36432)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2026-01-23 15:31:01 +00:00
Zettat123
52c3a7d3ce Bugfix: Potential incorrect runID in run status update (#36437)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
`jobs[0]` may not belong to the run for `runID`.

Co-authored-by: Giteabot <teabot@gitea.io>
2026-01-23 11:11:56 +00:00
Kemal Zebari
56c5d5e819 Restrict branch naming when new change matches with protection rules (#36405)
Resolves #36381 by only allowing admins to perform branch renames that
match to branch protection rules.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2026-01-23 11:42:24 +01:00
wxiaoguang
e42a1dbb6b Refactor GetRepoRawDiffForFile to avoid unnecessary pipe or goroutine (#36434)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
2026-01-23 02:10:11 +00:00
silverwind
5f91c51fa5 Remove node-check and go-check, support node prerelease versions (#36382)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
1. Remove those checks for the sake of build performance and because go
and node will fail anyways if their versions are incorrect.
3. Support pre-release Node version for determining NODE_VARS.
2. Update to the chinese READMEs to mention `pnpm` which is already
present in english README.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-22 09:30:02 +01:00
wxiaoguang
3a09d7aa8d Refactor git command stdio pipe (#36422)
Most potential deadlock problems should have been fixed, and new code is
unlikely to cause new problems with the new design.

Also raise the minimum Git version required to 2.6.0 (released in 2015)
2026-01-22 06:04:26 +00:00
Thomas Beutlich
2a56c4ec3b Fix spelling (#36399)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Signed-off-by: Thomas Beutlich <115483027+thbeu@users.noreply.github.com>
2026-01-22 02:52:39 +00:00
wxiaoguang
85c7901404 Fix issue filter menu layout (#36426)
Fix #36420
2026-01-22 02:22:20 +00:00
luo jiyin
6a5f9e12f9 Fix typos: unknow -> unknown, pktLineTypeUnknow -> pktLineTypeUnknown (#36419) 2026-01-22 01:17:06 +00:00
GiteaBot
a3a3e581aa [skip ci] Updated translations via Crowdin 2026-01-22 00:41:46 +00:00
Tyrone Yeh
58cd8244ba Fix markdown newline handling during IME composition (#36421)
### Summary

Fix incorrect newline handling in markdown editor when using IME input.

### Details

While composing text with an IME, pressing Enter should not trigger
markdown indentation logic.
This change skips indentation handling during composition by checking
`e.isComposing`.

This prevents unexpected line breaks and formatting issues for CJK
users.
2026-01-22 00:24:37 +00:00
Sebastian Ertz
111c822a30 Update chroma to v2.23.0 (#36423) 2026-01-21 23:55:24 +00:00
Bart van der Braak
2f377e8552 Update material-icon-theme to v5.31.0 (#36427) 2026-01-22 00:25:14 +01:00
Lunny Xiao
d46021a83a Allow foreachref parse max tokens from 4*64KB to 4MB (#36414)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
Fix #36408

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-21 04:18:57 +00:00
wxiaoguang
9ea91e036f Refactor git command context & pipeline (#36406)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Less and simpler code, fewer bugs
2026-01-21 01:35:14 +00:00
Lunny Xiao
f6db180a80 Fix missing repository id when migrating release attachments (#36389)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
This PR fixes missed repo_id on the migration of attachments to Gitea.
It also provides a doctor check to fix the dirty data on the database.
2026-01-20 10:05:51 -08:00
GiteaBot
987d82b038 [skip ci] Updated translations via Crowdin 2026-01-20 00:39:58 +00:00
wxiaoguang
72be55f7d3 Refactor git command stderr handling (#36402)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
And clean up legacy fragile & incorrect logic
2026-01-18 15:10:33 -08:00
Lunny Xiao
fafd1db19e Some refactors about GetMergeBase (#36186)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
Maybe fix #32018

- Use `gitrepo.GetMergeBase` method instead of other two
implementations.
- Add `FetchRemoteCommit` so that we don't need to add many `remote` to
the git repository to avoid possible git lock conflicts. A lock will
start when invoke the function, it will be invoked when cross-repository
comparing. The head repository will fetch the base repository's base
commit id. In most situations, it should lock the fork repositories so
that it should not become a bottleneck.
- Improve `GetCompareInfo` to remove unnecessarily adding remote.
- Remove unnecessary parameters of `SignMerge`.
2026-01-17 11:22:09 -08:00
wxiaoguang
149f7a6f1f Refactor git command stdio pipe (#36393)
And remove the incorrect `ensureValidGitRepository`
2026-01-17 18:11:46 +00:00
yy
7a2aac406d fix: typos in comments (#36394) 2026-01-17 17:03:25 +00:00
TheFox0x7
906ad802cf add support for archive-upload rpc (#36391)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
Add support for fetching archives with `git archive --remote <repo-url>`

closes: https://github.com/go-gitea/gitea/issues/23425

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-17 15:17:00 +00:00
Lunny Xiao
393c854f7b Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission (#36384)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
2026-01-16 22:25:24 +02:00
Gregorius Bima Kharisma Wicaksana
65422fde4d Fix CODEOWNERS review request attribution using comment metadata (#36348)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
Fixes #36333

## Problem

When CODEOWNERS automatically assigns reviewers to a pull request, the
timeline incorrectly shows the PR author as the one who requested the
review (e.g., "PR_AUTHOR requested review from CODE_OWNER"). This is
misleading since the action was triggered automatically by CODEOWNERS
rules, not by the PR author.

## Solution

Store CODEOWNERS attribution in comment metadata instead of changing the
doer user:
- Add `SpecialDoerName` field to `CommentMetaData` struct (value:
`"CODEOWNERS"` for CODEOWNERS-triggered requests)
- Pass `isCodeOwners=true` to `AddReviewRequest` and
`AddTeamReviewRequest` functions
- Template can check this metadata to show appropriate attribution
message

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-16 14:52:57 +00:00
silverwind
49edbbbc2e Update JS and PY deps (#36383)
- Update JS and PY dependencies
- Workaround https://github.com/stylelint/stylelint/issues/8893 by
moving the stylint config file to JS
- Regenerate SVGs
- Bump to python 3.14 in devcontainer and actions
- Verified `@github/text-expander-element`
- Removed obsolete type stub
2026-01-16 11:00:16 +00:00
TheFox0x7
69c5921d71 Add ability to download subpath archive (#36371)
closes: https://github.com/go-gitea/gitea/issues/4478

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-16 09:31:12 +00:00
Lunny Xiao
67e75f30a8 Fix bug on notification read (#36339)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
When a user has been revoked permission to access a repository, the
related notification could still be visited. But the repository's
information should not be leaked any more.
2026-01-15 21:11:13 -08:00
Zeno
3f46de8265 Add chunked transfer encoding support for LFS uploads (#36380)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
Enable chunked transfer encoding for Git LFS uploads by adding
Transfer-Encoding: chunked header to upload action responses. This
prevents large file uploads (100+ MB) from being blocked by reverse
proxies like Cloudflare that buffer non-chunked requests.

Fix https://github.com/go-gitea/gitea/issues/22233

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-16 07:15:18 +08:00
silverwind
4a9ac53862 Migrate to import.meta.env and clean up types and eslint (#36362)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
`import.meta.env` is supported in both vitest and webpack [as of
recent](https://github.com/webpack/webpack/pull/19996), so replace all
previous use of `process.env` with it. Current usage is limited to test
files, I've also verified it works in actual frontend code.

`webpack/module` is added to typescript types which includes the
definition for `import.meta.env`. I've also made the eslint globals more
precise. Finally, `__webpack_public_path__` is removed from our type
definitions because `webpack/module` also provides it.
2026-01-15 11:01:23 +00:00
silverwind
915a2cd86f Rename CSS variables and improve colorblind themes (#36353)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Followup https://github.com/go-gitea/gitea/pull/36215, rename the
variables for consistency with existing vars and change green to value
of `--color-blue` in the relevant color blind themes:

<img width="1305" height="303" alt="image"
src="https://github.com/user-attachments/assets/3d131ab7-99ab-4b03-93ab-715ce0030b08"
/>


The blue coloring also matched GitHub:

<img width="1313" height="393" alt="image"
src="https://github.com/user-attachments/assets/f97e35b2-4ff4-49b0-841f-ffd49a02e03d"
/>

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2026-01-15 06:18:33 +00:00
Michael Hoang
8e9fb4d14c Indicate when only optional checks failed (#36367)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
Currently it's not clear that you can merge a PR when only optional
checks failed:

<img width="922" height="447" alt="Screenshot 2026-01-14 at 4 08 17 pm"
src="https://github.com/user-attachments/assets/e11670c7-5ab9-42d7-af09-2d8a8fd532d3"
/>

This PR changes the text to say "Some optional checks failed" when only
optional checks failed:

<img width="922" height="443" alt="Screenshot 2026-01-14 at 3 59 08 pm"
src="https://github.com/user-attachments/assets/9ea69b13-38d6-4cfc-b4f7-952eff58e546"
/>

When a required check fails it'll still say "Some checks failed":

<img width="928" height="343" alt="Screenshot 2026-01-14 at 3 59 20 pm"
src="https://github.com/user-attachments/assets/d3764a95-9737-4482-851e-d3406b1e4d76"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-14 14:25:14 -08:00
Lunny Xiao
14e8c9b767 Release attachments must belong to the intended repo (#36347) 2026-01-14 11:37:53 -08:00
Lunny Xiao
7b5de594cd Fix permission check on org project operations (#36318) 2026-01-14 17:29:33 +00:00
Lunny Xiao
07ac29da32 Fix bug when compare in the pull request (#36363)
The pull request comparison should not use `direct compare`.
2026-01-14 16:56:23 +00:00
Lunny Xiao
8a98ac2213 clean watches when make a repository private and check permission when send release emails (#36319) 2026-01-14 16:11:22 +00:00
wxiaoguang
1c1a7b8492 Fix incorrect text content detection (#36364)
Fix #36325
2026-01-14 23:35:52 +08:00