Commit Graph
100 Commits
Author SHA1 Message Date
wxiaoguangandGitHub 10cf2023bf Refactor container package (#34877)
Use standard db.WithTx and introduce db.WithTx2
2025-06-29 09:20:38 +08:00
wxiaoguangandGitHub 8df59fa11c Fix project column edit (#34890)
Fix #34888
2025-06-28 16:15:51 +08:00
75aa23a665 Refactor "change file" API (#34855)
Follow up the "editor" refactor, use the same approach to simplify code,
and fix some docs & comments

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2025-06-25 11:25:20 -07:00
wxiaoguangandGitHub 1839110ea6 Fix some log and UI problems (#34863)
Remove the misleading error log, fix #34738

Make the "search" input auto-focused, fix #34807
2025-06-26 00:32:50 +08:00
wxiaoguangandGitHub d23c911997 Fix archive API (#34853)
Fix #34852
2025-06-25 14:55:19 +08:00
wxiaoguangandGitHub dbd9c69909 Refactor repo contents API and add "contents-ext" API (#34822)
See the updated swagger document for details.
2025-06-25 02:34:21 +00:00
wxiaoguangandGitHub 22a84a72cd Fix SSH LFS timeout (#34838)
Fix #34834
2025-06-24 15:49:31 +00:00
wxiaoguangandGitHub 6a97ab0af4 Fix team permissions (#34827)
* Fix #34793
* Fix #33456
2025-06-24 21:24:09 +08:00
327048c106 Refactor template helper (#34819)
FIx abuses and remove unused code

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2025-06-24 01:27:35 +08:00
wxiaoguangandGitHub 1748045285 Refactor packages (#34777) 2025-06-22 19:22:51 +08:00
wxiaoguangandGitHub f114c388ff Refactor wiki (#34805)
Remove unclear code
2025-06-22 18:53:33 +08:00
wxiaoguangandGitHub 4fc626daa1 Refactor editor (#34780)
A complete rewrite
2025-06-21 19:20:51 +08:00
wxiaoguangandGitHub 81adb01713 Improve img lazy loading (#34804)
Related #32051 and #13526
2025-06-21 14:53:22 +08:00
wxiaoguangandGitHub e0f3b30895 Fix container range bug (#34795)
Fix #34792 and add new tests
2025-06-21 01:13:34 +08:00
wxiaoguangandGitHub 719b151058 Fix OCI manifest parser (#34797)
Do not parse the media type we don't know.
2025-06-21 00:27:35 +08:00
wxiaoguangandGitHub 0ea958dc58 Fix tag target (#34781)
Fix #34779
2025-06-19 10:33:30 -07:00
wxiaoguangandGitHub 8efc4ca334 Refactor packages (func name & UI) (#34773)
1. Use `OpenXxx` instead of `GetXxx` because the returned readers should
be correctly closed, and clarify the behaviors of the functions: they
increase the download counter
2. Use `packages-content` styles instead of `issue-content`
2025-06-18 19:04:24 +00:00
wxiaoguangandGitHub a2ae7c69da Fix some package registry problems (#34759)
1. Fix #33787
2. Fix container image display
2025-06-19 00:32:43 +08:00
wxiaoguangandGitHub 7954f25290 Fix incorrect cli default values and default command (#34765) 2025-06-18 23:25:11 +08:00
wxiaoguangandGitHub b38813878c Fix readme path and markdown link paste (#34755) 2025-06-18 04:19:54 +00:00
71e4740946 Refactor some file edit related code (#34744)
Follow up #34350

---------

Co-authored-by: delvh <dev.lh@web.de>
2025-06-18 01:18:07 +00:00
f214bb40a3 Improve nuget/rubygems package registries (#34741)
1. Add some missing (optional) fields for nuget v2, and sort the fields
to make it easier to maintain
2. Add missing "platform" for rubygems: `VERSION-PLATFORM` and
`VERSION_PLATFORM`

Co-authored-by: Giteabot <teabot@gitea.io>
2025-06-17 19:42:00 +02:00
wxiaoguangandGitHub 4cbb482554 Fix JS error for "select" dropdown (#34743)
Regression of recent dropdown filter change.
2025-06-17 19:19:08 +08:00
wxiaoguangandGitHub 24ce2058e8 Clean bindata (#34728)
Follow #34692
2025-06-16 12:03:51 +00:00
wxiaoguangandGitHub 6b8b580218 Refactor container and UI (#34736) 2025-06-16 16:27:01 +08:00
wxiaoguangandGitHub 637070e07b Fix container range bug (#34725)
Fix #34724
2025-06-15 21:55:11 +03:00
wxiaoguangandGitHub 8fed27bf6a Fix various problems (#34708)
* Fix #34707
* Fix dropdown filter handling
* Fix #27014
2025-06-12 09:19:24 -07:00
wxiaoguangandGitHub 65986f423f Refactor embedded assets and drop unnecessary dependencies (#34692)
Benefits:

1. smaller binary size (reduces more than 1MB)
2. better control of the assets details
3. fewer unmaintained dependencies
4. faster startup if the assets are not needed
5. won't hang up editors when open "bindata.go" by accident
2025-06-12 03:59:33 +00:00
wxiaoguangandGitHub d5893ee260 Fix markdown wrap (#34697)
Fix #34696
2025-06-12 10:09:42 +08:00
wxiaoguangandGitHub 1610a63bfd Fix commit message rendering and some UI problems (#34680)
* Fix #34679
* Fix #34676
* Fix #34674
* Fix #34526
2025-06-10 23:20:32 +08:00
wxiaoguangandGitHub 0082cb51fa Fix last admin check when syncing users (#34649)
Fix #34358
2025-06-09 20:57:45 +00:00
wxiaoguangandGitHub 92e7e98c56 Update x/crypto package and make builtin SSH use default parameters (#34667) 2025-06-09 19:51:02 +00:00
wxiaoguangandGitHub 7b39c82587 Fix "oras" OCI client compatibility (#34666)
Fix #25846

1. the ImageConfig can be empty, fall back to default
2. the blob size can be empty, it still needs "Content-Length" header
2025-06-09 18:51:05 +00:00
wxiaoguangandGitHub 7a59f5a825 Ignore "Close" error when uploading container blob (#34620) 2025-06-09 07:06:21 +00:00
wxiaoguangandGitHub f6041441ee Refactor FindOrgOptions to use enum instead of bool, fix membership visibility (#34629) 2025-06-09 03:30:34 +00:00
wxiaoguangandGitHub cc942e2a86 Fix GetUsersByEmails (#34643) 2025-06-07 18:30:36 +00:00
wxiaoguangandGitHub 2a1585b32e Refactor some tests (#34580)
1. use `test.MockVariableValue` as much as possible
2. avoid `time.Sleep` as much as possible
2025-06-03 01:26:19 +00:00
wxiaoguangandGitHub e8d8984f7c Fix some trivial problems (#34579) 2025-06-02 15:22:43 +00:00
wxiaoguangandGitHub c6e2093f42 Clean up "file-view" related styles (#34558)
Move "file-view" and "code-view" related styles to their own file,
remove unnecessary `!important`
2025-05-28 21:43:59 +08:00
wxiaoguangandGitHub 9f10885b21 Refactor commit reader (#34542) 2025-05-27 16:49:05 +00:00
wxiaoguangandGitHub bf338bb9e2 Fix project board view (#34470)
Fix #34469
2025-05-15 23:25:46 +08:00
wxiaoguangandGitHub 5cb4cbf044 Fix repo broken check (#34444)
Fix #34424
2025-05-13 08:18:45 +00:00
wxiaoguangandGitHub 4a98ab0540 Remove legacy template helper functions (#34426)
These functions have been marked as `panicIfDevOrTesting` since 1.23
(#32422)
2025-05-11 01:42:21 -04:00
wxiaoguangandGitHub 9b8609e017 Fix GetUsersByEmails (#34423)
Fix #34418, fix #34353
2025-05-10 11:47:58 -07:00
wxiaoguangandGitHub 179068fddb Refactor commit message rendering and fix bugs (#34412)
Fix #34398, fix #33308

Remove all `repo.ComposeCommentMetas` from templates,
only use `repo` to render commit message.
2025-05-09 20:42:35 +08:00
wxiaoguangandGitHub f63822fe64 Fix autofocus behavior (#34397)
The "autofocus" was abused or misbehaved:

1. When users visit a page but they are not going to change a field,
then the field shouldn't get "autofocus"
* the "auth" / "user" page: in most cases, users do not want to change
the names
    * see also the GitHub's "settings" page behavior.
2. There shouldn't be duplicate "autofocus" inputs in most cases, only
the first one focuses
3. When a panel is shown, the "autofocus" should get focus
    * "add ssh key" panel

This PR fixes all these problems and by the way remove duplicate
"isElemHidden" function.
2025-05-08 18:26:18 +00:00
wxiaoguangandGitHub ba5c3f8087 Fix some dropdown problems on the issue sidebar (#34308)
Also fix #34300
2025-04-30 02:00:36 +00:00
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
wxiaoguangandGitHub d1ad8e1e80 Update unrs-resolver (#34279) 2025-04-24 14:02:38 +02:00
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
wxiaoguangandGitHub 58d2a87c6c update go&js dependencies (#34262) 2025-04-23 21:22:40 +00:00
wxiaoguangandGitHub b758241f28 Fix runner list tmpl (#34270)
Fix  #34269

And fix some layout problems.
2025-04-23 15:34:18 +00:00
wxiaoguangandGitHub 8aee07a064 Improve "not found" error messages for API (#34267)
Make the message clear, for example: #34266
2025-04-23 17:42:50 +08:00
wxiaoguangandGitHub 4832cb9e27 Display when a release attachment was uploaded (#34261)
Fix #34260
2025-04-22 23:03:49 +08:00
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
wxiaoguangandGitHub c9aa9068b3 Fix various UI problems (#34243)
Also fix #34242
2025-04-19 08:43:22 +00:00
wxiaoguangandGitHub 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
wxiaoguangandGitHub d2d381fd4b Improve "lock conversation" UI (#34207)
Fix #34203
2025-04-15 15:01:12 +00:00
wxiaoguangandGitHub 58a3952458 Fix package upload temp path (#34196)
Fix #34195

The temp dir should be created when it is used.
2025-04-14 18:55:02 +08:00
wxiaoguangandGitHub 34349c085c Fix incorrect file links (#34189)
Fix #34188

The name "FileName" is ambiguous: sometimes it is "base name without
path", sometimes it is "full name with path".

The ambiguous name causes various problems.

This PR clarifies the usage: `FileTreePath`: the full name with path.
2025-04-13 12:27:31 -07:00
wxiaoguangandGitHub f8edc29f5d Set MERMAID_MAX_SOURCE_CHARACTERS to 50000 (#34152)
Fix #32015
2025-04-09 07:52:01 +00:00
wxiaoguangandGitHub 07c6087878 Fix team permission (#34128)
The `team.access_mode` should be either `none` or `admin/owner`.
For non-admin team, the real permissions are provided by `team_unit`.
2025-04-08 04:15:15 +00:00
wxiaoguangandGitHub bcc38eb35f Make markdown render match GitHub's behavior (#34129)
For #2246
2025-04-06 17:34:59 +00:00
wxiaoguangandGitHub 3fe082a5a3 Remove dead code: RepoRef (#34131)
The RepoRef is a no-op since Refactor ref type (#33242) (Jan 14)
2025-04-06 20:08:10 +03:00
wxiaoguangandGitHub e94f8d56f1 Correctly handle submodule view and avoid throwing 500 error (#34121)
Auto-redirect for in-site links, and show 404 for external links
(to avoid open redirect or phishing)
2025-04-06 09:38:08 +00:00
wxiaoguangandGitHub a62ed19da6 Use overflow-wrap: anywhere to replace word-break: break-all (#34126) 2025-04-06 17:13:02 +08:00
wxiaoguangandGitHub e1c2d05bde Fix markdown render behaviors (#34122)
* Fix #27645
* Add config options `MATH_CODE_BLOCK_DETECTION`, problematic syntaxes
are disabled by default
* Fix #33639
    * Add config options `RENDER_OPTIONS_*`, old behaviors are kept
2025-04-05 11:56:48 +08:00
wxiaoguangandGitHub ee6929d96b Refactor dropdown ellipsis (#34123)
Remove legacy `truncated-item-container` and `truncated-item-name`.
2025-04-05 03:21:11 +00:00
wxiaoguangandGitHub 6cee3bfa96 Refactor markup render to fix various path problems (#34114)
* Fix #33972
    * Use consistent path resolving for links and medias.
* No need to make the markup renders to resolve the paths, instead, the
paths are all correctly resolved in the "post process" step.
* Fix #33274
* Since 1.23, all paths starting with "/" are relative to current render
context (for example: the current repo branch)
* Introduce `/:root/path-relative-to-root`, then the path will be
rendered as relative to "ROOT_URL"
2025-04-04 23:45:23 +08:00
wxiaoguangandGitHub ba921fd903 Fix markdown frontmatter rendering (#34102)
Fix #34101
2025-04-03 05:48:24 +00:00
wxiaoguangandGitHub 285950a222 Support creating relative link to raw path in markdown (#34105)
Fix #34104
2025-04-03 01:05:43 +08:00
wxiaoguangandGitHub 6ed1b26c58 Do not show 500 error when default branch doesn't exist (#34096)
Fix #34090
2025-04-01 21:39:00 -07:00
wxiaoguangandGitHub 86c1a33369 Fix some UI bugs and clean up unused tests (#34088)
1. Make the material icon falls back to basic theme correctly
2. Remove `TestAttributeReader`, the problem has been resolved.
3. Fix `toggleElem` bug and add tests
2025-04-01 07:02:30 +00:00
wxiaoguangandGitHub b59705fa34 Add a config option to block "expensive" pages for anonymous users (#34024)
Fix #33966

```
;; User must sign in to view anything.
;; It could be set to "expensive" to block anonymous users accessing some pages which consume a lot of resources,
;; for example: block anonymous AI crawlers from accessing repo code pages.
;; The "expensive" mode is experimental and subject to change.
;REQUIRE_SIGNIN_VIEW = false
```
2025-03-30 05:26:19 +00:00
wxiaoguangandGitHub cddd19efc8 Add anonymous access support for private/unlisted repositories (#34051)
Follow #33127

Fix #8649, fix #639

This is a complete solution. A repo unit could be set to:

* Anonymous read (non-signed-in user)
* Everyone read (signed-in user)
* Everyone write (wiki-only)
2025-03-29 13:26:41 +08:00
wxiaoguangandGitHub 0d2607a303 Add anonymous access support for private repositories (backend) (#33257)
Follow #33127

This PR add backend logic and test for "anonymous access", it shares the
same logic as "everyone access", so not too much change.

By the way, split `SettingsPost` into small functions to make it easier
to make frontend-related changes in the future.

Next PR will add frontend support for "anonymous access"
2025-03-28 22:42:29 +08:00
894821d522 Fix git client accessing renamed repo (#34034)
Fix #28460

The `reqGitSignIn` is just copied-pasted code (from githtttp.go) and
causes the regression bug.

Co-authored-by: Giteabot <teabot@gitea.io>
2025-03-28 07:28:58 +08:00
wxiaoguangandGitHub 96e7369515 Try to fix check-attr bug (#34029) 2025-03-27 05:07:17 +00:00
wxiaoguangandGitHub c7b85f7070 Fix dropdown module accessing (#34026)
Follow #34014.
2025-03-26 16:01:43 +00:00
wxiaoguangandGitHub d70be9d0fe Polyfill WeakRef (#34025)
Fix #33407
2025-03-26 23:56:25 +08:00
wxiaoguangandGitHub d28a7f9fea Fix dropdown delegating and some UI problems (#34014)
The old logic is incomplete. See the comment for the improved logic.

Fix #34011

And more fixes:

1. use empty "alt" for images, otherwise the width is not right when the
image fails to load
2. remove the "dropdown icon" patch, because it has been clearly done in
"dropdown.js" now
3. remove the "dropdown filtered item" patch, added a clear callback,
and improve the logic
4. fix global init when a node is removed and added back gain (eg: the
"cherry pick" dialog with a dropdown)
2025-03-26 02:51:22 +00:00
wxiaoguangandGitHub 41c946a66f Prepare common tmpl functions in a middleware (#33957)
Fix the TODO in `routers/web/web.go`, and avoid the unnecessary
`GetActiveStopwatch` SQL query in non-related route handlers.
2025-03-25 06:17:58 +00:00
32258e0f22 Update go mod dependencies (#33988)
blevesearch is skipped because it causes errors

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2025-03-25 05:51:52 +00:00
wxiaoguangandGitHub 51d86adb6d Fix some migration and repo name problems (#33986)
1. Ignore empty inputs in `UnmarshalHandleDoubleEncode`
2. Ignore non-existing `stateEvent.User` in gitlab migration
3. Enable `release` and `wiki` units when they are selected in migration
4. Sanitize repo name for migration and new repo
2025-03-24 20:26:58 -07:00
8745129c9c Fix incorrect code search indexer options (#33992)
Fix #33798

Co-authored-by: Giteabot <teabot@gitea.io>
2025-03-24 17:18:21 +01:00
wxiaoguangandGitHub b1e326d09e Auto expand "New PR" form (#33971)
Follow GitHub's behavior: use `?expand=1` to expand the "New PR" form
2025-03-24 14:28:02 +00:00
wxiaoguangandGitHub e1bba9c1a2 Improve oauth2 error handling (#33969)
Show the callback error to end users, it should be safe.
Fix #33967
2025-03-22 10:15:45 +08:00
wxiaoguangandGitHub 279473f467 Fix oauth2 auth and UI (#33961) 2025-03-21 20:50:39 +08:00
wxiaoguangandGitHub 9d7c02f9f7 Try to figure out attribute checker problem (#33901)
For #31600
2025-03-17 11:59:34 -07:00
wxiaoguangandGitHub fdaf1cca65 Defer captcha script loading (#33919)
Fix #33899
2025-03-17 15:21:04 +00:00
wxiaoguangandGitHub 9d89dfe142 Remove unused or abused styles (#33918)
* `top aligned` => `tw-align-top`
* label list: it was broken, this PR fixes it
* reference link: simplified
* settings/repos: not affected
2025-03-17 22:11:24 +08:00
wxiaoguangandGitHub a0e0a30d23 Make SearchMode have default value and add comments (#33863)
* Make `SearchMode` have default value if it is empty
* Add some comments for the "match" queries
* Fix a copy-paste mistake in `buildMatchQuery` (`db.go`)
* Add missing `q.Analyzer = repoIndexerAnalyzer`, it is in old code,
although I do not see real difference ....
2025-03-14 18:06:31 +00:00
wxiaoguangandGitHub 45c4139134 Fix maven panic when no package exists (#33888)
Fix #33886

Restore the old logic from #16510, which was incorrectly removed by
#33678
2025-03-14 10:35:40 -07:00
wxiaoguangandGitHub 0dfa94edc8 Add old svg class name to git entry icon (#33884)
Fix https://github.com/go-gitea/gitea/pull/33837#discussion_r1995521288
2025-03-14 23:11:29 +08:00
wxiaoguangandGitHub cb6b33c9cd Ignore trivial errors when updating push data (#33864)
Fix #23213
2025-03-14 08:36:39 +00:00
b094f9b75d Improve repo commit view (#33877)
Fix #24623

Major changes:

1. Redirect `/owner/repo/blob/*` requests to `/owner/repo/src/commit/*`
(like GitHub)
2. Add a "view file diff" link (see screenshot below)
3. Refactor "AssertHTMLElement" to generic, now we can accurately assert
existence or number.
4. Add more tests

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
2025-03-14 07:45:11 +00:00
wxiaoguangandGitHub d879ec6d92 Fine tune push mirror UI (#33866) 2025-03-14 00:03:21 +00:00
wxiaoguangandGitHub 8a0f7f0975 Fix markdown render (#33870)
Fix #33869, some code block is moved to make it easier to test.

Added a new test
2025-03-13 12:14:35 -07:00
wxiaoguangandGitHub 403775e74e Improve issue & code search (#33860)
Each "indexer" should provide the "search modes" they support by
themselves. And we need to remove the "fuzzy" search for code.
2025-03-13 11:07:48 +08:00
wxiaoguangandGitHub 3996518ed4 Refactor cache-control (#33861)
And fix #21391
2025-03-13 07:04:50 +08:00