aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* small refactor for retry downloader (#16137)a10121127962021-06-131-134/+83
| | | Signed-off-by: a1012112796 <1012112796@qq.com>
* [skip ci] Updated licenses and gitignoresGiteaBot2021-06-133-3/+4
|
* Removable media support (#16136)Andrei Yankovich2021-06-111-3/+3
| | | | Add support removable media for snap version of gitia. for get more info about removable media interface see the snapcraft [documentation](https://snapcraft.io/docs/removable-media-interface)
* Set self-adjusting deadline for connection writing (#16068)zeripath2021-06-115-39/+90
| | | | | | | | | | | | | | | | | | | | | | | | | * Set self-adjusting deadline for connection writing In #16055 it appears that the simple 5s deadline doesn't work for large file writes. Now we can't - or at least shouldn't just set no deadline as go will happily let these connections block indefinitely. However, what seems reasonable is to set some minimum rate we expect for writing. This PR suggests the following algorithm: * Every write has a minimum timeout of 5s (adjustable at compile time.) * If there has been a previous write - then consider its previous deadline, add half of the minimum timeout + 2s per kb about to written. * If that new deadline is after the minimum timeout use that. Fix #16055 * Linearly increase timeout * Make PerWriteTimeout, PerWritePerKbTimeouts configurable Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Vendor Update (#16121)65432021-06-10819-34838/+37941
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * update github.com/PuerkitoBio/goquery * update github.com/alecthomas/chroma * update github.com/blevesearch/bleve/v2 * update github.com/caddyserver/certmagic * update github.com/go-enry/go-enry/v2 * update github.com/go-git/go-billy/v5 * update github.com/go-git/go-git/v5 * update github.com/go-redis/redis/v8 * update github.com/go-testfixtures/testfixtures/v3 * update github.com/jaytaylor/html2text * update github.com/json-iterator/go * update github.com/klauspost/compress * update github.com/markbates/goth * update github.com/mattn/go-isatty * update github.com/mholt/archiver/v3 * update github.com/microcosm-cc/bluemonday * update github.com/minio/minio-go/v7 * update github.com/prometheus/client_golang * update github.com/unrolled/render * update github.com/xanzy/go-gitlab * update github.com/yuin/goldmark * update github.com/yuin/goldmark-highlighting Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Remove utf8 option from installation page (#16126)Lunny Xiao2021-06-101-1/+0
|
* [skip ci] Updated translations via CrowdinGiteaBot2021-06-101-1/+72
|
* Fix bug on getIssueIDsByRepoID (#16119)Lunny Xiao2021-06-102-1/+9
| | | | | * Fix bug on getIssueIDsByRepoID * Add test
* Remove unnecessary goroutine (#16080)Lunny Xiao2021-06-091-14/+12
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add sso.Group, context.Auth, context.APIAuth to allow auth special routes ↵Lunny Xiao2021-06-0919-220/+286
| | | | | | | | | | | (#16086) * Add sso.Group, context.Auth, context.APIAuth to allow auth special routes * Remove unnecessary check * Rename sso -> auth * remove unused method of Auth interface
* Fix http path bug (#16117)Lunny Xiao2021-06-093-0/+131
| | | | | | | | | * Fix http path bug * Add missed request * add tests Co-authored-by: 6543 <6543@obermui.de>
* Refactor routers directory (#15800)Lunny Xiao2021-06-09107-800/+940
| | | | | | | | | | | * refactor routers directory * move func used for web and api to common * make corsHandler a function to prohibit side efects * rm unused func Co-authored-by: 6543 <6543@obermui.de>
* Remove spurious AppSubUrl in serviceworker request. (#16047)zeripath2021-06-081-4/+3
| | | | | | | There is another spurious AppSubUrl placement in the serviceworker registration. This PR removes it. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix `doctor --run check-db-consistency --fix` with label fix (#16094)Lunny Xiao2021-06-081-17/+24
| | | | | | | * Add doctor for wrong label and issue_label data * Fix labels and issue labels check * Remove unnecessary functions
* Always store primary email address into email_address table and also the ↵Lunny Xiao2021-06-0811-236/+593
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | state (#15956) * Always store primary email address into email_address table and also the state * Add lower_email to not convert email to lower as what's added * Fix fixture * Fix tests * Use BeforeInsert to save lower email * Fix v180 migration * fix tests * Fix test * Remove wrong submited codes * Fix test * Fix test * Fix test * Add test for v181 migration * remove change user's email to lower * Revert change on user's email column * Fix lower email * Fix test * Fix test
* Fix data URI scramble (#16098)KN4CK3R2021-06-074-19/+23
| | | | | | | * Removed unused method. * No prefix for data uris. * Added test to prevent regressions.
* Merge all deleteBranch as one function and also fix bug when delete branch ↵Lunny Xiao2021-06-074-146/+111
| | | | | | | | | | | | | don't close related PRs (#16067) * Fix bug when delete branch don't close related PRs * Merge all deletebranch as one method * Add missed branch.go * fix comment Co-authored-by: Lauris BH <lauris@nix.lv>
* Fixed assert statements. (#16089)KN4CK3R2021-06-0756-228/+227
|
* Make commit info cancelable (#16032)zeripath2021-06-0612-35/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Make modules/context.Context a context.Context Signed-off-by: Andrew Thornton <art27@cantab.net> * Simplify context calls Signed-off-by: Andrew Thornton <art27@cantab.net> * Set the base context for requests to the HammerContext Signed-off-by: Andrew Thornton <art27@cantab.net> * pass context into get-last-commit Signed-off-by: Andrew Thornton <art27@cantab.net> * Make commit_info cancellable Signed-off-by: Andrew Thornton <art27@cantab.net> * use context as context Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix regression of renderer (#16091)Lunny Xiao2021-06-062-24/+36
| | | | | * Fix regression of renderer * Fix render setting load twice bug
* [skip ci] Updated translations via CrowdinGiteaBot2021-06-061-0/+3
|
* Rewrite of the LFS server (#15523)KN4CK3R2021-06-067-407/+727
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Restructured code. Moved static checks out of loop. * Restructured batch api. Add support for individual errors. * Let router decide if LFS is enabled. * Renamed methods. * Return correct status from verify handler. * Unified media type check in router. * Changed error code according to spec. * Moved checks into router. * Removed invalid v1 api methods. * Unified methods. * Display better error messages. * Added size parameter. Create meta object on upload. * Use object error on invalid size. * Skip upload if object exists. * Moved methods. * Suppress fields in response. * Changed error on accept. * Added tests. * Use ErrorResponse object. * Test against message property. * Add support for the old invalid lfs client. * Fixed the check because MinIO wraps the error. * Use individual repositories. Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
* Change default TMPDIR path in rootless containers (#16077)Steven2021-06-061-0/+2
| | | Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
* Fix panic (#16072)zeripath2021-06-051-1/+1
| | | | | | | There is an incorrect casting in the wrapped queue. Fix #16071 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix typo and add TODO notice (#16064)NekoBit2021-06-051-2/+2
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
* Add Image Diff for SVG files (#14867)KN4CK3R2021-06-0519-436/+444
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added type sniffer. * Switched content detection from base to typesniffer. * Added GuessContentType to Blob. * Moved image info logic to client. Added support for SVG images in diff. * Restore old blocked svg behaviour. * Added missing image formats. * Execute image diff only when container is visible. * add margin to spinner * improve BIN tag on image diffs * Default to render view. * Show image diff on incomplete diff. Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Copy git data from disk when restore repository (#16066)Lunny Xiao2021-06-043-6/+11
|
* [skip ci] Updated translations via CrowdinGiteaBot2021-06-041-2/+14
|
* Fixed unknown translation key. (#16057)KN4CK3R2021-06-031-1/+1
|
* [skip ci] Updated translations via CrowdinGiteaBot2021-06-031-0/+3
|
* use "true" for RACE_ENABLED (#15261)65432021-06-021-3/+4
|
* Fix case change in ownernames (#16045)zeripath2021-06-023-1/+36
| | | | | | | If you change the case of a username the change needs to be propagated to their repositories. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix bug due to missing MaxStartups and MaxSessions (#16046)zeripath2021-06-012-2/+4
| | | | | | | | | | Unforunately #16009 makes these settings mandatory. This PR uses the same technique as used for the certificates to make these settings non-mandatory. Fix #16044 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix language switch for install page (#16043)a10121127962021-06-012-1/+10
| | | Signed-off-by: a1012112796 <1012112796@qq.com>
* update ``.raw-content`` when edit issue/comment content (#16021)a10121127962021-05-311-0/+2
| | | | | | | | | | | * update ``.raw-content`` when edit issue/comment content fix #16000 Signed-off-by: a1012112796 <1012112796@qq.com> * handle empty content Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Make sshd_config more flexible regarding connections (#16009)Dario Louzado2021-05-311-0/+3
| | | | | | | | | | | | * Make sshd_config more flexible regarding MaxStartups and MaxSessions. See https://man.openbsd.org/sshd_config for more information. * make property prefix equals other existing Gitea SSH properties. Co-authored-by: dlouzado <dlouzado@senado.leg.br>
* [skip ci] Updated translations via CrowdinGiteaBot2021-06-011-0/+8
|
* Add missing SameSite settings for the i_like_gitea cookie (#16037)zeripath2021-05-313-0/+3
| | | | | | | | | | The i_like_gitea cookie appears to be missing the SameSite settings. I think they were present at some point but may have been removed in a merge. This PR ensures that they are set. Fix #15972 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Hide mirror passwords on repo settings page (#16022)zeripath2021-05-313-2/+12
| | | | | | | This PR simply hides mirror passwords from being displayed on the repo settings page. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Encrypt migration credentials at rest (#15895)Norwin2021-05-315-5/+145
| | | | | | | | | | | | | | | | | | | | | | | | * encrypt migration credentials in task persistence Not sure this is the best approach, we could encrypt the entire `PayloadContent` instead. Also instead of clearing individual fields in payload content, we could just delete the task once it has (successfully) finished..? * remove credentials of past migrations * only run DB migration for completed tasks * fix binding * add omitempty * never serialize unencrypted credentials * fix import order Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix bug in reverse proxy (#16026)zeripath2021-05-311-1/+1
| | | | | | | | | | | Unfortunately go panics you try to cast a nil interface{} as another primitive therefore you need to check interfaces are not nil before casting. Fix #16025 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Make modules/context.Context a context.Context (#16031)zeripath2021-05-3114-23/+46
| | | | | | | | | | | | | | | * Make modules/context.Context a context.Context Signed-off-by: Andrew Thornton <art27@cantab.net> * Simplify context calls Signed-off-by: Andrew Thornton <art27@cantab.net> * Set the base context for requests to the HammerContext Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-05-311-0/+9
|
* Replace clipboard.js with async clipboard api (#15899)silverwind2021-05-305-88/+36
| | | | | | | | | | | Use async clipboard api [1] over this dependency, saving around 10kB bundle size before minify while delivering the same functionality. The issue comment button works but does not have a popup indication. We could add some toast-style notifications in the future to fix that but I think it's out of scope of this PR. [1] https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText
* Close the dataRC reader sooner (#16023)zeripath2021-05-301-0/+5
| | | | | Fix #15932 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Improve assets handler middleware (#15961)Lunny Xiao2021-05-306-166/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use route to serve assets but not middleware * Fix build error with bindata tag * convert path to absolute * fix build * reduce function stack * Add tests for assets * Remove test for assets because they are not generated * Use a http function to serve assets * Still use middleware to serve assets then less middleware stack for assets * Move serveContent to original position * remove unnecessary blank line change * Fix bug for /assets* requests * clean code Co-authored-by: zeripath <art27@cantab.net>
* Don't manipulate input params in email notification (#16011)Jimmy Praet2021-05-303-6/+12
|
* [skip ci] Updated licenses and gitignoresGiteaBot2021-05-306-8/+45
|
* Fix get tag when migration (#16014)Lunny Xiao2021-05-291-1/+1
| | | Co-authored-by: zeripath <art27@cantab.net>
* Unified custom config creation (#16012)KN4CK3R2021-05-293-82/+39
| | | | | | | * Unified custom config creation. * Fixed log message. Co-authored-by: techknowlogick <techknowlogick@gitea.io>