aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make every not exist error unwrappable to a fs.ErrNotExist (#20891)zeripath2022-10-1848-20/+545
| | | | | | | | | | | | | | | | | | | | A lot of our code is repeatedly testing if individual errors are specific types of Not Exist errors. This is repetitative and unnecesary. `Unwrap() error` provides a common way of labelling an error as a NotExist error and we can/should use this. This PR has chosen to use the common `io/fs` errors e.g. `fs.ErrNotExist` for our errors. This is in some ways not completely correct as these are not filesystem errors but it seems like a reasonable thing to do and would allow us to simplify a lot of our code to `errors.Is(err, fs.ErrNotExist)` instead of `package.IsErr...NotExist(err)` I am open to suggestions to use a different base error - perhaps `models/db.ErrNotExist` if that would be felt to be better. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de>
* inline gitpod image (#21494)techknowlogick2022-10-182-1/+24
| | | | | fix #21492 Co-authored-by: 6543 <6543@obermui.de>
* [skip ci] Updated translations via CrowdinKN4CK3R2022-10-1829-0/+33
|
* Do not send notifications for draft releases (#21451)KN4CK3R2022-10-171-7/+8
| | | | | | | Fixes #21448 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Update reverse-proxies.zh-cn.md (#21484)rock2dust2022-10-171-0/+14
| | | | | | | | | | | | | add proxy header to nginx config example ``` proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; ``` Signed-off-by: rock2dust <its@baronbunny.cn> Signed-off-by: rock2dust <its@baronbunny.cn> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Docs: Update the feature comparison to other Git Hosting Services (#20933)delvh2022-10-171-89/+97
| | | This was drastically outdated recently.
* Add some api integration tests (#18872)KN4CK3R2022-10-1817-289/+2225
| | | | | | | | | | depends on #18871 Added some api integration tests to help testing of #18798. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* probe if sha before exec git (#21467)65432022-10-172-2/+23
|
* Fix incorrect notification commit url (#21479)wxiaoguang2022-10-171-4/+4
| | | | | For normal commits the notification url was wrong because oldCommitID is received from the shrinked commits list. This PR moves the commits list shrinking after the oldCommitID assignment.
* Localize all timestamps (#21440)Yarden Shoham2022-10-1720-27/+49
| | | | | | | | | | | | | | | | | | | | | Following * #21410 We are now able to localize all timestamps. Some examples: `short-date` format, French, user profile page: ![image](https://user-images.githubusercontent.com/20454870/195622461-aa0d5b93-f8df-42ad-881c-9c16606bf387.png) `date-time` format, Portuguese, mirror repository settings page: ![image](https://user-images.githubusercontent.com/20454870/195623191-7a37d77c-4a02-4140-846d-f290a65ea21d.png) Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinLunny Xiao2022-10-171-0/+8
|
* Add system setting table with cache and also add cache supports for user ↵Lunny Xiao2022-10-1759-436/+1117
| | | | setting (#18058)
* 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
|