aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Do not emit ambiguous character warning on rendered pages (#22016)zeripath2022-12-031-1/+3
| | | | | | | | | | | | The real sensitivity of ambiguous characters is in source code - therefore warning about them in rendered pages causes too many warnings. Therefore simply remove the warning on rendered pages. The escape button will remain available and it is present on the view source page. Fix #20999 Signed-off-by: Andrew Thornton <art27@cantab.net>
* docs: add `Edit this page` (#21981)Xinyu Zhou2022-12-031-0/+2
| | | | | | | | | | | | | Update theme to support `Edit this page`: https://gitea.com/gitea/theme/pulls/116 Screenshot: ![Edit this page](https://user-images.githubusercontent.com/76462613/205257167-d6039d0c-c913-4ebc-98c1-834aece4b5e9.png) Signed-off-by: Xinyu Zhou <i@sourcehut.net> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* refactor some functions to support ctx as first parameter (#21878)Lunny Xiao2022-12-03145-369/+360
| | | | Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
* Remove deprecated packages & staticcheck fixes (#22012)Chongyi Zheng2022-12-027-16/+15
| | | `ioutil` is deprecated and should use `io` instead
* Add pnpm to packages/overview (#22008)xtexChooser2022-12-021-1/+1
| | | | | | [`pnpm`](https://pnpm.io/) is a "fast, disk space efficient" node package manager. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update to Alpine 3.17 (#21904)flynnnnnnnnnn2022-12-023-5/+5
| | | | This pull request is for updating the base docker images to build with the latest version of Alpine.
* Update gitea-vet to check FSFE REUSE (#22004)Jason Song2022-12-0217-20/+18
| | | | | | | | | | | | | Related to: - #21840 - https://gitea.com/gitea/gitea-vet/pulls/21 What it looks like when it's working: https://drone.gitea.io/go-gitea/gitea/64040/1/5 All available SPDX license identifiers: [SPDX License List](https://spdx.org/licenses/). Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Multiple improvements for comment edit diff (#21990)silverwind2022-12-024-29/+51
| | | | | | | | | | | | | | | - Use explicit avatar size so when JS copies the HTML, the size gets copied with it - Replace icon font use with SVG - Improve styling and diff rendering - Sort lists in `svg.js` Fixes: https://github.com/go-gitea/gitea/issues/21924 <img width="933" alt="Screenshot 2022-11-30 at 17 52 17" src="https://user-images.githubusercontent.com/115237/204859608-f322a8f8-7b91-45e4-87c0-82694e574115.png"> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Remove session in api tests (#21984)Lunny Xiao2022-12-0146-433/+387
| | | It's no meaning to request an API route with session.
* Remove duplicate "Actions" label in mobile view (#21974)Mark Ormesher2022-12-011-1/+1
| | | | | | | | | | | | | | | | | | | Closes #21973. The "Actions" button on the commit view page is labelled twice in mobile view. No other buttons on the page have a `mobile-only` extra label, so this PR removes it. Before: ![before](https://user-images.githubusercontent.com/6496999/204540002-75baa08a-6c06-4b39-847b-34272e09d71e.PNG) After: ![after](https://user-images.githubusercontent.com/6496999/204539991-a0607765-d5e2-4b1a-84c9-a3e16cbc674e.PNG) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix generate index failure possibility on postgres (#21998)Lunny Xiao2022-12-023-2/+40
| | | | | @wxiaoguang Please review Co-authored-by: silverwind <me@silverwind.io>
* Use path not filepath in template filenames (#21993)zeripath2022-12-021-3/+3
| | | | | | | | | | Paths in git are always separated by `/` not `\` - therefore we should `path` and not `filepath` Fix #21987 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Update chroma to v2.4.0 (#22000)silverwind2022-12-012-3/+5
| | | Did a few cursory tests, seems to work well.
* Util type to parse ref name (#21969)Jason Song2022-12-011-20/+37
| | | | | | | Provide a new type to make it easier to parse a ref name. Actually, it's picked up from #21937, to make the origin PR lighter. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Skip initing LFS storage if disabled (#21996)Jason Song2022-12-011-0/+4
| | | | | | | A complement to #21985. I overlooked it because the name of the switch is `StartServer`, not `Enabled`. I believe the weird name is a legacy, but renaming is out of scope.
* Fix parallel creating commit status bug with tests (#21911)Lunny Xiao2022-12-013-70/+67
| | | | | This PR is a follow up of #21469 Co-authored-by: Lauris BH <lauris@nix.lv>
* Skip initing disabled storages (#21985)Jason Song2022-11-303-26/+108
| | | | If `Attachment` or `Packages` are disabled, we don't have to init the storages for them.
* Fix leaving organization bug on user settings -> orgs (#21983)花墨2022-11-303-4/+26
| | | | | Fix #21772 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix typos (#21979)luzpaz2022-11-293-29/+29
| | | Found via codespell
* Normalize `AppURL` according to RFC 3986 (#21950)Saswat Padhi2022-11-291-8/+11
| | | | | | | | | | | Fixes #21865. Scheme-based normalization ([RFC 3986, section 6.2.3](https://www.rfc-editor.org/rfc/rfc3986#section-6.2.3)) was already implemented, but only for `defaultAppURL`. This PR implements the same for `AppURL`. Signed-off-by: Saswat Padhi <saswatpadhi@protonmail.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Use random bytes to generate access token (#21959)Jason Song2022-11-281-3/+6
|
* Replace fmt.Sprintf with hex.EncodeToString (#21960)Jason Song2022-11-289-28/+30
| | | | | | | | | | | | | | | | | | | | | `hex.EncodeToString` has better performance than `fmt.Sprintf("%x", []byte)`, we should use it as much as possible. I'm not an extreme fan of performance, so I think there are some exceptions: - `fmt.Sprintf("%x", func(...)[N]byte())` - We can't slice the function return value directly, and it's not worth adding lines. ```diff func A()[20]byte { ... } - a := fmt.Sprintf("%x", A()) - a := hex.EncodeToString(A()[:]) // invalid + tmp := A() + a := hex.EncodeToString(tmp[:]) ``` - `fmt.Sprintf("%X", []byte)` - `strings.ToUpper(hex.EncodeToString(bytes))` has even worse performance.