summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Fix wrong GPG expire date (#6643)Antoine GIRARD2019-04-152-6/+162
| | | | | | * fix expire of gpg relative to key creation https://tools.ietf.org/html/rfc4880#section-5.2.3.6 * add test
* Fix forking an empty repository (#6637)Segev Finer2019-04-151-0/+1
| | | | | Fixes #6633 Signed-off-by: Segev Finer <segev@codeocean.com>
* add .gpg url (match github behaviour) (#6610)Antoine GIRARD2019-04-147-19/+117
| | | | | | | | | | | | | | | | | | | | | | * add .gpg url (match github behaviour) * wildcard * test to export maximum data * working POC * add comment for old imported keys * cleaning * Update routers/user/profile.go Co-Authored-By: sapk <sapk@users.noreply.github.com> * add migration script * add integration tests
* Correctly adjust mirror url (#6593)zeripath2019-04-122-11/+20
|
* Improve issue autolinks (#6273)mrsdizzie2019-04-122-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | * Improve issue autolinks Update autolinks to match what github does here: Issue in same repo: #1 Issue in different repo: org/repo#1 Fixes #6264 * Use setting.AppURL when parsing URL Using setting.AppURL here is a more reliable way of parsing the current URL and what other functions in this file seem to use. * Make ComposeMetas always return a valid context * Add per repository markdown renderers for better context * Update for use of context metas Now that we include the user and repo name inside context metas, update various code and tests for this new logic
* Support search operators for commits search (#6479)Mura Li2019-04-124-7/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support searching commits with prefix syntax For now, support auther: committer: When more than one prefix is supplied is presented, the result is the union. When different prefixes are supplied, the result is the intersection. For example, "author:alice author:bob" => the result is all commits authored by Alice OR Bob "hello committer:alice" => the result is all commits committed by Alice AND has the keyword 'hello' in the message. Note that there should NOT have any space after the colon(:) of the prefix. For example, "author:bill" => correct "author: bill" => wrong * Remove unneeded logging * Add missing files of test repository * Add missing repo_unit entries to test fixtures * Update test cases * Add tooltip for commits search button * Update tooltip text I have no idea about how to format it with line breaks. * Make the usage example more real * Add a test case * Add new options struct for SearchCommits * Prefer len(s) > 0 over s != "" * Add NewSearchCommitsOptions
* fix mail notification when close/reopen issue (#6581)Lunny Xiao2019-04-111-4/+12
|
* Delete local branch if it exists (#6497)John Olheiser2019-04-081-0/+32
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fixes #6446 - Sort team members and team's repositories (#6525)ngourdon2019-04-071-1/+7
| | | | | | * sort team's repositories by name * sort team members by display name
* Make distinction between DisplayName and Username in email templates (#6495)mrsdizzie2019-04-041-3/+4
| | | | | | | | | | | | | | | | | | * Make distinction between DisplayName and Username in email templates Store the actual username in the variable named Username and store the separate DisplayName in another variable. This allows us to access the actual username when we need, which currently fails if a user has set a full name. Fixes #6161 * Use u.Name directly No need for extra function, also change use in all mail sending functions here * Don't include Username when not used
* Show last commit status in pull request lists (#6465)Elias Norberg2019-04-021-0/+25
|
* fix upload attachments (#6481)Lunny Xiao2019-04-024-6/+62
| | | | | | | | * fix upload attachments * add migration for new column uploader_id on table attachment * fix imports sequence
* Better logging (#6038) (#6095)zeripath2019-04-0229-205/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
* fix bug when user login and want to resend register confirmation email (#6482)Lunny Xiao2019-04-021-6/+6
|
* Make "Ghost" not link to 404 page (#6410)oscar.lofwenhamn2019-03-271-0/+11
| | | | | | | | | | | | | * Make Ghost not link to 404 page * Make correct localization label show * Create and use GetLastEventLabelFake for when a Ghost user has made the action, thus not linking to a user profile * Add corresponding _fake entries to locale_en-US * Make Ghost avatar not link to 404 page * Make Ghost on milestone_issues not link to 404 page
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-2726-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move code.gitea.io/git to code.gitea.io/gitea/modules/git * fix imports * fix fmt * fix misspell * remove wrong tests data * fix unit tests * fix tests * fix tests * fix tests * fix tests * fix tests * enable Debug to trace the failure tests * fix tests * fix tests * fix tests * fix tests * fix tests * comment commit count tests since git clone depth is 50 * fix tests * update from code.gitea.io/git * revert change to makefile
* Add signatures to webhooks (#6428)techknowlogick2019-03-251-0/+19
|
* Fixed unitTypeCode not being used (#6419)kolaente2019-03-241-1/+1
|
* fix dump table name error and add some test for dump database (#6394)Lunny Xiao2019-03-203-3/+21
|
* fix migrations 82 to ignore unsynced tags between database and git data and ↵Lunny Xiao2019-03-201-6/+40
| | | | missing is_archived on repository table (#6387)
* make sure units of a team are returned (#6379)Lanre Adelowo2019-03-191-0/+5
|
* Implement Default Webhooks (#4299)Russell Aunger2019-03-182-1/+76
| | | | | | | | Partially implement #770. Add "Default Webhooks" page in site admin UI. Persist to the existing webhooks table, but store with RepoID=0 and OrgID=0. Upon repo creation, copy the set of default webhooks into the new repo.
* Add bio field for user (#6113)techknowlogick2019-03-181-6/+6
| | | | Fix #4339
* Clean up various use of escape/unescape functions for URL generation (#6334)mrsdizzie2019-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use PathUnescape instead of QueryUnescape when working with branch names Currently branch names with a '+' fail in certain situations because QueryUnescape replaces the + character with a blank space. Using PathUnescape should be better since it is defined as: // PathUnescape is identical to QueryUnescape except that it does not // unescape '+' to ' ' (space). Fixes #6333 * Change error to match new function name * Add new util function PathEscapeSegments This function simply runs PathEscape on each segment of a path without touching the forward slash itself. We want to use this instead of PathEscape/QueryEscape in most cases because a forward slash is a valid name for a branch etc... and we don't want that escaped in a URL. Putting this in new file url.go and also moving a couple similar functions into that file as well. * Use EscapePathSegments where appropriate Replace various uses of EscapePath/EscapeQuery with new EscapePathSegments. Also remove uncessary uses of various escape/unescape functions when the text had already been escaped or was not escaped. * Reformat comment to make drone build happy * Remove no longer used url library * Requested code changes
* Fix ParsePatch function to work with quoted diff --git strings (#6323)mrsdizzie2019-03-142-0/+65
| | | | | | | | | | | | | | | | * Fix ParsePatch to work properly with quoted diff --git string Currently ParsePatch fails when a diff contains a quoted diff line like: diff --git "a/file" "b/file" This patch makes it properly parse the line when that happens. Fixes #6309 * Add test for regular case while here * Simplify string modification
* Fix reported issue in repo description (#6306)zeripath2019-03-111-3/+5
|
* update git vendor to fix wrong release commit id and add migrations (#6224)Lunny Xiao2019-03-113-4/+94
| | | | | | | | | | * update git vendor to fix wrong release commit id and add migrations * fix count * fix migration release * fix tests
* Remove util.RemoveAll - should have been removed since go 1.7 (#6299)zeripath2019-03-101-1/+2
|
* Copyedit docs (#6275)Aidan Fitzgerald2019-03-092-2/+2
|
* Integrate OAuth2 Provider (#5378)Jonas Franz2019-03-088-0/+732
|
* Add robots.txt as reserved username (#6272)techknowlogick2019-03-071-0/+1
| | | Fix #6271
* Add ability to sort issues by due date (#6206) (#6244)stevegt2019-03-051-0/+4
| | | Signed-off-by: Steve Traugott <stevegt@t7a.org>
* Prevent double-close of issues (#6233)zeripath2019-03-041-1/+7
|
* Override xorm type mapping for U2F counter (#6232)Maurizio Porrato2019-03-044-1/+43
|
* add isAdmin to user model (#6231)Lanre Adelowo2019-03-032-0/+18
| | | | | update vendor and add tests fix swagger
* Fix renames over redirects (#6216)James E. Blair2019-03-021-1/+17
| | | | | | | | | | | | | | | | In #6211, we started creating repo_redirects for ownership transfers, however that opens an edge case where a user might perform the following sequence: rename org1/repo1 -> org1/repo2 (creates org1/repo1 redirect) transfer org2/repo1 -> org1/repo1 (org1/repo1 redirect continues to exist) rename org1/repo1 -> org1/repo3 (fails due to existing org1/repo1 redirect) This change ensures that each time we rename or transfer a repo, we delete any existing redirects at the target location. This already happens when a new repo is created. By doing this we ensure that we'll never have both a repo and a redirect at the same location. Signed-off-by: James E. Blair <jeblair@redhat.com>
* Add "ghost" and "notifications" to list of reserved user names. (#6208)tklein232019-02-271-0/+2
|
* Change sqlite DB path default to data directory (#6198)John Olheiser2019-02-271-1/+2
|
* fix bug when update owner team then visit team's repo return 404 (#6119)Lunny Xiao2019-02-222-0/+20
|
* Admins can now do unlimited page size user search (listAllUsers & ↵John Olheiser2019-02-211-0/+3
| | | | | listAllOrgs) (#6143) Non-admins will default to 10 page size
* Add more tests and docs for issue indexer, add db indexer type for searching ↵Lunny Xiao2019-02-212-0/+59
| | | | | | | | | | | | | | from database (#6144) * add more tests and docs for issue indexer, add db indexer type for searching from database * fix typo * fix typo * fix lint * improve docs
* refactor issue indexer, add some testing and fix a bug (#6131)Lunny Xiao2019-02-213-152/+5
| | | | | | | | * refactor issue indexer, add some testing and fix a bug * fix error copyright year on comment header * issues indexer package import keep consistent
* Refactor issue indexer (#5363)Lunny Xiao2019-02-196-94/+126
|
* Show email if the authenticated user owns the profile page being requested ↵Lanre Adelowo2019-02-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for (#4981) * Show email if the authenticated user owns the profile page being requested for. Also removed `setting.UI.ShowUserEmail` as it's documentation says it only controls the email setting on the explore page * fix current user check... This prevents a panic as a user must be signed in before ctx.User is called * fix panic in tests * try to fix tests * Update year * Test CI fail * Revert change * User 3 is not allowed to authorize * Set user2 email to be private * Change to user4 in explore page as user2 now has private email option set
* Fix prohibit login check on authorization (#6106)Lunny Xiao2019-02-192-4/+55
| | | | | | | | | | | | * fix bug prohibit login not applied on dashboard * fix tests * fix bug user status leak * fix typo * return after render
* Implement "conversation lock" for issue comments (#5073)Lanre Adelowo2019-02-185-0/+79
|
* Allow to set organization visibility (public, internal, private) (#1763)Rémy Boulanouar2019-02-185-13/+194
|
* Fix deadlock in webhook PullRequest (#6102)zeripath2019-02-173-13/+15
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix panic: template: repo/issue/list:210: unexpected "=" in operand (#6041)Zsombor2019-02-131-0/+19
|
* Refactor editor upload, update and delete to use git plumbing and add LFS ↵zeripath2019-02-124-572/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support (#5702) * Use git plumbing for upload: #5621 repo_editor.go: UploadRepoFile * Use git plumbing for upload: #5621 repo_editor.go: GetDiffPreview * Use git plumbing for upload: #5621 repo_editor.go: DeleteRepoFile * Use git plumbing for upload: #5621 repo_editor.go: UploadRepoFiles * Move branch checkout functions out of repo_editor.go as they are no longer used there * BUGFIX: The default permissions should be 100644 This is a change from the previous code but is more in keeping with the default behaviour of git. Signed-off-by: Andrew Thornton <art27@cantab.net> * Standardise cleanUploadFilename to more closely match git See verify_path in: https://github.com/git/git/blob/7f4e64169352e03476b0ea64e7e2973669e491a2/read-cache.c#L951 Signed-off-by: Andrew Thornton <art27@cantab.net> * Redirect on bad paths Signed-off-by: Andrew Thornton <art27@cantab.net> * Refactor to move the uploading functions out to a module Signed-off-by: Andrew Thornton <art27@cantab.net> * Add LFS support Signed-off-by: Andrew Thornton <art27@cantab.net> * Update upload.go attribution header Upload.go is essentially the remnants of repo_editor.go. The remaining code is essentially unchanged from the Gogs code, hence the Gogs attribution. * Delete upload files after session committed * Ensure that GIT_AUTHOR_NAME etc. are valid for git see #5774 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add in test cases per @lafriks comment * Add space between gitea and github imports Signed-off-by: Andrew Thornton <art27@cantab.net> * more examples in TestCleanUploadName Signed-off-by: Andrew Thornton <art27@cantab.net> * fix formatting Signed-off-by: Andrew Thornton <art27@cantab.net> * Set the SSH_ORIGINAL_COMMAND to ensure hooks are run Signed-off-by: Andrew Thornton <art27@cantab.net> * Switch off SSH_ORIGINAL_COMMAND Signed-off-by: Andrew Thornton <art27@cantab.net>