Commit Graph

20074 Commits

Author SHA1 Message Date
silverwind
c287a8cdb5 Disable matchBrackets in monaco (#36089)
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 one may be a bit opinionated but I prefer my editors to be clean of
distractions and these bracket highlights look too much like a cursor on
quick glance imho.

Before:
<img width="345" height="67" alt="Screenshot 2025-12-04 at 20 26 14"
src="https://github.com/user-attachments/assets/10b2ea19-4468-401b-9425-1caa1b64afe4"
/>

After:
<img width="319" height="69" alt="Screenshot 2025-12-04 at 20 26 25"
src="https://github.com/user-attachments/assets/edbd3291-965d-421f-85cf-8d927b2a323a"
/>
2025-12-05 07:06:13 +00:00
silverwind
ca8c4ebecd Update JS deps (#36091)
Result of `make update-js svg && git add --all`. Tested Mermaid.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-12-05 06:30:59 +01:00
Bryan Mutai
6675ddc117 fix: Exclude code expansion arrows when DiffBlobExcerptData is not available. (#36060)
Resolves #35994 

Do not render code expansion arrows when `DiffBlobExcerptData` is not
available (code file preview, pull conversation diff comment).

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-12-04 20:07:22 -08:00
silverwind
5fdc84841a Add strikethrough button to markdown editor (#36087)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Fixes: https://github.com/go-gitea/gitea/issues/36086


![strike](https://github.com/user-attachments/assets/984e36db-6fa8-4054-9794-aa54bc642354)
2025-12-05 01:21:24 +00:00
Lunny Xiao
64960a18f9 Move commit related functions to gitrepo package (#35600) 2025-12-05 00:20:23 +00:00
Lunny Xiao
cb5082f8fe Fix the bug when ssh clone with redirect user or repository (#36039)
Fix #36026 

The redirect should be checked when original user/repo doesn't exist.
2025-12-04 19:17:49 +00:00
a1012112796
ee365f5100 fix some file icon ui (#36078)
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 #36071

looks that's because if an svg in hiden env, it's color added by
`fill="url(#a)"` will become not usefull. by ai helping, I think moving
it out of page by position is a good solution. fell free creat a new
pull request if you have a better soluton. Thanks.
<img width="2198" height="1120" alt="image"
src="https://github.com/user-attachments/assets/bbf7c171-0b7f-412a-a1bc-aea3f1629636"
/>

---------

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-12-04 19:47:23 +01:00
silverwind
b49dd8e32f update golangci-lint to v2.7.0 (#36079)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
- Update and autofix most issues
- Corrected variable names to `cutOk`
- Impossible condition in `services/migrations/onedev_test.go` removed
- `modules/setting/config_env.go:128:3` looks like a false-positive,
added nolint
2025-12-04 09:06:44 +00:00
Lunny Xiao
ee6e371e44 Use Golang net/smtp instead of gomail's smtp to send email (#36055)
Replace #36032
Fix #36030

This PR use `net/smtp` instead of gomail's smtp. Now
github.com/wneessen/go-mail will be used only for generating email
message body.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2025-12-04 08:35:53 +00:00
Lunny Xiao
e30a130b9a Fix edit user email bug in API (#36068)
Follow #36058 for API edit user bug when editing email.

- The Admin Edit User API includes a breaking change. Previously, when
updating a user with an email from an unallowed domain, the request
would succeed but return a warning in the response headers. Now, the
request will fail and return an error in the response body instead.
- Removed `AdminAddOrSetPrimaryEmailAddress` because it will not be used
any where.

Fix https://github.com/go-gitea/gitea/pull/36058#issuecomment-3600005186

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2025-12-04 09:05:13 +01:00
GiteaBot
97cb4409fb [skip ci] Updated translations via Crowdin 2025-12-04 00:38:21 +00:00
silverwind
46d7adefe0 Enable TypeScript strictNullChecks (#35843)
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
A big step towards enabling strict mode in Typescript.

There was definitely a good share of potential bugs while refactoring
this. When in doubt, I opted to keep the potentially broken behaviour.
Notably, the `DOMEvent` type is gone, it was broken and we're better of
with type assertions on `e.target`.

---------

Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-12-03 02:13:16 +00:00
silverwind
9f268edd2f Update go toolchain to 1.25.5 (#36074)
Fixes: https://pkg.go.dev/vuln/GO-2025-4155
2025-12-03 00:26:07 +01:00
6543
ca4b21c305 Revert "adopt changes" (was intendet for #33356)
This reverts commit a04a16dc2b.
2025-12-02 21:51:00 +01:00
6543
a04a16dc2b adopt changes 2025-12-02 21:37:14 +01:00
GiteaBot
1e777f92c7 [skip ci] Updated translations via Crowdin 2025-12-02 00:38:36 +00:00
Lunny Xiao
5340db4dbe Fix bug when updating user email (#36058)
Fix #20390 

We should use `ReplacePrimaryEmailAddress` instead of
`AdminAddOrSetPrimaryEmailAddress` when modify user's email from admin
panel. And also we need a database transaction to keep deletion and
insertion succeed at the same time.
2025-12-01 23:50:10 +00:00
Bryan Mutai
7d6861ac54 Add "Go to file", "Delete Directory" to repo file list page (#35911)
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
/claim #35898
Resolves #35898 

### Summary of key changes:

1. Add file name search/Go to file functionality to repo button row.
2. Add backend functionality to delete directory
3. Add context menu for directories with functionality to copy path & delete a directory
4. Move Add/Upload file dropdown to right for parity with Github UI
5. Add tree view to the edit/upload UI

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-11-30 11:58:15 +08:00
silverwind
b54af8811e Replace lint-go-gopls with additional govet linters (#36028)
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
Many (but not all) analyzers ran by `gopls check` are available in
`golangci-lint` as part of default-disabled `govet` linters, so I think
it's best we remove this manual linting step and let `golangci-lint`
handle it. I hand-picked two available linters that were previously
linted using gopls and this list is not exhaustive.

This will reduce CI time by about 3 minutes.
2025-11-29 14:13:22 +00:00
Zettat123
f4e38e6367 Fix Actions pull_request.paths being triggered incorrectly by rebase (#36045)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Partially fix #34710 

The bug described in #34710 can be divided into two parts: `push.paths`
and `pull_request.paths`. This PR fixes the issue related to
`pull_request.paths`. The root cause is that the check for whether the
workflow can be triggered happens **before** updating the PR’s merge
base. This causes the file-change detection to use the old merge base.
Therefore, we need to update the merge base first and then check whether
the workflow can be triggered.
2025-11-28 19:33:52 +00:00
hamkido
a36951aef6 Fix error handling in mailer and wiki services (#36041)
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
- Updated error message in `incoming.go` to remove unnecessary wrapping
of the error.
- Corrected typo in error message in `wiki.go` for clarity.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2025-11-28 00:36:27 +00:00
silverwind
9668913d76 Update JS deps, fix deprecations (#36040)
- Update JS deps
- Regenerate SVGs
- Fix air `bin` deprecation
- Fix `monaco.languages.typescript` deprecation
- Remove `eslint-plugin-no-use-extend-native`, it's unnecessary with
typescript
- Enable new `@typescript-eslint` rules
- Disable `@typescript-eslint/no-redundant-type-constituents`, this rule
has bugs when not running under `strictNullChecks` (pending in
https://github.com/go-gitea/gitea/pull/35843).
2025-11-27 23:58:10 +00:00
bytedream
ede7f1a069 Fix incorrect viewed files counter if file has changed (#36009)
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
File changes since last review didn't decrease the viewed files counter

---
<img width="440" height="178" alt="image"
src="https://github.com/user-attachments/assets/da34fcf4-452f-4f71-8da2-97edbfc31fdd"
/>

Also reported here ->
https://github.com/go-gitea/gitea/issues/35803#issuecomment-3567850285

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-11-27 14:02:03 +00:00
GiteaBot
1816c7f9c1 [skip ci] Updated translations via Crowdin 2025-11-27 00:36:53 +00:00
silverwind
66707bc3ea Fix actions lint (#36029)
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
actionlint since https://github.com/rhysd/actionlint/releases/tag/v1.7.9
detects constant conditions and this workflow was being disabled in
58d2a87c6c
by such a condition which made the lint fail:


https://github.com/go-gitea/gitea/actions/runs/19673752806/job/56349128912?pr=36028

Instead, remove the whole workflow file. I'm sure we can re-create it if
the need arises.

Also, I locked the actionlint dependency to prevent similar surprises in
the future.
2025-11-26 10:13:37 -08:00
wxiaoguang
000c06d41b Fix oauth2 session gob register (#36017)
`gob.Register` must be called before Sessioner

Fix #36016
2025-11-26 23:25:34 +08:00
wxiaoguang
abe2755f7a Fix container registry error handling (#36021)
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. the `if` check in `handleCreateManifestResult` didn't handler err correctly
2. add more error details for debugging
2025-11-25 12:13:30 +08:00
Andrew Melnick
688430e3ce Allow admins to rename non-local users (#35970)
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
Presently, attempting to rename a non-local (e.g. Oauth2 or LDAP) user
results in an error, even if the requester is an administrator. As far
as I can tell, this is a security feature, not architectural in nature,
as automatic account linking could be used to take control of another
user's account. This is not a concern for an administrator, who we
should trust to know what they are doing.

This patch allows admins, and only admins, to rename non-local users.

Fixes https://github.com/go-gitea/gitea/issues/18308 (sort of)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-11-23 20:59:55 +00:00
wxiaoguang
87d5a8507d Add "site admin" back to profile menu (#36010)
Fix #35904
2025-11-23 22:29:58 +02:00
Zettat123
ed977d9702 Use GitHub-style commit message for squash merge (#35987)
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
2025-11-22 09:20:45 -08:00
Lunny Xiao
62d750eadb Fix various permission & login related bugs (#36002)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Permission & protection check:

- Fix Delete Release permission check
- Fix Update Pull Request with rebase branch protection check
- Fix Issue Dependency permission check
- Fix Delete Comment History ID check

Information leaking:

- Show unified message for non-existing user and invalid password
    - Fix #35984
- Don't expose release draft to non-writer users.
- Make API returns signature's email address instead of the user
profile's.

Auth & Login:

- Avoid GCM OAuth2 attempt when OAuth2 is disabled
    - Fix #35510

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-11-22 07:16:08 +00:00
Lunny Xiao
a60a8c6966 Allow empty commit when merging pull request with squash style (#35989)
Before this PR, when merging an empty PR with squash style will result
in 500.

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-11-22 06:02:25 +00:00
GiteaBot
4c51acb26b [skip ci] Updated translations via Crowdin 2025-11-21 00:37:11 +00:00
Sandro Santilli
543e3bf7e9 Mention proc-receive in text for dashboard.resync_all_hooks func (#35991) 2025-11-20 19:27:08 -05:00
silverwind
1baca49870 Update JS deps (#35978)
Update JS deps, regenerate SVGs, fixed lint issues and did cursory
testing of UI.
2025-11-20 21:53:44 +00:00
Gary Wang
afc25c5145 wiki: reuse selectable style for wiki (#35990)
This patch amends https://github.com/go-gitea/gitea/pull/27507.

Since https://github.com/go-gitea/gitea/pull/35072, `selectable` css
class can be used for providing hover effect for tables. This patch let
the wiki page be able to make use of that css class, and we can safely
remove the custom css for this purpose.

Behavior is not changed.

----

Side note: I made this patch locally months ago but completely forget to
submit it as a PR 😂
2025-11-20 21:23:14 +00:00
dependabot[bot]
98eb2b0aba Bump golang.org/x/crypto from 0.43.0 to 0.45.0 (#35985)
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
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from
0.43.0 to 0.45.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4e0068c009"><code>4e0068c</code></a>
go.mod: update golang.org/x dependencies</li>
<li><a
href="e79546e28b"><code>e79546e</code></a>
ssh: curb GSSAPI DoS risk by limiting number of specified OIDs</li>
<li><a
href="f91f7a7c31"><code>f91f7a7</code></a>
ssh/agent: prevent panic on malformed constraint</li>
<li><a
href="2df4153a03"><code>2df4153</code></a>
acme/autocert: let automatic renewal work with short lifetime certs</li>
<li><a
href="bcf6a849ef"><code>bcf6a84</code></a>
acme: pass context to request</li>
<li><a
href="b4f2b62076"><code>b4f2b62</code></a>
ssh: fix error message on unsupported cipher</li>
<li><a
href="79ec3a51fc"><code>79ec3a5</code></a>
ssh: allow to bind to a hostname in remote forwarding</li>
<li><a
href="122a78f140"><code>122a78f</code></a>
go.mod: update golang.org/x dependencies</li>
<li><a
href="c0531f9c34"><code>c0531f9</code></a>
all: eliminate vet diagnostics</li>
<li><a
href="0997000b45"><code>0997000</code></a>
all: fix some comments</li>
<li>Additional commits viewable in <a
href="https://github.com/golang/crypto/compare/v0.43.0...v0.45.0">compare
view</a></li>
</ul>
</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-19 20:10:35 -08:00
GiteaBot
adece922f1 [skip ci] Updated translations via Crowdin 2025-11-20 00:36:24 +00:00
silverwind
1da1e644ed Misc CSS fixes (#35888)
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/35913
Fixes: https://github.com/go-gitea/gitea/issues/35942

Contains a number of minor CSS fixes.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-11-19 03:02:41 +00:00
wxiaoguang
e1372e5bc1 Make composer registry support tar.gz and tar.bz2 and fix bugs (#35958)
Fix #35957
2025-11-18 23:15:50 +00:00
DrMaxNix
de69e7f16a Change project default column icon to 'star' (#35967)
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
Consistently use a `star` icon to highlight the default column of a
project.
The icon is both shown while viewing the project, as well as while
changing the default status of this column.

<img width="1065" height="370" alt="image"
src="https://github.com/user-attachments/assets/1ca5773d-8eec-4b90-ad0b-22b1f4bd4cfd"
/>
2025-11-18 10:55:27 +02:00
wxiaoguang
0fb3be7f0e Fix diff blob excerpt expansion (#35922)
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 add comments and tests
2025-11-14 04:50:48 +00:00
Daniel Mach
d6dc531d4b Add GITEA_PR_INDEX env variable to githooks (#35938)
`GITEA_PR_ID` is already part of the env variables available in the
githooks, but it contains a database ID instead of commonly used index
that is part of `owner/repo!index`
2025-11-14 04:21:05 +00:00
wxiaoguang
358de23a50 Fix container push tag overwriting (#35936)
Fix #35853
2025-11-14 03:49:57 +00:00
Lunny Xiao
018156079b Upgrade deps golang.org/x/crypto (#35952) 2025-11-14 03:19:51 +00:00
wxiaoguang
1f3558b65c Fix corrupted external render content (#35946)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
Fix #35944
2025-11-14 08:31:11 +08:00
wxiaoguang
b95fd7e13e Don't show unnecessary error message to end users for DeleteBranchAfterMerge (#35937)
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
2025-11-13 07:03:13 +08:00
wxiaoguang
372d24b84b Limit reading bytes instead of ReadAll (#35928)
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
2025-11-12 19:44:49 +08:00
鲁汀
2223be2cc4 Support blue yellow colorblind theme (#35910)
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 icon is from GitHub:

<img width="350" height="350" alt="image"
src="https://github.com/user-attachments/assets/c3f31901-5359-4b7f-ae68-eddcec63df53"
/>

---------

Signed-off-by: 鲁汀 <131967983+lutinglt@users.noreply.github.com>
Co-authored-by: lutinglt <lutinglt@users.noreply.github.com>
2025-11-11 18:21:15 +00:00
wxiaoguang
9affb513a8 Load jQuery as early as possible to support custom scripts (#35926)
Fix #35923
2025-11-12 00:11:46 +08:00