You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

error.go 34 kB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
9 years ago
9 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Oauth2 consumer (#679) * initial stuff for oauth2 login, fails on: * login button on the signIn page to start the OAuth2 flow and a callback for each provider Only GitHub is implemented for now * show login button only when the OAuth2 consumer is configured (and activated) * create macaron group for oauth2 urls * prevent net/http in modules (other then oauth2) * use a new data sessions oauth2 folder for storing the oauth2 session data * add missing 2FA when this is enabled on the user * add password option for OAuth2 user , for use with git over http and login to the GUI * add tip for registering a GitHub OAuth application * at startup of Gitea register all configured providers and also on adding/deleting of new providers * custom handling of errors in oauth2 request init + show better tip * add ExternalLoginUser model and migration script to add it to database * link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed * remove the linked external account from the user his settings * if user is unknown we allow him to register a new account or link it to some existing account * sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers) * from gorilla/sessions docs: "Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!" (we're using gorilla/sessions for storing oauth2 sessions) * use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
8 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import "fmt"
  6. // ErrNameReserved represents a "reserved name" error.
  7. type ErrNameReserved struct {
  8. Name string
  9. }
  10. // IsErrNameReserved checks if an error is a ErrNameReserved.
  11. func IsErrNameReserved(err error) bool {
  12. _, ok := err.(ErrNameReserved)
  13. return ok
  14. }
  15. func (err ErrNameReserved) Error() string {
  16. return fmt.Sprintf("name is reserved [name: %s]", err.Name)
  17. }
  18. // ErrNamePatternNotAllowed represents a "pattern not allowed" error.
  19. type ErrNamePatternNotAllowed struct {
  20. Pattern string
  21. }
  22. // IsErrNamePatternNotAllowed checks if an error is an
  23. // ErrNamePatternNotAllowed.
  24. func IsErrNamePatternNotAllowed(err error) bool {
  25. _, ok := err.(ErrNamePatternNotAllowed)
  26. return ok
  27. }
  28. func (err ErrNamePatternNotAllowed) Error() string {
  29. return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern)
  30. }
  31. // ____ ___
  32. // | | \______ ___________
  33. // | | / ___// __ \_ __ \
  34. // | | /\___ \\ ___/| | \/
  35. // |______//____ >\___ >__|
  36. // \/ \/
  37. // ErrUserAlreadyExist represents a "user already exists" error.
  38. type ErrUserAlreadyExist struct {
  39. Name string
  40. }
  41. // IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.
  42. func IsErrUserAlreadyExist(err error) bool {
  43. _, ok := err.(ErrUserAlreadyExist)
  44. return ok
  45. }
  46. func (err ErrUserAlreadyExist) Error() string {
  47. return fmt.Sprintf("user already exists [name: %s]", err.Name)
  48. }
  49. // ErrUserNotExist represents a "UserNotExist" kind of error.
  50. type ErrUserNotExist struct {
  51. UID int64
  52. Name string
  53. KeyID int64
  54. }
  55. // IsErrUserNotExist checks if an error is a ErrUserNotExist.
  56. func IsErrUserNotExist(err error) bool {
  57. _, ok := err.(ErrUserNotExist)
  58. return ok
  59. }
  60. func (err ErrUserNotExist) Error() string {
  61. return fmt.Sprintf("user does not exist [uid: %d, name: %s, keyid: %d]", err.UID, err.Name, err.KeyID)
  62. }
  63. // ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
  64. type ErrEmailAlreadyUsed struct {
  65. Email string
  66. }
  67. // IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.
  68. func IsErrEmailAlreadyUsed(err error) bool {
  69. _, ok := err.(ErrEmailAlreadyUsed)
  70. return ok
  71. }
  72. func (err ErrEmailAlreadyUsed) Error() string {
  73. return fmt.Sprintf("e-mail has been used [email: %s]", err.Email)
  74. }
  75. // ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
  76. type ErrOpenIDAlreadyUsed struct {
  77. OpenID string
  78. }
  79. // IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.
  80. func IsErrOpenIDAlreadyUsed(err error) bool {
  81. _, ok := err.(ErrOpenIDAlreadyUsed)
  82. return ok
  83. }
  84. func (err ErrOpenIDAlreadyUsed) Error() string {
  85. return fmt.Sprintf("OpenID has been used [oid: %s]", err.OpenID)
  86. }
  87. // ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
  88. type ErrUserOwnRepos struct {
  89. UID int64
  90. }
  91. // IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
  92. func IsErrUserOwnRepos(err error) bool {
  93. _, ok := err.(ErrUserOwnRepos)
  94. return ok
  95. }
  96. func (err ErrUserOwnRepos) Error() string {
  97. return fmt.Sprintf("user still has ownership of repositories [uid: %d]", err.UID)
  98. }
  99. // ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
  100. type ErrUserHasOrgs struct {
  101. UID int64
  102. }
  103. // IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
  104. func IsErrUserHasOrgs(err error) bool {
  105. _, ok := err.(ErrUserHasOrgs)
  106. return ok
  107. }
  108. func (err ErrUserHasOrgs) Error() string {
  109. return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
  110. }
  111. // ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
  112. type ErrUserNotAllowedCreateOrg struct {
  113. }
  114. // IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
  115. func IsErrUserNotAllowedCreateOrg(err error) bool {
  116. _, ok := err.(ErrUserNotAllowedCreateOrg)
  117. return ok
  118. }
  119. func (err ErrUserNotAllowedCreateOrg) Error() string {
  120. return fmt.Sprintf("user is not allowed to create organizations")
  121. }
  122. // ErrReachLimitOfRepo represents a "ReachLimitOfRepo" kind of error.
  123. type ErrReachLimitOfRepo struct {
  124. Limit int
  125. }
  126. // IsErrReachLimitOfRepo checks if an error is a ErrReachLimitOfRepo.
  127. func IsErrReachLimitOfRepo(err error) bool {
  128. _, ok := err.(ErrReachLimitOfRepo)
  129. return ok
  130. }
  131. func (err ErrReachLimitOfRepo) Error() string {
  132. return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
  133. }
  134. // __ __.__ __ .__
  135. // / \ / \__| | _|__|
  136. // \ \/\/ / | |/ / |
  137. // \ /| | <| |
  138. // \__/\ / |__|__|_ \__|
  139. // \/ \/
  140. // ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
  141. type ErrWikiAlreadyExist struct {
  142. Title string
  143. }
  144. // IsErrWikiAlreadyExist checks if an error is a ErrWikiAlreadyExist.
  145. func IsErrWikiAlreadyExist(err error) bool {
  146. _, ok := err.(ErrWikiAlreadyExist)
  147. return ok
  148. }
  149. func (err ErrWikiAlreadyExist) Error() string {
  150. return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
  151. }
  152. // __________ ___. .__ .__ ____ __.
  153. // \______ \__ _\_ |__ | | |__| ____ | |/ _|____ ___.__.
  154. // | ___/ | \ __ \| | | |/ ___\ | <_/ __ < | |
  155. // | | | | / \_\ \ |_| \ \___ | | \ ___/\___ |
  156. // |____| |____/|___ /____/__|\___ > |____|__ \___ > ____|
  157. // \/ \/ \/ \/\/
  158. // ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
  159. type ErrKeyUnableVerify struct {
  160. Result string
  161. }
  162. // IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.
  163. func IsErrKeyUnableVerify(err error) bool {
  164. _, ok := err.(ErrKeyUnableVerify)
  165. return ok
  166. }
  167. func (err ErrKeyUnableVerify) Error() string {
  168. return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
  169. }
  170. // ErrKeyNotExist represents a "KeyNotExist" kind of error.
  171. type ErrKeyNotExist struct {
  172. ID int64
  173. }
  174. // IsErrKeyNotExist checks if an error is a ErrKeyNotExist.
  175. func IsErrKeyNotExist(err error) bool {
  176. _, ok := err.(ErrKeyNotExist)
  177. return ok
  178. }
  179. func (err ErrKeyNotExist) Error() string {
  180. return fmt.Sprintf("public key does not exist [id: %d]", err.ID)
  181. }
  182. // ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
  183. type ErrKeyAlreadyExist struct {
  184. OwnerID int64
  185. Fingerprint string
  186. Content string
  187. }
  188. // IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.
  189. func IsErrKeyAlreadyExist(err error) bool {
  190. _, ok := err.(ErrKeyAlreadyExist)
  191. return ok
  192. }
  193. func (err ErrKeyAlreadyExist) Error() string {
  194. return fmt.Sprintf("public key already exists [owner_id: %d, finter_print: %s, content: %s]",
  195. err.OwnerID, err.Fingerprint, err.Content)
  196. }
  197. // ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
  198. type ErrKeyNameAlreadyUsed struct {
  199. OwnerID int64
  200. Name string
  201. }
  202. // IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  203. func IsErrKeyNameAlreadyUsed(err error) bool {
  204. _, ok := err.(ErrKeyNameAlreadyUsed)
  205. return ok
  206. }
  207. func (err ErrKeyNameAlreadyUsed) Error() string {
  208. return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
  209. }
  210. // ErrGPGNoEmailFound represents a "ErrGPGNoEmailFound" kind of error.
  211. type ErrGPGNoEmailFound struct {
  212. FailedEmails []string
  213. }
  214. // IsErrGPGNoEmailFound checks if an error is a ErrGPGNoEmailFound.
  215. func IsErrGPGNoEmailFound(err error) bool {
  216. _, ok := err.(ErrGPGNoEmailFound)
  217. return ok
  218. }
  219. func (err ErrGPGNoEmailFound) Error() string {
  220. return fmt.Sprintf("none of the emails attached to the GPG key could be found: %v", err.FailedEmails)
  221. }
  222. // ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
  223. type ErrGPGKeyParsing struct {
  224. ParseError error
  225. }
  226. // IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
  227. func IsErrGPGKeyParsing(err error) bool {
  228. _, ok := err.(ErrGPGKeyParsing)
  229. return ok
  230. }
  231. func (err ErrGPGKeyParsing) Error() string {
  232. return fmt.Sprintf("failed to parse gpg key %s", err.ParseError.Error())
  233. }
  234. // ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
  235. type ErrGPGKeyNotExist struct {
  236. ID int64
  237. }
  238. // IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.
  239. func IsErrGPGKeyNotExist(err error) bool {
  240. _, ok := err.(ErrGPGKeyNotExist)
  241. return ok
  242. }
  243. func (err ErrGPGKeyNotExist) Error() string {
  244. return fmt.Sprintf("public gpg key does not exist [id: %d]", err.ID)
  245. }
  246. // ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.
  247. type ErrGPGKeyIDAlreadyUsed struct {
  248. KeyID string
  249. }
  250. // IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  251. func IsErrGPGKeyIDAlreadyUsed(err error) bool {
  252. _, ok := err.(ErrGPGKeyIDAlreadyUsed)
  253. return ok
  254. }
  255. func (err ErrGPGKeyIDAlreadyUsed) Error() string {
  256. return fmt.Sprintf("public key already exists [key_id: %s]", err.KeyID)
  257. }
  258. // ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.
  259. type ErrGPGKeyAccessDenied struct {
  260. UserID int64
  261. KeyID int64
  262. }
  263. // IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.
  264. func IsErrGPGKeyAccessDenied(err error) bool {
  265. _, ok := err.(ErrGPGKeyAccessDenied)
  266. return ok
  267. }
  268. // Error pretty-prints an error of type ErrGPGKeyAccessDenied.
  269. func (err ErrGPGKeyAccessDenied) Error() string {
  270. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d]",
  271. err.UserID, err.KeyID)
  272. }
  273. // ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
  274. type ErrKeyAccessDenied struct {
  275. UserID int64
  276. KeyID int64
  277. Note string
  278. }
  279. // IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.
  280. func IsErrKeyAccessDenied(err error) bool {
  281. _, ok := err.(ErrKeyAccessDenied)
  282. return ok
  283. }
  284. func (err ErrKeyAccessDenied) Error() string {
  285. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d, note: %s]",
  286. err.UserID, err.KeyID, err.Note)
  287. }
  288. // ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
  289. type ErrDeployKeyNotExist struct {
  290. ID int64
  291. KeyID int64
  292. RepoID int64
  293. }
  294. // IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.
  295. func IsErrDeployKeyNotExist(err error) bool {
  296. _, ok := err.(ErrDeployKeyNotExist)
  297. return ok
  298. }
  299. func (err ErrDeployKeyNotExist) Error() string {
  300. return fmt.Sprintf("Deploy key does not exist [id: %d, key_id: %d, repo_id: %d]", err.ID, err.KeyID, err.RepoID)
  301. }
  302. // ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
  303. type ErrDeployKeyAlreadyExist struct {
  304. KeyID int64
  305. RepoID int64
  306. }
  307. // IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.
  308. func IsErrDeployKeyAlreadyExist(err error) bool {
  309. _, ok := err.(ErrDeployKeyAlreadyExist)
  310. return ok
  311. }
  312. func (err ErrDeployKeyAlreadyExist) Error() string {
  313. return fmt.Sprintf("public key already exists [key_id: %d, repo_id: %d]", err.KeyID, err.RepoID)
  314. }
  315. // ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
  316. type ErrDeployKeyNameAlreadyUsed struct {
  317. RepoID int64
  318. Name string
  319. }
  320. // IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.
  321. func IsErrDeployKeyNameAlreadyUsed(err error) bool {
  322. _, ok := err.(ErrDeployKeyNameAlreadyUsed)
  323. return ok
  324. }
  325. func (err ErrDeployKeyNameAlreadyUsed) Error() string {
  326. return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
  327. }
  328. // _____ ___________ __
  329. // / _ \ ____ ____ ____ ______ _____\__ ___/___ | | __ ____ ____
  330. // / /_\ \_/ ___\/ ___\/ __ \ / ___// ___/ | | / _ \| |/ // __ \ / \
  331. // / | \ \__\ \__\ ___/ \___ \ \___ \ | |( <_> ) <\ ___/| | \
  332. // \____|__ /\___ >___ >___ >____ >____ > |____| \____/|__|_ \\___ >___| /
  333. // \/ \/ \/ \/ \/ \/ \/ \/ \/
  334. // ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
  335. type ErrAccessTokenNotExist struct {
  336. SHA string
  337. }
  338. // IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
  339. func IsErrAccessTokenNotExist(err error) bool {
  340. _, ok := err.(ErrAccessTokenNotExist)
  341. return ok
  342. }
  343. func (err ErrAccessTokenNotExist) Error() string {
  344. return fmt.Sprintf("access token does not exist [sha: %s]", err.SHA)
  345. }
  346. // ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
  347. type ErrAccessTokenEmpty struct {
  348. }
  349. // IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
  350. func IsErrAccessTokenEmpty(err error) bool {
  351. _, ok := err.(ErrAccessTokenEmpty)
  352. return ok
  353. }
  354. func (err ErrAccessTokenEmpty) Error() string {
  355. return fmt.Sprintf("access token is empty")
  356. }
  357. // ________ .__ __ .__
  358. // \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
  359. // / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \
  360. // / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \
  361. // \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| /
  362. // \/ /_____/ \/ \/ \/ \/ \/
  363. // ErrOrgNotExist represents a "OrgNotExist" kind of error.
  364. type ErrOrgNotExist struct {
  365. ID int64
  366. Name string
  367. }
  368. // IsErrOrgNotExist checks if an error is a ErrOrgNotExist.
  369. func IsErrOrgNotExist(err error) bool {
  370. _, ok := err.(ErrOrgNotExist)
  371. return ok
  372. }
  373. func (err ErrOrgNotExist) Error() string {
  374. return fmt.Sprintf("org does not exist [id: %d, name: %s]", err.ID, err.Name)
  375. }
  376. // ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
  377. type ErrLastOrgOwner struct {
  378. UID int64
  379. }
  380. // IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.
  381. func IsErrLastOrgOwner(err error) bool {
  382. _, ok := err.(ErrLastOrgOwner)
  383. return ok
  384. }
  385. func (err ErrLastOrgOwner) Error() string {
  386. return fmt.Sprintf("user is the last member of owner team [uid: %d]", err.UID)
  387. }
  388. // __________ .__ __
  389. // \______ \ ____ ______ ____ _____|__|/ |_ ___________ ___.__.
  390. // | _// __ \\____ \ / _ \/ ___/ \ __\/ _ \_ __ < | |
  391. // | | \ ___/| |_> > <_> )___ \| || | ( <_> ) | \/\___ |
  392. // |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____|
  393. // \/ \/|__| \/ \/
  394. // ErrRepoNotExist represents a "RepoNotExist" kind of error.
  395. type ErrRepoNotExist struct {
  396. ID int64
  397. UID int64
  398. Name string
  399. }
  400. // IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
  401. func IsErrRepoNotExist(err error) bool {
  402. _, ok := err.(ErrRepoNotExist)
  403. return ok
  404. }
  405. func (err ErrRepoNotExist) Error() string {
  406. return fmt.Sprintf("repository does not exist [id: %d, uid: %d, name: %s]", err.ID, err.UID, err.Name)
  407. }
  408. // ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.
  409. type ErrRepoAlreadyExist struct {
  410. Uname string
  411. Name string
  412. }
  413. // IsErrRepoAlreadyExist checks if an error is a ErrRepoAlreadyExist.
  414. func IsErrRepoAlreadyExist(err error) bool {
  415. _, ok := err.(ErrRepoAlreadyExist)
  416. return ok
  417. }
  418. func (err ErrRepoAlreadyExist) Error() string {
  419. return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
  420. }
  421. // ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.
  422. type ErrRepoRedirectNotExist struct {
  423. OwnerID int64
  424. RepoName string
  425. }
  426. // IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist
  427. func IsErrRepoRedirectNotExist(err error) bool {
  428. _, ok := err.(ErrRepoRedirectNotExist)
  429. return ok
  430. }
  431. func (err ErrRepoRedirectNotExist) Error() string {
  432. return fmt.Sprintf("repository redirect does not exist [uid: %d, name: %s]", err.OwnerID, err.RepoName)
  433. }
  434. // ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
  435. type ErrInvalidCloneAddr struct {
  436. IsURLError bool
  437. IsInvalidPath bool
  438. IsPermissionDenied bool
  439. }
  440. // IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.
  441. func IsErrInvalidCloneAddr(err error) bool {
  442. _, ok := err.(ErrInvalidCloneAddr)
  443. return ok
  444. }
  445. func (err ErrInvalidCloneAddr) Error() string {
  446. return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]",
  447. err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
  448. }
  449. // ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
  450. type ErrUpdateTaskNotExist struct {
  451. UUID string
  452. }
  453. // IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
  454. func IsErrUpdateTaskNotExist(err error) bool {
  455. _, ok := err.(ErrUpdateTaskNotExist)
  456. return ok
  457. }
  458. func (err ErrUpdateTaskNotExist) Error() string {
  459. return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
  460. }
  461. // ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
  462. type ErrReleaseAlreadyExist struct {
  463. TagName string
  464. }
  465. // IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.
  466. func IsErrReleaseAlreadyExist(err error) bool {
  467. _, ok := err.(ErrReleaseAlreadyExist)
  468. return ok
  469. }
  470. func (err ErrReleaseAlreadyExist) Error() string {
  471. return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName)
  472. }
  473. // ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
  474. type ErrReleaseNotExist struct {
  475. ID int64
  476. TagName string
  477. }
  478. // IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.
  479. func IsErrReleaseNotExist(err error) bool {
  480. _, ok := err.(ErrReleaseNotExist)
  481. return ok
  482. }
  483. func (err ErrReleaseNotExist) Error() string {
  484. return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
  485. }
  486. // ErrInvalidTagName represents a "InvalidTagName" kind of error.
  487. type ErrInvalidTagName struct {
  488. TagName string
  489. }
  490. // IsErrInvalidTagName checks if an error is a ErrInvalidTagName.
  491. func IsErrInvalidTagName(err error) bool {
  492. _, ok := err.(ErrInvalidTagName)
  493. return ok
  494. }
  495. func (err ErrInvalidTagName) Error() string {
  496. return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName)
  497. }
  498. // ErrRepoFileAlreadyExist represents a "RepoFileAlreadyExist" kind of error.
  499. type ErrRepoFileAlreadyExist struct {
  500. FileName string
  501. }
  502. // IsErrRepoFileAlreadyExist checks if an error is a ErrRepoFileAlreadyExist.
  503. func IsErrRepoFileAlreadyExist(err error) bool {
  504. _, ok := err.(ErrRepoFileAlreadyExist)
  505. return ok
  506. }
  507. func (err ErrRepoFileAlreadyExist) Error() string {
  508. return fmt.Sprintf("repository file already exists [file_name: %s]", err.FileName)
  509. }
  510. // __________ .__
  511. // \______ \____________ ____ ____ | |__
  512. // | | _/\_ __ \__ \ / \_/ ___\| | \
  513. // | | \ | | \// __ \| | \ \___| Y \
  514. // |______ / |__| (____ /___| /\___ >___| /
  515. // \/ \/ \/ \/ \/
  516. // ErrBranchNotExist represents a "BranchNotExist" kind of error.
  517. type ErrBranchNotExist struct {
  518. Name string
  519. }
  520. // IsErrBranchNotExist checks if an error is a ErrBranchNotExist.
  521. func IsErrBranchNotExist(err error) bool {
  522. _, ok := err.(ErrBranchNotExist)
  523. return ok
  524. }
  525. func (err ErrBranchNotExist) Error() string {
  526. return fmt.Sprintf("branch does not exist [name: %s]", err.Name)
  527. }
  528. // ErrBranchAlreadyExists represents an error that branch with such name already exists
  529. type ErrBranchAlreadyExists struct {
  530. BranchName string
  531. }
  532. // IsErrBranchAlreadyExists checks if an error is an ErrBranchAlreadyExists.
  533. func IsErrBranchAlreadyExists(err error) bool {
  534. _, ok := err.(ErrBranchAlreadyExists)
  535. return ok
  536. }
  537. func (err ErrBranchAlreadyExists) Error() string {
  538. return fmt.Sprintf("branch already exists [name: %s]", err.BranchName)
  539. }
  540. // ErrBranchNameConflict represents an error that branch name conflicts with other branch
  541. type ErrBranchNameConflict struct {
  542. BranchName string
  543. }
  544. // IsErrBranchNameConflict checks if an error is an ErrBranchNameConflict.
  545. func IsErrBranchNameConflict(err error) bool {
  546. _, ok := err.(ErrBranchNameConflict)
  547. return ok
  548. }
  549. func (err ErrBranchNameConflict) Error() string {
  550. return fmt.Sprintf("branch conflicts with existing branch [name: %s]", err.BranchName)
  551. }
  552. // ErrTagAlreadyExists represents an error that tag with such name already exists
  553. type ErrTagAlreadyExists struct {
  554. TagName string
  555. }
  556. // IsErrTagAlreadyExists checks if an error is an ErrTagAlreadyExists.
  557. func IsErrTagAlreadyExists(err error) bool {
  558. _, ok := err.(ErrTagAlreadyExists)
  559. return ok
  560. }
  561. func (err ErrTagAlreadyExists) Error() string {
  562. return fmt.Sprintf("tag already exists [name: %s]", err.TagName)
  563. }
  564. // __ __ ___. .__ __
  565. // / \ / \ ____\_ |__ | |__ ____ ____ | | __
  566. // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /
  567. // \ /\ ___/| \_\ \ Y ( <_> | <_> ) <
  568. // \__/\ / \___ >___ /___| /\____/ \____/|__|_ \
  569. // \/ \/ \/ \/ \/
  570. // ErrWebhookNotExist represents a "WebhookNotExist" kind of error.
  571. type ErrWebhookNotExist struct {
  572. ID int64
  573. }
  574. // IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
  575. func IsErrWebhookNotExist(err error) bool {
  576. _, ok := err.(ErrWebhookNotExist)
  577. return ok
  578. }
  579. func (err ErrWebhookNotExist) Error() string {
  580. return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
  581. }
  582. // .___
  583. // | | ______ ________ __ ____
  584. // | |/ ___// ___/ | \_/ __ \
  585. // | |\___ \ \___ \| | /\ ___/
  586. // |___/____ >____ >____/ \___ >
  587. // \/ \/ \/
  588. // ErrIssueNotExist represents a "IssueNotExist" kind of error.
  589. type ErrIssueNotExist struct {
  590. ID int64
  591. RepoID int64
  592. Index int64
  593. }
  594. // IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
  595. func IsErrIssueNotExist(err error) bool {
  596. _, ok := err.(ErrIssueNotExist)
  597. return ok
  598. }
  599. func (err ErrIssueNotExist) Error() string {
  600. return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
  601. }
  602. // __________ .__ .__ __________ __
  603. // \______ \__ __| | | |\______ \ ____ ________ __ ____ _______/ |_
  604. // | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\
  605. // | | | | / |_| |_| | \ ___< <_| | | /\ ___/ \___ \ | |
  606. // |____| |____/|____/____/____|_ /\___ >__ |____/ \___ >____ > |__|
  607. // \/ \/ |__| \/ \/
  608. // ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
  609. type ErrPullRequestNotExist struct {
  610. ID int64
  611. IssueID int64
  612. HeadRepoID int64
  613. BaseRepoID int64
  614. HeadBranch string
  615. BaseBranch string
  616. }
  617. // IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
  618. func IsErrPullRequestNotExist(err error) bool {
  619. _, ok := err.(ErrPullRequestNotExist)
  620. return ok
  621. }
  622. func (err ErrPullRequestNotExist) Error() string {
  623. return fmt.Sprintf("pull request does not exist [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  624. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  625. }
  626. // ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
  627. type ErrPullRequestAlreadyExists struct {
  628. ID int64
  629. IssueID int64
  630. HeadRepoID int64
  631. BaseRepoID int64
  632. HeadBranch string
  633. BaseBranch string
  634. }
  635. // IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
  636. func IsErrPullRequestAlreadyExists(err error) bool {
  637. _, ok := err.(ErrPullRequestAlreadyExists)
  638. return ok
  639. }
  640. // Error does pretty-printing :D
  641. func (err ErrPullRequestAlreadyExists) Error() string {
  642. return fmt.Sprintf("pull request already exists for these targets [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  643. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  644. }
  645. // _________ __
  646. // \_ ___ \ ____ _____ _____ ____ _____/ |_
  647. // / \ \/ / _ \ / \ / \_/ __ \ / \ __\
  648. // \ \___( <_> ) Y Y \ Y Y \ ___/| | \ |
  649. // \______ /\____/|__|_| /__|_| /\___ >___| /__|
  650. // \/ \/ \/ \/ \/
  651. // ErrCommentNotExist represents a "CommentNotExist" kind of error.
  652. type ErrCommentNotExist struct {
  653. ID int64
  654. IssueID int64
  655. }
  656. // IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
  657. func IsErrCommentNotExist(err error) bool {
  658. _, ok := err.(ErrCommentNotExist)
  659. return ok
  660. }
  661. func (err ErrCommentNotExist) Error() string {
  662. return fmt.Sprintf("comment does not exist [id: %d, issue_id: %d]", err.ID, err.IssueID)
  663. }
  664. // _________ __ __ .__
  665. // / _____// |_ ____ ________ _ _______ _/ |_ ____ | |__
  666. // \_____ \\ __\/ _ \\____ \ \/ \/ /\__ \\ __\/ ___\| | \
  667. // / \| | ( <_> ) |_> > / / __ \| | \ \___| Y \
  668. // /_______ /|__| \____/| __/ \/\_/ (____ /__| \___ >___| /
  669. // \/ |__| \/ \/ \/
  670. // ErrStopwatchNotExist represents a "Stopwatch Not Exist" kind of error.
  671. type ErrStopwatchNotExist struct {
  672. ID int64
  673. }
  674. // IsErrStopwatchNotExist checks if an error is a ErrStopwatchNotExist.
  675. func IsErrStopwatchNotExist(err error) bool {
  676. _, ok := err.(ErrStopwatchNotExist)
  677. return ok
  678. }
  679. func (err ErrStopwatchNotExist) Error() string {
  680. return fmt.Sprintf("stopwatch does not exist [id: %d]", err.ID)
  681. }
  682. // ___________ __ .______________.__
  683. // \__ ___/___________ ____ | | __ ____ __| _/\__ ___/|__| _____ ____
  684. // | | \_ __ \__ \ _/ ___\| |/ // __ \ / __ | | | | |/ \_/ __ \
  685. // | | | | \// __ \\ \___| <\ ___// /_/ | | | | | Y Y \ ___/
  686. // |____| |__| (____ /\___ >__|_ \\___ >____ | |____| |__|__|_| /\___ >
  687. // \/ \/ \/ \/ \/ \/ \/
  688. // ErrTrackedTimeNotExist represents a "TrackedTime Not Exist" kind of error.
  689. type ErrTrackedTimeNotExist struct {
  690. ID int64
  691. }
  692. // IsErrTrackedTimeNotExist checks if an error is a ErrTrackedTimeNotExist.
  693. func IsErrTrackedTimeNotExist(err error) bool {
  694. _, ok := err.(ErrTrackedTimeNotExist)
  695. return ok
  696. }
  697. func (err ErrTrackedTimeNotExist) Error() string {
  698. return fmt.Sprintf("tracked time does not exist [id: %d]", err.ID)
  699. }
  700. // .____ ___. .__
  701. // | | _____ \_ |__ ____ | |
  702. // | | \__ \ | __ \_/ __ \| |
  703. // | |___ / __ \| \_\ \ ___/| |__
  704. // |_______ (____ /___ /\___ >____/
  705. // \/ \/ \/ \/
  706. // ErrLabelNotExist represents a "LabelNotExist" kind of error.
  707. type ErrLabelNotExist struct {
  708. LabelID int64
  709. RepoID int64
  710. }
  711. // IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
  712. func IsErrLabelNotExist(err error) bool {
  713. _, ok := err.(ErrLabelNotExist)
  714. return ok
  715. }
  716. func (err ErrLabelNotExist) Error() string {
  717. return fmt.Sprintf("label does not exist [label_id: %d, repo_id: %d]", err.LabelID, err.RepoID)
  718. }
  719. // _____ .__.__ __
  720. // / \ |__| | ____ _______/ |_ ____ ____ ____
  721. // / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \
  722. // / Y \ | |_\ ___/ \___ \ | | ( <_> ) | \ ___/
  723. // \____|__ /__|____/\___ >____ > |__| \____/|___| /\___ >
  724. // \/ \/ \/ \/ \/
  725. // ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
  726. type ErrMilestoneNotExist struct {
  727. ID int64
  728. RepoID int64
  729. }
  730. // IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
  731. func IsErrMilestoneNotExist(err error) bool {
  732. _, ok := err.(ErrMilestoneNotExist)
  733. return ok
  734. }
  735. func (err ErrMilestoneNotExist) Error() string {
  736. return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
  737. }
  738. // _____ __ __ .__ __
  739. // / _ \_/ |__/ |______ ____ | |__ _____ ____ _____/ |_
  740. // / /_\ \ __\ __\__ \ _/ ___\| | \ / \_/ __ \ / \ __\
  741. // / | \ | | | / __ \\ \___| Y \ Y Y \ ___/| | \ |
  742. // \____|__ /__| |__| (____ /\___ >___| /__|_| /\___ >___| /__|
  743. // \/ \/ \/ \/ \/ \/ \/
  744. // ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
  745. type ErrAttachmentNotExist struct {
  746. ID int64
  747. UUID string
  748. }
  749. // IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.
  750. func IsErrAttachmentNotExist(err error) bool {
  751. _, ok := err.(ErrAttachmentNotExist)
  752. return ok
  753. }
  754. func (err ErrAttachmentNotExist) Error() string {
  755. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  756. }
  757. // .____ .__ _________
  758. // | | ____ ____ |__| ____ / _____/ ____ __ _________ ____ ____
  759. // | | / _ \ / ___\| |/ \ \_____ \ / _ \| | \_ __ \_/ ___\/ __ \
  760. // | |__( <_> ) /_/ > | | \ / ( <_> ) | /| | \/\ \__\ ___/
  761. // |_______ \____/\___ /|__|___| / /_______ /\____/|____/ |__| \___ >___ >
  762. // \/ /_____/ \/ \/ \/ \/
  763. // ErrLoginSourceNotExist represents a "LoginSourceNotExist" kind of error.
  764. type ErrLoginSourceNotExist struct {
  765. ID int64
  766. }
  767. // IsErrLoginSourceNotExist checks if an error is a ErrLoginSourceNotExist.
  768. func IsErrLoginSourceNotExist(err error) bool {
  769. _, ok := err.(ErrLoginSourceNotExist)
  770. return ok
  771. }
  772. func (err ErrLoginSourceNotExist) Error() string {
  773. return fmt.Sprintf("login source does not exist [id: %d]", err.ID)
  774. }
  775. // ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.
  776. type ErrLoginSourceAlreadyExist struct {
  777. Name string
  778. }
  779. // IsErrLoginSourceAlreadyExist checks if an error is a ErrLoginSourceAlreadyExist.
  780. func IsErrLoginSourceAlreadyExist(err error) bool {
  781. _, ok := err.(ErrLoginSourceAlreadyExist)
  782. return ok
  783. }
  784. func (err ErrLoginSourceAlreadyExist) Error() string {
  785. return fmt.Sprintf("login source already exists [name: %s]", err.Name)
  786. }
  787. // ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.
  788. type ErrLoginSourceInUse struct {
  789. ID int64
  790. }
  791. // IsErrLoginSourceInUse checks if an error is a ErrLoginSourceInUse.
  792. func IsErrLoginSourceInUse(err error) bool {
  793. _, ok := err.(ErrLoginSourceInUse)
  794. return ok
  795. }
  796. func (err ErrLoginSourceInUse) Error() string {
  797. return fmt.Sprintf("login source is still used by some users [id: %d]", err.ID)
  798. }
  799. // ___________
  800. // \__ ___/___ _____ _____
  801. // | |_/ __ \\__ \ / \
  802. // | |\ ___/ / __ \| Y Y \
  803. // |____| \___ >____ /__|_| /
  804. // \/ \/ \/
  805. // ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
  806. type ErrTeamAlreadyExist struct {
  807. OrgID int64
  808. Name string
  809. }
  810. // IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.
  811. func IsErrTeamAlreadyExist(err error) bool {
  812. _, ok := err.(ErrTeamAlreadyExist)
  813. return ok
  814. }
  815. func (err ErrTeamAlreadyExist) Error() string {
  816. return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
  817. }
  818. //
  819. // Two-factor authentication
  820. //
  821. // ErrTwoFactorNotEnrolled indicates that a user is not enrolled in two-factor authentication.
  822. type ErrTwoFactorNotEnrolled struct {
  823. UID int64
  824. }
  825. // IsErrTwoFactorNotEnrolled checks if an error is a ErrTwoFactorNotEnrolled.
  826. func IsErrTwoFactorNotEnrolled(err error) bool {
  827. _, ok := err.(ErrTwoFactorNotEnrolled)
  828. return ok
  829. }
  830. func (err ErrTwoFactorNotEnrolled) Error() string {
  831. return fmt.Sprintf("user not enrolled in 2FA [uid: %d]", err.UID)
  832. }
  833. // ____ ___ .__ .___
  834. // | | \______ | | _________ __| _/
  835. // | | /\____ \| | / _ \__ \ / __ |
  836. // | | / | |_> > |_( <_> ) __ \_/ /_/ |
  837. // |______/ | __/|____/\____(____ /\____ |
  838. // |__| \/ \/
  839. //
  840. // ErrUploadNotExist represents a "UploadNotExist" kind of error.
  841. type ErrUploadNotExist struct {
  842. ID int64
  843. UUID string
  844. }
  845. // IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
  846. func IsErrUploadNotExist(err error) bool {
  847. _, ok := err.(ErrAttachmentNotExist)
  848. return ok
  849. }
  850. func (err ErrUploadNotExist) Error() string {
  851. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  852. }
  853. // ___________ __ .__ .____ .__ ____ ___
  854. // \_ _____/__ ____/ |_ ___________ ____ _____ | | | | ____ ____ |__| ____ | | \______ ___________
  855. // | __)_\ \/ /\ __\/ __ \_ __ \/ \\__ \ | | | | / _ \ / ___\| |/ \ | | / ___// __ \_ __ \
  856. // | \> < | | \ ___/| | \/ | \/ __ \| |__ | |__( <_> ) /_/ > | | \ | | /\___ \\ ___/| | \/
  857. // /_______ /__/\_ \ |__| \___ >__| |___| (____ /____/ |_______ \____/\___ /|__|___| / |______//____ >\___ >__|
  858. // \/ \/ \/ \/ \/ \/ /_____/ \/ \/ \/
  859. // ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.
  860. type ErrExternalLoginUserAlreadyExist struct {
  861. ExternalID string
  862. UserID int64
  863. LoginSourceID int64
  864. }
  865. // IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.
  866. func IsErrExternalLoginUserAlreadyExist(err error) bool {
  867. _, ok := err.(ErrExternalLoginUserAlreadyExist)
  868. return ok
  869. }
  870. func (err ErrExternalLoginUserAlreadyExist) Error() string {
  871. return fmt.Sprintf("external login user already exists [externalID: %s, userID: %d, loginSourceID: %d]", err.ExternalID, err.UserID, err.LoginSourceID)
  872. }
  873. // ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.
  874. type ErrExternalLoginUserNotExist struct {
  875. UserID int64
  876. LoginSourceID int64
  877. }
  878. // IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.
  879. func IsErrExternalLoginUserNotExist(err error) bool {
  880. _, ok := err.(ErrExternalLoginUserNotExist)
  881. return ok
  882. }
  883. func (err ErrExternalLoginUserNotExist) Error() string {
  884. return fmt.Sprintf("external login user link does not exists [userID: %d, loginSourceID: %d]", err.UserID, err.LoginSourceID)
  885. }