aboutsummaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Add restricted user filter to LDAP authentication (#10600)Lauris BH2020-03-052-14/+51
| | | | | | * Add restricted user filter to LDAP authentification * Fix unit test cases
* Ensure executable bit is kept on the web editor (#10607)Antoine GIRARD2020-03-051-2/+10
| | | | Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* OAuth2: add Yandex provider (#8335) (#10564)Lauris BH2020-03-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | * OAuth2: add Yandex provider (#8335) * remove changes from locale ru-RU * fmt modules/auth/oauth2/oauth2.go Co-Authored-By: 6543 <6543@obermui.de> * fix fmt * Update templates/admin/auth/new.tmpl * fix fmt Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix LFS max file size enforcement (#10593)zeripath2020-03-031-0/+6
| | | | | Unfortunately the batch handler also needs to enforce max file size. Enforce max file size in batch handler
* nextcloud oauth (#10562)techknowlogick2020-03-021-0/+23
| | | Fix #7078
* Change default value of DefaultCommandExecutionTimeout to match cheatsheet ↵zeripath2020-03-021-1/+1
| | | | (#10581)
* Display pull request head branch even the branch deleted or repository ↵Lunny Xiao2020-03-022-63/+68
| | | | | | | | | | | | | | | | deleted (#10413) * Display pull request head branch even the branch deleted or repository deleted * Merge getHeadRepo/loadHeadRepo and getBaseRepo/loadBaseRepo on pull and fill repo when pr.Issue.Repo is available * retrieve sha from pull head when pull request branch deleted and fix tests * Fix test * Ensure MustHeadRepoName returns empty string if no head repo Co-authored-by: zeripath <art27@cantab.net>
* Remove Unused Functions (#10516)65432020-03-024-65/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * remove ReplaceLeft * remove GetRepositoryByOwnerAndName chainload to models.GetRepositoryByOwnerAndName * remove CheckUnitUser chainload to models.CheckUnitUser * remove MakeAssigneeList * remove DownloadDiff & DownloadPatch -> DownloadDiffOrPatch * remove GetRandomBytesAsBase64 * remove PushUpdateDeleteTags * remove GetUserByKeyID (you still can resolve user by "k, err := GetPublicKeyByID; userID := k.OwnerID") * remove BasicAuthEncode from struct package -> same function in modules/base/tools ! * remove UserID from api.utils * remove unused func from structs package
* adds API endpoints to manage OAuth2 Application (list/create/delete) (#10437)Gustavo Marin2020-02-292-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | * add API endpoint to create OAuth2 Application. * move endpoint to /user. Add swagger documentations and proper response type. * change json tags to snake_case. add CreateOAuth2ApplicationOptions to swagger docs. * change response status to Created (201) * add methods to list OAuth2 apps and delete an existing OAuth2 app by ID. * add APIFormat convert method and file header * fixed header * hide secret on oauth2 application list * add Created time to API response * add API integration tests for create/list/delete OAuth2 applications. Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* [Refactor] move APIFormat() of Issue and Label to convert package (#10423)65432020-02-284-13/+142
| | | | | | | | | | | | | | | | | | | * Label: delete .APIFormat() and use convert.ToLabel() * move issue APIFormat too * add missing one * move TEST too * handle error -> return empty APIIssue * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Handle panic in indexer initialisation better (#10534)zeripath2020-02-282-0/+19
| | | | | * Handle panic in indexer initialisation better * as per @guillep2k
* Relax sanitization as per https://github.com/jch/html-pipeline (#10527)zeripath2020-02-282-9/+41
| | | | | | | Looking at github/markup#245 it is clear that GH uses https://github.com/jch/html-pipeline to sanitize. This PR relaxes our sanitization to more closely match this. Fixes #10471 and likely others...
* inform participants on UI too (#10473)65432020-02-281-0/+10
| | | | | | | | * inform participants on UI too * ajust test * refactor getParticipantIDsByIssue
* Add max-file-size to LFS (#10463)zeripath2020-02-282-0/+7
| | | | | | | | | | | | | | | * Add max-file-size to LFS * Update modules/lfs/server.go * As per @silverwind Co-Authored-By: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Use media links for img in post-process (#10515)zeripath2020-02-281-5/+29
| | | | | | * use media links for img in post-process * do not visit text of anchors
* Fix potential bugs (#10513)65432020-02-271-1/+1
| | | | | | | * use e if it is an option * potential nil so check err first * check err first * m == nil already checked
* Fix SQLite concurrency problems by using BEGIN IMMEDIATE (#10368)guillep2k2020-02-271-1/+1
| | | | | | | | | * Test locking immediate for SQLite3 * fix url field separator Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Code Refactor of IssueWatch related things (#10401)65432020-02-262-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor * optimize * remove Iretating function LoadWatchUsers do not load Users into IW object and it is used only in api ... so move this logic * remove unessesary * Apply suggestions from code review Thx Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * make Tests more robust * fix rebase * restart CI * CI no dont hit sqlites deadlock Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Change admin dashboard to POST (#10465)John Olheiser2020-02-251-0/+10
| | | | | | | | * Add form and convert to POST * Redirect for flash Signed-off-by: jolheiser <john.olheiser@gmail.com>
* [API] enable paggination for ListRepoTags (#10454)65432020-02-252-2/+14
| | | | | | | | | | | | * enable paggination for repoTags * precalculate first, cut slice second * 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>
* Various fixes in login sources (#10428)guillep2k2020-02-233-7/+9
|
* Fix webhook bug (#10427)Lunny Xiao2020-02-231-2/+2
| | | | Co-authored-by: techknowlogick <matti@mdranta.net>
* Handle push rejection message in Merge & Web Editor (#10373)zeripath2020-02-221-2/+22
| | | | | | | | | | | | | | | | | | * Handle push rejection message in Merge * placate golangci-lint * Fix sanitize, adjust message handling * oops * Oops * Handle push-rejection in webeditor CRUD too * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv>
* Render READMEs in docs/ .gitea or .github from root (#10361)zeripath2020-02-212-0/+38
| | | | * Render READMEs in docs/ .gitea or .github from root
* Add detected file language to code search (#10256)Lauris BH2020-02-208-52/+188
| | | | | | | Move langauge detection to separate module to be more reusable Add option to disable vendored file exclusion from file search Allways show all language stats for search
* Fix notification (#10331)Lunny Xiao2020-02-181-18/+18
|
* Inject SVG sprite via ajax (#10320)John Olheiser2020-02-171-1/+1
| | | | | | | | | | * AJAX SVG * Fix PWA * Remove unused PWA assets Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-Authored-by: silverwind <me@silverwind.io>
* Don't manually replace whitespace during render (#10291)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>
* Notification: queue ui.go notification-service (#10281)zeripath2020-02-151-16/+27
| | | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix Workerpool deadlock (#10283)zeripath2020-02-152-3/+6
| | | | | | * Prevent deadlock on boost * Force a boost in testchannelqueue
* Index code and stats only for non-empty repositories (#10251)Lauris BH2020-02-141-2/+2
| | | | | Fix test and switch to unique queue Fix MySQL support when deleting old statistics
* Issue search support elasticsearch (#9428)Lunny Xiao2020-02-134-21/+273
| | | | | | | | | | | | * Issue search support elasticsearch * Fix lint * Add indexer name on app.ini * add a warnning on SearchIssuesByKeyword * improve code
* Add API branch protection endpoint (#9311)David Svantesson2020-02-122-25/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add API branch protection endpoint * lint * Change to use team names instead of ids. * Status codes. * fix * Fix * Add new branch protection options (BlockOnRejectedReviews, DismissStaleApprovals, RequireSignedCommits) * Do xorm query directly * fix xorm GetUserNamesByIDs * Add some tests * Improved GetTeamNamesByID * http status created for CreateBranchProtection * Correct status code in integration test Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Fix queue pop error and stat empty repository error (#10248)Lunny Xiao2020-02-123-2/+8
| | | | | | * Fix queue pop error and stat empty repository error * Fix error
* Add feishu webhook support (#10229)Lunny Xiao2020-02-125-2/+219
| | | | Add feishu webhook support
* Stop hanging issue indexer initialisation from preventing shutdown (#10243)zeripath2020-02-121-17/+15
| | | | | Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Add Octicon SVG spritemap (#10107)John Olheiser2020-02-112-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add octicon SVG sprite Signed-off-by: jolheiser <john.olheiser@gmail.com> * Static prefix Signed-off-by: jolheiser <john.olheiser@gmail.com> * SVG for all repo icons Signed-off-by: jolheiser <john.olheiser@gmail.com> * make vendor Signed-off-by: jolheiser <john.olheiser@gmail.com> * Swap out octicons Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move octicons to top of less imports Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix JS Signed-off-by: jolheiser <john.olheiser@gmail.com> * Definitely not a search/replace Signed-off-by: jolheiser <john.olheiser@gmail.com> * Missed regex Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move to more generic calls and webpack Signed-off-by: jolheiser <john.olheiser@gmail.com> * make svg -> make webpack Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove svg-sprite Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Missed a test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove svg from makefile Signed-off-by: jolheiser <john.olheiser@gmail.com> * Suggestions Signed-off-by: jolheiser <john.olheiser@gmail.com> * Attempt to fix test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Revert timetracking test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Swap .octicon for .svg in less Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add aria-hidden Signed-off-by: jolheiser <john.olheiser@gmail.com> * Replace mega-octicon Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix webpack globbing on Windows Signed-off-by: jolheiser <john.olheiser@gmail.com> * Revert Co-Authored-By: silverwind <me@silverwind.io> * Fix octions from upstream Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix Vue and missed JS function Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add JS helper and PWA Signed-off-by: jolheiser <john.olheiser@gmail.com> * Preload SVG Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <matti@mdranta.net>
* Language statistics bar for repositories (#8037)Lauris BH2020-02-119-5/+353
| | | | | | | | | | | | | | | | | | * Implementation for calculating language statistics Impement saving code language statistics to database Implement rendering langauge stats Add primary laguage to show in repository list Implement repository stats indexer queue Add indexer test Refactor to use queue module * Do not timeout for queues
* Restore graceful restart on SIGHUP (#10224)zeripath2020-02-111-2/+2
| | | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix commit between two commits calculation if there is only last commit (#10225)Lauris BH2020-02-111-1/+1
|
* [API] Fix inconsistent label color format (#10129)65432020-02-092-4/+4
| | | | | | | | | | | | | | | | * update and use labelColorPattern * add TestCases * fix lint * # optional for templates * fix typo * some more * fix lint of **master**
* modules/log: remove noop written variables (#10182)Lars Lehtonen2020-02-071-8/+0
| | | | Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Prevent double waitgroup decrement (#10170)zeripath2020-02-071-3/+7
| | | | * Prevent double waitgroup decrement
* [API] expose RepoOwner on Issue responce (#10126)65432020-02-041-0/+1
| | | | | | * add RepoOwner on issue api responce * CI.restart()
* Show download count info in release list (#10124)Lauris BH2020-02-033-40/+16
| | | | | | * Show download count info in release list * Use go-humanize
* Move PushUpdateAddDeleteTags to repository module from models (#10106)Lunny Xiao2020-02-032-1/+135
| | | | | | * Move PushUpdateAddDeleteTags to repository module from models * Fix deadlock on sqlite
* Add Unique Queue infrastructure and move TestPullRequests to this (#9856)zeripath2020-02-0216-403/+1389
| | | | | | | | | | | | | | | | | | | | | * Upgrade levelqueue to version 0.2.0 This adds functionality for Unique Queues * Add UniqueQueue interface and functions to create them * Add UniqueQueue implementations * Move TestPullRequests over to use UniqueQueue * Reduce code duplication * Add bytefifos * Ensure invalid types are logged * Fix close race in PersistableChannelQueue Shutdown
* Improve push update options (#10105)Lunny Xiao2020-02-023-143/+187
| | | | | | | | | | | | | | * Improve push update options * fix test * More refactor and fix lint * fix lint * Fix lint Co-authored-by: Lauris BH <lauris@nix.lv>
* Add warning when using relative path to app.ini (#10104)guillep2k2020-02-021-0/+1
| | | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Implement "embedded" command to extract static resources (#9982)guillep2k2020-02-023-0/+77
| | | | | | | | | | | | | | | | | | | | | | | * draft * Implement extract command * Fix nits and force args on extract * Add !bindata stub, support Windows, fmt * fix vendored flag * Remove leading slash for matching * Add docs * Fix typos * Add embedded view command Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>