summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Supplement and Improvement for #32558 (#32585)Kerwin Bryant2024-11-212-2/+4
| | | | Thank you for @wxiaoguang's reminders and suggestions: https://github.com/go-gitea/gitea/pull/32558#discussion_r1849972913
* make search box in issue sidebar dropdown list always show when scrolling ↵a10121127962024-11-216-72/+88
| | | | | | | | | (#32576) as title, replace #31597 after #32460 --------- Signed-off-by: a1012112796 <1012112796@qq.com>
* Fix submodule parsing (#32571)Lunny Xiao2024-11-2020-360/+492
| | | | | | | Fix #32568, parse `.gitmodules` correctly --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* allow the actions user to login via the jwt token (#32527)Rowan Bohde2024-11-204-3/+105
| | | | | | | | | | | | | | | | We have some actions that leverage the Gitea API that began receiving 401 errors, with a message that the user was not found. These actions use the `ACTIONS_RUNTIME_TOKEN` env var in the actions job to authenticate with the Gitea API. The format of this env var in actions jobs changed with go-gitea/gitea/pull/28885 to be a JWT (with a corresponding update to `act_runner`) Since it was a JWT, the OAuth parsing logic attempted to parse it as an OAuth token, and would return user not found, instead of falling back to look up the running task and assigning it to the actions user. Make ACTIONS_RUNTIME_TOKEN in action runners could be used, attempting to parse Oauth JWTs. The code to parse potential old `ACTION_RUNTIME_TOKEN` was kept in case someone is running an older version of act_runner that doesn't support the Actions JWT.
* Support HTTP POST requests to `/userinfo`, aligning to OpenID Core ↵Marcell Mars2024-11-201-1/+1
| | | | | | | | | specification (#32578) This PR adds support for the HTTP POST requests to `/userinfo` endpoint. While the OpenID Core specification says both are supported and recommends using HTTP GET. ref: https://openid.net/specs/openid-connect-core-1_0.html#UserInfo
* Remove duplicate empty repo check in delete branch API (#32569)Kemal Zebari2024-11-201-5/+0
| | | | | | Found while working on #32433. This branch will never be executed because we have would have already made the same check a couple lines above.
* Optimize installation-page experience (#32558)Kerwin Bryant2024-11-202-1/+2
| | | | | | ![3000-gogitea-gitea-kiagpwhqbx1 ws-us116 gitpod io_ (1)](https://github.com/user-attachments/assets/7f9ff835-7122-420e-83a9-218a1b9c7030) Highlight the path of the configuration file with a label-style emphasis and provide a quick copy button.
* Remove unnecessary code (#32560)Lunny Xiao2024-11-191-7/+0
| | | | PushMirrors only be used in the repository setting page. So it should not be loaded on every repository page.
* Fix a compilation error in the Gitpod environment (#32559)Kerwin Bryant2024-11-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When opening the latest code in **Gitpod** and running `make lint-backend`, the following error occurs: ```bash gitpod /workspace/gitea (main) $ make lint-backend go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3 run # internal/profilerecord compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/goarch compile: version "go1.23.1" does not match go tool version "go1.22.9" # unicode/utf8 compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/coverage/rtcov compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/byteorder compile: version "go1.23.1" does not match go tool version "go1.22.9" # cmp compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/itoa compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/race compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/goos compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/unsafeheader compile: version "go1.23.1" does not match go tool version "go1.22.9" # unicode compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/godebugs compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/asan compile: version "go1.23.1" does not match go tool version "go1.22.9" # math/bits compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/goexperiment compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/msan compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/runtime/atomic compile: version "go1.23.1" does not match go tool version "go1.22.9" # sync/atomic compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/runtime/syscall compile: version "go1.23.1" does not match go tool version "go1.22.9" # crypto/internal/alias compile: version "go1.23.1" does not match go tool version "go1.22.9" # encoding compile: version "go1.23.1" does not match go tool version "go1.22.9" # log/internal compile: version "go1.23.1" does not match go tool version "go1.22.9" # vendor/golang.org/x/crypto/cryptobyte/asn1 compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/golangci/golangci-lint/pkg/exitcodes compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/cpu compile: version "go1.23.1" does not match go tool version "go1.22.9" # unicode/utf16 compile: version "go1.23.1" does not match go tool version "go1.22.9" # container/list compile: version "go1.23.1" does not match go tool version "go1.22.9" # crypto/subtle compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/goversion compile: version "go1.23.1" does not match go tool version "go1.22.9" # golang.org/x/exp/maps compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/ccojocar/zxcvbn-go/match compile: version "go1.23.1" does not match go tool version "go1.22.9" # golang.org/x/exp/constraints compile: version "go1.23.1" does not match go tool version "go1.22.9" # golang.org/x/tools/internal/packagesinternal compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/quasilyte/go-ruleguard/dsl/types compile: version "go1.23.1" does not match go tool version "go1.22.9" # vendor/golang.org/x/crypto/internal/alias compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/nettrace compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/google/go-cmp/cmp/internal/flags compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/gobwas/glob/util/runes compile: version "go1.23.1" does not match go tool version "go1.22.9" # internal/platform compile: version "go1.23.1" does not match go tool version "go1.22.9" # crypto/internal/boring/sig compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/quasilyte/gogrep/internal/stdinfo compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/daixiang0/gci/pkg/utils compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/quasilyte/stdinfo compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/Antonboom/testifylint/internal/testify compile: version "go1.23.1" does not match go tool version "go1.22.9" # hash/maphash compile: version "go1.23.1" does not match go tool version "go1.22.9" # github.com/nunnatsa/ginkgolinter/version compile: version "go1.23.1" does not match go tool version "go1.22.9" # google.golang.org/protobuf/internal/flags compile: version "go1.23.1" does not match go tool version "go1.22.9" make: *** [Makefile:413: lint-go] Error 1 ```
* Use user.FullName in Oauth2 id_token response (#32542)Baltazár Radics2024-11-183-22/+3
| | | | This makes `/login/oauth/authorize` behave the same way as the `/login/oauth/userinfo` endpoint.
* Fix some places which doesn't repsect org full name setting (#32243)Lunny Xiao2024-11-183-3/+3
| | | Partially fix #31345
* Refactor push mirror find and add check for updating push mirror (#32539)Lunny Xiao2024-11-188-108/+142
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor markup render system (#32533)wxiaoguang2024-11-1842-507/+567
| | | | | Remove unmaintainable sanitizer rules. No need to add special "class" regexp rules anymore, use RenderInternal.SafeAttr instead, more details (and examples) are in the tests
* Refactor find forks and fix possible bugs that weak permissions check (#32528)Lunny Xiao2024-11-188-41/+202
| | | | | | | | | | | - Move models/GetForks to services/FindForks - Add doer as a parameter of FindForks to check permissions - Slight performance optimization for get forks API with batch loading of repository units - Add tests for forking repository to organizations --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use better name for userinfo structure (#32544)Lunny Xiao2024-11-181-11/+11
|
* Fix basic auth with webauthn (#32531)Lunny Xiao2024-11-162-0/+63
|
* Fix and refactor markdown rendering (#32522)wxiaoguang2024-11-1627-278/+289
|
* Fix large image overflow in comment page (#31740)charles2024-11-152-1/+2
| | | | | | | | | | | | | | | | | | | | | | Close #31709 52px is calculate by avatar size in templates\repo\issue\view_content\comments.tmpl ```html <img src="{{.Poster.AvatarLink $.Context}}" width="40" height="40"> ``` + ```css .ui.comments .comment > .avatar ~ .content { margin-left: 12px; } ``` ![圖片](https://github.com/user-attachments/assets/bf15f4d4-1574-46f6-9f5e-1fbdbf1a98b0) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve testing and try to fix MySQL hanging (#32515)wxiaoguang2024-11-1515-242/+197
| | | | | | | | | | | | | | | | | | | | By some CI fine tunes (`run tests`), SQLite & MSSQL could complete in about 12~13 minutes (before > 14), MySQL could complete in 18 minutes (before: about 23 or even > 30) Major changes: 1. use tmpfs for MySQL storage 1. run `make test-mysql` instead of `make integration-test-coverage` because the code coverage is not really used at the moment. 1. refactor testlogger to make it more reliable and be able to report stuck stacktrace 1. do not requeue failed items when a queue is being flushed (failed items would keep failing and make flush uncompleted) 1. reduce the file sizes for testing 1. use math ChaCha20 random data instead of crypot/rand (for testing purpose only) 1. no need to `DeleteRepository` in `TestLinguist` 1. other related refactoring to make code easier to maintain
* Fix `recentupdate` sorting bugs (#32505)Zettat1232024-11-152-0/+2
| | | | | | Fix #32499 - Add the missing `recentupdate` to `OrderByFlatMap` - Assign default value(`recentupdate`) to `EXPLORE_PAGING_DEFAULT_SORT`
* Remove transaction for archive download (#32186)Lunny Xiao2024-11-152-26/+19
| | | | | | | Since there is a status column in the database, the transaction is unnecessary when downloading an archive. The transaction is blocking database operations, especially with SQLite. Replace #27563
* Fix oauth2 error handle not return immediately (#32514)Lunny Xiao2024-11-151-0/+2
|
* Fix incorrect project page CSS class (#32510)wxiaoguang2024-11-151-1/+1
| | | Otherwise milestone JS would run on this page and cause errors
* Add avif image file support (#32508)wxiaoguang2024-11-157-25/+81
| | | | | | | | | Most modern browsers support it now ` Update ALLOWED_TYPES #96 ` https://gitea.com/gitea/docs/pulls/96 --------- Co-authored-by: silverwind <me@silverwind.io>
* Reduce integration test overhead (#32475)Rowan Bohde2024-11-14102-456/+95
| | | | | | | | | | | | | In profiling integration tests, I found a couple places where per-test overhead could be reduced: * Avoiding disk IO by synchronizing instead of deleting & copying test Git repository data. This saves ~100ms per test on my machine * When flushing queues in `PrintCurrentTest`, invoke `FlushWithContext` in a parallel. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove jQuery import from some files (#32512)wxiaoguang2024-11-1511-24/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many files do not directly depend on jQuery now. To clarify the usage: use `fomanticQuery` to operate Fomantic components. Then developers could focus on removing the remaining jQuery usages by searching `import $` globally. 21 files now: ``` ./components/RepoBranchTagSelector.vue:3:import $ from 'jquery'; ./features/admin/common.ts:1:import $ from 'jquery'; ./features/admin/emails.ts:1:import $ from 'jquery'; ./features/common-button.ts:1:import $ from 'jquery'; ./features/comp/ComboMarkdownEditor.ts:3:import $ from 'jquery'; (I am working on it, there will be a new PR) ./features/comp/LabelEdit.ts:1:import $ from 'jquery'; ./features/notification.ts:1:import $ from 'jquery'; ./features/org-team.ts:1:import $ from 'jquery'; ./features/repo-code.ts:1:import $ from 'jquery'; ./features/repo-common.ts:1:import $ from 'jquery'; ./features/repo-diff.ts:1:import $ from 'jquery'; ./features/repo-editor.ts:1:import $ from 'jquery'; ./features/repo-issue-content.ts:1:import $ from 'jquery'; ./features/repo-issue-list.ts:1:import $ from 'jquery'; ./features/repo-issue-sidebar.ts:1:import $ from 'jquery'; ./features/repo-issue.ts:1:import $ from 'jquery'; ./features/repo-legacy.ts:1:import $ from 'jquery'; ./features/repo-new.ts:1:import $ from 'jquery'; ./features/repo-projects.ts:1:import $ from 'jquery'; ./features/repo-settings.ts:1:import $ from 'jquery'; ./features/repo-template.ts:1:import $ from 'jquery'; ```
* Trim title before insert/update to database to match the size requirements ↵Lunny Xiao2024-11-148-0/+18
| | | | | of database (#32498) Fix #32489
* Reimplement GetUserOrgsList to make it simple and clear (#32486)Lunny Xiao2024-11-146-172/+205
| | | | | | | | Reimplement GetUserOrgsList and also move some functions and test to org_list file. --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
* Refactor render system (#32492)wxiaoguang2024-11-1432-257/+237
| | | | | | | | | | | | | | | | | | | There were too many patches to the Render system, it's really difficult to make further improvements. This PR clears the legacy problems and fix TODOs. 1. Rename `RenderContext.Type` to `RenderContext.MarkupType` to clarify its usage. 2. Use `ContentMode` to replace `meta["mode"]` and `IsWiki`, to clarify the rendering behaviors. 3. Use "wiki" mode instead of "mode=gfm + wiki=true" 4. Merge `renderByType` and `renderByFile` 5. Add more comments ---- The problem of "mode=document": in many cases it is not set, so many non-comment places use comment's hard line break incorrectly
* Fix nil panic if repo doesn't exist (#32501)wxiaoguang2024-11-141-0/+6
| | | fix #32496
* Bump CI,Flake and Snap to Node 22 (#32487)silverwind2024-11-138-16/+16
| | | | | | | Node 22 is LTS since 2024-10-29. Updated it everywhere. --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com>
* Perf: add extra index to notification table (#32395)BoYanZh2024-11-133-9/+127
| | | | | | | | | | | Index SQL: `CREATE INDEX u_s_uu ON notification(user_id, status, updated_unix);` The naming follows `action.go` in the same dir. I am unsure which version I should add SQL to the migration folder, so I have not modified it. Fix #32390
* Fix LFS route mock, realm, middleware names (#32488)wxiaoguang2024-11-1311-93/+102
| | | | | | | | | | 1. move "internal-lfs" route mock to "common-lfs" 2. fine tune tests 3. fix "realm" strings, according to RFC: https://datatracker.ietf.org/doc/html/rfc2617: * realm = "realm" "=" realm-value * realm-value = quoted-string 4. clarify some names of the middlewares, rename `ignXxx` to `optXxx` to match `reqXxx`, and rename ambiguous `requireSignIn` to `reqGitSignIn`
* Disable Oauth check if oauth disabled (#32368)Lunny Xiao2024-11-122-33/+44
| | | | | | | | Fix #32367 --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update JS and PY dependencies (#32482)silverwind2024-11-124-1098/+688
| | | | | | | | Result of `make update-js update-py`. Fixes: https://github.com/go-gitea/gitea/security/dependabot/80 Fixes: https://github.com/go-gitea/gitea/security/dependabot/81 Tested build and swagger ui.
* Update `github.com/meilisearch/meilisearch-go` (#32484)silverwind2024-11-122-7/+6
| | | | | | Result of `go get -u github.com/meilisearch/meilisearch-go && make tidy`. Fixes: https://github.com/go-gitea/gitea/security/dependabot/78
* Fix test fixtures for user2/lfs.git (#32477)wxiaoguang2024-11-127-25/+14
|
* Limit org member view of restricted users (#32211)65432024-11-124-3/+108
| | | | | | | | | currently restricted users can only see the repos of teams in orgs they are part at. they also should only see the users that are also part at the same team. --- *Sponsored by Kithara Software GmbH*
* cargo registry - respect renamed dependencies (#32430)Albin Hedman2024-11-122-17/+52
| | | | | | | | | rust allows renaming dependencies such as when depending on multiple versions of the same package. This is not supported by gitea as discovered in #31500 . This PR tries to address that. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor LFS SSH and internal routers (#32473)wxiaoguang2024-11-1217-264/+376
| | | | | | | | | | | | | | | | | | Gitea instance keeps reporting a lot of errors like "LFS SSH transfer connection denied, pure SSH protocol is disabled". When starting debugging the problem, there are more problems found. Try to address most of them: * avoid unnecessary server side error logs (change `fail()` to not log them) * figure out the broken tests/user2/lfs.git (added comments) * avoid `migratePushMirrors` failure when a repository doesn't exist (ignore them) * avoid "Authorization" (internal&lfs) header conflicts, remove the tricky "swapAuth" and use "X-Gitea-Internal-Auth" * make internal token comparing constant time (it wasn't a serous problem because in a real world it's nearly impossible to timing-attack the token, but good to fix and backport) * avoid duplicate routers (introduce AddOwnerRepoGitLFSRoutes) * avoid "internal (private)" routes using session/web context (they should use private context) * fix incorrect "path" usages (use "filepath") * fix incorrect mocked route point handling (need to check func nil correctly) * split some tests from "git general tests" to "git misc tests" (to keep "git_general_test.go" simple) Still no correct result for Git LFS SSH tests. So the code is kept there (`tests/integration/git_lfs_ssh_test.go`) and a FIXME explains the details.
* Fix a number of typescript issues (#32459)silverwind2024-11-1114-113/+109
| | | | | | | Fixes 69 typescript errors found in the `admin` and `markup` folders. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Harden runner updateTask and updateLog api (#32462)ChristopherHX2024-11-112-2/+10
| | | Per proposal https://github.com/go-gitea/gitea/issues/32461
* Move some functions from issue.go to standalone files (#32468)Lunny Xiao2024-11-118-3146/+3298
| | | | | | | Just functions move, no code change. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Calculate `PublicOnly` for org membership only once (#32234)65432024-11-117-53/+72
| | | | | | | | | | Refactoring of #32211 this move the PublicOnly() filter calcuation next to the DB querys and let it be decided by the Doer --- *Sponsored by Kithara Software GmbH*
* Add `DEFAULT_MIRROR_REPO_UNITS` and `DEFAULT_TEMPLATE_REPO_UNITS` options ↵Zettat1232024-11-114-1/+58
| | | | | | | | | | | | | (#32416) Resolve #30350 The action unit of mirrors and templates should be disabled by default. This PR adds `DEFAULT_MIRROR_REPO_UNITS` and `DEFAULT_TEMPLATE_REPO_UNITS` options to allow users to specify default units for mirrors and templates. Thanks to @lng2020 for the [idea](https://github.com/go-gitea/gitea/issues/30350#issuecomment-2053942243)
* Add a doctor check to disable the "Actions" unit for mirrors (#32424)Zettat1232024-11-101-0/+70
| | | | | | | | Resolve #32232 Users can disable the "Actions" unit for all mirror repos by running ``` gitea doctor check --run disable-mirror-actions-unit --fix ```
* Refactor sidebar assignee&milestone&project selectors (#32465)wxiaoguang2024-11-1123-829/+504
| | | | | | | | | | | | | | | | | | | Follow #32460 Now the code could be much clearer than before and easier to maintain. A lot of legacy code is removed. Manually tested. This PR is large enough, that fine tunes could be deferred to the future if there is no bug found or design problem. Screenshots: <details> ![image](https://github.com/user-attachments/assets/35f4ab7b-1bc0-4bad-a73c-a4569328303c) </details>
* Refactor sidebar label selector (#32460)wxiaoguang2024-11-1022-232/+275
| | | Introduce `issueSidebarLabelsData` to handle all sidebar labels related data.
* Fix mermaid diagram height when initially hidden (#32457)silverwind2024-11-091-1/+12
| | | | | | | | | | | In a hidden iframe, `document.body.clientHeight` is not reliable. Use `IntersectionObserver` to detect the visibility change and update the height there. Fixes: https://github.com/go-gitea/gitea/issues/32392 <img width="885" alt="image" src="https://github.com/user-attachments/assets/a95ef6aa-27e7-443f-9d06-400ef27919ae">
* Add reviewers selection to new pull request (#32403)Calvin K2024-11-0926-268/+500
| | | | | | | | | | Users could add reviewers when creating new PRs. --------- Co-authored-by: splitt3r <splitt3r@users.noreply.github.com> Co-authored-by: Sebastian Sauer <sauer.sebastian@gmail.com> Co-authored-by: bb-ben <70356237+bboerben@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>