summaryrefslogtreecommitdiffstats
path: root/services
Commit message (Collapse)AuthorAgeFilesLines
* Use templates for issue e-mail subject and body (#8329)guillep2k2019-11-074-96/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add template capability for issue mail subject * Remove test string * Fix trim subject length * Add comment to template and run make fmt * Add information for the template * Rename defaultMailSubject() to fallbackMailSubject() * General rewrite of the mail template code * Fix .Doer name * Use text/template for subject instead of html * Fix subject Re: prefix * Fix mail tests * Fix static templates * [skip ci] Updated translations via Crowdin * Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (#8528) * Expose db.SetMaxOpenConns and allow other dbs to set their connection params * Add note about port exhaustion Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Prevent .code-view from overriding font on icon fonts (#8614) * Correct some outdated statements in the contributing guidelines (#8612) * More information for drone-cli in CONTRIBUTING.md * Increases the version of drone-cli to 1.2.0 * Adds a note for the Docker Toolbox on Windows Signed-off-by: LukBukkit <luk.bukkit@gmail.com> * Fix the url for the blog repository (now on gitea.com) Signed-off-by: LukBukkit <luk.bukkit@gmail.com> * Remove TrN due to lack of lang context * Redo templates to match previous code * Fix extra character in template * Unify PR & Issue tempaltes, fix format * Remove default subject * Add template tests * Fix template * Remove replaced function * Provide User as models.User for better consistency * Add docs * Fix doc inaccuracies, improve examples * Change mail footer to math AppName * Add test for mail subject/body template separation * Add support for code review comments * Update docs/content/doc/advanced/mail-templates-us.md Co-Authored-By: 6543 <24977596+6543@users.noreply.github.com>
* Move release webhook to notification (#8817)Lunny Xiao2019-11-061-38/+4
| | | | | | | | | | * Move release webhook to notification * Extract release webhook method * fix bug * fix import
* Move pull webhook to notification (#8805)Lunny Xiao2019-11-053-70/+9
| | | | | | * Move pull webhook to notification * fix fmt
* Move actions to notification (#8785)Lunny Xiao2019-11-032-37/+3
|
* Move push commits events to notification (#8783)Lunny Xiao2019-11-031-20/+3
| | | | | | | | * Move push commits events to notification * Update modules/notification/base/null.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Move issue milestone assign to issue service and move webhook to ↵Lunny Xiao2019-11-022-58/+21
| | | | notification (#8780)
* Rename HookQueue to hookQueue (#8778)Lunny Xiao2019-11-026-24/+2
| | | | | | * Rename HookQueue to hookQueue * fix lint
* Move labels webhooks to notification (#8749)Lunny Xiao2019-11-021-52/+3
| | | | | | * Move webhooks to notification * fix notification
* Move webhook to a standalone package under modules (#8747)Lunny Xiao2019-11-017-22/+29
| | | | | | | | * Move webhook to a standalone package under modules * fix test * fix comments
* Allow to merge if file path contains " or \ (#8629)Ilya2019-11-011-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * if a filename in a repository contains " or \ the owner can't merge pull request with this files because "git diff-tree" adds double quotes to that filepath example: filepath is ab"cd but "git diff-tree" returns "ab\"cd" now, when the owner click "Merge Pull Request" button the server returns 500 this commit fix it Signed-off-by: Ilya Pavlov <ilux@cpan.org> * add -z option to getDiffTree escape spec symbols for sparse-checkout Signed-off-by: Ilya Pavlov <ilux@cpan.org> * go fmt Signed-off-by: Ilya Pavlov <ilux@cpan.org> * typo Signed-off-by: Ilya Pavlov <ilux@cpan.org> * escape '\' escape all spaces and '!' * use regexp.ReplaceAllString() Signed-off-by: Ilya Pavlov <ilux@cpan.org> * strings.ReplaceAll was added in go 1.12 Signed-off-by: Ilya Pavlov <ilux@cpan.org> * add '\' to regexp.MustCompile Signed-off-by: Ilya Pavlov <ilux@cpan.org>
* Move webhook codes from service to webhook notification (#8712)Lunny Xiao2019-10-301-69/+5
| | | | | | | | * 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-0/+23
| | | | | | * Move issue change content from models to service * fix lint
* Add basic repository lfs management (#7199)zeripath2019-10-281-108/+8
| | | | | | | | | | | | 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-292-25/+16
|
* Move issue change status from models to service (#8691)Lunny Xiao2019-10-281-0/+21
|
* Move more issue assignee code from models to issue service (#8690)Lunny Xiao2019-10-283-42/+93
| | | | | | * Move more issue assignee code from models to issue service * fix test
* Move some repositories' operations to a standalone service package (#8557)Lunny Xiao2019-10-261-0/+56
| | | | | | | | | | | | * 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-254-10/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Move issue label operations to issue service package (#8553)Lunny Xiao2019-10-193-0/+165
| | | | | | | | * Move issue label operations to issue service package * fix test * fix fmt
* Improve webhooks (#8583)John Olheiser2019-10-182-1/+7
| | | | | | | | | | | | | | * Improve webhooks Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update MSTeams and ReviewPayload comment Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add repo.FullName to comments Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix bug on pull requests when transfer head repository (#8564)Lunny Xiao2019-10-181-4/+7
| | | | | | | | * 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-13/+27
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Allow externalID to be UUID (#8551)Wenxuan Zhao2019-10-171-5/+1
| | | Signed-off-by: Wenxuan Zhao <viz@linux.com>
* Sign merges, CRUD, Wiki and Repository initialisation with gpg key (#7631)zeripath2019-10-161-9/+55
| | | | | | | | | | | | | | | | | | | 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.
* Move sync mirror actions to mirror service package (#8518)Lunny Xiao2019-10-162-6/+93
| | | | | | | | | | * move sync mirror actions to mirror service * fix go.mod * fix lint * fix lint
* Move clearlabels from models to issue service (#8326)Lunny Xiao2019-10-151-0/+21
| | | | | | | | | | * 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-152-1/+89
| | | | | | * move AddTestPullRequestTask to pull service package from models * fix fmt
* Update migrated repositories' issues/comments/prs poster id if user has a ↵Lunny Xiao2019-10-141-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rewrite reference processing code in preparation for opening/closing from ↵guillep2k2019-10-132-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comment references (#8261) * Add a markdown stripper for mentions and xrefs * Improve comments * Small code simplification * Move reference code to modules/references * Fix typo * Make MarkdownStripper return [][]byte * Implement preliminary keywords parsing * Add FIXME comment * Fix comment * make fmt * Fix permissions check * Fix text assumptions * Fix imports * Fix lint, fmt * Fix unused import * Add missing export comment * Bypass revive on implemented interface * Move mdstripper into its own package * Support alphanumeric patterns * Refactor FindAllMentions * Move mentions test to references * Parse mentions from reference package * Refactor code to implement renderizable references * Fix typo * Move patterns and tests to the references package * Fix nil reference * Preliminary rendering attempt of closing keywords * Normalize names, comments, general tidy-up * Add CSS style for action keywords * Fix permission for admin and owner * Fix golangci-lint * Fix golangci-lint
* Move migrating repository from frontend to backend (#6200)Lunny Xiao2019-10-131-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Restore functionality for early gits (#7775)zeripath2019-10-122-25/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | * Change tests to make it possible to run TestGit with 1.7.2 * Make merge run on 1.7.2 * Fix tracking and staging branch name problem * Ensure that git 1.7.2 works on tests * ensure that there is no chance for conflicts * Fix-up missing merge issues * Final rm * Ensure LFS filters run on the tests * Do not sign commits from temp repo * Restore tracking fetch change * Apply suggestions from code review * Update modules/repofiles/temp_repo.go
* Move change issue title from models to issue service package (#8456)Lunny Xiao2019-10-111-0/+51
| | | | | | | | * move change issue title from models to issue service package * make the change less * fix typo
* Ignore mentions for users with no access (#8395)guillep2k2019-10-102-6/+20
| | | | | | | | | | | | | | | | | | | | | | * Draft for ResolveMentionsByVisibility() * Correct typo * Resolve teams instead of orgs for mentions * Create test for ResolveMentionsByVisibility * Fix check for individual users and doer * Test and fix team mentions * Run all mentions through visibility filter * Fix error check * Simplify code, fix doer included in teams * Simplify team id list build
* Move mirror to a standalone package from models (#7486)Lunny Xiao2019-10-013-59/+473
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Extract actions on deletereleasebyid from models to release service (#8219)Lunny Xiao2019-10-012-1/+69
| | | | | | * extract actions on deletereleasebyid from models to release service * fix tests
* Extract actions on new issue from models to services (#8217)Lunny Xiao2019-09-301-0/+47
| | | | | | | | * extract actions on new issue from models to services * improve code * rename services/issues to services/issue
* If no specific context is required for status check, require an overall ↵Elias Norberg2019-09-301-1/+9
| | | | | success (#8318) Signed-off-by: Elias Norberg <elias@aisle.se>
* Extract actions on new pull request from models to pulls service and move ↵Lunny Xiao2019-09-275-0/+722
| | | | | | | | | | | | | | 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
* Move create issue comment to comments package (#8212)Lunny Xiao2019-09-241-0/+103
| | | | | | | | | | * move create issue comment to comments package * extract actions on update/delete comment from models to comment service * fix lint * fix lint
* Fix assets key on release webhook (#8253)Daniel Fonseca de Lira2019-09-241-2/+4
| | | | | | | | * Fix assets key on release webhook * Fix assets key on release webhook * Add message to log on AddReleaseAttachments failure
* Move all mail related codes from models to services/mailer (#7200)Lunny Xiao2019-09-246-0/+838
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* move some milestone functions to a standalone package (#8213)Lunny Xiao2019-09-181-0/+59
|
* Move create release from models to a standalone package (#7539)Lunny Xiao2019-09-152-0/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | * move create release from models to a standalone package * fix lint * fix comment year * fix lint * fix lint * fix package import name * fix vendor * fix go mod * some refactors * fix vendor * use go1.12 make vendor * fix vendor
* Move git diff codes from models to services/gitdiff (#7889)Lunny Xiao2019-09-054-0/+1110
* move git diff codes from models to services/gitdiff * fix template * fix test * fix template