summaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* Fix count for commit graph last page (#8843)jaqra2019-11-071-1/+7
| | | | | | | | | | | | * Fix count for commit graph last page * Remove used once variable * Move func to model * capitalize method name * fix error message
* Add team option to grant rights for all organization repositories (#8688)David Svantesson2019-11-063-17/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add field IsAllRepositories to team * Add AllRepositories to team UI * Manage team with access to all repositories * Add field IsAllRepositories to team API * put backticks around table/column names * rename IsAllRepositories to IncludesAllRepositories * do not reload slice if already loaded * add repo to teams with access to all repositories when changing repo owner * improve tests for teams with access to all repositories * Merge branch 'master' * Change code for adding all repositories Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * fmt after merge * Change code in API EditTeam similar to EditTeamPost web interface Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Clarify that all repositories will be added Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * All repositories option under Permissions headline * New setting group 'Repository access' * Move check IncludeAllRepositories to removeRepository. * Revert "Move check IncludeAllRepositories to removeRepository." and add comment instead. This reverts commit 753b7d205be260b8be465b5291a02975a81f3093. * Clarify help text what options do.
* Add additional periods to activity page (#8829)Lauris BH2019-11-051-0/+12
|
* Fix new user form for non-local users (#8826)Lauris BH2019-11-041-9/+11
|
* Move more webhook codes from models to webhook module (#8802)Lunny Xiao2019-11-033-12/+14
| | | | * Move more webhook codes from models to webhook module
* Fix API deadline removal (#8759)David Svantesson2019-11-032-7/+21
| | | | | | | | | | * Handle deadline is zero (to remove deadline) * Better API documentation for issue deadline. * Add parameter to unset due date. * Update pull edit API comment
* Add API for Issue set Subscription (#8729)65432019-11-022-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add issue subscriber API * subscribers return []user.APIFormat * add comments * more meaningfull description * without "reqToken()" api works ... * should be still secure beause ctx.user has to be there or nothing will hapen * FIX: getIssueWatchers() get only aktive suscriber * add return avter error on right position * Revert "FIX: getIssueWatchers() get only aktive suscriber" This reverts commit 5eca9291858a821981992b0aaa38cef610d84bca. * Update routers/api/v1/repo/issue.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * test go linter again * update swagger * GetIssueWatchers -> GetIssueSubscribers part one Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * GetIssueWatchers -> GetIssueSubscribers part two * Revert "test go linter again" This reverts commit bab12356227e44334de113b76f12099de0b8aaa6. * change description for unsubscribe too * golangci-lint timeout avter 5min * move issueSubscription to seperate file * dont create black entitys * use IsWatching until refactoring * Update License Info * better swagger description * Update .golangci.yml because functions moved from issue.go to issue_subscription.go * add IssueWatchList type * batch tasks * use e Engien * add error handling * error should be the last type when returning multiple items * short version * reurn empy UserList instead of nil
* Prevent upload (overwrite) of lfs locked file (#8769)David Svantesson2019-11-021-1/+5
| | | | | | | | | | | | * Check if file is locked on upload file commit. * Better user message if file is locked. * Check lfs lock before creating temporary repository. fix some errors. * move lines * Add comment that enabled setting is checked.
* Move issue milestone assign to issue service and move webhook to ↵Lunny Xiao2019-11-023-6/+3
| | | | notification (#8780)
* Rename HookQueue to hookQueue (#8778)Lunny Xiao2019-11-023-4/+1
| | | | | | * Rename HookQueue to hookQueue * fix lint
* Move webhook to a standalone package under modules (#8747)Lunny Xiao2019-11-014-6/+10
| | | | | | | | * Move webhook to a standalone package under modules * fix test * fix comments
* Allow cross-repository dependencies on issues (#7901)Brad Albright2019-10-314-5/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * in progress changes for #7405, added ability to add cross-repo dependencies * removed unused repolink var * fixed query that was breaking ci tests; fixed check in issue dependency add so that the id of the issue and dependency is checked rather than the indexes * reverted removal of string in local files becasue these are done via crowdin, not updated manually * removed 'Select("issue.*")' from getBlockedByDependencies and getBlockingDependencies based on comments in PR review * changed getBlockedByDependencies and getBlockingDependencies to use a more xorm-like query, also updated the sidebar as a result * simplified the getBlockingDependencies and getBlockedByDependencies methods; changed the sidebar to show the dependencies in a different format where you can see the name of the repository * made some changes to the issue view in the dependencies (issue name on top, repo full name on separate line). Change view of issue in the dependency search results (also showing the full repo name on separate line) * replace call to FindUserAccessibleRepoIDs with SearchRepositoryByName. The former was hardcoded to use isPrivate = false on the repo search, but this code needed it to be true. The SearchRepositoryByName method is used more in the code including on the user's dashboard * some more tweaks to the layout of the issues when showing dependencies and in the search box when you add new dependencies * added Name to the RepositoryMeta struct * updated swagger doc * fixed total count for link header on SearchIssues * fixed indentation * fixed aligment of remove icon on dependencies in issue sidebar * removed unnecessary nil check (unnecessary because issue.loadRepo is called prior to this block) * reverting .css change, somehow missed or forgot that less is used * updated less file and generated css; updated sidebar template with styles to line up delete and issue index * added ordering to the blocked by/depends on queries * fixed sorting in issue dependency search and the depends on/blocks views to show issues from the current repo first, then by created date descending; added a "all cross repository dependencies" setting to allow this feature to be turned off, if turned off, the issue dependency search will work the way it did before (restricted to the current repository) * re-applied my swagger changes after merge * fixed split string condition in issue search * changed ALLOW_CROSS_REPOSITORY_DEPENDENCIES description to sound more global than just the issue dependency search; returning 400 in the cross repo issue search api method if not enabled; fixed bug where the issue count did not respect the state parameter * when adding a dependency to an issue, added a check to make sure the issue and dependency are in the same repo if cross repo dependencies is not enabled * updated sortIssuesSession call in PullRequests, another commit moved this method from pull.go to pull_list.go so I had to re-apply my change here * fixed incorrect setting of user id parameter in search repos call
* Move webhook codes from service to webhook notification (#8712)Lunny Xiao2019-10-302-14/+1
| | | | | | | | * Move webhook codes from service to webhook notification * move deletecomment webhook to notifications * fix notification
* Move issue change content from models to service (#8711)Lunny Xiao2019-10-301-1/+1
| | | | | | * Move issue change content from models to service * fix lint
* Create PR on Current Repository by Default (#8670)Benno2019-10-301-0/+28
| | | | | | | | | | | | | | * 'update' * Send push tag event when release created * send tag create event while release created in UI * update to go v1.13 * fix gofmt error * fix #8576 create pull request on current repository by default
* Respect LFS File Lock on UI (#8719)Benno2019-10-292-6/+38
| | | | | | | | * update #8687 respect file locking * upate #8687 Add LFS locker information * update #8719 enhance coding style and return error
* Show zero lines on the line counter if the file empty (#8700)Lukas2019-10-291-0/+5
| | | | | | | | | | * Show zero lines on the line counter if the file empty Signed-off-by: LukBukkit <luk.bukkit@gmail.com> * A single variable to check whether NumLines is set Signed-off-by: LukBukkit <luk.bukkit@gmail.com>
* Add basic repository lfs management (#7199)zeripath2019-10-282-0/+561
| | | | | | | | | | | | This PR adds basic repository LFS management UI including the ability to find all possible pointers within the repository. Locks are not managed at present but would be addable through some simple additions. * Add basic repository lfs management * add auto-associate function * Add functionality to find commits with this lfs file * Add link to find commits on the lfs file view * Adjust commit view to state the likely branch causing the commit * Only read Oid from database
* Move issue notifications (#8713)Lunny Xiao2019-10-294-30/+4
|
* Move issue change status from models to service (#8691)Lunny Xiao2019-10-283-14/+5
|
* Move more issue assignee code from models to issue service (#8690)Lunny Xiao2019-10-281-5/+2
| | | | | | * Move more issue assignee code from models to issue service * fix test
* Fix deadline on update issue or PR via API (#8696)David Svantesson2019-10-282-16/+14
| | | | | | * Fix deadline on update issue or PR via API * variable initialized directly (review comment)
* Move some repositories' operations to a standalone service package (#8557)Lunny Xiao2019-10-266-33/+23
| | | | | | | | | | | | * Move some repositories' operations to a standalone service package * improve code * remove unused codes * add rollback when fork failed * add repo when return
* Mail assignee when issue/pull request is assigned (#8546)David Svantesson2019-10-255-17/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Send email to assigned user * Only send mail if enabled * Mail also when assigned through API * Need to refactor functions from models to issue service * Refer to issue index rather than ID * Disable email notifications completly at initalization if global disable * Check of user enbled mail shall be in mail notification function only * Initialize notifications from routers init function. * Use the assigned comment when sending assigned mail * Refactor so that assignees always added as separate step when new issue/pr. * Check error from AddAssignees * Check if user can be assiged to issue or pull request * Missing return * Refactor of CanBeAssigned check. CanBeAssigned shall have same check as UI. * Clarify function names (toggle rather than update/change), and clean up. * Fix review comments. * Flash error if assignees was not added when creating issue/pr * Generate error if assignee users doesn't exist
* Revert "API should follow RequireSignInView (#8654)" (#8675)Lunny Xiao2019-10-241-8/+1
| | | This reverts commit 3c63c3ace4bff1e0e796759a4676fcfff3c5c872.
* API should follow RequireSignInView (#8654)Lunny Xiao2019-10-241-1/+8
|
* Hide some user information via API if user have no enough permission (#8655)Lunny Xiao2019-10-241-4/+4
| | | | | | * Hide some user information via API if user have no enough permission * fix test
* Fix 500 when getting user as unauthenticated user (#8653)Monty Taylor2019-10-241-1/+1
| | | | | | | | When doing GET /api/v1/users/{user} as an unauthenticated user, gitea throws a 500 because it's trying to dereference elements from the context user. It wants to do this to see whether to show the primary email and will do that if the logged in user is admin or the user in question. However, if ctx.User is nil, go gets really unhappy.
* Use AppSubUrl for more redirections (#8647)zeripath2019-10-231-1/+1
| | | | Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template Fixes /explore and organisation redirection
* Make /users/{username}/repos list private repos the current user has access ↵7FM2019-10-231-1/+1
| | | | to (#8621)
* Improve OGP (#8637)John Olheiser2019-10-231-0/+4
| | | | | | | * Improve OGP * Ensure Repo is loaded when checking Pull info Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Allow Protected Branches to Whitelist Deploy Keys (#8483)zeripath2019-10-213-1/+9
| | | | | | | | | | | | | | | Add an option to protected branches to add writing deploy keys to the whitelist for pushing. Please note this is technically a breaking change: previously if the owner of a repository was on the whitelist then any writing deploy key was effectively on the whitelist. This option will now need to be set if that is desired. Closes #8472 Details: * Allow Protected Branches to Whitelist Deploy Keys * Add migration * Ensure that IsDeployKey is set to false on the http pushes * add not null default false
* Allows external rendering of other filetypes 2 (#8300)George Harvey2019-10-211-0/+14
| | | | | | | | | | | | | * allow external rendering of other filetypes fixes #4996 and #7614 allows rendering of non-tex files, or otherwise accounted for filetypes * Moves flie-size check before read() And performs gofmt -s * Only reads if markType is detected
* Move issue label operations to issue service package (#8553)Lunny Xiao2019-10-192-3/+3
| | | | | | | | * Move issue label operations to issue service package * fix test * fix fmt
* Fix template error on account page (#8562)John Olheiser2019-10-191-1/+1
|
* Fix bug on pull requests when transfer head repository (#8564)Lunny Xiao2019-10-182-26/+24
| | | | | | | | * fix bug on pull requests when transfer head repository * add migration and fix lint * fix tests and add a cache check on LoadBaseRepo
* Fix review webhooks (#8570)John Olheiser2019-10-181-2/+2
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Upgrade xorm to v0.8.0 (#8536)Lunny Xiao2019-10-171-1/+1
|
* don't ignore error message (#8550)Antoine GIRARD2019-10-171-1/+1
|
* Sign merges, CRUD, Wiki and Repository initialisation with gpg key (#7631)zeripath2019-10-163-8/+77
| | | | | | | | | | | | | | | | | | | This PR fixes #7598 by providing a configurable way of signing commits across the Gitea instance. Per repository configurability and import/generation of trusted secure keys is not provided by this PR - from a security PoV that's probably impossible to do properly. Similarly web-signing, that is asking the user to sign something, is not implemented - this could be done at a later stage however. ## Features - [x] If commit.gpgsign is set in .gitconfig sign commits and files created through repofiles. (merges should already have been signed.) - [x] Verify commits signed with the default gpg as valid - [x] Signer, Committer and Author can all be different - [x] Allow signer to be arbitrarily different - We still require the key to have an activated email on Gitea. A more complete implementation would be to use a keyserver and mark external-or-unactivated with an "unknown" trust level icon. - [x] Add a signing-key.gpg endpoint to get the default gpg pub key if available - Rather than add a fake web-flow user I've added this as an endpoint on /api/v1/signing-key.gpg - [x] Try to match the default key with a user on gitea - this is done at verification time - [x] Make things configurable? - app.ini configuration done - [x] when checking commits are signed need to check if they're actually verifiable too - [x] Add documentation I have decided that adjusting the docker to create a default gpg key is not the correct thing to do and therefore have not implemented this.
* Add missed close in ServeBlobLFS (#8527)zeripath2019-10-161-0/+5
|
* Fix password complexity regex for special characters (on master) (#8525)guillep2k2019-10-163-27/+15
| | | | | | | | | | | | | | | | | | | | * Fix extra space * Fix regular expression * Fix error template name * Simplify check code, fix default values, add test * Fix router tests * Fix fmt * Fix setting and lint * Move cleaning up code to test, improve comments * Tidy up variable declaration
* upgrade gopkg.in/editorconfig/editorconfig-core-go.v1 (#8501)Colin Arnott2019-10-151-1/+1
| | | | | editorconfig-core-go made breaking api changes and has recently released v2.1.1. This change consumes the new api and fixes up any breaking references.
* Restore Graceful Restarting & Socket Activation (#7274)zeripath2019-10-152-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prevent deadlock in indexer initialisation during graceful restart * Move from gracehttp to our own service to add graceful ssh * Add timeout for start of indexers and make hammer time configurable * Fix issue with re-initialization in indexer during tests * move the code to detect use of closed to graceful * Handle logs gracefully - add a pid suffix just before restart * Move to using a cond and a holder for indexers * use time.Since * Add some comments and attribution * update modules.txt * Use zero to disable timeout * Move RestartProcess to its own file * Add cleanup routine
* Enable Uploading/Removing Attachments When Editing an Issue/Comment (#8426)blueworrybear2019-10-153-4/+135
|
* Move clearlabels from models to issue service (#8326)Lunny Xiao2019-10-152-2/+4
| | | | | | | | | | * move clearlabels from models to issue service * improve code * Apply suggestions from code review Co-Authored-By: zeripath <art27@cantab.net>
* Move AddTestPullRequestTask to pull service package from models (#8324)Lunny Xiao2019-10-151-1/+1
| | | | | | * move AddTestPullRequestTask to pull service package from models * fix fmt
* [Branch View] Add Included TAG (#8449)65432019-10-141-0/+4
| | | | | | | | * included message * add property IsIncluded * Add Orange Lable
* Make static resouces web browser cache time customized on app.ini (#8442)Lunny Xiao2019-10-141-4/+4
| | | | | | | | | | | | | | * make static resouces web browser cache time customized on app.ini * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-Authored-By: zeripath <art27@cantab.net> * Update custom/conf/app.ini.sample Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * fix docs
* Add pagination to commit graph page (#8360)jaqra2019-10-141-2/+4
| | | Fixes #8308