summaryrefslogtreecommitdiffstats
path: root/services
Commit message (Collapse)AuthorAgeFilesLines
* Send tag create and push webhook when release created on UI (#8671)Benno2019-11-221-0/+9
| | | | | | | | | | | | | | | | | | * '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 * update #8671 move release tag created hook to modules/notification/webhook due to #8802 refactoring * use NotifyCreateRef and NotifyPushCommits instead of NotifyNewReleaseTag * move tag notification to correct place
* Move merge actions to notification (#9024)Lunny Xiao2019-11-211-19/+1
| | | | | | * Move merge actions to notification * Add missing mail notification
* Close/reopen issues by keywords in titles and comments (#8866)guillep2k2019-11-181-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | * Add close/reopen from comment functionality * Fix comment * Rewrite closing/reopening template * Check xref permissions, move action to services/pull * Fix RefIsPull field * Add xref tests * Fix xref unique filter * Only highlight keywords for actionable xrefs * Fix xref neuter filter * Fix check return status * Restart CI
* Rewrite delivery of issue and comment mails (#9009)guillep2k2019-11-185-144/+187
| | | | | | | | | | | | | | | | * Mail issue subscribers, rework the function * Simplify a little more * Fix unused variable * Refactor mail delivery to avoid heavy load on server * Avoid splitting into too many goroutines * Fix comments and optimize GetMaileableUsersByIDs() * Fix return on errors
* Add review comments to mail notifications (#8996)guillep2k2019-11-151-4/+28
|
* Move transfer repository and rename repository on a service package and ↵Lunny Xiao2019-11-154-2/+130
| | | | | | | | | | | | | | | | | | | | | | start action notification (#8573) * move transfer repository and rename repository on a service package and start action notification * remove unused codes * fix lint * fix bugs * fix test * fix test * fix test * fix lint * update go mod and sum
* services/mirror: fix dropped test errors (#9007)Lars Lehtonen2019-11-151-0/+2
|
* Expand/Collapse Files and Blob Excerpt while Reviewing/Comparing code (#8924)Benno2019-11-151-17/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * update #8659 fold/unfold code diffs * add fold button style * update #8659 implement expand up/down codes (blob excerpt) * fix golint errors * fix expand direction * remove debug message * update css style for blob exceprt * fix typo in comment * update style sheet with less * update expect diff (add SectionInfo) * update #8942 accept suggested change (fix typo) * close reader and check file type before get tail section * adjust button position and check file type before insert fold button * move index js to web_src * merge index.js with master * generate index.js * update js coding style
* Refactor pull request review (#8954)Lunny Xiao2019-11-142-73/+124
| | | | | | | | | | | | | | | | | | * refactor submit review * remove unnecessary code * remove unused comment * fix lint * remove duplicated actions * remove duplicated actions * fix typo * fix comment content
* Don't send notification on pending reviews (#8943)guillep2k2019-11-131-1/+3
|
* Add Close() method to gogitRepository (#8901)zeripath2019-11-137-72/+87
| | | | | | | | | In investigating #7947 it has become clear that the storage component of go-git repositories needs closing. This PR adds this Close function and adds the Close functions as necessary. In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files. Fixes #7947
* Template Repositories (#8768)John Olheiser2019-11-111-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start work on templates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Continue work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix IsTemplate vs IsGenerated Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tabs vs spaces * Tabs vs Spaces * Add templates to API & start adding tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix integration tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove unused User Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move template tests to existing repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Minor re-check updates and cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix optionalbool Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test fixes and icon change Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add new user and repo for tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests (finally) Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update meta repo with env variables Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move generation to create page Combine with repo create template Modify API search to prioritize owner for repo Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests and coverage Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix swagger and JS lint Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix API searching for own private repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change wording Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix repo search test. User had a private repo that didn't show up Signed-off-by: jolheiser <john.olheiser@gmail.com> * Another search test fix Signed-off-by: jolheiser <john.olheiser@gmail.com> * Clarify git content Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Feedback updates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add topics WIP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Finish adding topics Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update locale Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Adjust error reporting from merge failures and use LC_ALL=C for git (#8548)zeripath2019-11-101-91/+214
| | | | | | There are two major components to this PR: * This PR handles merge and rebase failures from merging a little more nicely with Flash errors rather a 500. * All git commands are run in the LC_ALL="C" environment to ensure that error messages are in English. This DefaultLocale is defined in a way that if necessary (due to platform weirdness) it can be overridden at build time using LDFLAGS="-X "code.gitea.io/gitea/modules/git.DefaultLocale=C"" with C changed for the locale as necessary.
* 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>