summaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* [Vendor] Switch go-version lib (#12719)65432020-09-0511-61/+90
| | | | | | | | | | | | | | | | | | | | | * vendor: switch from "mcuadros/go-version" to "hashicorp/go-version" * Adapt P1 * simplify * fix lint * adapt * fix lint & rm old code * no deadlock * rm RWMutex and check GoVersion only 1-time * Copyright header Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Update to go-org 1.3.2 (#12728)zeripath2020-09-051-3/+3
| | | | | | | | | | | | | * Update to go-org 1.3.2 Fix #12727 Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix unit test Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* additional data for type StopWatch in swagger api (#12458)Jochen Peters2020-09-051-2/+5
| | | | | | | | | | | | * additional data for type StopWatch in swagger api * fix lint-backend issue with gofmt * fix format in v1_json with 'make generate-swagger' * using issue.LoadRepo() instead of getRepositoryByID() Co-authored-by: jochen@homeland <no-go@localhost> Co-authored-by: zeripath <art27@cantab.net>
* Expose Attachemnt Settings by API (#12514)65432020-09-051-0/+8
| | | close #12368
* Refactor webhook payload convertion (#12310)Lunny Xiao2020-09-0412-454/+397
| | | | | | | * Refactor webhook payload convertion * Fix lint Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Remove async pre-empt hack if go >= 1.15 (#12718)zeripath2020-09-041-1/+5
| | | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* API: Expose its limitation settings (#12714)65432020-09-041-0/+8
| | | | | | | | * API: Expose its limitation settings * TESTs Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add spent time to referenced issue in commit message (#12220)Lauris BH2020-09-043-38/+157
|
* fix go1.15 lint error in modules/public/public.go (#12707)65432020-09-041-1/+1
| | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Use argon as default password hash algorithm (#12688)zeripath2020-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * Restrict TLS connections to 1.2 minimum * Set Argon2 as the default KDF * Fix user.yml * Remove TLS minversion changes Signed-off-by: Andrew Thornton <art27@cantab.net> * Add migration as per @techknowlogick Signed-off-by: Andrew Thornton <art27@cantab.net> * set the password algo in the fixtures Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove the v148 migration - it needs recreate table to change the defaults Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Nadim Kobeissi <nadim@symbolic.software>
* Migrations: Gitlab Add Reactions Support for Issues & MergeRequests (#12695)65432020-09-032-23/+120
| | | | | | | | | | | | | * fix migrations: gitlab_test * more stable test * Get Reactions to Pulls * Reactions for Issues * Comments are still hard Co-authored-by: Lauris BH <lauris@nix.lv>
* Avoid sending "0 new commits" webhooks (#12212)S7evinK2020-09-022-2/+10
| | | | | | | | | | | | | | | | | | | | | * Avoid sending "0 new commits" webhook Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Revert "Avoid sending "0 new commits" webhook" This reverts commit 1f47ccfacd81470e2c33a02bb8d255172aa4ec08. * Move commit count check to more central place * Make tests pass * Update modules/webhook/webhook.go Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Set TLS minimum version to 1.2 (#12689)zeripath2020-09-021-0/+2
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* When reading expired sessions - expire them (#12686)zeripath2020-09-022-218/+1
| | | | | | | | | | | | | | | * When reading expired sessions - expire them Update to latest macaron/session following merge of https://gitea.com/macaron/session/pulls/11 Also remove old memory provider as 11 updates the memory provider to make it unnecessary. Signed-off-by: Andrew Thornton <art27@cantab.net> * and macaron/session/pulls/12 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Escape failed highlighted code (#12685)zeripath2020-09-021-1/+2
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Ensure that all migration requests are cancellable (#12669)zeripath2020-09-027-39/+86
| | | | | | | | | | | * Ensure that all migration requests are cancellable Signed-off-by: Andrew Thornton <art27@cantab.net> * Use WithContext as RequestWithContext is go 1.14 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Escape provider name in oauth2 provider redirect (#12648)zeripath2020-08-301-1/+2
| | | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Support elastic search for code search (#10273)Lunny Xiao2020-08-309-157/+670
| | | | | | | | | | | | | | | | | | | | | | | * Support elastic search for code search * Finished elastic search implementation and add some tests * Enable test on drone and added docs * Add new fields to elastic search * Fix bug * remove unused changes * Use indexer alias to keep the gitea indexer version * Improve codes * Some code improvements * The real indexer name changed to xxx.v1 Co-authored-by: zeripath <art27@cantab.net>
* Rename models.ProtectedBranchRepoID to models.EnvRepoID and ensure ↵zeripath2020-08-301-0/+1
| | | | | | EnvPusherEmail is set (#12646) Signed-off-by: Andrew Thornton <art27@cantab.net>
* Set context for running CreateArchive in to that of the request (#12555)zeripath2020-08-281-2/+3
| | | | | | | | | | Set the context for CreateArchive to that of the request to ensure that archives are only built for as long as a request is requesting them Fix #11551 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Macaron 1.5 (#12596)techknowlogick2020-08-271-0/+4
| | | | | | | | | | | | | | * update macaron to v1.5 of fork * update macaron to v1.5 of fork * test gzip PR * add push method impl to context_tests * use proper gzip commit Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Git migration UX (#12619)John Olheiser2020-08-2813-81/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Implementation Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix gitlab and token cloning Signed-off-by: jolheiser <john.olheiser@gmail.com> * Imports and JS Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Linting Signed-off-by: jolheiser <john.olheiser@gmail.com> * Generate swagger Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move mirror toggle and rename options Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Mark Cache with ini tag (#12605)John Olheiser2020-08-261-1/+1
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add cron running API (#12421)zeripath2020-08-241-0/+16
| | | | | | | | | | | | | | | | | | | * Add cron running API Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review * placate-swagger Signed-off-by: Andrew Thornton <art27@cantab.net> * return not found Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix emoji replacements, make emoji images consistent (#12567)silverwind2020-08-233-2/+3
| | | | | | | - Fix emoji not being replaced in issue title change text - Make the image attributes consistent, add alt, remove align Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Initial support for push options (#12169)John Olheiser2020-08-232-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial support for push options Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix misspelling 🤦 Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix formatting after conflict resolution * defer close git repo * According the GitLab documentation, git >= 2.10 Signed-off-by: jolheiser <john.olheiser@gmail.com> * Words are hard. Thanks @mrsdizzie :sweat_smile: Co-authored-by: mrsdizzie <info@mrsdizzie.com> * Only update if there are push options Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Add email notify for new release (#12463)赵智超2020-08-231-0/+13
| | | | | | * Add email notify for new release Signed-off-by: a1012112796 <1012112796@qq.com>
* Ensure that the detected charset order is set in chardet test (#12574)zeripath2020-08-231-5/+23
| | | | | | | | | | | | | | | TestToUTF8WithFallback is the cause of recurrent spurious test failures even despite code to set the detected charset order. The reason why this happens is because the preferred detected charset order is not being initialised for these tests. This PR simply ensures that this is set at the start of each test and would allow different tests to be written to allow differing orders. Replaces #12571 Close #12571 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Set utf8mb4 as the default charset on MySQL if CHARSET is unset (#12563)zeripath2020-08-221-1/+3
| | | | | | | | | | | | MySQL in its infinite wisdom determines that UTF8 does not mean UTF8. Our install scripts know about this and will set CHARSET to utf8mb4 if we users choose this but... users who do not explicitly set this variable will default to utf8mb3 without knowing it. This PR changes the unset CHARSET value to utf8mb4 if users choose to use mysql. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Skip SSPI authentication attempts for /api/internal (#12556)zeripath2020-08-223-1/+8
| | | | | | | | | | | | | | | * Skip SSPI authentication attempts for /api/internal SSPI fails badly on authentication attempts to /api/internal which it can never succesfully authenticate. Fix #11260 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update oauth2.go Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Disable password complexity check default (#12557)mrsdizzie2020-08-211-0/+3
| | | | | | | * Disable password complexity check default These features enourange bad passwords/are annoying for people using better password methods, and at minimum we shouldn't force that as a default for obvious reasons. Disable any default check to avoid regular complaints. * fix copy paste format
* fix typos (#12545)Success2020-08-201-1/+1
| | | | | | | * fix typo in app.ini * fix typo in git hook module Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Default empty merger list to those with write permissions (#12535)zeripath2020-08-201-1/+5
| | | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove hardcoded ES indexername (#12521)Wim2020-08-181-1/+1
|
* change PIDFile default from /var/run/gitea.pid to /run/gitea.pid (#12500)Florian Klink2020-08-181-1/+1
| | | | | | | | | | | | | | | | | | * docs: update heading This section covers more paths than the 3 listed in the heading. * setting: change PIDFile default from /var/run/gitea.pid to /run/gitea.pid On most modern distributions, /var/run is deprecated and only kept for backwards compat according to https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html, and is a symlink to `/run/` on modern distributions. Old Distros that still don't have `/run` can update the gitea default as described in from-source.en-us.md to point to the old location. Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add a storage layer for attachments (#11387)Lunny Xiao2020-08-187-30/+323
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a storage layer for attachments * Fix some bug * fix test * Fix copyright head and lint * Fix bug * Add setting for minio and flags for migrate-storage * Add documents * fix lint * Add test for minio store type on attachments * fix test * fix test * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Add warning when storage migrated successfully * Fix drone * fix test * rebase * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * refactor the codes * add trace * Fix test * remove log on xorm * Fi download bug * Add a storage layer for attachments * Add setting for minio and flags for migrate-storage * fix lint * Add test for minio store type on attachments * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Fix drone * fix test * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * refactor the codes * add trace * Fix test * Add URL function to serve attachments directly from S3/Minio * Add ability to enable/disable redirection in attachment configuration * Fix typo * Add a storage layer for attachments * Add setting for minio and flags for migrate-storage * fix lint * Add test for minio store type on attachments * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Fix drone * fix test * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * don't change unrelated files * Fix lint * Fix build * update go.mod and go.sum * Use github.com/minio/minio-go/v6 * Remove unused function * Upgrade minio to v7 and some other improvements * fix lint * Fix go mod Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Tyler <tystuyfzand@gmail.com>
* Kanban board (#8346)Lanre Adelowo2020-08-165-0/+60
| | | | | | | | | | | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: jaqra <48099350+jaqra@users.noreply.github.com> Co-authored-by: Kerry <flatline-studios@users.noreply.github.com> Co-authored-by: Jaqra <jaqra@hotmail.com> Co-authored-by: Kyle Evans <kevans91@users.noreply.github.com> Co-authored-by: Tsakiridis Ilias <TsakiDev@users.noreply.github.com> Co-authored-by: Ilias Tsakiridis <ilias.tsakiridis@outlook.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Make the default PID file compile-time settable (#12485)zeripath2020-08-151-3/+4
| | | | | | | | | | #12391 offered to change the default PID file from /var/run/gitea.pid however in discussion it was decided that this could break users of older systems. An alternative was offered that we could make the PID file compile/link time settable. This PR does this, and changes the name of the setting from CustomPID to simply PIDFile. It also updates the from-source docs to show how to change the compiler settings to do this. Closes #12391 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Florian Klink <flokli@flokli.de>
* Add Access-Control-Expose-Headers (#12446)zeripath2020-08-132-0/+3
| | | | | | Fix #12424 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* go1.15 (#12475)techknowlogick2020-08-132-1/+3
| | | | | | | | | | | | | * go1.15 * update makefile xgo version * fix vet issue * update docs to version of go in use * add TODO for asyncpreemptoff Co-authored-by: Lauris BH <lauris@nix.lv>
* Do not add prefix on http/https submodule links (#12477)zeripath2020-08-132-3/+4
| | | | | Fix #12345 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Re-attempt to delete temporary upload if the file is locked by another ↵zeripath2020-08-1125-101/+127
| | | | | | | | | | | process (#12447) Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util. Fix #12339 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* Make dashboard newsfeed list length a configurable item (#12469)techknowlogick2020-08-111-0/+2
| | | Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Prevent redirect back to /user/events (#12462)zeripath2020-08-081-3/+6
| | | | | | This PR prevents 2 further ways of causing the redirect cookie to be set to redirect back to /user/events Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make default StaticRootPath compile time settable (#12371)65432020-08-081-1/+4
| | | | | | Make it possible to compile the default location of StaticRootPath independent from AppWorkPath Co-authored-by: Andrew Thornton <art27@cantab.net>
* Detect full references to issues and pulls in commit messages (#12399)zeripath2020-08-063-8/+200
| | | | | Fix #10269 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Render the git graph on the server (#12333)zeripath2020-08-065-91/+1236
| | | | | | | | | | | | | Rendering the git graph on the server means that we can properly track flows and switch from the Canvas implementation to a SVG implementation. * This implementation provides a 16 limited color selection * The uniqued color numbers are also provided * And there is also a monochrome version *In addition is a hover highlight that allows users to highlight commits on the same flow. Closes #12209 Signed-off-by: Andrew Thornton art27@cantab.net Co-authored-by: silverwind <me@silverwind.io>
* Mirror System Notice reports are too frequent (#12438)zeripath2020-08-053-8/+18
| | | | | | This PR switches off the success reports from the Update Mirrors cron job as they are too frequent and not necessarily helpful. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add loading spinners and mermaid error handling (#12358)silverwind2020-08-042-5/+27
| | | | | - Add loading spinners on editor and mermaid renderers - Add error handling and inline error box for mermaid - Fix Mermaid rendering by using the .init api
* Fix incorrect error logging in Stats indexer and OAuth2 (#12387)zeripath2020-08-012-3/+9
| | | | | | | | | | | | | | | | | | | | * Fix incorrect logging in oauth2.go Fix #11945 Signed-off-by: Andrew Thornton <art27@cantab.net> * Handle ErrAlreadyInQueue in stats indexer Fix #12380 Signed-off-by: Andrew Thornton <art27@cantab.net> * Fixes type in error message of indexer Add the missing character in the error message. Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lieven Hollevoet <hollie@lika.be>