summaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Add Ability for User to Customize Email Notification Frequency (#7813)Gary Kim2019-08-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Backend Logic for Toggling Email Notification This commit adds the backend logic for allowing users to enable or disable email notifications. The implementation ensures that only issue notification emails get disabled and important emails are still sent regardless of the setting. The UI to toggle this setting has not yet been implemented. * Add UI and complete user email notification enable This commit completes the functionality to allow users to disable their own email notifications. Signed-off-by: Gary Kim <gary@garykim.dev> * Add Third Option for Only Email on Mention Signed-off-by: Gary Kim <gary@garykim.dev> * Readd NOT NULL to new preference string Signed-off-by: Gary Kim <gary@garykim.dev> * Add Tests and Rewrite Comment Signed-off-by: Gary Kim <gary@garykim.dev> * Allow admin to set default email frequency Signed-off-by: Gary Kim <gary@garykim.dev> * Add new config option to docs Signed-off-by: Gary Kim <gary@garykim.dev> * Fix a few mistakes Signed-off-by: Gary Kim <gary@garykim.dev> * Only update required columns Signed-off-by: Gary Kim <gary@garykim.dev> * Simplify an error check Signed-off-by: Gary Kim <gary@garykim.dev> * Make email_notification_preference column in DB be VARCHAR(20) Signed-off-by: Gary Kim <gary@garykim.dev> * Handle errors Signed-off-by: Gary Kim <gary@garykim.dev> * Update models/migrations/v93.go Co-Authored-By: Lauris BH <lauris@nix.lv>
* Fixes #7945 - makes sure we are only getting tag refs (#7990)Richard Mahn2019-08-261-1/+1
|
* swagger/fix: []string are not enum by swagger definition (#7916)Antoine GIRARD2019-08-261-3/+3
| | | | | | | | * []string are not enum by swagger definition * apply suggestion of @guillep2k * re-generate swagger file
* API method to list all commits of a repository (#6408)Mike Schwörer2019-08-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added API endpoint ListAllCommits (/repos/{owner}/{repo}/git/commits) Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Fixed failing drone build Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Implemented requested changes (PR reviews) Signed-off-by: Mike Schwörer <mailport@mikescher.de> * gofmt Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Changed api route from "/repos/{owner}/{repo}/git/commits" to "/repos/{owner}/{repo}/commits" * Removed unnecessary line * better error message when git repo is empty * make generate-swagger * fixed removed return * Update routers/api/v1/repo/commits.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Update routers/api/v1/repo/commits.go Co-Authored-By: Lauris BH <lauris@nix.lv> * go fmt * Refactored common code into ToCommit() * made toCommit not exported * added check for userCache == nil
* Include description in repository search. (#7942)David Svantesson2019-08-251-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add description in repository search. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Refactor SearchRepositoryByName with a general function SearchRepository Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Allow to specify if description shall be included in API repo search. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add new app.ini setting for whether to search within repo description. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Search keyword in description (if setting enabled) on: - Explore page - Organization profile page - User profile page - Admin repo page Do not search keyword in description on: - Any non-keyword search (not relevant) - Incremental search (uses API) Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Put parameters related to keyword directly after it Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test cases for including (and not including) repository description in search. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Rename test function from TestSearchRepositoryByName to TestSearchRepository. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Make setting SEARCH_REPO_DESCRIPTION default to true Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Abort syncrhonization from LDAP source if there is some error. (#7960)David Svantesson2019-08-241-5/+5
| | | Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Add support for DEFAULT_ORG_MEMBER_VISIBLE (#7669)guillep2k2019-08-241-0/+2
| | | | | | | | | | | | * Add support for DEFAULT_ORG_MEMBER_VISIBLE * Correct formatting * Improved description in cheat sheet. * Add test for DefaultOrgMemberVisible * Remove dead code
* Move database settings from models to setting (#7806)Lunny Xiao2019-08-244-24/+295
| | | | | | | | | | | | | | | | | | * move database settings from models to setting * update docs * fix checkout pr * fix tests * fix lint * remove unsupported tidb options * correct wrong variable name * remove tidb totally
* Allow token as authorization for accessing attachments (#7909)David Svantesson2019-08-241-1/+6
| | | | | | | | * Allow token as authorization for accessing attachments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Only allow token authentication for attachments if it is a download (GET)
* Use gitea forked macaron (#7933)Tamal Saha2019-08-2355-94/+108
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Add file status on API (#7671)Lunny Xiao2019-08-212-11/+15
| | | | | | | | | | * add file status on API * fix tests * fix tests * fix tests
* fix bug when migrating a private repository (#7917)Lunny Xiao2019-08-201-1/+12
|
* Fix upload file type check (#7890)Lunny Xiao2019-08-172-10/+54
| | | | | | | | * fix upload file type check * make the function simple and added tests * Update comment as per @silverwind
* Extract the username and password from the mirror url (#7651)zeripath2019-08-161-7/+9
| | | | | | | | | | | | * Explode out mirror username and password * Update models/repo_mirror.go * Just roundtrip the password * remove unused declaration * Update templates/repo/settings/options.tmpl
* Detect delimiter in CSV rendering (#7869)Norwin2019-08-162-6/+66
| | | | | | | | | | | | | | | | | | | | | * detect csv delimiter in csv rendering fixes #7868 * make linter happy * fix failing testcase & use ints where possible * expose markup type to template previously all markup had the .markdown class, which is incorrect, as it applies markdown CSS & JS logic to CSV rendering * fix build (missing `make css`) * ignore quoted csv content for delimiter scoring also fix html generation
* Remove unique filter from repo indexer analyzer. (#7878)guillep2k2019-08-151-3/+2
| | | | | | | | | | * Remove unique filter from repo indexer analyzer. * Bump repoIndexerLatestVersion to 4 * Corrrect fmt * make vendor to remove unique dependency
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-1511-358/+449
| | | | | | | | | | | | | | | | | | * display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
* Convert files to utf-8 for indexing (#7814)guillep2k2019-08-157-152/+354
| | | | | | | | | | | | | | * Convert files to utf-8 for indexing * Move utf8 functions to modules/base * Bump repoIndexerLatestVersion to 3 * Add tests for base/encoding.go * Changes to pass gosimple * Move UTF8 funcs into new modules/charset package
* move CreateReview to moduels/pull (#7841)Lunny Xiao2019-08-141-0/+57
|
* Attempt to fix hook problem (#7854)zeripath2019-08-141-1/+3
|
* Check commit message hashes before making links (#7713)Gary Kim2019-08-143-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Check commit message hashes before making links Previously, when formatting commit messages, anything that looked like SHA1 hashes was turned into a link using regex. This meant that certain phrases or numbers such as `777777` or `deadbeef` could be recognized as a commit even if the repository has no commit with those hashes. This change will make it so that anything that looks like a SHA1 hash using regex will then also be checked to ensure that there is a commit in the repository with that hash before making a link. Signed-off-by: Gary Kim <gary@garykim.dev> * Use gogit to check if commit exists This commit modifies the commit hash check in the render for commit messages to use gogit for better performance. Signed-off-by: Gary Kim <gary@garykim.dev> * Make code cleaner Signed-off-by: Gary Kim <gary@garykim.dev> * Use rev-parse to check if commit exists Signed-off-by: Gary Kim <gary@garykim.dev> * Add and modify tests for checking hashes in html link rendering Signed-off-by: Gary Kim <gary@garykim.dev> * Return error in sha1CurrentPatternProcessor Co-Authored-By: mrsdizzie <info@mrsdizzie.com> * Import Gitea log module Signed-off-by: Gary Kim <gary@garykim.dev> * Revert "Return error in sha1CurrentPatternProcessor" This reverts commit 28f561cac46ef7e51aa26aefcbe9aca4671366a6. Signed-off-by: Gary Kim <gary@garykim.dev> * Add debug logging to sha1CurrentPatternProcessor This will log errors by the git command run in sha1CurrentPatternProcessor if the error is one that was unexpected. Signed-off-by: Gary Kim <gary@garykim.dev>
* Import topics during migration (#7851)Antoine GIRARD2019-08-147-0/+33
| | | | | | | | * add GetTopics interface * CreateTopics * remove un-needed comment
* Do not fetch all refs (#7797)Mura Li2019-08-131-1/+1
| | | Which would unnecessarily slow down the pull compare operation.
* Fix lax comparison in validation tests (#7815)WGH2019-08-121-2/+6
| | | | | | | | | | | | | | | | | If you add t.Logf("%+v %+v", actual, testCase.expectedErrors) to the test code, you'll notice that only Errors' Messages are being compared: --- PASS: Test_ValidURLValidation/Invalid_schema (0.00s) binding_test.go:43: [Url] [Url] FieldNames and Classification are ignored in comparison. Moreover, an Errors slice with a single Error with empty message is formatted as '[]' (the same as empty slice), which is also error-prone. I discovered this when working on #7791 when one test which was not supposed to pass did pass. https://play.golang.org/p/qC4wVLrm4NG This commit changes the test to do the comparison properly.
* Fix duplicate call of webhook (#7821)Antoine GIRARD2019-08-114-112/+0
|
* Remove camel case tokenization from repo indexer (#7733)guillep2k2019-08-061-3/+2
| | | | | | | | | | | | | | * Make repository indexer tokenize by camel case selectable * Revert "Make repository indexer tokenize by camel case selectable" This reverts commit a8d4e40af56ffeab9c040a13e01b9e0d5487bd3b. * Remove app.ini setting, permanently remove camel case tokenizer * Increase repoIndexerLatestVersion to force indexes to be rebuilt * Changes introduced by the commmand make vendor
* Be more strict with git arguments (#7715)zeripath2019-08-0512-20/+41
| | | | | | * Be more strict with git arguments * fix-up commit test * use bindings for branch name
* Add a lot of extension to language mappings for syntax highlights (#7741)silverwind2019-08-051-35/+79
| | | | | Data partially based on [CodeMirror's meta.js](https://github.com/codemirror/CodeMirror/blob/master/mode/meta.js). Fixes: https://github.com/go-gitea/gitea/issues/6057
* Fix specific highlighting (CMakeLists.txt ...) (#7686)FlorianBen2019-08-041-5/+7
| | | | | | | | * Fix specific highlighting. * Highlighting CMakeLists.txt: remove case sensitive checks. use lowercase checks instead.
* Include "executable" files in the index, as they are not necessarily binary ↵guillep2k2019-08-021-0/+5
| | | | (#7718)
* remove unnecessary fmt on generate bindata (#7706)Lunny Xiao2019-08-013-3/+0
|
* Correct wrong datetime format for git (#7689)zeripath2019-07-312-2/+2
|
* Move commit repo action from models to repofiles package (#7645)Lunny Xiao2019-07-303-1/+338
| | | | | | * move commit repo action from models to repofiles package * fix unit tests
* fix bug on migrating milestone from github (#7665)Lunny Xiao2019-07-291-1/+1
|
* Fix bug create/edit wiki pages when code master branch protected (#7580)Lunny Xiao2019-07-251-1/+7
| | | | | | * fix bug create/edit wiki pages when code master branch protected * improve FullPushingEnvironment function
* Fix panic on push at #7611 (#7615)zeripath2019-07-251-1/+1
| | | | | | | | * Fix panic in #7611 Use pr.IssueID instead of pr.Issue.ID as Issue may not be loaded and is unnecessary * Only fetch the head branch from the remote
* Move models.PushUpdate to repofiles.PushUpdate (#7485)Lunny Xiao2019-07-241-2/+87
| | | | | | * move models.PushUpdate to repofiles.PushUpdate * remove duplicated code to load repo
* Added missing error checks in tests (#7554)Christian Muehlhaeuser2019-07-232-1/+5
| | | Whenever we assign a value to err, check for it being nil.
* Removed unnecessary conversions (#7557)Christian Muehlhaeuser2019-07-2320-37/+31
| | | No need to convert to the same type.
* Fix empty commits now showing in repo overview (#7521)silverwind2019-07-227-13/+24
| | | | | | | | * Fix empty commits now showing in repo overview * add test * make fmt
* Un-lambda base.FileSize (#7556)Christian Muehlhaeuser2019-07-221-4/+2
| | | No need to wrap this.
* Fix markdown invoke sequence (#7513)Lunny Xiao2019-07-181-1/+1
|
* remove duplicated webhook trigger (#7511)Lunny Xiao2019-07-181-1/+0
|
* Remove settting dependency on modules/session (#7237)Lunny Xiao2019-07-173-10/+3
| | | | | | | | | | * remove settting dependency on modules/session * fix fmt * fix tests * fix lint
* Move status table to cron package (#7370)Lunny Xiao2019-07-151-14/+42
|
* only create opened pull request when migrating from github (#7463)Lunny Xiao2019-07-141-1/+1
|
* Support setting cookie domain (#6288)Tamal Saha2019-07-122-1/+5
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* wiki history improvements (#7391)Cherrg2019-07-111-0/+10
| | | | | | | | | | | | | | | | | * add history comments to detect page delete Signed-off-by: Michael Gnehr <michael@gnehr.de> * fix too much history entries - caused by --follow flag - if files with same contents exists Signed-off-by: Michael Gnehr <michael@gnehr.de> * style imprevements wiki - history - wrap long author names Signed-off-by: Michael Gnehr <michael@gnehr.de>
* Fix migration tests since #7 fixed (#7375)Lunny Xiao2019-07-081-2/+4
| | | | | | * fix migration tests since #7 fixed * fix test time
* Display original author and URL information when showing migrated ↵mrsdizzie2019-07-0814-87/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | issues/comments (#7352) * Store original author info for migrated issues and comments Keep original author name for displaying in Gitea interface and also store original author user ID for potential future use in linking accounts from old location. * Add original_url for repo Store the original URL for a migrated repo Clean up migrations/tests * fix migration * fix golangci-lint * make 'make revive' happy also * Modify templates to use OriginalAuthor if set Use the original author name in templates if it is set rather than the user who migrated/currently owns the issues * formatting fixes * make generate-swagger * Use default avatar for imported comments * Remove no longer used IgnoreIssueAuthor option * Add OriginalAuthorID to swagger also