summaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Return json on 500 error from API (#11574) (#11660)65432020-05-281-4/+21
| | | | | | | Backport #11574 add API specific InternalServerError() InternalServerError
* Prevent (caught) panic on login (#11590) (#11598)zeripath2020-05-271-6/+14
| | | | | | | | | | | | | | | | | Backport #11590 Unfortunately when the virtual session is released it requires that the real session does not exist. This worked fine when sessions were only saved at the end of request/response cycle however, now sessions are saved proactively this does not hold. The result is a caught panic in the logs during every log-in. This panic has no significant side-effects but should not occur. This PR marks the virtual session as released when released and updates it if the same session is released again. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use media links for img in post-process (#10515) (#11504)zeripath2020-05-191-5/+29
| | | | | * use media links for img in post-process * do not visit text of anchors
* Add NotifySyncPushCommits to indexer notifier (#11309) (#11338)zeripath2020-05-081-0/+6
| | | | | | | | | Thanks to @simon-on-gh for tracking down the issue. Fix #11200 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Prevent timer leaks in Workerpool and others (#11333) (#11340)zeripath2020-05-094-20/+29
| | | | | | | | | | | | | | | | | | | There is a potential memory leak in `Workerpool` due to the intricacies of `time.Timer` stopping. Whenever a `time.Timer` is `Stop`ped its channel must be cleared using a `select` if the result of the `Stop()` is `false`. Unfortunately in `Workerpool` these were checked the wrong way round. However, there were a few other places that were not being checked. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Manage port in submodule refurl (#11305) (#11323)zeripath2020-05-071-3/+7
| | | | | | | | | | | | | | | | | | | | | | | * Manage port in submodule refurl Fix #11304 Signed-off-by: Andrew Thornton <art27@cantab.net> * fix lint Signed-off-by: Andrew Thornton <art27@cantab.net> * URLJoin is causes a cyclic dependency and possibly isn't what what we want anyway Signed-off-by: Andrew Thornton <art27@cantab.net> * Protect against leading .. in scp syntax Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* api.Context.NotFound(...) should tolerate nil (#11288) (#11306)zeripath2020-05-051-0/+5
| | | | | | | | | | | | | There is an unfortunate signature change with the api.Context NotFound function; whereas the normal modules/context/Context NotFound function requires an error or nil, the api.Context variant will panic with an NPE if a nil is provided. This PR will allow api.Context.NotFound to tolerate a being passed a nil. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix GetContents(): Dont't ignore Executables (#11192) (#11209)65432020-04-251-1/+1
|
* Fix submodule paths when AppSubUrl is not root (#11098) (#11176)zeripath2020-04-222-29/+26
| | | | | | | Backport #11098 Fix #11002 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [Backport] Fix release counter on API repository info (#10968) (#10996)65432020-04-061-2/+1
| | | | | * Fix release counter on API repository info (#10968) * correct Pull Count to v1.11 Fixtures
* Mulitple Gitea Doctor improvements (#10943) (#10990) (#10064) (#9095) (#10991)zeripath2020-04-062-0/+10
| | | | | | | | | | | | | | | | | | | | | | * Mulitple Gitea Doctor improvements (#10943) Backport #10943 * Add `gitea doctor --list` flag to list the checks that will be run, including those by default * Add `gitea doctor --run` to run specific checks * Add `gitea doctor --all` to run all checks * Add db version checker * Add non-default recalculate merge bases check/fixer to doctor * Add hook checker (Fix #9878) and ensure hooks are executable (Fix #6319) * Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.) * Add SCRIPT_TYPE check (Fix #10977) * Add `gitea doctor --fix` to attempt to fix what is possible to easily fix * Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.) Signed-off-by: Andrew Thornton <art27@cantab.net> * Switch to io.Writer instead of io.StringWriter Signed-off-by: Andrew Thornton <art27@cantab.net>
* Convert plumbing.ErrObjectNotFound to git.ErrNotExist in getCommit (#10862) ↵zeripath2020-03-291-1/+7
| | | | | | | | | | | (#10868) Backport #10862 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Convert plumbing.ErrReferenceNotFound to git.ErrNotExist in GetRefCommitID ↵zeripath2020-03-231-1/+6
| | | | | | | | | | | | | | | | | (#10676) (#10797) * Fix panic in API pulls when headbranch does not exist (#10676) Backport #10676 * Fix panic in API pulls when headbranch does not exist * refix other reference to plumbing.ErrReferenceNotFound Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review Co-Authored-By: Lauris BH <lauris@nix.lv>
* Fix bug on branch API (#10767) (#10775)Lunny Xiao2020-03-201-7/+21
| | | | | * Fix bug on branch API (#10767) * Fix branch api canPush and canMerge
* Migrate to go-git/go-git v5.0.0 (#10735) (#10753)Lauris BH2020-03-1819-34/+34
|
* Ensure executable bit is kept on the web editor (#10607) (#10614)Lunny Xiao2020-03-051-2/+10
| | | | | | Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Fix potential bugs (#10513) (#10518)65432020-02-281-1/+1
| | | | | | * use e if it is an option * potential nil so check err first * check err first * m == nil already checked
* Handle push rejection message in Merge & Web Editor (#10373) (#10497)zeripath2020-02-271-4/+24
| | | | | | | | | | | | | | Backport #10373 * Handle push rejection message in Merge * Fix sanitize, adjust message handling * Handle push-rejection in webeditor CRUD too Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix SQLite concurrency problems by using BEGIN IMMEDIATE (#10368) (#10493)guillep2k2020-02-261-1/+1
|
* Change admin dashboard to POST (#10465) (#10466)John Olheiser2020-02-251-0/+10
| | | | | | | | | | | | * Change admin dashboard to POST (#10465) * Add form and convert to POST * Redirect for flash * Convert octicons back to fa for 1.11 Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix webhook bug (#10427) (#10432)Lunny Xiao2020-02-241-2/+2
| | | | Co-authored-by: techknowlogick <matti@mdranta.net>
* Various fixes in login sources (#10428) (#10429)zeripath2020-02-232-6/+8
| | | | Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Don't manually replace whitespace during render (#10291) (#10315)mrsdizzie2020-02-172-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Don't manually replace whitespace during render For historical reasons Gitea manually alters the urlPrefix and replaces a whitespace with a +. This Works for URLs, but we're also passing urlPrefix to git calls and adding the + is breaking the tree path. Goldmark will automatically convert a white space to the proper %20, so we should leave the string as is which lets us pass it to git unmodified and then let Goldmark fix it. Also fixed separate bug in URLJoin I noticed while testing where it will silently discard sections of a path that have # in them (possibly others). We should just escape it first. Fixes 10156 * Escape elems as well * Revert "Escape elems as well" This reverts commit 8bf49596fee6fac4d9da256cd1e90a0ec0183671. * restart ci * remove changes to URLJoin * restart ci Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: techknowlogick <matti@mdranta.net>
* Fix Workerpool deadlock (#10283) (#10284)zeripath2020-02-152-3/+4
| | | | | * Prevent deadlock on boost * Force a boost in testchannelqueue
* Stop hanging issue indexer initialisation from preventing shutdown (#10243) ↵zeripath2020-02-121-17/+15
| | | | | | | | (#10249) Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Fix commit between two commits calculation if there is only last commit ↵Lauris BH2020-02-111-1/+1
| | | | (#10225) (#10226)
* Prevent double waitgroup decrement (#10170) (#10175)guillep2k2020-02-071-3/+7
| | | | | | * Prevent double waitgroup decrement Co-authored-by: zeripath <art27@cantab.net>
* Sanitize credentials in mirror form (#9975) (#9991)Lunny Xiao2020-01-262-0/+28
|
* Fix pull view when head repository or head branch missed and close related ↵Lunny Xiao2020-01-251-5/+17
| | | | | | | | | | | | | | | | | | | | pull requests when delete head repository or head branch (#9927) (#9974) * fix pull view when head repository or head branch missed and close related pull requests when delete branch * fix pull view broken when head repository deleted * close pull requests when head repositories deleted * Add tests for broken pull request head repository or branch * fix typo * ignore special error when close pull request Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix check for push on default branch (#9963)guillep2k2020-01-241-1/+2
| | | | Co-authored-by: techknowlogick <matti@mdranta.net>
* Fix file rename/copy not supported by indexer (#9967)guillep2k2020-01-241-2/+27
|
* Don't convert ellipsis in markdown (#9905) (#9937)John Olheiser2020-01-221-2/+3
| | | | | | | | | | | | | | | | | | * Don't convert ellipsis Signed-off-by: jolheiser <john.olheiser@gmail.com> * Formatting Co-Authored-By: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net>
* Fix wrong hint when status checking is running on pull request view (#9886) ↵Lunny Xiao2020-01-222-0/+64
| | | | | | | | | | | | | | | | | (#9928) * Fix wrong hint when status checking is running on pull request view * fix lint * fix test * fix test * fix wrong tmpl * fix import * rename function name
* Fix RocketChat (#9908) (#9921)John Olheiser2020-01-211-10/+5
| | | | | | | | | | | | | | | | | | * Fix RocketChat?? Signed-off-by: jolheiser <john.olheiser@gmail.com> * Don't send attachment for repo create/delete Signed-off-by: jolheiser <john.olheiser@gmail.com> * Make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* Update queue_redis.go (#9911)zeripath2020-01-211-5/+6
|
* Add option to prevent LDAP from deactivating everything on empty search ↵zeripath2020-01-202-0/+2
| | | | | | | | | | | (#9879) (#9896) * Add option to prevent LDAP from deactivating everything on empty search * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix wrong permissions check when issues/prs shared operations (#9885) (#9889)Lunny Xiao2020-01-202-3/+3
| | | | | | | | | | * Fix wrong permissions check when issues/prs shared operations * move redirect to the last of the function * fix swagger Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Allow hyphen in language name (#9873) (#9880)zeripath2020-01-191-1/+1
| | | | Co-authored-by: techknowlogick <matti@mdranta.net>
* [Backport] CI optimisation & add github token env var (#9875)65432020-01-192-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ci: use docker image for golangci-lint (#9737) * ci: re-ordering Drone CI for optimizing time (#9719) * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try re-ordering for optimizing time * ci: try offloading mysql8 to arm64 * Revert "ci: try offloading mysql8 to arm64" This reverts commit c60de5db1cf8b5984c3014a57da6490f06c8d980. * ci: try offloading pgsql to arm64 * ci: activate ldap on arm64 * ci: test mysql8 in place pgsql arm64 * chore: clean un-needed move * typo * ci: revert runnning mysql on arm64 * ci: run compliance on arm * chore: limit change * chore: readd maybe need for release fetch-tags * ci: remove docker-linux-amd64-dry-run * ci: remove docker-linux-amd64-dry-run * Revert "ci: remove docker-linux-amd64-dry-run" This reverts commit 0715f65b11c37869359aaaa5d22901da512e8184. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * ci: use new mssql image (#9720) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * ci: run notify on arm64 (#9762) * ci: run notify on arm64 Free one jobs on amrd64 * Update .drone.yml * Update .drone.yml * Update .drone.yml Based on: https://github.com/appleboy/drone-discord/blob/master/.drone.yml#L339 * improve trigger Co-authored-by: techknowlogick <matti@mdranta.net> * ci: move some integration tests on arm64 (#9747) * tests: configure github remaining limit + read token (#9800) * ci: configure remaining github limmit * prepend with github since package is common to all migrations * add RefreshRate * Update github.go * add missing space * go fmt * Read env variable GITHUB_READ_TOKEN for token * Update .drone.yml * ci: simplify tag/release by always running coverage (#9774) * ci: simplify tag/release by always running coverage * use mod and vendor for unit test coverage * remove not needed lfs for unit test * use arm drone agent for docs (#9776) * run translations pipeline on arm server (#9865) * add git-check to Makefile Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <matti@mdranta.net>
* Make CertFile and KeyFile relative to CustomPath (#9868) (#9874)zeripath2020-01-192-2/+22
| | | | | | | | | | | | | | | | | | * Make CertFile and KeyFile relative to CustomPath The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath. Fix #4196 * Improve error reporting when reading certificates * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Fix issues/pulls dependencies problems (#9842) (#9864)Lunny Xiao2020-01-191-2/+2
| | | | | | | * Fix issues/pulls dependencies problems * fix swagger and api param name * fix js
* Fix markdown anchor links (#9673) (#9840)Moritz2020-01-171-0/+3
|
* Fix missing unlock in uniquequeue (#9791)zeripath2020-01-161-0/+1
|
* Fix #9752 (#9769) (#9775)65432020-01-151-1/+1
| | | | Co-authored-by: zeripath <art27@cantab.net>
* Fix missing updated time on migrated issues and comments (#9744) (#9764)Lunny Xiao2020-01-146-0/+15
| | | | | | | | | | * Fix missing updated time on migrated issues and comments * Fix testing and missing updated on migrating pullrequest Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Make hook status printing configurable with delay (#9641) (#9725)zeripath2020-01-121-0/+4
| | | | | | | | | | | | | | | | * Delay printing hook statuses until after 1 second * Move to a 5s delay, wrapped writer structure and add config * Update cmd/hook.go * Apply suggestions from code review * Update cmd/hook.go Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Remove unused lock (#9710)zeripath2020-01-112-1/+3
|
* Missed q.lock.Unlock() will cause panic (#9706)zeripath2020-01-111-1/+0
|
* Don't attempt to close issue if already closed (#9699)guillep2k2020-01-111-3/+5
|
* Prevent redirect to Host (#9678) (#9679)zeripath2020-01-091-1/+2
|