aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Use `querySelector` over alternative DOM methods (#31280)silverwind2024-06-1047-168/+165
| | | | | | | | | | | | | | | | As per https://github.com/go-gitea/gitea/pull/30115#discussion_r1626060164, prefer `querySelector` by enabling [`unicorn/prefer-query-selector`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md) and autofixing all except 10 issues. According to [this](https://old.reddit.com/r/learnjavascript/comments/i0f5o8/performance_of_getelementbyid_vs_queryselector/), querySelector may be faster as well, so it's a win-win. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Remove jQuery `.text()` (#30506)silverwind2024-06-1012-168/+160
| | | | | | | | | Remove and forbid [.text()](https://api.jquery.com/text/). Tested some, but not all functionality, but I think these are pretty safe replacements. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-101-0/+110
|
* Remove sub-path from container registry realm (#31293)wxiaoguang2024-06-095-14/+23
| | | | Container registry requires that the "/v2" must be in the root, so the sub-path in AppURL should be removed
* Fix some URLs whose sub-path is missing (#31289)wxiaoguang2024-06-073-3/+3
| | | Fix #31285
* Fix and clean up `ConfirmModal` (#31283)silverwind2024-06-075-15/+28
| | | | | | | | | | | | | | | | Bug: orange button color was removed in https://github.com/go-gitea/gitea/pull/30475, replaced with red Bug: translation text was not html-escaped Refactor: Replaced as much jQuery as possible, added useful `createElementFromHTML` Refactor: Remove colors checks that don't exist on `.link-action` <img width="381" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/5900bf6a-8a86-4a86-b368-0559cbfea66e"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Enable poetry non-package mode (#31282)silverwind2024-06-072-6/+3
| | | | | | | | [Poetry 1.8.0](https://github.com/python-poetry/poetry/releases/tag/1.8.0) added support for [non-package mode](https://python-poetry.org/docs/basic-usage/#operating-modes), e.g. projects that are not python packages themselves like we are. Make use of that and remove the previous workaround via `--no-root`.
* fixed the dropdown menu for the top New button to expand to the left (#31273)Kerwin Bryant2024-06-061-1/+1
| | | | | | | | | before: ![1717660314025](https://github.com/go-gitea/gitea/assets/3371163/17ae7a48-31c5-4c71-b285-f65d9106bf86) after: ![1717660674763](https://github.com/go-gitea/gitea/assets/3371163/85f847ac-a044-4695-9004-26e6485288c6)
* Optimize repo-list layout to enhance visual experience (#31272)Kerwin Bryant2024-06-072-10/+6
| | | | | | | | | | | | | | | | before: ![1717655078227](https://github.com/go-gitea/gitea/assets/3371163/4d564f96-c2f8-46b1-996f-6cc7abb940ef) ***The problem was that the icon and text were not on a horizontal line, and the horizontal was not centered;*** after: ![1717655094071](https://github.com/go-gitea/gitea/assets/3371163/b11797f6-05f8-486c-b5fd-df89d0cbdcfd) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Allow including `Reviewed-on`/`Reviewed-by` lines for custom merge messages ↵Max Wipfli2024-06-063-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | (#31211) This PR introduces the `ReviewedOn` and `ReviewedBy` variables for the default merge message templates (e.g., `.gitea/default_merge_message/MERGE_TEMPLATE.md`). This allows customizing the default merge messages while retaining these trailers. This also moves the associated logic out of `pull.tmpl` into the relevant Go function. This is a first contribution towards #11077. --- For illustration, this allows to recreate the "default default" merge message with the following template: ``` .gitea/default_merge_message/MERGE_TEMPLATE.md Merge pull request '${PullRequestTitle}' (${PullRequestReference}) from ${HeadBranch} into ${BaseBranch} ${ReviewedOn} ${ReviewedBy} ```
* Add `MAX_ROWS` option for CSV rendering (#30268)Henrique Pimentel2024-06-064-69/+41
| | | | | | | | | | | | | | | | | | | This solution implements a new config variable MAX_ROWS, which corresponds to the “Maximum allowed rows to render CSV files. (0 for no limit)” and rewrites the Render function for CSV files in markup module. Now the render function only reads the file once, having MAX_FILE_SIZE+1 as a reader limit and MAX_ROWS as a row limit. When the file is larger than MAX_FILE_SIZE or has more rows than MAX_ROWS, it only renders until the limit, and displays a user-friendly warning informing that the rendered data is not complete, in the user's language. --- Previously, when a CSV file was larger than the limit, the render function lost its function to render the code. There were also multiple reads to the file, in order to determine its size and render or pre-render. The warning: ![image](https://s3.amazonaws.com/i.snag.gy/vcKh90.jpg)
* Update `golang.org/x/net` (#31260)silverwind2024-06-062-22/+23
| | | | Result of `go get -u golang.org/x/net && make tidy`. ~~Fixes https://pkg.go.dev/vuln/GO-2024-2887.~~
* Add replacement module for `mholt/archiver` (#31267)silverwind2024-06-062-2/+5
| | | | | | | | | | | | Switch to this fork tag: https://github.com/anchore/archiver/releases/tag/v3.5.2 which includes https://github.com/anchore/archiver/commit/82ca88a2eb24d418c30bf960ef071b0bbec04631. Ref: https://pkg.go.dev/vuln/GO-2024-2698 Ref: https://github.com/advisories/GHSA-rhh4-rh7c-7r5v --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix Activity Page Contributors dropdown (#31264)wxiaoguang2024-06-064-17/+12
| | | Fix #31261
* Optimize runner-tags layout to enhance visual experience (#31258)Kerwin Bryant2024-06-051-1/+1
| | | ![image](https://github.com/go-gitea/gitea/assets/3371163/b8199005-94f2-45be-8ca9-4fa1b3f221b2)
* fix: allow actions artifacts storage migration to complete succesfully (#31251)Rowan Bohde2024-06-051-2/+16
| | | | | | | | | | | | | | | | | | | | | Change the copy to use `ActionsArtifact.StoragePath` instead of the `ArtifactPath`. Skip artifacts that are expired, and don't error if the file to copy does not exist. --- When trying to migrate actions artifact storage from local to MinIO, we encountered errors that prevented the process from completing successfully: * The migration tries to copy the files using the per-run `ArtifactPath`, instead of the unique `StoragePath`. * Artifacts that have been marked expired and had their files deleted would throw an error * Artifacts that are pending, but don't have a file uploaded yet will throw an error. This PR addresses these cases, and allow the process to complete successfully.
* Add `lint-go-gopls` (#30729)silverwind2024-06-057-10/+41
| | | | | | | | | | | | | | | | | | | | | | Uses `gopls check <files>` as a linter. Tested locally and brings up 149 errors currently for me. I don't think I want to fix them in this PR, but I would like at least to get this analysis running on CI. List of errors: ``` modules/indexer/code/indexer.go:181:11: impossible condition: nil != nil routers/private/hook_post_receive.go:120:15: tautological condition: nil == nil services/auth/source/oauth2/providers.go:185:9: tautological condition: nil == nil services/convert/issue.go:216:11: tautological condition: non-nil != nil tests/integration/git_test.go:332:9: impossible condition: nil != nil services/migrations/migrate.go:179:24-43: unused parameter: ctx services/repository/transfer.go:288:48-69: unused parameter: doer tests/integration/api_repo_tags_test.go:75:41-61: unused parameter: session tests/integration/git_test.go:696:64-74: unused parameter: baseBranch tests/integration/gpg_git_test.go:265:27-39: unused parameter: t tests/integration/gpg_git_test.go:284:23-29: unused parameter: tmpDir tests/integration/gpg_git_test.go:284:31-35: unused parameter: name tests/integration/gpg_git_test.go:284:37-42: unused parameter: email ```
* Make blockquote attention recognize more syntaxes (#31240)wxiaoguang2024-06-043-19/+86
| | | Fix #31214
* Fix admin oauth2 custom URL settings (#31246)wxiaoguang2024-06-041-12/+17
| | | Fix #31244
* Replace `gt-word-break` with `tw-break-anywhere` (#31183)silverwind2024-06-0416-23/+18
| | | | | `overflow-wrap: anywhere` is a superior alternative to `word-wrap: break-word` and we were already setting it in the class. I tested a few cases, all look good.
* Make pasted "img" tag has the same behavior as markdown image (#31235)wxiaoguang2024-06-045-59/+79
| | | | | | | Fix #31230 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove .segment from .project-column (#31204)silverwind2024-06-042-1/+2
| | | | | | Using `.segment` on the project columns is a major abuse of that class, so remove it and instead set the border-radius directly on it. Fixes: https://github.com/go-gitea/gitea/issues/31129
* Fix overflow on push notification (#31179)silverwind2024-06-041-2/+2
| | | | | | Fixes: https://github.com/go-gitea/gitea/issues/30063 <img width="1301" alt="Screenshot 2024-05-30 at 14 43 24" src="https://github.com/go-gitea/gitea/assets/115237/00443af0-088d-49a5-be9e-8c9adcc2c01d">
* Fix NuGet Package API for $filter with Id equality (#31188)Thomas Desveaux2024-06-042-35/+115
| | | | | | | | | | | | | | | | Fixes issue when running `choco info pkgname` where `pkgname` is also a substring of another package Id. Relates to #31168 --- This might fix the issue linked, but I'd like to test it with more choco commands before closing the issue in case I find other problems if that's ok. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix overflow on notifications (#31178)silverwind2024-06-041-2/+2
| | | | | | Fixes https://github.com/go-gitea/gitea/issues/31170. <img width="1312" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/627711ed-93ca-4be6-b958-10d673ae9517">
* Update chroma to v2.14.0 (#31177)silverwind2024-06-042-5/+5
| | | | | https://github.com/alecthomas/chroma/releases/tag/v2.14.0 Tested it with a typescript file.
* Update air package path (#31233)yp053272024-06-041-1/+1
|
* Bump `@github/relative-time-element` to v4.4.1 (#31232)Yarden Shoham2024-06-042-5/+5
| | | | | I tested and all timestamps work as before. Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Add option for mailer to override mail headers (#27860)65432024-06-035-10/+128
| | | | | | Add option to override headers of mails, gitea send out --- *Sponsored by Kithara Software GmbH*
* Move custom `tw-` helpers to tailwind plugin (#31184)silverwind2024-06-032-16/+23
| | | | | | | | Move the previous custom `tw-` classes to be defined in a tailwind plugin. I think it's cleaner that way and I also verified double-class works as expected: <img width="299" alt="Screenshot 2024-05-30 at 19 06 24" src="https://github.com/go-gitea/gitea/assets/115237/003cbc76-2013-46a0-9e27-63023fa7c7a4">
* Remove unnecessary inline style for tab-size (#31224)silverwind2024-06-032-1/+2
| | | | Move the rule to the parent node. `tab-size` is inherited so will work just as before.
* Document possible action types for the user activity feed API (#31196)Kemal Zebari2024-06-032-2/+35
| | | | | | Resolves #31131. It uses the the go-swagger `enum` property to document the activity action types.
* Remove sqlite-viewer and using database client (#31223)yp053272024-06-032-3/+4
| | | | | | | | | | | sqlite-viewer can not edit sqlite. database client can connect to almost all common databases, which is very useful I think. Of cause, it can edit sqlite. https://marketplace.visualstudio.com/items?itemName=cweijan.vscode-database-client2 And for using sqlite, sqlite3 is required. So also added a new feature: https://github.com/warrenbuckley/codespace-features found from: https://containers.dev/features
* Update golangci-lint to v1.59.0 (#31221)silverwind2024-06-032-4/+4
| | | | | One new error regarding `fmt.Fscanf` error return in `gitdiff.go` but I'm not touching that further right now as handling the error would introduce a behaviour difference.
* [skip ci] Updated licenses and gitignoresGiteaBot2024-06-0315-51/+122
|
* Fix overflow in issue card (#31203)silverwind2024-06-031-1/+1
| | | | | | | | | | Before: <img width="373" alt="Screenshot 2024-06-01 at 01 31 26" src="https://github.com/go-gitea/gitea/assets/115237/82a210f2-c82e-4b7e-ac43-e70e46fa1186"> After: <img width="376" alt="Screenshot 2024-06-01 at 01 31 32" src="https://github.com/go-gitea/gitea/assets/115237/82d1b9f7-4fad-47bd-948a-04e1e7e006e6">
* Fix agit checkout command line hint & fix ShowMergeInstructions checking ↵Lunny Xiao2024-06-032-9/+10
| | | | (#31219)
* Fix the possible migration failure on 286 with postgres 16 (#31209)Lunny Xiao2024-06-021-1/+1
| | | Try to fix #31205
* Only update poster in issue/comment list if it has been loaded (#31216)Max Wipfli2024-06-022-2/+6
| | | | | | Previously, all posters were updated, even if they were not part of posterMaps. In that case, a ghost user was erroneously inserted. Fixes #31213.
* Return an empty string when a repo has no avatar in the repo API (#31187)Kemal Zebari2024-06-011-2/+8
| | | | | | | | | | | | | Resolves #31167. https://github.com/go-gitea/gitea/pull/30885 changed the behavior of `repo.AvatarLink()` where it can now take the empty string and append it to the app data URL. This does not point to a valid avatar image URL, and, as the issue mentions, previous Gitea versions returned the empty string. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Split sanitizer functions and fine-tune some tests (#31192)wxiaoguang2024-05-318-245/+270
|
* Performance improvements for pull request list API (#30490)Lunny Xiao2024-05-3112-122/+235
| | | | | | | | Fix #30483 --------- Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix URL In Gitea Actions Badge Docs (#31191)TheBrokenRail2024-05-311-1/+1
| | | | | | | | | | | | | | | | The example URL given in the documentation leads to a 404. For instance, `https://your-gitea-instance.com/{owner}/{repo}/actions/workflows/{workflow_file}?branch={branch}&event={event}` translates to `https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/actions/workflows/build.yml`, which is a 404. I had to check the [linked GitHub docs](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge) to learn that you have to add `/badge.svg` to the URL. Example: https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/actions/workflows/build.yml/badge.svg
* Drop `IDOrderDesc` for listing Actions task and always order by `id DESC` ↵Jason Song2024-05-312-8/+3
| | | | | | | (#31150) Close #31066 Just follow what `FindRunOptions` and `FindScheduleOptions` do.
* Fix branch order (#31174)Lunny Xiao2024-05-311-8/+4
| | | | | | Fix #31172 The original order or the default order should not be ignored even if we have an is_deleted order.
* Azure blob storage support (#30995)Lunny Xiao2024-05-3031-56/+780
| | | | | | | | | | | | | | | | | | | | | | | | | This PR implemented object storages(LFS/Packages/Attachments and etc.) for Azure Blob Storage. It depends on azure official golang SDK and can support both the azure blob storage cloud service and azurite mock server. Replace #25458 Fix #22527 - [x] CI Tests - [x] integration test, MSSQL integration tests will now based on azureblob - [x] unit test - [x] CLI Migrate Storage - [x] Documentation for configuration added ------ TODO (other PRs): - [ ] Improve performance of `blob download`. --------- Co-authored-by: yp05327 <576951401@qq.com>
* Use repo as of renderctx's member rather than a repoPath on metas (#29222)Lunny Xiao2024-05-3019-48/+135
| | | | Use a `gitrepo.Repository` in the markup's RenderContext but not store the repository's path.
* Ignore FindRecentlyPushedNewBranches err (#31164)wxiaoguang2024-05-301-2/+1
| | | Fix #31163
* [skip ci] Updated translations via CrowdinGiteaBot2024-05-3025-50/+5
|
* Fix markup preview (#31158)wxiaoguang2024-05-291-2/+3
| | | | | | | Fix #31157 After: ![image](https://github.com/go-gitea/gitea/assets/2114189/4d918cce-cd0d-4601-9c81-4b32df1b0b38)