aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Return 404 when user is not found on avatar (#21476)Gusted2022-10-161-0/+4
| | | | - Instead of returning a 500 Internal Server when the user wasn't found, return 404 Not found
* Enforce grouped NuGet search results (#21442)KN4CK3R2022-10-172-37/+72
| | | | | | | | Fixes #21434 Added tests to enforce this behaviour. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Display total commit count in hook message (#21400)KN4CK3R2022-10-1713-68/+74
| | | | | | | | | Fixes #21379 The commits are capped by `setting.UI.FeedMaxCommitNum` so `len(commits)` is not the correct number. So this PR adds a new `TotalCommits` field. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor GetNextResourceIndex to make it work properly with transaction (#21469)wxiaoguang2022-10-167-87/+213
| | | | | | | | | | | | | | Related: * #21362 This PR uses a general and stable method to generate resource index (eg: Issue Index, PR Index) If the code looks good, I can add more tests ps: please skip the diff, only have a look at the new code. It's entirely re-written. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Simplify fmt-check (#21458)silverwind2022-10-164-35/+21
| | | | | | | | | `fmt-check` now simply does `fmt` before and relies on `git diff` like other checks like 'tidy-check' already do, so we can remove the argument in the tool that handles printing changed files. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* update current stable versiontechknowlogick2022-10-151-1/+1
|
* 1.17.3 changelogtechknowlogick2022-10-151-0/+80
|
* [skip ci] Updated translations via Crowdinsilverwind2022-10-164-1/+68
|
* Fix mermaid-related bugs (#21431)silverwind2022-10-152-1/+5
|
* Update OpenRC startup script (#21436)Lauris BH2022-10-151-4/+33
|
* Use own Go version instead of hardcoded 1.17 for `make fmt` (#21457)Yarden Shoham2022-10-151-1/+12
| | | | | | | | We should make sure we're using the same version across the codebase. * We upgraded in #19918 but forgot about the following line https://github.com/go-gitea/gitea/blob/6bb6a108e0c03b323402b452fc05c6845f7d00df/build/code-batch-process.go#L273 Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Add `code` highlighting in issue titles (#21432)Yarden Shoham2022-10-166-9/+24
| | | | | | | | | | | | This changes the rendering logic of issue titles. If a substring in an issue title is enclosed with a pair of backticks, it'll be rendered with a monospace font (HTML `code` tag). * Closes #20887 Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Add wording about keeping PRs up-to-date in CONTRIBUTING.md (#21468)Yarden Shoham2022-10-151-0/+10
| | | | | | | | | Following a discord discussion from today I've written the policy explained to me about keeping PRs up-to-date. Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [refactor] Use const for wiki DefaultBranch (#21466)65432022-10-153-16/+21
| | | | just a nit, that will make it easier to change things and we now have a single source of truth
* Follow improve code quality (#21465)wxiaoguang2022-10-152-12/+24
| | | | | | After some discussion, introduce a new slice `brokenArgs` to make `gitCmd.Run()` return errors if any dynamic argument is invalid. Co-authored-by: delvh <dev.lh@web.de>
* alternative to PR "improve code quality" (#21464)wxiaoguang2022-10-156-25/+52
| | | | | This PR doesn't require new git version, and can be backported easily. Co-authored-by: 6543 <6543@obermui.de>
* [skip ci] Updated translations via CrowdinYarden Shoham2022-10-152-3/+34
|
* Fix Drone pushing commits with wrong author info (#21450)Yarden Shoham2022-10-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | I don't know how to test this so I'll explain my thought process: After a discussion with @techknowlogick in https://github.com/go-gitea/gitea/commit/cda2c38f4a61ef7f448be3efab5420d9974c8474 I saw the CI config has this block: https://github.com/go-gitea/gitea/blob/cda2c38f4a61ef7f448be3efab5420d9974c8474/.drone.yml#L618-L630 I don't know much about Drone but after looking at [appleboy/drone-git-push](https://github.com/appleboy/drone-git-push)'s source code, I think each setting becomes an environment variable (e.g. `remote` to `PLUGIN_REMOTE`, `commit_message` to `PLUGIN_COMMIT_MESSAGE` etc...). Take a look at the code block loading the author info: https://github.com/appleboy/drone-git-push/blob/a69878c00665277c53fb38d6c5980221cb687935/main.go#L32-L42 Two environment variables are listed for each setting. This PR forces both to have the same value. Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Add vitest tests to Gitpod (#21449)Yarden Shoham2022-10-141-0/+1
| | | | | | | | | | | | | The vitest PR is merged, we can now add vitest to Gitpod's testing pane * #21444 We couldn't use jest in the same manner because we had to customize `NODE_OPTIONS`. Screenshot (look at all the cool stuff circled in red): ![image](https://user-images.githubusercontent.com/20454870/195728971-9a2eaa80-8d91-4e4f-899b-a068edb9ff30.png) Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Switch from jest to vitest (#21444)silverwind2022-10-149-4191/+520
| | | | | | | | | | | | | | Even if we are not bundling with `vite` yet, we can use `vitest` in place of Jest which brings a few benefits like not requiring to use `NODE_OPTIONS` to run and having sane module resolution. It's possible to also use `jest-extended` with vitest, but I opted to not do so for now because it brings heavyweight dependencies and it was trivial to just rewrite the affected matchers to be compatible. This PR also removes 153 JS dependencies, which is certainly nice. Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Diff file tree tweaks (#21446)silverwind2022-10-142-10/+12
| | | | | | | | | | | | | | | | | | | | - Left-align the diff stat line again like previously. - Default the file tree to collapsed view, which means the tree will rendered initially collapsed and it may "pop in" via JS if enabled. I think this is more desirable than having the empty space for the tree "pop out" like it currently does. - Mute the icon, removing color unless hovered. - Increase icon size and vertically center it. Before: <img width="1271" alt="image" src="https://user-images.githubusercontent.com/115237/195666451-55771595-0525-42b8-be1b-d03cc1cb2961.png"> After: <img width="1280" alt="image" src="https://user-images.githubusercontent.com/115237/195666385-c91fd0de-6dcc-4d9c-89ff-7581828fcf14.png"> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add cynkra bronze sponsor (#21325)Patrick Schratz2022-10-131-0/+1
| | | | | | | | | | | | @techknowlogick Only added a placeholder, the index is possibly wrong. But I think you need to do/finalize that as the opencollective holder :) You can take the logo of the opencollective account. LMK if I can help more! Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <matti@mdranta.net>
* Run `make fmt` (#21437)Yarden Shoham2022-10-132-6/+6
| | | | | | The only change is what `make fmt` did, I am merely a vessel for its glorious function Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Remove useless `appVer` from JS `window.config` (#21445)wxiaoguang2022-10-142-3/+2
| | | | The only usage of `appVer` was in serviceworker.js, while indeed it needs the asset version.
* Add support for Chocolatey/NuGet v2 API (#21393)KN4CK3R2022-10-138-134/+849
| | | | | | | | Fixes #21294 This PR adds support for NuGet v2 API. Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix #21406: Hide repo information from file view/blame mode (#21420)Neel2022-10-134-2/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Summary The repo information such as description, stats and topics are getting displayed in the top-bar when viewing a file. This has been fixed to display the repo information only while navigating the repo and not while viewing or blaming a file from the repo ## Before fix Screenshot from the issue ![image](https://user-images.githubusercontent.com/47709856/195278543-9afbb735-7bd3-4f42-b3ba-da514c6989d2.png) ## After the fix - **Repo homepage** The repo description, topics and summary will be displayed ![image](https://user-images.githubusercontent.com/47709856/195443913-2ca967cd-6694-4a97-98d0-4d0750692b5d.png) - **When opening a file** The repo description, topic and summary has been conditionally hidden from the view <img width="1311" alt="image" src="https://user-images.githubusercontent.com/47709856/195278964-9479231c-62ad-4c0e-b438-2018f22289db.png"> - **When running blame on a file** > This was originally not part of the issue #21406. However the fix seems relevant for the blame view as well. <img width="1312" alt="image" src="https://user-images.githubusercontent.com/47709856/195279619-02010775-aec3-4c8d-a184-d2d838c797e8.png"> - **From within a directory** The repo description, topics and summary will not be displayed ![image](https://user-images.githubusercontent.com/47709856/195444080-ff5b2def-7e0f-47d7-b54a-7e9df5f9edd8.png) Supporting integration tests have also been added.
* [skip ci] Updated translations via CrowdinYarden Shoham2022-10-131-5/+5
|
* Respect user's locale when rendering the date range in the repo activity ↵Yarden Shoham2022-10-133-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | page (#21410) # Description Previously, to make the date range understood by all, we used the format "2006-01-02" for the dates as it's locale-generic. This commit changes the rendering logic. Instead of rendering the date on the server, we send a formatted computer-readable timestamp. The client's javascript then renders it according to the user's locale. This approach is reusable across the codebase, any `<time></time>` tag with the data-format="date" attribute would get rendered according to the user's chosen locale. ## Previous View ![image](https://user-images.githubusercontent.com/20454870/195099143-e1c5df86-282a-42f1-898f-a36bb5fe7c2f.png) ## New View ### English ![image](https://user-images.githubusercontent.com/20454870/195099301-5cda4eab-4012-49d5-97e5-b1f9cada9c06.png) ### French ![image](https://user-images.githubusercontent.com/20454870/195099434-ce23e394-8d65-4c4c-8ac8-8b96bc9044f3.png) ### Portuguese ![image](https://user-images.githubusercontent.com/20454870/195099559-9a7aed28-944a-45ec-bedb-64403e3faede.png) ### Italian ![image](https://user-images.githubusercontent.com/20454870/195099661-17758d55-3fe0-4797-879b-d45de0ee8ba3.png) # References * #21380 * #21387 * #21396 Inspiration: I think either differentiating by class, or probably better by a custom attribute such as `data-format` or similar, is the best course of action. _Originally posted by @delvh in https://github.com/go-gitea/gitea/issues/21396#issuecomment-1274424788_ Resolves #21380 Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Consolidate more CSS colors into variables (#21402)silverwind2022-10-124-65/+30
| | | | | | | | | | | | | | | | | Move more colors into variables. The only real notable change is the dot in the release timeline. Also, made the variable comments a bit more clear. <img width="279" alt="Screen Shot 2022-10-10 at 21 10 23" src="https://user-images.githubusercontent.com/115237/194938496-e5a21056-67c4-4219-9c68-134b0edf0e61.png"> <img width="88" alt="Screen Shot 2022-10-10 at 21 31 53" src="https://user-images.githubusercontent.com/115237/194939712-f666c43e-fb1a-4045-be52-1176391bd8ea.png"> <img width="90" alt="Screen Shot 2022-10-10 at 21 31 44" src="https://user-images.githubusercontent.com/115237/194939710-2e620c06-75a9-41b7-a3e1-18eab7a57614.png"> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add HEAD fix to gitea doctor (#21352)Clar Fon2022-10-121-0/+91
| | | | | | | | | | | | | | | | Due to a bug in presumably an older version of Gitea, multiple of my repositories still have their HEADs pointing to a `master` branch while the default branch on the UI is listed as `main`. This adds a `gitea doctor` command that will fix all of the HEAD references for repos when they're not synchronized with the default branch in the DB. This will help with cloning to ensure that git automatically checks out the right branch, instead of a nonexistent one. Note: I'm not sure if I actually need to do more other than add a file here. Will try testing this out on my server soon. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Contribution guidelines (#21425)KN4CK3R2022-10-121-24/+8
| | | | | | | | | | | | | Some changes to the contribution guidelines. - I removed the `Large Character Comments` part because I think they are bad design. They are used in big files to group sections of code. This code should be organized into individual files. - Updated some paths. - Added `Documentation` because our documentation is not good at the moment. We should enforce documentation of newly added features to help our users. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Refactor Gitpod configuration to improve quick spin up of automated dev ↵Yarden Shoham2022-10-124-4/+27
| | | | | | | | | | | | | | | | | environments (#21411) This commit instructs Gitpod to run `docs` in watch mode in fresh development environments so any dev could start hacking in seconds. Also included some vscode extensions for Vue, Go, and Docker. Try it here: [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/yardenshoham/gitea/tree/gitpod) Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com>
* Support instance-wide OAuth2 applications (#21335)qwerty2872022-10-127-6/+149
| | | | | | | Support OAuth2 applications created by admins on the admin panel, they aren't owned by anybody. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Case-insensitive NuGet symbol file GUID (#21409)Hubert Wawrzyńczyk2022-10-123-3/+3
| | | | | | | NuGet symbol file lookup returned 404 on Visual Studio 2019 due to case-sensitive api router. The api router should accept case-insensitive GUID. Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add generic set type (#21408)KN4CK3R2022-10-1241-324/+328
| | | | | This PR adds a generic set type to get rid of maps used as sets. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve OAuth integration tests (#21390)M Hickford2022-10-122-33/+133
| | | | | | | In particular, test explicit error responses. No change to behaviour. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make e-mail sanity check more precise (#20991)Andreas Fischer2022-10-112-20/+21
| | | | | | | | | | | | For security reasons, all e-mail addresses starting with non-alphanumeric characters were rejected. This is too broad and rejects perfectly valid e-mail addresses. Only leading hyphens should be rejected -- in all other cases e-mail address specification should follow RFC 5322. Co-authored-by: Andreas Fischer <_@ndreas.de> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix broken link to frontend guidelines in hacking guidelines (#21382)Yarden Shoham2022-10-112-1/+1
|
* Use Name instead of DisplayName in LFS Lock (#21415)KN4CK3R2022-10-113-5/+6
| | | | | Fixes #21268 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [skip ci] Updated translations via Crowdinkolaente2022-10-121-0/+8
|
* feat(pr review): add more space on mobile (#21326)kolaente2022-10-111-0/+10
| | | | | | | | | | | | | | | | | This PR adds more space to the review screen on mobile so that comments are more readable and less "squashed" an smaller screens. Before: ![Screen Shot 2022-10-03 at 17 12 26](https://user-images.githubusercontent.com/13721712/193612834-6add9e25-f635-4a5b-84f6-b8e2b320ec29.png) After: ![Screen Shot 2022-10-03 at 17 10 15](https://user-images.githubusercontent.com/13721712/193612671-ab4ef640-0360-44ef-9184-b366b7abeb37.png) Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Bump `golang.org/x/text` (#21412)Gusted2022-10-112-2/+3
| | | | | - Update the `golang.org/x/text` dependency, this fixes [a security issue](https://groups.google.com/g/golang-announce/c/-hjNw559_tE/m/KlGTfid5CAAJ).
* Update gitea.service (#21399)plsnp2022-10-111-6/+2
| | | | | | | | | | | | | | | | | `LimitMEMLOCK=infinity` is already the default, so removed that Default soft limit for LimitNOFILE is 1024 Default hard limit for LimitNOFILE is 524288 `LimitNOFILE=65535` increases the soft limit, but decreases the hard limit References: * https://www.freedesktop.org/software/systemd/man/systemd.exec.html * https://blog.skbali.com/2019/09/set-ulimits-for-a-script-started-using-systemd/ Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Do DB update after merge in hammer context (#21401)zeripath2022-10-111-10/+12
| | | | | | | | | | | | | | | When merge was changed to run in the background context, the db updates were still running in request context. This means that the merge could be successful but the db not be updated. This PR changes both these to run in the hammer context, this is not complete rollback protection but it's much better. Fix #21332 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* add gitpod config (#20995)Anbraten2022-10-111-0/+34
| | | | | | | | | | | Add a config for <https://www.gitpod.io/>. This allows users to easily run an online IDE pre-configured to develop and test Gitea by opening <https://gitpod.io/#https://github.com/go-gitea/gitea>. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/go-gitea/gitea) Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Remove cancel button in repo creation page (#21381)Yarden Shoham2022-10-111-1/+0
|
* Improve clarity for camo proxy parameters (#21386)Bill Wenrich2022-10-111-3/+3
| | | | | | | | | | Updates the Config Cheat Sheet for the `ALLWAYS` option in Camo proxy. - Clarifies the behavior for true (both HTTP and HTTPS is proxied) vs false (only HTTP is proxied) - Minor grammar and typo improvements Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Redirect to new repository owner (#21398)KN4CK3R2022-10-111-1/+10
| | | | | | | Fixes #17655 If you rename `user1` to `user2` and visit `/user1` you get redirected to `/user2`. But if you visit `/user1/repo` you just get a 404 error. With this PR the user is redirected to `/user2/repo`.
* Use ISO date format instead of hard-coded English date format for date range ↵Yarden Shoham2022-10-111-2/+2
| | | | | | | in repo activity page (#21396) January 2, 2006 -> 2006-01-02 Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* log real ip of requests from ssh (#21216)Lunny Xiao2022-10-112-2/+17
| | | | | | | | | | | Partially fix #21213. This PR will get client IP address from SSH_CONNECTION env which should be the first field of that. And deliver it to the internal API so Gitea routers could record the real IP from SSH requests. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>