summaryrefslogtreecommitdiffstats
path: root/routers/repo
Commit message (Collapse)AuthorAgeFilesLines
* Use gitea forked macaron (#7933)Tamal Saha2019-08-236-7/+7
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Extract the username and password from the mirror url (#7651)zeripath2019-08-161-0/+4
| | | | | | | | | | | | * Explode out mirror username and password * Update models/repo_mirror.go * Just roundtrip the password * remove unused declaration * Update templates/repo/settings/options.tmpl
* Detect delimiter in CSV rendering (#7869)Norwin2019-08-161-2/+4
| | | | | | | | | | | | | | | | | | | | | * detect csv delimiter in csv rendering fixes #7868 * make linter happy * fix failing testcase & use ints where possible * expose markup type to template previously all markup had the .markdown class, which is incorrect, as it applies markdown CSS & JS logic to CSV rendering * fix build (missing `make css`) * ignore quoted csv content for delimiter scoring also fix html generation
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-155-15/+16
| | | | | | | | | | | | | | | | | | * display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
* Convert files to utf-8 for indexing (#7814)guillep2k2019-08-153-8/+8
| | | | | | | | | | | | | | * Convert files to utf-8 for indexing * Move utf8 functions to modules/base * Bump repoIndexerLatestVersion to 3 * Add tests for base/encoding.go * Changes to pass gosimple * Move UTF8 funcs into new modules/charset package
* fix non existent milestone with 500 error (#7867)Lanre Adelowo2019-08-141-0/+5
|
* move CreateReview to moduels/pull (#7841)Lunny Xiao2019-08-141-1/+3
|
* Enable switching to a different source branch when PR already exists (#7819)Mario Lubenka2019-08-111-7/+7
| | | Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Display error as string but not bytes (#7780)Lunny Xiao2019-08-071-1/+1
| | | | | | | | * display error as string but not bytes * Update routers/repo/http.go Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>
* improve branches list performance and fix protected branch icon when ↵Lunny Xiao2019-08-011-4/+12
| | | | no-login (#7695)
* use 403 instead of 401 for ErrUserProhibitLogin (#7591)zeripath2019-07-231-1/+1
|
* Handle ErrUserProhibitLogin in http git (#7586)zeripath2019-07-231-1/+4
|
* Fixes #7474 - Handles all redirects for Web UI File CRUD (#7478)Richard Mahn2019-07-172-15/+119
| | | | | | | | | | | | | | | | * Fixes #7474 - Handles all redirects for Web UI File CRUD * Fixes lint errors * Typo fix * Adds unit tests for a few helper functions * Fixes per review * Fix for new branch creation and to unit test * Fixes the template used for errors on delete
* add notification placeholder (#7409)Lunny Xiao2019-07-121-0/+5
|
* Only show "New Pull Request" button if repo allows pulls (#7426)Gary Kim2019-07-111-0/+1
| | | Signed-off-by: Gary Kim <gary@garykim.dev>
* wiki history improvements (#7391)Cherrg2019-07-111-2/+2
| | | | | | | | | | | | | | | | | * add history comments to detect page delete Signed-off-by: Michael Gnehr <michael@gnehr.de> * fix too much history entries - caused by --follow flag - if files with same contents exists Signed-off-by: Michael Gnehr <michael@gnehr.de> * style imprevements wiki - history - wrap long author names Signed-off-by: Michael Gnehr <michael@gnehr.de>
* wiki - page revisions list (#7369)Cherrg2019-07-081-64/+188
| | | | | | | | | | | | | | fix #7 * add wiki page revision list * mobile improvements * css improvements for long usernames * split renderWikiPage into 3 functions Signed-off-by: Michael Gnehr <michael@gnehr.de>
* Refactor filetype is not allowed errors (#7309)Antoine GIRARD2019-07-063-30/+8
|
* routers: do not leak secrets via timing side channel (#7364)leonklingele2019-07-061-1/+4
| | | | | | * routers: do not leak secrets via timing side channel * routers/repo: do not leak secrets via timing side channel
* Add commit statuses reports on pull request view (#6845)Lunny Xiao2019-06-301-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add commit statuses reports on pull view * Add some translations * improve the UI * fix fmt * fix tests * add a new test git repo to fix tests * fix bug when headRepo or headBranch missing * fix tests * fix tests * fix consistency * fix tests * fix tests * change the test repo * fix tests * fix tests * fix migration * keep db size consistency * fix translation * change commit hash status table unique index * remove unused table * use char instead varchar * make hashCommitStatusContext private * split merge section with status check on pull view ui * fix tests; fix arc-green theme on pull ui
* Show Pull Request button or status of latest PR in branch list (#6990)Mario Lubenka2019-06-271-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Show Pull Request button or status of latest PR in branch list Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Do not show pull request button on deleted branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Do not show commit divergence on deleted branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use XORMs Get instead of limit * Links pull request ID and use smaller labels for displaying the pull request status Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Handle error when getting latest pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Indent template Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check error when loading issue Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Monitor all git commands; move blame to git package and replace git as a ↵Lunny Xiao2019-06-262-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variable (#6864) * monitor all git commands; move blame to git package and replace git as a variable * use git command but not other commands * fix build * move exec.Command to git.NewCommand * fix fmt * remove unrelated changes * remove unrelated changes * refactor IsEmpty and add tests * fix tests * fix tests * fix tests * fix tests * remove gitLogger * fix fmt * fix isEmpty * fix lint * fix tests
* Fix #732: Add LFS objects to base repository on merging (#7082)zeripath2019-06-221-1/+2
| | | | On merge we walk the merge history and ensure that all lfs objects pointed to in the history are added to the base repository. This switches from relying on having git-lfs installed on the server, (and in fact .gitattributes being correctly installed.)
* Add golangci (#6418)kolaente2019-06-1212-52/+84
|
* Fixes diff on merged pull requests (#7171)Mario Lubenka2019-06-111-8/+8
|
* if milestone id is zero don't get it from database (#7169)Lunny Xiao2019-06-101-6/+8
|
* Move PushUpdate dependency from models to repofiles (#6763)Lunny Xiao2019-06-101-9/+12
| | | | | | * remove push_update * move models.PushUpdate to repofiles.PushUpdate
* Compare branches, commits and tags with each other (#6991)Mario Lubenka2019-06-073-324/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Supports tags when comparing commits or branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Hide headline when only comparing and don't load unused data Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Merges compare logics to allow comparing branches, commits and tags with eachother Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Display branch or tag instead of commit when used for comparing Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show pull request form after click on button Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Transfers relevant pull.go changes from master to compare.go Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes error when comparing forks against a commit or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes console.log from JavaScript file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show icon next to commit reference when comparing branch or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Updates css file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes import order * Renames template variable * Update routers/repo/compare.go Co-Authored-By: zeripath <art27@cantab.net> * Update from master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Allow short-shas in compare * Renames prInfo to compareInfo Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check PR permissions only if compare is pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use compareInfo instead of prInfo
* Add state param to milestone listing API (#7131)Lanre Adelowo2019-06-061-1/+2
| | | | | | | | | | | | | | | | * Support state params * update tests * fix tests * add state=all support * update tests * update swagger * update swagger
* Move serv hook functionality & drop GitLogger (#6993)zeripath2019-06-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move hook functionality internally * Internalise serv logic * Remove old internal paths * finally remove the gitlogger * Disallow push on archived repositories * fix lint error * Update modules/private/key.go * Update routers/private/hook.go * Update routers/private/hook.go * Update routers/private/hook.go * Updated routers/private/serv.go * Fix LFS Locks over SSH * rev-list needs to be run by the hook process * fixup * Improve git test * Ensure that the lfs files are created with a different prefix * Reduce the replication in git_test.go * slight refactor * Remove unnecessary "/" * Restore ensureAnonymousClone * Restore ensureAnonymousClone * Run rev-list on server side * Try passing in the alternative directories instead * Mark test as skipped * Improve git test * Ensure that the lfs files are created with a different prefix * Reduce the replication in git_test.go * Remove unnecessary "/"
* Validate External Tracker URL Format (#7089)mrsdizzie2019-05-311-1/+1
| | | | | | | | | | | | | | | | | | * Validate External Tracker URL Format Add some validation checks for external tracker URL format. Fixes #7068 * Don't make {index} a hard requirement * Fix Description * make fmt * move regex to package level * fix copyright date
* Repository avatars (#6986)Sergey Dryabzhinsky2019-05-291-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Repository avatars - first variant of code from old work for gogs - add migration 87 - add new option in app.ini - add en-US locale string - add new class in repository.less * Add changed index.css, remove unused template name * Update en-us doc about configuration options * Add comments to new functions, add new option to docker app.ini * Add comment for lint * Remove variable, not needed * Fix formatting * Update swagger api template * Check if avatar exists * Fix avatar link/path checks * Typo * TEXT column can't have a default value * Fixes: - remove old avatar file on upload - use ID in name of avatar file - users may upload same files - add simple tests * Fix fmt check * Generate PNG instead of "static" GIF * More informative comment * Fix error message * Update avatar upload checks: - add file size check - add new option - update config docs - add new string to en-us locale * Fixes: - use FileHEader field for check file size - add new test - upload big image * Fix formatting * Update comments * Update log message * Removed wrong style - not needed * Use Sync2 to migrate * Update repos list view - bigger avatar - fix html blocks alignment * A little adjust avatar size * Use small icons for explore/repo list * Use new cool avatar preparation func by @lafriks * Missing changes for new function * Remove unused import, move imports * Missed new option definition in app.ini Add file size check in user/profile avatar upload * Use smaller field length for Avatar * Use session to update repo DB data, update DeleteAvatar - use session too * Fix err variable definition * As suggested @lafriks - return as soon as possible, code readability
* Show git-notes (#6984)Vladimir Panteleev2019-05-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | * Show git-notes * Make git-notes heading text localizable * Refactor git-notes data fetching to a separate function * Display the author and time of git notes * Move note bubble inside the commit bubble * Revert "Move note bubble inside the commit bubble" This reverts commit c0951fe0e3b4dea38064515546b1825c1bcf19e1. * Add test for git-notes * testing ui * Polish CSS * Apply suggestions from code review Co-Authored-By: Lauris BH <lauris@nix.lv>
* Fix index produces problem when issues/pulls deleted (#6973)Lunny Xiao2019-05-181-1/+7
| | | | | | | | | | * fix index produces problem when issues/pulls deleted * fix tests * fix tests * fix tests
* Webhook Logs show proper HTTP Method, and allow change HTTP method in form ↵techknowlogick2019-05-151-0/+1
| | | | | | | | | | | (#6953) * Fix #6951 - logs show proper HTTP Method, and allow change HTTP method in form * enforce POST method for webhook * set default if method is empty
* fix syntax highlight in blame view #6895 (#6909)iliyan ivanov2019-05-111-1/+1
|
* Remove local clones & make hooks run on merge/edit/upload (#6672)zeripath2019-05-111-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add options to git.Clone to make it more capable * Begin the process of removing the local copy and tidy up * Remove Wiki LocalCopy Checkouts * Remove the last LocalRepo helpers * Remove WithTemporaryFile * Enable push-hooks for these routes * Ensure tests cope with hooks Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove Repository.LocalCopyPath() * Move temporary repo to use the standard temporary path * Fix the tests Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove LocalWikiPath * Fix missing remove Signed-off-by: Andrew Thornton <art27@cantab.net> * Use AppURL for Oauth user link (#6894) * Use AppURL for Oauth user link Fix #6843 * Update oauth.go * Update oauth.go * internal/ssh: ignore env command totally (#6825) * ssh: ignore env command totally * Remove commented code Needed fix described in issue #6889 * Escape the commit message on issues update and title in telegram hook (#6901) * update sdk to latest (#6903) * improve description of branch protection (fix #6886) (#6906) The branch protection description text were not quite accurate. * Fix logging documentation (#6904) * ENABLE_MACARON_REDIRECT should be REDIRECT_MACARON_LOG * Allow DISABLE_ROUTER_LOG to be set in the [log] section * [skip ci] Updated translations via Crowdin * Move sdk structs to modules/structs (#6905) * move sdk structs to moduels/structs * fix tests * fix fmt * fix swagger * fix vendor
* Move sdk structs to modules/structs (#6905)Lunny Xiao2019-05-111-1/+1
| | | | | | | | | | | | * move sdk structs to moduels/structs * fix tests * fix fmt * fix swagger * fix vendor
* Fix 404 when send pull request some situation (#6871)Lunny Xiao2019-05-071-4/+22
|
* Improve migrations to support migrating ↵Lunny Xiao2019-05-071-31/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | milestones/labels/issues/comments/pullrequests (#6290) * add migrations * fix package dependency * fix lints * implements migrations except pull requests * add releases * migrating releases * fix bug * fix lint * fix migrate releases * fix tests * add rollback * pull request migtations * fix import * fix go module vendor * add tests for upload to gitea * more migrate options * fix swagger-check * fix misspell * add options on migration UI * fix log error * improve UI options on migrating * add support for username password when migrating from github * fix tests * remove comments and fix migrate limitation * improve error handles * migrate API will also support migrate milestones/labels/issues/pulls/releases * fix tests and remove unused codes * add DownloaderFactory and docs about how to create a new Downloader * fix misspell * fix migration docs * Add hints about migrate options on migration page * fix tests
* fix 500 when reviewer is deleted with integration tests (#6856)Lunny Xiao2019-05-061-2/+7
|
* Add GET requests to webhook (#6771)Simon2019-05-051-0/+1
| | | | | | | | | | | | | | * Add GET requests to webhook * make fmt * Handle invalid http method on webhook * Uppercase http method in webhook * Rename v85.go to v86.go * make fmt
* Number of commits ahead/behind in branch overview (#6695)Mario Lubenka2019-05-051-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Call Git API to determine divergence of a branch and its base branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show commit divergance in branch list Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds test for diverging commits Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Try comparing commits instead of branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes test as CI can't run it Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts signature of percentage function to allow providing multiple integers as numerator Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves CountDivergingCommits function into repofiles module Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Git statistics in Activity tab (#4724)Lauris BH2019-05-041-2/+31
| | | | | | | | | | | | | | | | | | * Initial implementation for git statistics in Activity tab * Create top user by commit count endpoint * Add UI and update src-d/go-git dependency * Add coloring * Fix typo * Move git activity stats data extraction to git module * Fix message * Add git code stats test
* fix pulls broken when fork repository deleted (#6754)Lunny Xiao2019-04-261-1/+6
| | | | | | * fix pulls broken when fork repository deleted * fix lint
* OAuth2 token can be used in basic auth (#6747)techknowlogick2019-04-251-0/+12
|
* Fix org visibility bug when git cloning (#6743)Lunny Xiao2019-04-251-5/+0
| | | | | | | | | | | | | | * fix org visibility bug * fix permission check * add integration tests * fix tests * change test user name for easier maintainance and fix test * fix test git repo name
* Handle redirects in git clone commands (#6688)James E. Blair2019-04-251-2/+17
| | | | | | | | | | Add support for repo_redirect objects in the git smart http handler so that when a user clones a repo that has been moved or renamed, they are redirected to the new location. This requires that the query string be included in the redirect as well, so that is added. Signed-off-by: James E. Blair <jeblair@redhat.com>
* Trace Logging on Permission Denied & ColorFormat (#6618)zeripath2019-04-224-1/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add log.ColorFormat and log.ColorFormatted Structs can now implement log.ColorFormatted to provide their own colored format when logged with `%-v` or additional flags. Signed-off-by: Andrew Thornton <art27@cantab.net> * Add basic ColorFormat to repository and user Signed-off-by: Andrew Thornton <art27@cantab.net> * Add basic ColorFormat to access and unit Signed-off-by: Andrew Thornton <art27@cantab.net> * Add ColorFormat to permission and on trace log it Signed-off-by: Andrew Thornton <art27@cantab.net> * Add log.NewColoredIDValue to make ID value coloring consistent Signed-off-by: Andrew Thornton <art27@cantab.net> * formatting changes * Add some better tracing to permission denied for read issues/pulls Signed-off-by: Andrew Thornton <art27@cantab.net> * Add Trace logging on permission denied Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove isTrace() check from deferred func * Adjust repo and allow logging of team * use FormatInt instead of Itoa * Add blank line Signed-off-by: Andrew Thornton <art27@cantab.net> * Update access.go
* Show "delete branch" button on closed pull requests (#6570) (#6601)Mario Lubenka2019-04-202-2/+3
| | | | | | | | | | * Show button to delete a pull request branch after a pull request has been closed (#6570) Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update routers/repo/pull.go Co-Authored-By: saitho <mario.lubenka@googlemail.com>