summaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Move all push update operations to a queue (#10133)Lunny Xiao2020-09-113-560/+0
| | | | | | | | | | | | | | | | | | | | * Fix test * Add no queue for test only * improve code * Auto watch whatever branch operation * Fix lint * Rename noqueue to immediate * Remove old PushUpdate function * Fix tests Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [API] Migration: Change ServiceType String (#12672)65432020-09-108-37/+86
| | | | | | | | | | | | | | | | | | | | | | | | | * use different structs for MigrateRepoOptions on UI and API * Fix TokenAuth and rename UID to an understandable Name * fix swagger doc * simplify & mk redable * R E F A C T O R: migration has now internal 3 structs to store its options: * the Options for WebUI: modules/auth/repo_form.go * the Options for API: modules/structs/repo.go * the option struct with after validation for internal prossessing: modules/migrations/base/options.go * Copyright Header * Deprecate UID - add RepoOwner * adopt repo.go -> migrate.go * add comment about each struct purpose * lint
* Add check for LDAP group membership (#10869)John Olheiser2020-09-103-2/+101
| | | | | | | | | | | | | | This is a port of gogs/gogs#4398 The only changes made by myself are: Add locales Add some JS to the UI Otherwise all code credit goes to @aboron Resolves #10829 Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* GitLab DL: normalizeColor (#12793)65432020-09-101-1/+14
|
* return error when create gitlabdownloader (#12790)Lunny Xiao2020-09-102-25/+10
|
* Add a migrate service type switch page (#12697)Lunny Xiao2020-09-091-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a migrat service type switch page * Improve translations * remove images * Fix images * remove extra create repo button on dashboard * Follow reviewers' opinions * Fix frontend lint * Remove wrong submit file * Fix tests * Adjust the size of image * Apply suggestions from code review Co-authored-by: 赵智超 <1012112796@qq.com> * Remove username and password from migration of github/gitlab * Improve docs * Improve interface docs Co-authored-by: 赵智超 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix yet another bug with diff file names (#12771)zeripath2020-09-091-1/+1
| | | | | | | | | | Following further testing it has become apparent that the diff line cannot be used to determine filenames for diffs with any sort of predictability the answer therefore is to use the other lines that are provided with a diff Fix #12768 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Check passwords against HaveIBeenPwned (#12716)John Olheiser2020-09-083-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement pwn Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update module Signed-off-by: jolheiser <john.olheiser@gmail.com> * Apply suggestions mrsdizzie Co-authored-by: mrsdizzie <info@mrsdizzie.com> * Add link to HIBP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add more details to admin command Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add context to pwn Signed-off-by: jolheiser <john.olheiser@gmail.com> * Consistency and making some noise ;) Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: zeripath <art27@cantab.net>
* File header tweaks, add CSS helpers (#12635)silverwind2020-09-081-2/+12
| | | | | | | | | - replace two instances of fontawesome with octicons - add new "class" optional argument to "svg" helper - add many new CSS helpers and move their import to the end for increaseed precedence Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Change/remove a branch of an open issue (#9080)Vedran2020-09-084-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add field with isIssueWriter to front end * Make branch field editable * Switch frontend to form and POST from javascript * Add /issue/id/ref endpoint to routes * Use UpdateIssueTitle model to change ref in backend * Removed crossreference check and adding comments on branch change * Use ref returned from POST to update the field * Prevent calling loadRepo from models/ * Branch/tag refreshed without page reload * Remove filter for empty branch name * Add clear option to tag list as well * Delete button translation and coloring * Fix for not showing selected branch name in new issue * Check that branch is not being changed on a PR * Change logic * Notification when changing issue ref * Fix for renamed permission parameter * Fix for failing build * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Gitea <gitea@fake.local> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* LFS support to be stored on minio (#12518)Lunny Xiao2020-09-0810-161/+297
| | | | | | | | | | | | | | | | | * LFS support to be stored on minio * Fix test * Fix lint * Fix lint * Fix check * Fix test * Update documents and add migration for LFS * Fix some bugs
* Compare SSH_DOMAIN when parsing submodule URLs (#12753)mrsdizzie2020-09-072-22/+24
| | | | | Right now we only compare the hostname from a submodule with the prefixURL it is viewed from to check if the submodule is hosted on the same Gitea instance. This adds an additional check to compare it against SSH_DOMAIN as well since the same Gitea instance might have a different hostname for SSH and if the submodule uses that hostname we should also detect that and link to the proper DOMAIN value. Fixes #12747, #9756
* Add queue for code indexer (#10332)Lunny Xiao2020-09-074-160/+216
| | | | | | | | | | | | | | | | | | | | | * Add queue for code indexer * Fix lint * Fix test * Fix lint * Fix bug * Fix bug * Fix lint * Add noqueue * Fix tests * Rename noqueue to immediate
* RepoInit Respect AlternateDefaultBranch (#12746)65432020-09-061-0/+4
|
* Fix Avatar Resize (resize algo NearestNeighbor -> Bilinear) (#12745)65432020-09-061-1/+1
| | | | | | * Update Vendor github.com/nfnt/resize * switch resize algo NearestNeighbor -> Bilinear
* [Vendor] Update xanzy/go-gitlab v0.31.0 => v0.37.0 (#12701)65432020-09-061-2/+2
| | | | | | | | | * update github.com/xanzy/go-gitlab v0.31.0 => v0.37.0 * vendor * adapt changes Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* use assignment in tests (#12734)zeripath2020-09-062-2/+2
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* refactor repo_stats to use os.pipe (#11726)techknowlogick2020-09-052-67/+86
| | | | | | | | | | | | | * refactor repo_stats to use os.pipe * woops. missing reader. * stdout not stderr, woops * Fix copyright date and ensure that the stderr is collected Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Add Created & Updated to Milestone (#12662)65432020-09-053-0/+10
| | | | | | | | | * Add Created and Updated to Milestone table and expose via API * Expose to UI - To Overloaded ?!? * fix unit test Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [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