aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/view.go
Commit message (Collapse)AuthorAgeFilesLines
* Add golangci (#6418)kolaente2019-06-121-3/+1
|
* 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
* Unifies pagination template usage (#6531) (#6533)Mario Lubenka2019-04-201-4/+3
|
* Improve listing performance by using go-git (#6478)Filip Navara2019-04-191-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use go-git for tree reading and commit info lookup. Signed-off-by: Filip Navara <navara@emclient.com> * Use TreeEntry.IsRegular() instead of ObjectType that was removed. Signed-off-by: Filip Navara <navara@emclient.com> * Use the treePath to optimize commit info search. Signed-off-by: Filip Navara <navara@emclient.com> * Extract the latest commit at treePath along with the other commits. Signed-off-by: Filip Navara <navara@emclient.com> * Fix listing commit info for a directory that was created in one commit and never modified after. Signed-off-by: Filip Navara <navara@emclient.com> * Avoid nearly all external 'git' invocations when doing directory listing (.editorconfig code path is still hit). Signed-off-by: Filip Navara <navara@emclient.com> * Use go-git for reading blobs. Signed-off-by: Filip Navara <navara@emclient.com> * Make SHA1 type alias for plumbing.Hash in go-git. Signed-off-by: Filip Navara <navara@emclient.com> * Make Signature type alias for object.Signature in go-git. Signed-off-by: Filip Navara <navara@emclient.com> * Fix GetCommitsInfo for repository with only one commit. Signed-off-by: Filip Navara <navara@emclient.com> * Fix PGP signature verification. Signed-off-by: Filip Navara <navara@emclient.com> * Fix issues with walking commit graph across merges. Signed-off-by: Filip Navara <navara@emclient.com> * Fix typo in condition. Signed-off-by: Filip Navara <navara@emclient.com> * Speed up loading branch list by keeping the repository reference (and thus all the loaded packfile indexes). Signed-off-by: Filip Navara <navara@emclient.com> * Fix lising submodules. Signed-off-by: Filip Navara <navara@emclient.com> * Fix build Signed-off-by: Filip Navara <navara@emclient.com> * Add back commit cache because of name-rev Signed-off-by: Filip Navara <navara@emclient.com> * Fix tests Signed-off-by: Filip Navara <navara@emclient.com> * Fix code style * Fix spelling * Address PR feedback Signed-off-by: Filip Navara <navara@emclient.com> * Update vendor module list Signed-off-by: Filip Navara <navara@emclient.com> * Fix getting trees by commit id Signed-off-by: Filip Navara <navara@emclient.com> * Fix remaining unit test failures * Fix GetTreeBySHA * Avoid running `git name-rev` if not necessary Signed-off-by: Filip Navara <navara@emclient.com> * Move Branch code to git module * Clean up GPG signature verification and fix it for tagged commits * Address PR feedback (import formatting, copyright headers) * Make blob lookup by SHA working * Update tests to use public API * Allow getting content from any type of object through the blob interface * Change test to actually expect the object content that is in the GIT repository * Change one more test to actually expect the object content that is in the GIT repository * Add comments
* Better logging (#6038) (#6095)zeripath2019-04-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move code.gitea.io/git to code.gitea.io/gitea/modules/git * fix imports * fix fmt * fix misspell * remove wrong tests data * fix unit tests * fix tests * fix tests * fix tests * fix tests * fix tests * enable Debug to trace the failure tests * fix tests * fix tests * fix tests * fix tests * fix tests * comment commit count tests since git clone depth is 50 * fix tests * update from code.gitea.io/git * revert change to makefile
* update git vendor to fix wrong release commit id and add migrations (#6224)Lunny Xiao2019-03-111-1/+1
| | | | | | | | | | * update git vendor to fix wrong release commit id and add migrations * fix count * fix migration release * fix tests
* Allow display of LFS stored Readme.md on directory page (#6073) (#6099)zeripath2019-02-211-26/+88
| | | | | | | | | | | | | | | | | | * Fix display of >1Kb LFS text files * Make LFS stored Readme files viewable Signed-off-by: Andrew Thornton <art27@cantab.net> * Slight restructure Signed-off-by: Andrew Thornton <art27@cantab.net> * Slight restructure Signed-off-by: Andrew Thornton <art27@cantab.net> * catch errors and restructure LFS sections
* Allow to set organization visibility (public, internal, private) (#1763)Rémy Boulanouar2019-02-181-0/+5
|
* Allow markdown files to read from the LFS (#5787)zeripath2019-02-121-28/+36
| | | | | | | This PR makes it possible for the markdown renderer to render images and media straight from the LFS. Fix #5746 Signed-off-by: Andrew Thornton [art27@cantab.net](mailto:art27@cantab.net)
* Feature: Archive repos (#5009)kolaente2019-01-231-2/+2
|
* Refactor repo.isBare to repo.isEmpty #5629 (#5714)zeripath2019-01-171-6/+6
| | | | | | | | * Refactor repo.isBare to repo.isEmpty #5629 Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove Sync call
* Prioritize "readme.md" (#5691)Khaled Hamed2019-01-141-5/+18
| | | | | | | | * prioritize readme.md * Improve IsReadmeFile * Add more tests
* Restrict permission check on repositories and fix some problems (#5314)Lunny Xiao2018-11-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix units permission problems * fix some bugs and merge LoadUnits to repoAssignment * refactor permission struct and add some copyright heads * remove unused codes * fix routes units check * improve permission check * add unit tests for permission * fix typo * fix tests * fix some routes * fix api permission check * improve permission check * fix some permission check * fix tests * fix tests * improve some permission check * fix some permission check * refactor AccessLevel * fix bug * fix tests * fix tests * fix tests * fix AccessLevel * rename CanAccess * fix tests * fix comment * fix bug * add missing unit for test repos * fix bug * rename some functions * fix routes check
* Serve audio files using HTML5 audio tag (#5221)Jonas Bröms2018-10-301-0/+2
| | | | | | * Serve audio files using HTML5 audio tag * Correct copy paste error
* Detect charset and convert non UTF-8 files for display (#4950)Lauris BH2018-09-291-2/+4
| | | | | | | | | | | | | | * Detect charset and convert non UTF-8 files for display * Refactor and move function to correct module * Revert unrelated changes * More unrelated changes * Duplicate content for small text to have better encoding detection * Check if original content is valid before duplicating it
* Add file name and branch to page title (#4902)Lanre Adelowo2018-09-101-0/+2
|
* HTML-escape text READMEs (#4192)nickolas3602018-06-101-2/+6
|
* Added deletion of an empty line at the end of the file (#4050) (#4054)Alexey Terentyev2018-05-291-0/+4
| | | Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
* Add topic support (#3711)Lunny Xiao2018-04-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | * add topic models and unit tests * fix comments * fix comment * add the UI to show or add topics for a repo * show topics on repositories list * fix test * don't show manage topics link when no permission * use green basic as topic label * fix topic label color * remove trace content * remove debug function
* Handle refactor (#3339)Morgan Bazalgette2018-01-101-9/+9
| | | | | | * Replace all ctx.Handle with ctx.ServerError or ctx.NotFound * Change Handle(403) to NotFound, avoid using macaron's NotFound
* Improve LFS tests + fix lfs url refs + keep path upper/lowercase in db. (#3092)Antoine GIRARD2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Add failing test * Fix urls * Improve url in tests * improve testing * Remove debug code * Add deps * LFS corner-case : Search on lower but store with case * Temporary comment of blocking action * fix hooks * Use temporary repo for git client test * Use userPassword in place of hard-coded password
* Memory usage improvements (#3013)Duncan Ogilvie2017-11-291-10/+19
| | | | | | | | | | * govendor update code.gitea.io/git Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com> * Greatly improve memory usage Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
* Make URL scheme unambiguous (#2408)Ethan Koenig2017-10-301-2/+2
| | | | | | | | | | * Make URL scheme unambiguous Redirect old routes to new routes * Fix redirects to new URL scheme, and update template * Fix branches/_new endpoints, and update integration test
* Render plain text README.txt monospaced (#2721)Jonas Franz2017-10-171-2/+3
| | | Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Fix plain readme didn't render correctly on repo home page (#2705)Lunny Xiao2017-10-161-12/+7
| | | | | | | | * fix plain readme didn't render correctly on repo home page * fix missing render * remove unused template variables
* Fix implementation of repo Home func (#2601)Morlinest2017-10-011-8/+13
| | | | | | * Fix implementation of repo Home func * Make fixture changes for testing
* fix readme view bug (#2566)Lunny Xiao2017-09-211-1/+3
|
* Add init support of orgmode document type on file view and readme (#2525)Lunny Xiao2017-09-211-6/+4
| | | | | | | | | | | | | | * add init support of orgmode document type on file view and readme * fix imports * fix imports and readmeExist * fix imports order * fix format * remove unnecessary convert
* Sort repository tree entries in natural way (#2506)Lauris BH2017-09-191-1/+1
| | | | | | | | | | | | * Sort repository tree entries in natural way * Fix sort for different length strings with first parts equal * Improve test case * Refactor return statements * Update gitea/git dependency
* Restructure markup & markdown to prepare for multiple markup language… (#2411)Lunny Xiao2017-09-161-3/+2
| | | | | | | | | | * restructure markup & markdown to prepare for multiple markup languages support * adjust some functions between markdown and markup * fix tests * improve the comments
* Display commit status on landing page of repo (#1784)Rémy Boulanouar2017-09-141-0/+8
| | | | | | | | * Display commit status on landing page of repo * improve last status of commits and add link to ci * fix last commit status since the order of ids are desc
* Support CRLF when splitting code lines for display (#1862)silverwind2017-06-101-1/+5
| | | | | | | | | | | | * Support CRLF when splitting code lines for display * refactor, fix mixed match * fmt * split on both LF and CRLF, use raw literals in regexes * simplify
* feat: add check misspelling (#1877)Bo-Yi Wu2017-06-051-1/+1
|
* Add units to team (#947)Lunny Xiao2017-05-181-0/+19
| | | | | | | | | | | | | | | | | | * add units to team * fix lint * finish team setting backend * finished permission controll on routes * fix import blank line * add unit check on ssh/http pull and push and fix test failed * fix fixtures data * remove unused code
* Remove sha1 hash display in repository table and add latest commit GPG check ↵Lauris BH2017-05-051-0/+1
| | | | (#1678)
* fix multiple readme file rendering and fix #1657 (#1658)Lunny Xiao2017-05-021-3/+9
| | | | | | * fix multiple readme file rendering and fix #1657 * remove unnecessary loop
* Add markup package to prepare for org markup format (#1493)Lunny Xiao2017-04-211-13/+14
|
* feat: Only use issue and wiki on repo. (#1297)Bo-Yi Wu2017-03-181-1/+8
|
* fix some typos (#1082)Lunny Xiao2017-02-281-1/+1
|
* Cleanup log messagingGabriel Jackson2017-02-021-3/+3
| | | | | | | | | This change corrects a few logging issues: * Standardized formatting errors with '%v'. * Standardized failure warning word usage. * Corrected an instance of using the standard log library when the gitea log library should be used instead.
* Git LFS support v2 (#122)Fabian Zaremba2016-12-261-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Import github.com/git-lfs/lfs-test-server as lfs module base Imported commit is 3968aac269a77b73924649b9412ae03f7ccd3198 Removed: Dockerfile CONTRIBUTING.md mgmt* script/ vendor/ kvlogger.go .dockerignore .gitignore README.md * Remove config, add JWT support from github.com/mgit-at/lfs-test-server Imported commit f0cdcc5a01599c5a955dc1bbf683bb4acecdba83 * Add LFS settings * Add LFS meta object model * Add LFS routes and initialization * Import github.com/dgrijalva/jwt-go into vendor/ * Adapt LFS module: handlers, routing, meta store * Move LFS routes to /user/repo/info/lfs/* * Add request header checks to LFS BatchHandler / PostHandler * Implement LFS basic authentication * Rework JWT secret generation / load * Implement LFS SSH token authentication with JWT Specification: https://github.com/github/git-lfs/tree/master/docs/api * Integrate LFS settings into install process * Remove LFS objects when repository is deleted Only removes objects from content store when deleted repo is the only referencing repository * Make LFS module stateless Fixes bug where LFS would not work after installation without restarting Gitea * Change 500 'Internal Server Error' to 400 'Bad Request' * Change sql query to xorm call * Remove unneeded type from LFS module * Change internal imports to code.gitea.io/gitea/ * Add Gitea authors copyright * Change basic auth realm to "gitea-lfs" * Add unique indexes to LFS model * Use xorm count function in LFS check on repository delete * Return io.ReadCloser from content store and close after usage * Add LFS info to runWeb() * Export LFS content store base path * LFS file download from UI * Work around git-lfs client issue with unauthenticated requests Returning a dummy Authorization header for unauthenticated requests lets git-lfs client skip asking for auth credentials See: https://github.com/github/git-lfs/issues/1088 * Fix unauthenticated UI downloads from public repositories * Authentication check order, Finish LFS file view logic * Ignore LFS hooks if installed for current OS user Fixes Gitea UI actions for repositories tracking LFS files. Checks for minimum needed git version by parsing the semantic version string. * Hide LFS metafile diff from commit view, marking as binary * Show LFS notice if file in commit view is tracked * Add notbefore/nbf JWT claim * Correct lint suggestions - comments for structs and functions - Add comments to LFS model - Function comment for GetRandomBytesAsBase64 - LFS server function comments and lint variable suggestion * Move secret generation code out of conditional Ensures no LFS code may run with an empty secret * Do not hand out JWT tokens if LFS server support is disabled
* serve video files using the HTML5 video tag (#418)Nico Mandery2016-12-201-0/+2
| | | | | | * serve video files using the HTML5 video tag * lint fix: add comment to IsVideoFile
* Integrate templates into bindata optionally (#314)Thomas Boerger2016-12-061-3/+3
| | | Integrated optional bindata for the templates
* Golint fixed for modules/templateLunny Xiao2016-11-251-1/+1
|
* golint fixed for routers/repo/view.go (#205)Lunny Xiao2016-11-211-7/+12
|
* Normalize files with gofmtThibault Meyer2016-11-111-2/+2
|
* Update import paths from github.com/go-gitea to code.gitea.io (#135)Sandro Santilli2016-11-101-9/+9
| | | | | | | - Update import paths from github.com/go-gitea to code.gitea.io - Fix import path for travis See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
* Fix rendering of non-markdown readme filesOdin Ugedal2016-11-061-2/+4
|
* Replace gogits/git-module dependency with go-gitea/git (#94)Sandro Santilli2016-11-061-1/+1
| | | | | | | | * Replace gogits/git-module dependency with go-gitea/git Fixes #92 * Remove git alias for git module import (not needed)