summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Implement FSFE REUSE for golang files (#21840)flynnnnnnnnnn2022-11-271872-3749/+1887
| | | | | | | | | Change all license headers to comply with REUSE specification. Fix #16132 Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Correct the fallbacks for mailer configuration (#21945)zeripath2022-11-275-94/+96
| | | | | | | | | | | | | | | Unfortunately the fallback configuration code for [mailer] that were added in #18982 are incorrect. When you read a value from an ini section that key is added. This leads to a failure of the fallback mechanism. Further there is also a spelling mistake in the startTLS configuration. This PR restructures the mailer code to first map the deprecated settings on to the new ones - and then use ini.MapTo to map those on to the struct with additional validation as necessary. Ref #21744 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated licenses and gitignoresKN4CK3R2022-11-272-0/+20
|
* Fix typos (#21947)KN4CK3R2022-11-272-5/+5
| | | | | | | | | | | | | Two typos The `recieve` typo is also present in a translation. https://github.com/go-gitea/gitea/blob/5f38acd9a08958024e8bbf47bcc482c79d844e44/options/locale/locale_sv-SE.ini#L1760 Someone with a Crowdin account should fix that. ... and in a license file but I don't think we can change that because that's the official text. https://github.com/go-gitea/gitea/blob/5f38acd9a08958024e8bbf47bcc482c79d844e44/options/license/xinetd#L21
* Fix markdown anchor re-clicking (#21931)silverwind2022-11-261-6/+9
| | | | | | | | | The hashchange event did not fire on re-click of a active anchor. Instead, use the click event which always fires. Fixes: https://github.com/go-gitea/gitea/issues/21680 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Prevent NPE if trying to restore an already restored deleted branch (#21940)zeripath2022-11-252-0/+10
| | | | | | | | | | If a deleted-branch has already been restored, a request to restore it again will cause a NPE. This PR adds detection for this case, but also disables buttons when they're clicked in order to help prevent accidental repeat requests. Fix #21930 Signed-off-by: Andrew Thornton <art27@cantab.net>
* add rel="me" to org.website link (#21941)Meisam2022-11-251-1/+1
| | | This lets organizations verify their link on 3rd party websites.
* Fix typo in sidebar (#21934)KN4CK3R2022-11-251-1/+1
| | | | | Same as #21922 I used the npm file as template which was a bad idea to spot these casing errors...
* fix(web): keep the pages of the navigation in the center (#21867)Percy Ma2022-11-252-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Keep the pages of the navigation in the center <table> <tr> <th>Before</th> <th>After</th> </tr> <tr> <td> <img width="200" alt="image" src="https://user-images.githubusercontent.com/45708948/202838756-d6d57b3f-8144-4a43-a33b-ea7c8ab3a495.png"> </td> <td> <img width="192" alt="image" src="https://user-images.githubusercontent.com/45708948/202838740-bbae1e86-b14c-421d-92d4-d0e53d5952a2.png"> </td> </tr> </table> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Workaround for container registry push/pull errors (#21862)KN4CK3R2022-11-255-4/+103
| | | | | | | | | | | | | | | This PR addresses #19586 I added a mutex to the upload version creation which will prevent the push errors when two requests try to create these database entries. I'm not sure if this should be the final solution for this problem. I added a workaround to allow a reupload of missing blobs. Normally a reupload is skipped because the database knows the blob is already present. The workaround checks if the blob exists on the file system. This should not be needed anymore with the above fix so I marked this code to be removed with Gitea v1.20. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>