aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Prevent double use of `git cat-file` session. (#29298)KN4CK3R2024-02-212-6/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the reason why #29101 is hard to replicate. Related #29297 Create a repo with a file with minimum size 4097 bytes (I use 10000) and execute the following code: ```go gitRepo, err := gitrepo.OpenRepository(db.DefaultContext, <repo>) assert.NoError(t, err) commit, err := gitRepo.GetCommit(<sha>) assert.NoError(t, err) entry, err := commit.GetTreeEntryByPath(<file>) assert.NoError(t, err) b := entry.Blob() // Create a reader r, err := b.DataAsync() assert.NoError(t, err) defer r.Close() // Create a second reader r2, err := b.DataAsync() assert.NoError(t, err) // Should be no error but is ErrNotExist defer r2.Close() ``` The problem is the check in `CatFileBatch`: https://github.com/go-gitea/gitea/blob/79217ea63c1f77de7ca79813ae45950724e63d02/modules/git/repo_base_nogogit.go#L81-L87 `Buffered() > 0` is used to check if there is a "operation" in progress at the moment. This is a problem because we can't control the internal buffer in the `bufio.Reader`. The code above demonstrates a sequence which initiates an operation for which the code thinks there is no active processing. The second call to `DataAsync()` therefore reuses the existing instances instead of creating a new batch reader.
* Revert #28753 because UI broken. (#29293)Lunny Xiao2024-02-215-13/+23
| | | | Revert #29255 Revert #28753
* Fix error display when merging PRs (#29288)Zettat1232024-02-211-4/+4
| | | | | | | | Partially fix #29071, regression of Modernize merge button #28140 Fix some missing `Redirect` -> `JSONRedirect`. Thanks @yp05327 for the help in https://github.com/go-gitea/gitea/issues/29071#issuecomment-1931261075
* Refactor markup rendering to accept general "protocol:" prefix (#29276)wxiaoguang2024-02-214-32/+38
| | | | | | | | | | | | Follow #29024 Major changes: * refactor validLinksPattern to fullURLPattern and add comments, now it accepts "protocol:" prefix * rename `IsLink*` to `IsFullURL*`, and remove unnecessray "mailto:" check * fix some comments (by the way) * rename EmojiShortCodeRegex -> emojiShortCodeRegex (by the way)
* Remove jQuery from the installation page (#29284)Yarden Shoham2024-02-211-52/+49
| | | | | | | | | | - Switched to plain JavaScript - Tested the installation page functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/286475b3-1919-4d99-b790-def10fa36e66) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Always write proc-receive hook for all git versions (#29287)wxiaoguang2024-02-211-7/+5
|
* Do not use `ctx.Doer` when reset password (#29289)Jason Song2024-02-211-1/+1
| | | | | Fix #29278. Caused by a small typo in #28733
* Update Discord logo (#29285)DC2024-02-212-2/+2
| | | | | | | | | | | | | Fixes #27057 by changing the discord .svg file and running `make svg`. Before: <img width="637" src="https://private-user-images.githubusercontent.com/85847352/267667100-1eaf5d20-b4e9-4736-bb55-7f1da04bbde7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDg0NzAwNDUsIm5iZiI6MTcwODQ2OTc0NSwicGF0aCI6Ii84NTg0NzM1Mi8yNjc2NjcxMDAtMWVhZjVkMjAtYjRlOS00NzM2LWJiNTUtN2YxZGEwNGJiZGU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjIwVDIyNTU0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIwN2Y2ODc5N2MzZDU5NzgzODRhNDIzZWY3MDk3ODhiYmIzZDU4NWVlYmFmZjc2OTIyZjE3MWM4ZDg0ODZjNTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.C6jVQLFPfq4fhGV8wiY9D-P21PUNTDMkX2d2-kU17Ug"> After: <img width="637" src="https://github.com/go-gitea/gitea/assets/106393991/45b197ae-e422-42f4-999e-25dc8f6b7a92">
* [skip ci] Updated translations via CrowdinGiteaBot2024-02-211-21/+212
|
* Remove jQuery .map() and enable eslint rules for it (#29272)silverwind2024-02-213-19/+14
| | | | | | | - Use case in `repo-commit` was tested until the point where the POST request was sent with the same payload. - Use case in `repo-legacy` was tested completely with comment editing. - `jquery/no-fade` was disabled as well to stay in sync with `no-jquery/no-fade`, had no violations.
* Explained where create issue/PR template (#29035) (#29266)65432024-02-201-1/+2
| | | | | | | | | | | | | | | For some user (as me), documentation lack of precision about where to store issue/pr template. I propose an enhancement about this point. With bold exergue and precision about server itself. I've found some user with same interrogation as : https://forum.gitea.com/t/issue-template-directory/3328 --------- Co-authored-by: Km <cam.lafit@azerttyu.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove jQuery from repo wiki creation page (#29271)Yarden Shoham2024-02-204-37/+51
| | | | | | | | | | | | | - Switched to plain JavaScript - Tested the wiki creation form functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/2dfc95fd-40cc-4ffb-9ae6-50f798fddd67) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Do not show delete button when time tracker is disabled (#29257)Zettat1232024-02-201-1/+1
| | | | | | | Fix #29233 The delete button of time logs won't be shown when the time tracker is disabled. ![image](https://github.com/go-gitea/gitea/assets/15528715/5cc4e0c9-d2f9-4b8f-a2f5-fe202b94c191)
* Left align the input labels for the link account page (#29255)Rafael Heard2024-02-191-2/+0
| | | | | | | | | | | | | | | | | | In a previous [PR](https://github.com/go-gitea/gitea/pull/28753) we moved the labels to be above the inputs. The PR ensures that the alignment is also on both tabs of the link account page (`/user/link_account`). Before <img width="1094" alt="before" src="https://github.com/go-gitea/gitea/assets/6152817/ac1e86bd-c4d6-4e45-87d1-87bb8a736149"> After <img width="1094" alt="after" src="https://github.com/go-gitea/gitea/assets/6152817/1b5fc109-f4d2-43ee-b924-0a9e53a0e391"> --------- Co-authored-by: rafh <rafaelheard@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2024-02-201-3/+43
|
* Remove jQuery from the repo migration form (#29229)Yarden Shoham2024-02-191-34/+40
| | | | | | | | | | | | | - Switched to plain JavaScript - Tested the repo migration form functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/3496ec05-48a7-449e-8cdd-f8372ba0d589) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix content size does not match error when uploading lfs file (#29259)vincent2024-02-192-2/+6
| | | | | | | | | | | | | | | | | | | | ![image](https://github.com/go-gitea/gitea/assets/38434877/cd726b4d-4771-4547-8aee-ae4e4b56b1d1) When we update an lfs file by API `api/v1/repos/{owner}/{repo}/contents/{filepath}`, there will show an error ```json { "message": "Put \"http://localhost:9000/gitea/lfs/38/92/05904d6c7bb83fc676513911226f2be25bf1465616bb9b29587100ab1414\": readfrom tcp [::1]:57300->[::1]:9000: content size does not match", "url": "http://localhost:3000/api/swagger" } ``` The reason of this error is https://github.com/go-gitea/gitea/blob/main/services/repository/files/update.go, in this file, the `file.ContentReader` been used twice. So when use `file.ContentReader` in the second time, the `i` of this Reader has been updated to the length of the content. it will return 0 and an `io.EOF` error when we try to read cotent from this Reader.
* Workaround to clean up old reviews on creating a new one (#28554)65432024-02-193-9/+165
| | | | | | | | close #28542 blocks #28544 --- *Sponsored by Kithara Software GmbH*
* Deduplicate translations for contributors graph (#29256)Şahin Akkaya2024-02-193-5/+4
| | | | | | | | | I have implemented three graph pages ([contributors](https://github.com/go-gitea/gitea/pull/27882), [code frequency](https://github.com/go-gitea/gitea/pull/29191) and [recent commits](https://github.com/go-gitea/gitea/pull/29210)) and they have all same page title as the tab name so I decided to use same translations for them. This PR is for contributors graph. Other PR's have their own respective commits.
* Remove DataRaceCheck (#29258)wxiaoguang2024-02-193-16/+0
| | | | | Since #26254, it started using `{{ctx.Locale.Tr ...}}` Now the `ctx` seems stable enough, so the check could be removed.
* Fix c/p error in inline documentation (#29148)Johan Van de Wauw2024-02-191-1/+1
| | | | | | | Fix small copy/paste error in inline documentation --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Show commit status for releases (#29149)KN4CK3R2024-02-194-165/+168
| | | | | Fixes #29082 ![grafik](https://github.com/go-gitea/gitea/assets/1666336/bb2ccde1-ee99-459d-9e74-0fb8ea79e8b3)
* Disallow merge when required checked are missing (#29143)Markus Amshove2024-02-194-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #21892 This PR disallows merging a PR when not all commit status contexts configured in the branch protection are met. Previously, the PR was happy to merge when one commit status was successful and the other contexts weren't reported. Any feedback is welcome, first time Go :-) I'm also not sure if the changes in the template break something else Given the following branch protection: ![branch_protection](https://github.com/go-gitea/gitea/assets/2401875/f871b4e4-138b-435a-b496-f9ad432e3dec) This was shown before the change: ![before](https://github.com/go-gitea/gitea/assets/2401875/60424ff0-ee09-4fa0-856e-64e6e3fb0612) With the change, it is now shown as this: ![after](https://github.com/go-gitea/gitea/assets/2401875/4e464142-efb1-4889-8166-eb3be26c8f3d) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Do not use lower tag names to find releases/tags (#29261)Jason Song2024-02-191-6/+6
| | | | | | | | | | | | | | | | Fix #26090, see https://github.com/go-gitea/gitea/issues/26090#issuecomment-1952013206 Since `TagName` stores the original tag name and `LowerTagName` stores the lower tag name, it doesn't make sense to use lowercase tags as `TagNames` in `FindReleasesOptions`. https://github.com/go-gitea/gitea/blob/5e72526da4e915791f03af056890e16821bde052/services/repository/push.go#L396-L397 While the only other usage looks correct: https://github.com/go-gitea/gitea/blob/5e72526da4e915791f03af056890e16821bde052/routers/web/repo/repo.go#L416
* Downscale pasted PNG images based on metadata (#29123)silverwind2024-02-193-3/+93
| | | | | | | | | | | | | | | | Some images like MacOS screenshots contain [pHYs](http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.div.8) data which we can use to downscale uploaded images so they render in the same dppx ratio in which they were taken. Before: <img width="584" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/50979e3a-5d5a-40dc-a0a4-36eb6e28f14a"> After: <img width="329" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/0690902a-f2fe-4c6b-97b3-6fdd67c21bad">
* [skip ci] Updated licenses and gitignoresGiteaBot2024-02-1914-0/+205
|
* De-duplicate contributor graph translations (#29247)Şahin Akkaya2024-02-182-8/+11
|
* Use general token signing secret (#29205)wxiaoguang2024-02-189-33/+82
| | | Use a clearly defined "signing secret" for token signing.
* Fix missed edit issues event for actions (#29237)Lunny Xiao2024-02-181-0/+41
| | | Fix #29213
* Clean up diff header css and reduce global textarea min-height (#29232)silverwind2024-02-185-22/+11
| | | | | | | | | | | | | | | | | | | | | 1. Tweak diff header and remove a numbe of unneeded CSS for it: Before: <img width="433" alt="Screenshot 2024-02-18 at 01 08 09" src="https://github.com/go-gitea/gitea/assets/115237/d8b377c0-57bc-44d5-bb57-a582c7d4b3b4"> After: <img width="463" alt="Screenshot 2024-02-18 at 01 07 56" src="https://github.com/go-gitea/gitea/assets/115237/d08c17e7-5b86-4d07-81da-6371f4754325"> 3. Reduce height of review textarea and also reduce fomantic's CSS from 12em to 8em. Now fits better on my screen: <img width="1352" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/5c658d13-295e-4929-94da-13ade888020d"> --------- Co-authored-by: delvh <dev.lh@web.de>
* Expire artifacts before deleting them physically (#29241)FuXiaoHei2024-02-181-8/+8
| | | | | | | | | | https://github.com/go-gitea/gitea/pull/27172#discussion_r1493735466 When cleanup artifacts, it removes storage first. If storage is not exist (maybe delete manually), it gets error and continue loop. It makes a dead loop if there are a lot pending but non-existing artifacts. Now it updates db record at first to avoid keep a lot of pending status artifacts.
* Improve TrHTML and add more tests (#29228)wxiaoguang2024-02-182-3/+71
| | | | | Follow #29165. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Convert visibility to number (#29226)Tim-Nicas Oelschläger2024-02-181-1/+1
| | | Don't throw error while creating user (Fixes #29218)
* Implement some action notifier functions (#29173)yp053272024-02-183-13/+75
| | | | | | | | | | | Fix #29166 Add support for the following activity types of `pull_request` - assigned - unassigned - review_requested - review_request_removed - milestoned - demilestoned
* Artifact deletion in actions ui (#27172)FuXiaoHei2024-02-188-11/+120
| | | | | | | | | | | Add deletion link in runs view page. Fix #26315 ![image](https://github.com/go-gitea/gitea/assets/2142787/aa65a4ab-f434-4deb-b953-21e63c212033) When click deletion button. It marks this artifact `need-delete`. This artifact would be deleted when actions cleanup cron task.
* Update docs for actions variables (#29239)zhangnew2024-02-181-6/+0
| | | | the variables is supported, see https://github.com/go-gitea/gitea/blob/a784ed3d6c6946fd9bf95f2e910f52f549326fe2/docs/content/usage/actions/act-runner.zh-cn.md?plain=1#L262-L289
* Refactor more code in templates (#29236)wxiaoguang2024-02-1811-42/+45
| | | | | | | | Follow #29165. * Introduce JSONTemplate to help to render JSON templates * Introduce JSEscapeSafe for templates. Now only use `{{ ... | JSEscape}}` instead of `{{ ... | JSEscape | Safe}}` * Simplify "UserLocationMapURL" useage
* Use "Safe" modifier for manually constructed safe HTML strings in templates ↵wxiaoguang2024-02-1812-15/+15
| | | | | | (#29227) Follow #29165. These HTML strings are safe to be rendered directly, to avoid double-escaping.
* Remove jQuery from the repo release form (#29225)Yarden Shoham2024-02-181-11/+11
| | | | | | | | | | | | | - Switched to plain JavaScript - Tested the repo release form functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/ede2072a-823d-418f-9890-a5a7445a1cc6) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make submit event code work with both jQuery event and native event (#29223)wxiaoguang2024-02-173-2/+3
| | | | | Partially related to #29200 and fix other potential bugs. Co-authored-by: Giteabot <teabot@gitea.io>
* Remove jQuery from repo migrate page (#29219)Yarden Shoham2024-02-171-9/+8
| | | | | | | | | | | | | - Switched to plain JavaScript - Tested the repo migrate functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/44ad134b-832e-44b8-8e77-7cc8603d95fe) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Remove unneccesary `initUserAuthLinkAccountView` from "link account" page ↵Yarden Shoham2024-02-172-30/+1
| | | | | | (#29217) Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix labels referencing the wrong ID in the user profile settings (#29199)Yarden Shoham2024-02-172-7/+7
| | | | | | | | 2 instances of `for` with a wrong value and 1 `for` that had a reference to a `name` instead of `id`. --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Fix label `for` pointing to a `name` instead of `id` in webhook settings ↵Yarden Shoham2024-02-171-1/+1
| | | | | | | | (#29209) Here's the spec for the `for` attribute: https://html.spec.whatwg.org/multipage/forms.html#attr-label-for Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Load outdated comments when (un)resolving conversation on PR timeline (#29203)Jimmy Praet2024-02-172-3/+4
| | | | | | | | | Relates to #28654, #29039 and #29050. The "show outdated comments" flag should only apply to the file diff view. On the PR timeline, outdated comments are always shown. So they should also be loaded when (un)resolving a conversation on the timeline page.
* Fix missing template for follow button in organization (#29215)Yarden Shoham2024-02-173-8/+9
| | | | | | | | | | | | | | | Leftover from https://github.com/go-gitea/gitea/pull/29005 # Before ![before](https://github.com/go-gitea/gitea/assets/20454870/24c74278-ccac-4dc6-bf26-713e90c07239) # After ![after](https://github.com/go-gitea/gitea/assets/20454870/f91d503b-87d4-4c17-a56c-9c0a81fd9082) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Enable markdownlint `no-trailing-punctuation` and `no-blanks-blockquote` ↵silverwind2024-02-177-9/+7
| | | | | (#29214) Enable these two and fix issues.
* Remove jQuery from the webhook editor (#29211)Yarden Shoham2024-02-171-29/+27
| | | | | | | | | | | | | - Switched to plain JavaScript - Tested the webhook editing functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/b24c264d-d5e5-4954-8789-e72564a99027) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove jQuery from issue reference context popup attach (#29216)Yarden Shoham2024-02-171-2/+1
| | | | | | | | | | - Switched to plain JavaScript - Tested the context popup functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/1d2f173e-e626-4f7d-82c8-d1539d38d247) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* fix typo (#29212)xkcdstickfigure2024-02-171-1/+1
|