aboutsummaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Remove sub-path from container registry realm (#31293)wxiaoguang2024-06-092-7/+4
| | | | Container registry requires that the "/v2" must be in the root, so the sub-path in AppURL should be removed
* Add `MAX_ROWS` option for CSV rendering (#30268)Henrique Pimentel2024-06-063-69/+38
| | | | | | | | | | | | | | | | | | | 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)
* Make blockquote attention recognize more syntaxes (#31240)wxiaoguang2024-06-043-19/+86
| | | Fix #31214
* Make pasted "img" tag has the same behavior as markdown image (#31235)wxiaoguang2024-06-044-58/+74
| | | | | | | Fix #31230 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add option for mailer to override mail headers (#27860)65432024-06-031-8/+15
| | | | | | Add option to override headers of mails, gitea send out --- *Sponsored by Kithara Software GmbH*
* Document possible action types for the user activity feed API (#31196)Kemal Zebari2024-06-031-2/+5
| | | | | | Resolves #31131. It uses the the go-swagger `enum` property to document the activity action types.
* Split sanitizer functions and fine-tune some tests (#31192)wxiaoguang2024-05-318-245/+270
|
* Azure blob storage support (#30995)Lunny Xiao2024-05-308-13/+593
| | | | | | | | | | | | | | | | | | | | | | | | | 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-307-39/+107
| | | | Use a `gitrepo.Repository` in the markup's RenderContext but not store the repository's path.
* Add topics for repository API (#31127)Lunny Xiao2024-05-281-0/+1
| | | Fix ##31100
* Fix missing memcache import (#31105)wxiaoguang2024-05-271-0/+2
| | | Fix #31102
* feat: add support for a credentials chain for minio access (#31051)Rowan Bohde2024-05-274-1/+149
| | | | | | | | | | | | | We wanted to be able to use the IAM role provided by the EC2 instance metadata in order to access S3 via the Minio configuration. To do this, a new credentials chain is added that will check the following locations for credentials when an access key is not provided. In priority order, they are: 1. MINIO_ prefixed environment variables 2. AWS_ prefixed environment variables 3. a minio credentials file 4. an aws credentials file 5. EC2 instance metadata
* Rename project board -> column to make the UI less confusing (#30170)Lunny Xiao2024-05-2710-30/+30
| | | | | | | | | | | | | This PR split the `Board` into two parts. One is the struct has been renamed to `Column` and the second we have a `Template Type`. But to make it easier to review, this PR will not change the database schemas, they are just renames. The database schema changes could be in future PRs. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: yp05327 <576951401@qq.com>
* Make gitea webhooks openproject compatible (#28435)André Rosenhammer2024-05-263-0/+9
| | | | | | | This PR adds some fields to the gitea webhook payload that [openproject](https://www.openproject.org/) expects to exists in order to process the webhooks. These fields do exists in Github's webhook payload so adding them makes Gitea's native webhook more compatible towards Github's.
* Support setting the `default` attribute of the issue template dropdown field ↵Zettat1232024-05-232-0/+117
| | | | | | | | | | (#31045) Fix #31044 According to [GitHub issue template documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-for-dropdown), the `default` attribute can be used to specify the preselected option for a dropdown field.
* Refactor sha1 and time-limited code (#31023)wxiaoguang2024-05-204-87/+116
| | | | | | | Remove "EncodeSha1", it shouldn't be used as a general purpose hasher (just like we have removed "EncodeMD5" in #28622) Rewrite the "time-limited code" related code and write better tests, the old code doesn't seem quite right.
* Fix project column title overflow (#31011)wxiaoguang2024-05-201-4/+5
| | | | | | By the way: * Re-format the "color.go" to Golang code style * Remove unused `overflow-y: scroll;` from `.project-column` because there is `overflow: visible`
* Improve reverse proxy documents and clarify the AppURL guessing behavior ↵wxiaoguang2024-05-192-17/+26
| | | | | | | | | | | | (#31003) Fix #31002 1. Mention Make sure `Host` and `X-Fowarded-Proto` headers are correctly passed to Gitea 2. Clarify the basic requirements and move the "general configuration" to the top 3. Add a comment for the "container registry" 4. Use 1.21 behavior if the reverse proxy is not correctly configured Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Simplify mirror repository API logic (#30963)wxiaoguang2024-05-171-1/+1
| | | Fix #30921
* Supports forced use of S3 virtual-hosted style (#30969)dicarne2024-05-152-4/+18
| | | | | Add a configuration item to enable S3 virtual-hosted style (V2) to solve the problem caused by some S3 service providers not supporting path style (V1).
* Always load or generate oauth2 jwt secret (#30942)wxiaoguang2024-05-142-12/+33
| | | Fix #30923
* Support using label names when changing issue labels (#30943)Zettat1232024-05-131-2/+3
| | | | | | | | | | | | Resolve #30917 Make the APIs for adding labels and replacing labels support both label IDs and label names so the [`actions/labeler`](https://github.com/actions/labeler) action can work in Gitea. <img width="600px" src="https://github.com/go-gitea/gitea/assets/15528715/7835c771-f637-4c57-9ce5-e4fbf56fa0d3" />
* Refactor AppURL usage (#30885)wxiaoguang2024-05-073-9/+112
| | | | | | | | Fix #30883 Fix #29591 --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Move database operations of merging a pull request to post receive hook and ↵Lunny Xiao2024-05-072-0/+10
| | | | | | | | | | | | | | | | | | | | add a transaction (#30805) Merging PR may fail because of various problems. The pull request may have a dirty state because there is no transaction when merging a pull request. ref https://github.com/go-gitea/gitea/pull/25741#issuecomment-2074126393 This PR moves all database update operations to post-receive handler for merging a pull request and having a database transaction. That means if database operations fail, then the git merging will fail, the git client will get a fail result. There are already many tests for pull request merging, so we don't need to add a new one. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make "sync branch" also sync object format and add tests (#30878)wxiaoguang2024-05-063-27/+41
|
* Make sure git version&feature are always prepared (#30877)wxiaoguang2024-05-0613-125/+94
| | | Otherwise there would be more similar issues like #29287
* Fix markdown URL parsing for commit ID (#30812)wxiaoguang2024-05-044-74/+115
|
* Improve grep search (#30843)wxiaoguang2024-05-034-7/+59
| | | | Reduce the context line number to 1, make "git grep" search respect the include/exclude patter, and fix #30785
* Fix no edit history after editing issue's title and content (#30814)yp053272024-05-031-1/+1
| | | | | Fix #30807 reuse functions in services
* Remove external API calls in `TestPassword` (#30716)silverwind2024-05-021-76/+23
| | | | | | | | | | | The test had a dependency on `https://api.pwnedpasswords.com` which caused many failures on CI recently: ``` --- FAIL: TestPassword (2.37s) pwn_test.go:41: Get "https://api.pwnedpasswords.com/range/e6b6a": context deadline exceeded (Client.Timeout exceeded while awaiting headers) FAIL coverage: 82.9% of statements ```
* Skip gzip for some well-known compressed file types (#30796)wxiaoguang2024-05-021-0/+8
| | | Co-authored-by: silverwind <me@silverwind.io>
* Fix markdown rendering when mentioning users (#30795)wxiaoguang2024-05-024-10/+14
|
* Fix bleve fuzziness (#30799)wxiaoguang2024-05-013-9/+15
| | | | Fix #30797 Fix #30317
* Add API endpoints for getting action jobs status (#26673)Chester2024-05-011-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sample of response, it is similar to Github actions ref https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository ``` json { "workflow_runs": [ { "id": 3, "name": "Explore-Gitea-Actions", "head_branch": "main", "head_sha": "6d8d29a9f7a01ded8f8aeb64341cb31ee1ab5f19", "run_number": 3, "event": "push", "display_title": "More job", "status": "success", "workflow_id": "demo2.yaml", "url": "/chester/test/actions/runs/3", "created_at": "2023-08-22T13:41:33-04:00", "updated_at": "2023-08-22T13:41:37-04:00", "run_started_at": "2023-08-22T13:41:33-04:00" }, { "id": 2, "name": "Explore-Gitea-Actions", "head_branch": "main", "head_sha": "6d8d29a9f7a01ded8f8aeb64341cb31ee1ab5f19", "run_number": 2, "event": "push", "display_title": "More job", "status": "success", "workflow_id": "demo.yaml", "url": "/chester/test/actions/runs/2", "created_at": "2023-08-22T13:41:30-04:00", "updated_at": "2023-08-22T13:41:33-04:00", "run_started_at": "2023-08-22T13:41:30-04:00" }, { "id": 1, "name": "Explore-Gitea-Actions", "head_branch": "main", "head_sha": "e5369ab054cae79899ba36e45ee82811a6e0acd5", "run_number": 1, "event": "push", "display_title": "Add job", "status": "failure", "workflow_id": "demo.yaml", "url": "/chester/test/actions/runs/1", "created_at": "2023-08-22T13:15:21-04:00", "updated_at": "2023-08-22T13:18:10-04:00", "run_started_at": "2023-08-22T13:15:21-04:00" } ], "total_count": 3 } ``` --------- Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
* Fix tautological conditions (#30735)silverwind2024-04-301-6/+0
| | | | | | | As discovered by https://github.com/go-gitea/gitea/pull/30729. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix issue label rendering in the issue popup (#30763)wxiaoguang2024-04-301-22/+17
|
* Resolve lint for unused parameter and unnecessary type arguments (#30750)Chongyi Zheng2024-04-2918-62/+45
| | | | | | | | | | Resolve all cases for `unused parameter` and `unnecessary type arguments` Related: #30729 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Add support for npm bundleDependencies (#30751)Micash2024-04-292-0/+3
|
* Replace deprecated `math/rand` functions (#30733)v1.23.0-devChongyi Zheng2024-04-271-11/+5
| | | | | | | | | | | | Suggested by logs in #30729 - Remove `math/rand.Seed` `rand.Seed is deprecated: As of Go 1.20 there is no reason to call Seed with a random value.` - Replace `math/rand.Read` `rand.Read is deprecated: For almost all use cases, [crypto/rand.Read] is more appropriate.` - Replace `math/rand` with `math/rand/v2`, which is available since Go 1.22
* Add some tests to clarify the "must-change-password" behavior (#30693)wxiaoguang2024-04-271-1/+3
| | | | | | | | | | Follow #30472: When a user is created by command line `./gitea admin user create`: Old behavior before #30472: the first user (admin or non-admin) doesn't need to change password. Revert to the old behavior before #30472
* Update misspell to 0.5.1 and add `misspellings.csv` (#30573)silverwind2024-04-273-6/+6
| | | | | | Misspell 0.5.0 supports passing a csv file to extend the list of misspellings, so I added some common ones from the codebase. There is at least one typo in a API response so we need to decided whether to revert that and then likely remove the dict entry.
* Fix incorrect object id hash function (#30708)wxiaoguang2024-04-263-15/+8
| | | | | | | | | | | | | Great thanks to @oliverpool for figuring out the problem and proposing a fix. Regression of #28138 Incorrect hash causes the user's LFS files get all deleted when running `doctor fix all` (by the way, remove unused/non-standard comments) Co-authored-by: Giteabot <teabot@gitea.io>
* Deduplicate lfs common code (#30704)wxiaoguang2024-04-263-48/+42
|
* Improve oauth2 client "preferred username field" logic and the error ↵wxiaoguang2024-04-253-11/+52
| | | | | | | | | | | | | handling (#30622) Follow #30454 And fix #24957 When using "preferred_username", if no such field, `extractUserNameFromOAuth2` (old `getUserName`) shouldn't return an error. All other USERNAME options do not return such error. And fine tune some logic and error messages, make code more stable and more friendly to end users.
* Initial support for colorblindness-friendly themes (#30625)wxiaoguang2024-04-245-12/+17
| | | | | | | Initial support for #25680 This PR only adds some simple styles from GitHub, it is big enough and it focuses on adding the necessary framework-level supports. More styles could be fine-tuned later.
* Perform Newest sort type correctly when sorting issues (#30644)Kemal Zebari2024-04-231-2/+2
| | | | | | | | | | | | | Should resolve #30642. Before this commit, we were treating an empty `?sort=` query parameter as the correct sorting type (which is to sort issues in descending order by their created UNIX time). But when we perform `sort=latest`, we did not include this as a type so we would sort by the most recently updated when reaching the `default` switch statement block. This commit fixes this by considering the empty string, "latest", and just any other string that is not mentioned in the switch statement as sorting by newest.
* Fix queue test (#30646)wxiaoguang2024-04-223-19/+34
| | | | | | | | Fix #30643 The old test code is not stable due to the data-race described in the TODO added at that time. Make it stable, and remove a debug-only field from old test code.
* Enable more `revive` linter rules (#30608)silverwind2024-04-2217-51/+37
| | | | | | | | | | | Noteable additions: - `redefines-builtin-id` forbid variable names that shadow go builtins - `empty-lines` remove unnecessary empty lines that `gofumpt` does not remove for some reason - `superfluous-else` eliminate more superfluous `else` branches Rules are also sorted alphabetically and I cleaned up various parts of `.golangci.yml`.
* Use maintained gziphandler (#30592)Lunny Xiao2024-04-211-7/+13
| | | | | | | | Replace #27894 --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix commit file status parser (#30602)wxiaoguang2024-04-191-1/+1
| | | Try to fix #30492