summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix 500 error viewing pull request when fork has pull requests disabled ↵John Olheiser2023-01-181-0/+3
| | | | | | | (#22512) (#22515) Backport #22512 Co-authored-by: Brecht Van Lommel <brecht@blender.org>
* Reliable selection of admin user (#22509) (#22511)John Olheiser2023-01-181-1/+4
| | | | | Backport #22509 Co-authored-by: Sybren <122987084+drsybren@users.noreply.github.com>
* Set disable_gravatar/enable_federated_avatar when offline mode is true ↵Jason Song2023-01-182-0/+37
| | | | | | | | (#22479) (#22496) Backport #22479. When offline mode is true, we should set `disable_gravatar` to `true` and `enable_federated_avatar` to `false` in system settings.
* chore: changelog 1.18.1 (#22471)v1.18.1John Olheiser2023-01-171-0/+41
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Update `github.com/zeripath/zapx/v15` (#22485)KN4CK3R2023-01-172-3/+3
| | | | | | Fixes #22481 _Originally posted by @zeripath in https://github.com/go-gitea/gitea/issues/22481#issuecomment-1385188703_
* Fix pull request API field `closed_at` always being `null` (#22482) (#22483)Yarden Shoham2023-01-171-0/+4
| | | | | Backport #22482 Fix #22480
* Fix migration from GitBucket (#22465)Haruo Kinoshita2023-01-172-3/+12
| | | | | | | | | | | | | Migration from GitBucket does not work due to a access for "Reviews" API on GitBucket that makes 404 response. This PR has following changes. 1. Made to stop access for Reviews API while migrating from GitBucket. 2. Added support for custom URL (e.g. `http://example.com/gitbucket/owner/repository`) 3. Made to accept for git checkout URL (`http://example.com/git/owner/repository.git`) Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix container blob mount (#22226) (#22476)John Olheiser2023-01-175-71/+120
| | | | | Backport #22226 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix error when calculate the repository size (#22392) (#22474)zeripath2023-01-165-18/+42
| | | | | | | | | | Backport #22392 Fix #22386 `GetDirectorySize` moved as `getDirectorySize` because it becomes a special function which should not be put in `util`. Co-authored-by: Jason Song <i@wolfogre.com>
* Fix Operator does not exist bug on explore page with ↵zeripath2023-01-161-2/+7
| | | | | | | | | | | | | | | ONLY_SHOW_RELEVANT_REPOS (#22454) (#22472) Backport #22454 There is a mistake in the code for SearchRepositoryCondition where it tests topics as a string. This is incorrect for postgres where topics is cast and stored as json. topics needs to be cast to text for this to work. (For some reason JSON_ARRAY_LENGTH does not work, so I have taken the simplest solution of casting to text and doing a string comparison.) Ref https://github.com/go-gitea/gitea/pull/21962#issuecomment-1379584057 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix environments for KaTeX and error reporting (#22453) (#22473)zeripath2023-01-161-5/+9
| | | | | | | | | | | | | | | Backport #22453 In #22447 it was noticed that display environments were not working correctly. This was due to the setting displayMode not being set. Further it was noticed that the error was not being displayed correctly. This PR fixes both of these issues by forcibly setting the displayMode setting and corrects an error in displayError. Fix #22447 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove the netgo tag for Windows build (#22467) (#22468)wxiaoguang2023-01-161-2/+2
| | | | | | | | | | | | | | | Backport #22467 Fix #22370 and more. Before Go 1.19, the `netgo` tag for Windows does nothing. But Go 1.19 rewrite the net package code for Windows DNS, and there is a bug: * https://github.com/golang/go/issues/57757 This PR just removes the `netgo` tag for Windows build, then the Gitea for Windows can have the old DNS behavior.
* Fix leaving organization bug on user settings -> orgs (#21983) (#22438)zeripath2023-01-163-4/+26
| | | | | | | | | | | | Backport #21983 Fix #21772 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: 花墨 <shanee@live.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Restore previous official review when an official review is deleted (#22449) ↵Jimmy Praet2023-01-152-9/+58
| | | | | | | (#22460) Backport #22449 Co-authored-by: Lauris BH <lauris@nix.lv>
* Prevent panic on looking at api "git" endpoints for empty repos (#22457) ↵zeripath2023-01-151-1/+1
| | | | | | | | | | | | | | (#22458) Backport #22457 The API endpoints for "git" can panic if they are called on an empty repo. We can simply allow empty repos for these endpoints without worry as they should just work. Fix #22452 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fixed colour transparency regex matching in project board sorting (#22092) ↵zeripath2023-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#22437) Backport #22092 As described in the linked issue (#22091), semi-transparent UI elements would result in JS errors due to the fact that the CSS `backgroundColor` element was being matched by the pattern `^rgb\((\d+),\s*(\d+),\s*(\d+)\)$`, which does not take the alpha channel into account. I changed the pattern to `^rgba?\((\d+),\s*(\d+),\s*(\d+).*\)$`. This new pattern accepts both `rgb` and `rgba` tuples, and ignores the alpha channel (that little `.*` at the end) from the sorting criteria. The reason why I chose to ignore alpha is because when it comes to kanban colour sorting, only the hue is important; the order of the panels should stay the same, even if some of them are transparent. Alternative solutions were discussed in the bug report and are included here for completeness: 1. Change the regex from ^rgb\((\d+),\s*(\d+),\s*(\d+)\)$ to ^rgba?\((\d+),\s*(\d+),\s*(\d+)(,\s*(\d+(\.\d+)?))?\)$ (alpha channel is a float or NaN on 5th group) and include the alpha channel in the sorting criteria. 2. Rethink on why you're reading colours out of the CSS in the first place, then reformat this sorting procedure. Fix #22091 Co-authored-by: MisterCavespider <deler.urist@tutanota.de>
* Log STDERR of external renderer when it fails (#22442) (#22444)Jonathan Tran2023-01-141-1/+4
| | | Backport #22442.
* fix: PR status layout on mobile (#21547) (#22441)zeripath2023-01-142-8/+48
| | | | | | | | | | | | | | | | | | | | | | Backport #21547 This PR fixes the layout of PR status layouts on mobile. For longer status context names or on very small screens the text would overflow and push the "Details" and "Required" badges out of the container. Before: ![Screen Shot 2022-10-22 at 12 27 46](https://user-images.githubusercontent.com/13721712/197335454-e4decf09-4778-43e8-be88-9188fabbec23.png) After: ![Screen Shot 2022-10-22 at 12 53 24](https://user-images.githubusercontent.com/13721712/197335449-2c731a6c-7fd6-4b97-be0e-704a99fd3d32.png) Co-authored-by: kolaente <k@knt.li> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix wechatwork webhook sends empty content in PR review (#21762) (#22440)zeripath2023-01-141-1/+1
| | | | | | | | | | | | | | Backport #21762 Wechatwork webhook is sending the following string for pull request reviews: ``` markdown > ``` This commit fixes this problem. Co-authored-by: Jim Kirisame <jim@lotlab.org>
* Remove duplicate "Actions" label in mobile view (#21974) (#22439)zeripath2023-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Backport #21974 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> Co-authored-by: Mark Ormesher <me@markormesher.co.uk> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Prepend refs/heads/ to issue template refs (#20461) (#22427)zeripath2023-01-134-2/+11
| | | | | Backport #20461 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Continue GCing other repos on error in one repo (#22422) (#22425)zeripath2023-01-131-27/+34
| | | | | | | | | | | | Backport #22422 The current code propagates all errors up to the iteration step meaning that a single malformed repo will prevent GC of other repos. This PR simply stops that propagation. Fix #21605 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Correctly handle select on multiple channels in Queues (#22146) (#22428)zeripath2023-01-133-57/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #22146 There are a few places in FlushQueueWithContext which make an incorrect assumption about how `select` on multiple channels works. The problem is best expressed by looking at the following example: ```go package main import "fmt" func main() { closedChan := make(chan struct{}) close(closedChan) toClose := make(chan struct{}) count := 0 for { select { case <-closedChan: count++ fmt.Println(count) if count == 2 { close(toClose) } case <-toClose: return } } } ``` This PR double-checks that the contexts are closed outside of checking if there is data in the dataChan. It also rationalises the WorkerPool FlushWithContext because the previous implementation failed to handle pausing correctly. This will probably fix the underlying problem in #22145 Fix #22145 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove test session cache to reduce possible concurrent problem (#22199) ↵Lunny Xiao2023-01-132-11/+2
| | | | | (#22429) backport #22199
* Restore function to "Show more" buttons (#22399) (#22426)zeripath2023-01-134-3/+30
| | | | | | | | | | | | | | | Backport #22399 There was a serious regression in #21012 which broke the Show More button on the diff page, and the show more button was also broken on the file tree too. This PR fixes this by resetting the pageData.diffFiles as the vue watched value and reattachs a function to the show more button outside of the file tree view. Fix #22380 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Allow HOST has no port (#22280) (#22409)Lunny Xiao2023-01-123-5/+57
| | | | | | | Fix #22274 Backport #22280 This PR will allow `HOST` without port. Then a default port will be given in future steps.
* fix: omit avatar_url in discord payload when empty (#22393) (#22394)John Olheiser2023-01-101-1/+1
| | | | | Backport #22393 Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Don't display stop watch top bar icon when disabled and hidden when click ↵Yarden Shoham2023-01-102-0/+3
| | | | | | | | | | | | other place (#22374) (#22387) Backport #22374 Fix #22286 When timetracking is disabled, the stop watch top bar icon should be hidden. When the stop watch recording popup, it should be allowed to hide with some operation. Now click any place on this page will hide the popup window.
* Don't lookup mail server when using sendmail (#22300) (#22383)Lunny Xiao2023-01-091-14/+17
| | | | Fix #22287 backport #22300
* Fix set system setting failure once it cached (#22334)Lunny Xiao2023-01-092-13/+20
| | | backport #22333
* Update Emoji dataset to Unicode 14 (#22342) (#22343)isla w2023-01-043-306/+527
| | | Backport of #22342 to release/v1.18 as requested
* fix gravatar disable bug (#22337)Lunny Xiao2023-01-041-1/+1
|
* fix: update settings table on install (#22326) (#22327)John Olheiser2023-01-031-4/+7
| | | | | Backport #22326 Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add deprecated warning for DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR (#22324)Kyle D2023-01-031-2/+2
| | | Backport https://github.com/go-gitea/gitea/pull/22318
* Fix sitemap (#22272) (#22320)Jason Song2023-01-032-66/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #22272. Fix #22270. Related to #18407. The old code treated both sitemap and sitemap index as the format like: ```xml ... <url> <loc>http://localhost:3000/explore/users/sitemap-1.xml</loc> </url> ... ``` Actually, it's incorrect for sitemap index, it should be: ```xml ... <sitemap> <loc>http://localhost:3000/explore/users/sitemap-1.xml</loc> </sitemap> ... ``` See https://www.sitemaps.org/protocol.html Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Display error log when a modified template has an error so that it could ↵Lunny Xiao2023-01-031-2/+9
| | | | | | | | | | | recovery when the error fixed (#22261) (#22321) backport #22261 A drawback is the previous generated template has been cached, so you cannot get error in the UI but only from log Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: delvh <dev.lh@web.de>
* fix: code search title translation (#22285) (#22316)John Olheiser2023-01-031-1/+1
| | | | | | | Backport #22285 Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix due date rendering the wrong date in issue (#22302) (#22306)Yarden Shoham2023-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Backport #22302 Previously, the last minute of the chosen date caused bad timezone rendering. For example, I chose January 4th, 2023. ### Before ```html <time data-format="date" datetime="Wed, 04 Jan 2023 23:59:59 +0000">January 5, 2023</time> ``` ### After ```html <time data-format="date" datetime="2023-01-04">January 4, 2023</time> ``` --- Closes #21999 Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Fix get system setting bug when enabled redis cache (#22298)Lunny Xiao2023-01-015-53/+16
| | | | | backport #22295, fix #22281 Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix bug of DisableGravatar default value (#22297)Lunny Xiao2023-01-012-2/+2
| | | | | backport #22296 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Add `sync_on_commit` option for push mirrors api (#22271) (#22292)Chongyi Zheng2022-12-313-4/+15
| | | Backport of #22271
* Fix key signature error page (#22229) (#22230)Gusted2022-12-303-6/+20
| | | | | | | | | | | | | | | - Backport of #22229 - When the GPG key contains an error, such as an invalid signature or an email address that does not match the user.A page will be shown that says you must provide a signature for the token. - This page had two errors: one had the wrong translation key and the other tried to use an undefined variable [`.PaddedKeyID`](https://github.com/go-gitea/gitea/blob/e81ccc406bf723a5a58d685e7782f281736affd4/models/asymkey/gpg_key.go#L65-L72), which is a function implemented on the `GPGKey` struct, given that we don't have that, we use [`KeyID`](https://github.com/go-gitea/gitea/blob/e81ccc406bf723a5a58d685e7782f281736affd4/routers/web/user/setting/keys.go#L102) which is [the fingerprint of the publickey](https://pkg.go.dev/golang.org/x/crypto/openpgp/packet#PublicKey.KeyIdString) and is a valid way for opengpg to refer to a key.
* Frontport 1.17.4 changelog and Add 1.18.0 changelog (#22215)v1.18.0Lunny Xiao2022-12-291-1/+75
| | | | | Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Add more test directory to exclude dir of air, remove watching templates ↵Lunny Xiao2022-12-293-4/+7
| | | | | | | | | | | | | | | | | | from air include dir because gitea has internal mechanism (#22246) (#22247) backport #22246 Since #20218 introduced internal watching template, template watching should be removed from `air`. This will prevent restart the whole server once the template files changed to speed up developing when using `make watch`. To ensure `make watch` will reuse template watching, this PR introduced a new ENV `GITEA_RUN_MODE` to make sure `make watch` will always run in a dev mode of Gitea so that template watching will open. This PR also added more exclude testdata directories. Co-authored-by: 6543 <6543@obermui.de>
* refactor auth interface to return error when verify failure (#22119) (#22259)Lunny Xiao2022-12-2915-79/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | backport #22119 This PR changed the Auth interface signature from `Verify(http *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) *user_model.User` to `Verify(http *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) (*user_model.User, error)`. There is a new return argument `error` which means the verification condition matched but verify process failed, we should stop the auth process. Before this PR, when return a `nil` user, we don't know the reason why it returned `nil`. If the match condition is not satisfied or it verified failure? For these two different results, we should have different handler. If the match condition is not satisfied, we should try next auth method and if there is no more auth method, it's an anonymous user. If the condition matched but verify failed, the auth process should be stop and return immediately. This will fix #20563 Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Jason Song <i@wolfogre.com>
* Use complete SHA to create and query commit status (#22244) (#22257)Jason Song2022-12-2819-23/+68
| | | | | | | | | | | | | Backport #22244. Fix #13485. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove ReverseProxy authentication from the API (#22219) (#22251)Lunny Xiao2022-12-271-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | backport from #22219 Since we changed the /api/v1/ routes to disallow session authentication we also removed their reliance on CSRF. However, we left the ReverseProxy authentication here - but this means that POSTs to the API are no longer protected by CSRF. Now, ReverseProxy authentication is a kind of session authentication, and is therefore inconsistent with the removal of session from the API. This PR proposes that we simply remove the ReverseProxy authentication from the API and therefore users of the API must explicitly use tokens or basic authentication. Replace #22077 Close #22221 Close #22077 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Update bleve and zapx to fix unaligned atomic (#22031) (#22218)zeripath2022-12-222-38/+37
| | | | | | | | | | | | | | Backport #22031 There is an unaligned atomic field in zapx 15.3.5 which should have been fixed in a subsequent patch This bug causes issues on 32bit builds. Update bleve and zapx to account for this. Fix #21957 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix container layer display overflow (#22208) (#22211)Lauris BH2022-12-221-1/+1
| | | Backport #22208
* Allow empty assignees on pull request edit (#22150) (#22214)KN4CK3R2022-12-221-0/+5
| | | | | Backport of #22150 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>