aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix delete secret modal (#22187)Lunny Xiao2022-12-202-3/+23
| | | Fix #22181
* Secrets storage with SecretKey encrypted (#22142)Jason Song2022-12-2017-2/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fork of #14483, but [gave up MasterKey](https://github.com/go-gitea/gitea/pull/14483#issuecomment-1350728557), and fixed some problems. Close #12065. Needed by #13539. Featrues: - Secrets for repo and org, not user yet. - Use SecretKey to encrypte/encrypt secrets. - Trim spaces of secret value. - Add a new locale ini block, to make it easy to support secrets for user. Snapshots: Repo level secrets: ![image](https://user-images.githubusercontent.com/9418365/207823319-b8a4903f-38ca-4af7-9d05-336a5af906f3.png) Rrg level secrets ![image](https://user-images.githubusercontent.com/9418365/207823371-8bd02e93-1928-40d1-8c76-f48b255ace36.png) Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Check for zero time instant in `TimeStamp.IsZero()` (#22171)Gusted2022-12-201-3/+8
| | | | | | | | | | | | | | | | | | - Currently, the 'IsZero' function for 'TimeStamp' just checks if the unix time is zero, which is not the behavior of 'Time.IsZero()', but Gitea is using this method in accordance with the behavior of 'Time.IsZero()'. - Adds a new condition to check for the zero time instant. - Fixes a bug where non-expiring GPG keys where shown as they expired on Jan 01, 0001. - Related https://codeberg.org/Codeberg/Community/issues/791 Before: ![image](https://user-images.githubusercontent.com/25481501/208509035-ecc5fa4a-3bd1-4fa3-beba-90875719163c.png) After: ![image](https://user-images.githubusercontent.com/25481501/208508950-3e7f6eeb-be83-432a-89a6-d738553dafe4.png)
* Fix heatmap first color being unused (#22157)silverwind2022-12-191-0/+7
| | | | | | | | | | | | | | | | | | | vue3-calendar-heatmap has the behaviour that the first and second colors are mapped to values null and 0, meaning the second color was not used as intended for values > 0. I think this is a behaviour change from previous vue2 version that was missed during the upgrade. This change makes first and second values the same, so the heatmap can now use one additional color for meaningful values. Before: <img width="710" alt="Screenshot 2022-12-18 at 09 17 58" src="https://user-images.githubusercontent.com/115237/208288347-df4973af-8ebd-4582-b828-bec948ffdf60.png"> After: <img width="709" alt="Screenshot 2022-12-18 at 09 18 15" src="https://user-images.githubusercontent.com/115237/208288350-e0b85aa2-6925-4a37-83d2-89e2518c91ce.png"> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add setting to disable the git apply step in test patch (#22130)zeripath2022-12-194-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a long time Gitea has tested PR patches using a git apply --check method, and in fact prior to the introduction of a read-tree assisted three-way merge in #18004, this was the only way of checking patches. Since #18004, the git apply --check method has been a fallback method, only used when the read-tree three-way merge method has detected a conflict. The read-tree assisted three-way merge method is much faster and less resource intensive method of detecting conflicts. #18004 kept the git apply method around because it was thought possible that this fallback might be able to rectify conflicts that the read-tree three-way merge detected. I am not certain if this could ever be the case. Given the uncertainty here and the now relative stability of the read-tree method - this PR makes using this fallback optional and disables it by default. The hope is that users will not notice any significant difference in conflict detection and we will be able to remove the git apply fallback in future, and/or improve the read-tree three-way merge method to catch any conflicts that git apply method might have been able to fix. An additional benefit is that patch checking should be significantly less resource intensive and much quicker. (See https://github.com/go-gitea/gitea/issues/22083\#issuecomment-1347961737) Ref #22083 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Local storage should not store files as executable (#22162)zeripath2022-12-191-1/+2
| | | | | | | | | | The PR #21198 introduced a probable security vulnerability which resulted in making all storage files be marked as executable. This PR ensures that these are forcibly marked as non-executable. Fix #22161 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated licenses and gitignoreszeripath2022-12-181-0/+44
|
* Ensure that plain files are rendered correctly even when containing ↵zeripath2022-12-174-23/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ambiguous characters (#22017) As recognised in #21841 the rendering of plain text files is somewhat incorrect when there are ambiguous characters as the html code is double escaped. In fact there are several more problems here. We have a residual isRenderedHTML which is actually simply escaping the file - not rendering it. This is badly named and gives the wrong impression. There is also unusual behaviour whether the file is called a Readme or not and there is no way to get to the source code if the file is called README. In reality what should happen is different depending on whether the file is being rendered a README at the bottom of the directory view or not. 1. If it is rendered as a README on a directory - it should simply be escaped and rendered as `<pre>` text. 2. If it is rendered as a file then it should be rendered as source code. This PR therefore does: 1. Rename IsRenderedHTML to IsPlainText 2. Readme files rendered at the bottom of the directory are rendered without line numbers 3. Otherwise plain text files are rendered as source code. Replace #21841 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* verify nodeinfo response by schema (#22137)Meisam2022-12-175-0/+219
| | | | | | ... using [github.com/xeipuuv/gojsonschema](https://github.com/xeipuuv/gojsonschema) Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix margin and alignment in dashboard repolist (#22120)silverwind2022-12-172-4/+8
| | | | | | | | | | | | | | | | Seems this has recently regressed, previously, there was a significant whitespace between icon and text, but it seems to be gone, so I added the margin and also vertically aligned the icon because it was slightly misaligned. Before: <img width="419" alt="Screenshot 2022-12-13 at 20 03 51" src="https://user-images.githubusercontent.com/115237/207422938-7c45110c-f73e-4344-afc8-c072266d1f95.png"> After: <img width="419" alt="image" src="https://user-images.githubusercontent.com/115237/207447579-95525405-574d-4ca8-84ba-d8a9af50015a.png"> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Update username (#22147)Xinyu Zhou2022-12-161-1/+1
| | | update my email & username
* Do not list active repositories as unadopted (#22034)Christian Ullrich2022-12-161-1/+1
| | | | | | | | | | | | | | | | | This fixes a bug where, when searching unadopted repositories, active repositories will be listed as well. This is because the size of the array of repository names to check is larger by one than the `IterateBufferSize`. For an `IterateBufferSize` of 50, the original code will pass 51 repository names but set the query to `LIMIT 50`. If all repositories in the query are active (i.e. not unadopted) one of them will be omitted from the result. Due to the `ORDER BY` clause it will be the oldest (or least recently modified) one. Bug found in 1.17.3. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add doctor command for full GC of LFS (#21978)zeripath2022-12-155-39/+245
| | | | | | | | | | | | | | The recent PR adding orphaned checks to the LFS storage is not sufficient to completely GC LFS, as it is possible for LFSMetaObjects to remain associated with repos but still need to be garbage collected. Imagine a situation where a branch is uploaded containing LFS files but that branch is later completely deleted. The LFSMetaObjects will remain associated with the Repository but the Repository will no longer contain any pointers to the object. This PR adds a second doctor command to perform a full GC. Signed-off-by: Andrew Thornton <art27@cantab.net>
* remove silentcode from MAINTAINERS (#22143)silentcodeg2022-12-151-1/+0
| | | Signed-off-by: silentcode <silentcode@senga.org>
* Fixed Project view .board-column height for tall screens. (#22108)Nathaniel Sabanski2022-12-141-1/+2
| | | | | | | | | | | | | | | | | This bug occurs because we are calculating `.board-column` height strictly off of `vh`, when the layout header is of static height. BEFORE https://user-images.githubusercontent.com/24665/206991060-372c24e3-986e-4fc6-9fc8-aab8b4ef09bb.mp4 AFTER https://user-images.githubusercontent.com/24665/206991070-91b7cbab-d807-4016-8696-e43bdaf8a7ff.mp4
* Correctly handle moved files in apply patch (#22118)zeripath2022-12-141-0/+3
| | | | | | | | | | | | | | | Moved files in a patch will result in git apply returning: ``` error: {filename}: No such file or directory ``` This wasn't handled by the git apply patch code. This PR adds handling for this. Fix #22083 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* remove duplicated read file code (#22042)Lunny Xiao2022-12-141-117/+82
| | | | Merge the duplicated read file code as one function in reading text file and readme file.
* Fix condition for is_internal (#22095)KN4CK3R2022-12-142-3/+9
| | | | | | | | | | depends on #22094 Fixes https://codeberg.org/forgejo/forgejo/issues/77 The old logic did not consider `is_internal`. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Make gitea work using cmd.exe again (#22073)zeripath2022-12-141-0/+7
| | | | | | | | | | | | | | | | Gitea will attempt to lookup its location using LookPath however, this fails on cmd.exe if gitea is in the current working directory. exec.LookPath will return an exec.ErrDot error which we can test for and then simply using filepath.Abs(os.Args[0]) to absolute gitea against the current working directory. Fix #22063 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix markdown typo of an extra backtick in docs (#22123)Yakov57762022-12-131-1/+1
| | | Fixes a visual bug in docs which is caused by a typo of an extra backtick.
* Fix autofilled text visibility in dark mode (#22088)Chongyi Zheng2022-12-131-0/+6
| | | Fixes #22087
* Fix permission check on issue/pull lock (#22110)Lunny Xiao2022-12-121-3/+2
| | | Fix #21826
* Add a simple test for external renderer (#20033)Lunny Xiao2022-12-1224-9/+178
| | | Fix #16402
* refactor bind functions based on generics (#22055)Lunny Xiao2022-12-124-188/+168
|
* Allow disable code tab (#20805)Lunny Xiao2022-12-123-0/+23
| | | | | | | | | | | | | | | I know some users created a repository in an organization but just use issues and projects to handle the whole organizations issues. So that `Code` could be disabled per repository. <img width="1148" alt="image" src="https://user-images.githubusercontent.com/81045/184792075-346cb508-b620-4adb-bc9a-cba76fdcb294.png"> It could also become a wiki repository. <img width="1173" alt="image" src="https://user-images.githubusercontent.com/81045/184792324-e15c6f68-35c0-4105-ab77-83585ce53672.png"> Co-authored-by: delvh <dev.lh@web.de>
* Use multi reader instead to concat strings (#22099)Lunny Xiao2022-12-121-11/+8
| | | extract from #20326
* Fix sorting admin user list by last login (#22081)aceArt-GmbH2022-12-112-2/+6
| | | | | | Admin User Account list sort `updated_unix` is not the same as "Last Sign-In"
* Fix wrong default value for update checker on app.example.ini (#22084)Lunny Xiao2022-12-112-2/+2
|
* fix(config): remove context on config template (#22096)Restray2022-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 👋 Hey I'm new around here, so I may have done some mistakes, sorry! --- ## Context On a fresh Gitea install, when I go to the [config admin page](http://localhost:3000/admin/config) I had a 500 error page. The logs: ``` 2022/12/10 20:08:47 ...s/context/context.go:232:HTML() [E] [6394d93f] Render failed: template: admin/config:180:22: executing "admin/config" at <.Service.DefaultAllowOnlyContributorsToTrackTime>: DefaultAllowOnlyContributorsToTrackTime has arguments but cannot be invoked as function 2022/12/10 20:08:47 [6394d93f] router: completed GET /admin/config for [::1]:43800, 500 Internal Server Error in 5.1ms @ admin/config.go:99(admin.Config) ``` ## The fix I removed the `$.Context` on the `.Service.DefaultAllowOnlyContributorsToTrackTime` to fix the 500 error page happening. It could be a mistake, and I don't fully understand what I've done! Signed-off-by: Restray <contact@restray.org>
* [skip ci] Updated licenses and gitignoresKN4CK3R2022-12-111-0/+10
|
* Update xorm (#22094)KN4CK3R2022-12-103-10/+10
|
* Remove unnecessary whitespace in snapcraft.yaml (#22090)Yarden Shoham2022-12-101-2/+1
| | | Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Rename almost all Ctx functions (#22071)Lunny Xiao2022-12-1078-611/+562
|
* Change ID pattern of raw content container for issue (#21966)Felipe Leopoldo Sologuren Gutiérrez2022-12-106-9/+9
| | | | | Implement differentiation to html id for issue raw content container. Fixes #21965
* Optimize html templates (#22080)Jason Song2022-12-0928-164/+164
| | | Replace `active{{end}} item` with `active{{end}} item`.
* Add API management for issue/pull and comment attachments (#21783)KN4CK3R2022-12-0921-84/+1754
| | | | | | | | | | | | | | Close #14601 Fix #3690 Revive of #14601. Updated to current code, cleanup and added more read/write checks. Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andre Bruch <ab@andrebruch.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Norwin <git@nroo.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Rename actions to operations on UI (#22067)Jason Song2022-12-084-7/+7
| | | | | | | | | | | | | | | | | | | | | Use "operations" to indicate "some something can be done", to prevent users from confusing it with CICD. Releated to: #13539. Snapshots: <img width="389" alt="image" src="https://user-images.githubusercontent.com/9418365/206409797-a99bac25-2d38-4066-b9ab-27a4f6fe67e7.png"> <img width="398" alt="image" src="https://user-images.githubusercontent.com/9418365/206410099-bbd258a9-54d9-4664-8d95-31d29cb35209.png"> <img width="442" alt="image" src="https://user-images.githubusercontent.com/9418365/206410218-009a3103-a9b9-4d0c-86b6-540dda5bce89.png"> I'm not a native English speaker, but I think "operations" may be good enough, and Gitea already uses this word: <img width="1440" alt="image" src="https://user-images.githubusercontent.com/9418365/206410671-4a718b14-0603-40cb-bdcb-f6f84d1f5e24.png">
* Update go dev dependencies (#22064)silverwind2022-12-0844-67/+71
| | | | | `golangci-lint` [deprecated](https://github.com/golangci/golangci-lint/issues/1841) a bunch of linters, removed them.
* Round language stats percentage using largest remainder (#22026)hr-982022-12-081-4/+36
| | | | | | | | | | Fix #22023 I've changed how the percentages for the language statistics are rounded because they did not always add up to 100% Now it's done with the largest remainder method, which makes sure that total is 100% Co-authored-by: Lauris BH <lauris@nix.lv>
* Support disabling database auto migration (#22053)Jason Song2022-12-075-1/+27
| | | | | Gitea will migrate the database model version automatically, but it should be able to be disabled and keep Gitea shutdown if the version is not matched.
* Release and Tag List tweaks (#21712)silverwind2022-12-065-41/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reduce font size on tag list and add muted links - Move Release tag to right side on release list - Move Release edit button to far-right and make it icon-only - Add styles for error dropdowns, seen on release edit page - Make the release page slightly more mobile-friendly <img width="468" alt="Screen Shot 2022-11-07 at 22 10 44" src="https://user-images.githubusercontent.com/115237/200417500-149f40f5-2376-42b4-92a7-d7eba3ac359d.png"> <img width="1015" alt="Screen Shot 2022-11-07 at 22 27 14" src="https://user-images.githubusercontent.com/115237/200419201-b28f39d6-fe9e-4049-8023-b301c9bae528.png"> <img width="1019" alt="Screen Shot 2022-11-07 at 22 27 27" src="https://user-images.githubusercontent.com/115237/200419206-3f07d988-42f6-421d-8ba9-303a0d59e711.png"> <img width="709" alt="Screen Shot 2022-11-07 at 22 42 10" src="https://user-images.githubusercontent.com/115237/200421671-f0393cde-2d8f-4e1f-a788-f1f51fc4807c.png"> <img width="713" alt="Screen Shot 2022-11-07 at 22 42 27" src="https://user-images.githubusercontent.com/115237/200421676-5797f8cf-dfe8-4dd6-85d4-dc69e31a9912.png"> <img width="406" alt="image" src="https://user-images.githubusercontent.com/115237/200418220-8c3f7549-61b4-4661-935e-39e1352f7851.png"> <img width="416" alt="Screen Shot 2022-11-07 at 22 21 36" src="https://user-images.githubusercontent.com/115237/200418107-cdb0eb6f-1292-469c-b89a-2cb13f24173c.png"> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix issue/PR numbers (#22037)Jason Song2022-12-063-9/+11
| | | | | | | | | | | | | | When deleting a closed issue, we should update both `NumIssues`and `NumClosedIssues`, or `NumOpenIssues`(`= NumIssues -NumClosedIssues`) will be wrong. It's the same for pull requests. Releated to #21557. Alse fixed two harmless problems: - The SQL to check issue/PR total numbers is wrong, that means it will update the numbers even if they are correct. - Replace legacy `num_issues = num_issues + 1` operations with `UpdateRepoIssueNumbers`.
* Remove useless "Cancel" buttons (#21872)Yarden Shoham2022-12-0512-12/+0
| | | | | | | | * Continues #21381 These buttons have no real use. To cancel, one would simply navigate away. Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Ensure that Chinese punctuation is not ambiguous when locale is Chinese (#22019)zeripath2022-12-041-0/+6
| | | | | | | | | | Although there are per-locale fallbacks for ambiguity the locale names for Chinese do not quite match our locales. This PR simply maps zh-CN on to zh-hans and other zh variants on to zh-hant. Ref #20999 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use GhostUser if needed for TrackedTimes (#22021)zeripath2022-12-042-15/+23
| | | | | | | | | When getting tracked times out of the db and loading their attributes handle not exist errors in a nicer way. (Also prevent an NPE.) Fix #22006 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add dumb-init to rootless docker (#21775)Michael Kriese2022-12-041-1/+2
| | | | Add dumb-init as process reaper to the rootless image to reap defunct git processes.
* On tag/branch-exist check, dont panic if repo is nil (#21787)65432022-12-042-2/+2
| | | | fix a panic found in gitea logs
* Fix ListBranches to handle empty case (#21921)Lunny Xiao2022-12-041-26/+34
| | | | | | Fix #21910 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* fix(web): reduce page jitter on browsers that support overlay scrollbar (#21850)Percy Ma2022-12-041-0/+7
| | | | | | | | | | | | | Reduce jitter caused by the presence or absence of scrollbars in page switching --- Ref [scrollbar-gutter | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-gutter) https://user-images.githubusercontent.com/45708948/165972251-7d5a5017-f76d-4ba2-9106-a224b3ee521f.mp4
* [skip ci] Updated licenses and gitignoreszeripath2022-12-041-1/+1
|