summaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix errors in create org UI regarding team access permission. (#8506)David Svantesson2019-10-141-4/+5
|
* Password Complexity Checks (#6230)Maxim Tkachenko2019-10-145-27/+92
| | | | | | | | | Add password complexity checks. The default settings require a lowercase, uppercase, number and a special character within passwords. Co-Authored-By: T-M-A <maxim.tkachenko@gmail.com> Co-Authored-By: Lanre Adelowo <adelowomailbox@gmail.com> Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-Authored-By: Lauris BH <lauris@nix.lv>
* Update migrated repositories' issues/comments/prs poster id if user has a ↵Lunny Xiao2019-10-142-51/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | github external user saved (#7751) * update migrated issues/comments when login as github * add get userid when migrating or login with github oauth2 * fix lint * add migrations for repository service type * fix build * remove unnecessary dependencies on migrations * add cron task to update migrations poster ids and fix posterid when migrating * fix lint * fix lint * improve code * fix lint * improve code * replace releases publish id to actual author id * fix import * fix bug * fix lint * fix rawdata definition * fix some bugs * fix error message
* Move migrating repository from frontend to backend (#6200)Lunny Xiao2019-10-136-43/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move migrating to backend * add loading image when migrating and fix tests * fix format * fix lint * add redis task queue support and improve docs * add redis vendor * fix vet * add database migrations and fix app.ini sample * add comments for task section on app.ini.sample * Update models/migrations/v84.go Co-Authored-By: lunny <xiaolunwen@gmail.com> * Update models/repo.go Co-Authored-By: lunny <xiaolunwen@gmail.com> * move migrating to backend * add loading image when migrating and fix tests * fix fmt * add redis task queue support and improve docs * fix fixtures * fix fixtures * fix duplicate function on index.js * fix tests * rename repository statuses * check if repository is being create when SSH request * fix lint * fix template * some improvements * fix template * unified migrate options * fix lint * fix loading page * refactor * When gitea restart, don't restart the running tasks because we may have servel gitea instances, that may break the migration * fix js * Update models/repo.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * fix tests * rename ErrTaskIsNotExist to ErrTaskDoesNotExist * delete release after add one on tests to make it run happy * fix tests * fix tests * improve codes * fix lint * fix lint * fix migrations
* Move change issue title from models to issue service package (#8456)Lunny Xiao2019-10-111-1/+1
| | | | | | | | * move change issue title from models to issue service package * make the change less * fix typo
* Check for either escaped or unescaped wiki filenames (#8408)Tekaoh2019-10-091-0/+12
| | | | | | | | | | | | * Check for either escaped or unescaped wiki filenames + Gitea currently saves wiki pages with escaped filenames. + Wikis mirrored from other places like Github use unescaped filenames. + We need to be checking for filenames in either format to increase compatibility. * Better logic for escaped and unescaped wiki filenames Co-Authored-By: null <guillep2k@users.noreply.github.com>
* Allow users with explicit read access to give approvals (#8382)guillep2k2019-10-081-2/+2
|
* Revert "Fix issues/pr list broken when there are many repositories (#8409)" ↵Lunny Xiao2019-10-081-48/+92
| | | | | (#8427) This reverts commit 78438d310be42f9c5e0e2937ee54e6050cc8f381.
* Fix issues/pr list broken when there are many repositories (#8409)Lunny Xiao2019-10-081-92/+48
| | | | | | | | | | | | | | * fix issues/pr list broken when there are many repositories * remove unused codes * fix counting error on issues/prs * keep the old logic * fix panic * fix tests
* add file line count info on UI (#8396)silverwind2019-10-071-0/+2
| | | | | | | Also reworked the header to remove the filename (which is redundant with the file path above) and made the header a flexbox with a monospace font. Fixes: https://github.com/go-gitea/gitea/issues/8170
* Fix editor commit to new branch if PR disabled (#8375)guillep2k2019-10-051-3/+3
|
* Bugfix for image compare and minor improvements to image compare (#8289)Mario Lubenka2019-10-043-76/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Resolve error when comparing images Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check blob existence instead of git-ls when checking if file exists Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show file metadata also when a file was newly added Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes error in commit view Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Excludes assigning path and image infos for compare routers to service package Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes nil default and fixes import order Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comments Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves methods for assigning compare data to context into repo router package Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show image compare for deleted images as well. Simplify check if image should be displayed Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Fix a comment typo (#8358)Tekaoh2019-10-021-1/+1
|
* Change general form binding to gogs form (#8334)Aam Surganda2019-10-022-12/+9
|
* Api: advanced settings for repository (external wiki, issue tracker etc.) ↵David Svantesson2019-10-021-28/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#7756) * Add API for Repo Advanced Settings of wiki and issue tracker Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add some integration tests for tracker and wiki settings through API * Should return StatusUnprocessableEntity in case of invalid API values. * Add tests for invalid URLs for external tracker and wiki. * Do not set inital values if they are default of type * Make issue tracker and wiki units separate structures in Repository API structure. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix comment of structures Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Rewrite API to use struct for setting tracker and wiki settings. * LetOnlyContributorsTrackTime -> AllowOnlyContributorsToTrackTime
* Move mirror to a standalone package from models (#7486)Lunny Xiao2019-10-013-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move mirror to a standalone package * fix mirror address in template * fix tests * fix lint * fix comment * fix tests * fix tests * fix vendor * fix fmt * fix lint * remove wrong file submitted * fix conflict * remove unrelated changes * fix go mod * fix tests * clean go mod * make vendor work * make vendor work * fix tests * remove duplicated test
* API endpoint for searching teams. (#8108)David Svantesson2019-10-012-2/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Api endpoint for searching teams. Signed-off-by: dasv <david.svantesson@qrtech.se> * Move API to /orgs/:org/teams/search Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Regenerate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix search is Get Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test for search team API. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update routers/api/v1/org/team.go grammar Co-Authored-By: Richard Mahn <richmahn@users.noreply.github.com> * Fix review comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix some issues in repo collaboration team search, after changes in this PR. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Remove teamUser which is not used and replace with actual user id. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Remove unused search variable UserIsAdmin. * Add paging to team search. * Re-genereate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix review comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * fix * Regenerate swagger
* Extract actions on deletereleasebyid from models to release service (#8219)Lunny Xiao2019-10-012-2/+2
| | | | | | * extract actions on deletereleasebyid from models to release service * fix tests
* Extract actions on new issue from models to services (#8217)Lunny Xiao2019-09-302-2/+4
| | | | | | | | * extract actions on new issue from models to services * improve code * rename services/issues to services/issue
* Fix repo_admin_change_team_access always checked in org settings (#8319)David Svantesson2019-09-301-0/+1
| | | Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Fix API for edit and delete release attachment (#8285)David Svantesson2019-09-271-2/+6
| | | | | | * Add logging for when user requested attachment doesn't belong to the specified release. * Fix API to use correct variable for release asset (attachment)
* Extract actions on new pull request from models to pulls service and move ↵Lunny Xiao2019-09-273-9/+7
| | | | | | | | | | | | | | code.gitea.io/gitea/modules/pull to code.gitea.io/gitea/services/pull (#8218) * extract actions on new pull request from models to pulls service * improve code * move code.gitea.io/gitea/modules/pull to code.gitea.io/gitea/services/pull * fix fmt * Rename pulls.go to pull.go
* Alwaywas return local url for users avatar (#8245)Sandro Santilli2019-09-262-0/+38
| | | | | | | | | | | * Always return local url for users avatar Avoids having to wait for DNS lookups when libravatar is activated fixing #6046 * Avoid double slash in avatar link * Move avatar route to the correct place
* Move create issue comment to comments package (#8212)Lunny Xiao2019-09-242-6/+8
| | | | | | | | | | * move create issue comment to comments package * extract actions on update/delete comment from models to comment service * fix lint * fix lint
* Move all mail related codes from models to services/mailer (#7200)Lunny Xiao2019-09-249-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move all mail related codes from models to modules/mailer * fix lint * use DBContext instead Engine * use WithContext not WithEngine * Use DBContext instead of Engine * don't use defer when sess.Close() * move DBContext to context.go and add some methods * move mailer from modules/ to services * fix lint * fix tests * fix fmt * add gitea copyright * fix tests * don't expose db functions * make code clear * add DefaultDBContext * fix build * fix bug
* Add teams to repo on collaboration page. (#8045)David Svantesson2019-09-236-16/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add teams to repo on collaboration page. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add option for repository admins to change teams access to repo. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add comment for functions Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make RepoAdminChangeTeamAccess default false in xorm and make it default checked in template instead. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make proper language strings and fix error redirection. * Add unit tests for adding and deleting team from repository. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add database migration Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix redirect Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix locale string mismatch. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Move team access mode text logic to template. * Move collaborator access mode text logic to template.
* Reference issues from pull requests and other issues (#8137)guillep2k2019-09-201-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update ref comment * Generate comment on simple ref * Make fmt + remove unneeded repo load * Add TODO comments * Add ref-check in issue creation; re-arrange template * Make unit tests pass; rearrange code * Make fmt * Filter out xref comment if user can't see the referencing issue * Add TODOs * Add cross reference * Rearrange code; add cross-repository references * Striketrhough obsolete references * Remove unnecesary TODO * Add "not supported" note * Support for edits and deletes, and issue title * Revert changes to go.mod * Fix fmt * Add support for xref from API * Add first integration test * Add integration tests * Correct formatting * Fix add comment test * Add migration * Remove outdated comments; fix typo * Some code refactoring and rearranging * Rename findCrossReferences to createCrossReferences * Delete xrefs when repository is deleted * Corrections as suggested by @lafriks * Prepare for merge * Fix log for errors
* Allow registration when button is hidden (#8237)guillep2k2019-09-191-1/+1
|
* Add 'Mentioning you' group to /issues page (#8201)jaqra2019-09-181-0/+2
|
* Refuse merge until all required status checks success (#7481)Lunny Xiao2019-09-183-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refuse merge until ci successfully * deny merge request when required status checkes not succeed on merge Post and API * add database migration for added columns on protected_branch * fix migration * fix protected branch check bug * fix protected branch settings * remove duplicated code on check pull request's required commit statuses pass * remove unused codes * fix migration * add newline for template file * fix go mod * rename function name and some other fixes * fix template * fix bug pull view * remove go1.12 wrong dependencies * add administrator bypass when protected branch status check enabled * fix bug * improve the codes
* move some milestone functions to a standalone package (#8213)Lunny Xiao2019-09-183-3/+6
|