summaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Use Go1.11 module (#5743)Mura Li2019-03-271-1/+1
| | | | | | | | | | | | | | | | | | * Migrate to go modules * make vendor * Update mvdan.cc/xurls * make vendor * Update code.gitea.io/git * make fmt-check * Update github.com/go-sql-driver/mysql * make vendor
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-27110-17/+4655
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Clean up ref name rules (#6437)mrsdizzie2019-03-262-2/+129
| | | | | | | | | | | | | | | | | * Clean up ref name rules Clean up checks on reference names to better conform to the guideline here: https://git-scm.com/docs/git-check-ref-format This fixes half of #6321 * Update branch create integration test According to: https://git-scm.com/docs/git-check-ref-format And: git check-ref-format "master/feature=test1" This is a valid branch name and we should not be testing for it to fail.
* Markdown: enable some more extensions (#6362)Roland Koebler2019-03-212-4/+72
| | | | | | | | | | | | | | * Markdown: enable some more extensions Improve Markdown-rendering by enabling some extensions: - enable definitions lists - enable footnotes - enable header-ids and automatically generate header-ids (for linking to README-sections or creating table-of-contents for larger READMEs) * Markdown: update and exted tests Update and add tests for additionally enabled Markdown-extensions.
* Updates to API 404 responses (#6077)John Olheiser2019-03-181-0/+29
|
* Add bio field for user (#6113)techknowlogick2019-03-181-0/+1
| | | | Fix #4339
* Clean up various use of escape/unescape functions for URL generation (#6334)mrsdizzie2019-03-186-49/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use PathUnescape instead of QueryUnescape when working with branch names Currently branch names with a '+' fail in certain situations because QueryUnescape replaces the + character with a blank space. Using PathUnescape should be better since it is defined as: // PathUnescape is identical to QueryUnescape except that it does not // unescape '+' to ' ' (space). Fixes #6333 * Change error to match new function name * Add new util function PathEscapeSegments This function simply runs PathEscape on each segment of a path without touching the forward slash itself. We want to use this instead of PathEscape/QueryEscape in most cases because a forward slash is a valid name for a branch etc... and we don't want that escaped in a URL. Putting this in new file url.go and also moving a couple similar functions into that file as well. * Use EscapePathSegments where appropriate Replace various uses of EscapePath/EscapeQuery with new EscapePathSegments. Also remove uncessary uses of various escape/unescape functions when the text had already been escaped or was not escaped. * Reformat comment to make drone build happy * Remove no longer used url library * Requested code changes
* Add lang specific font stacks for CJK (#6007)zeripath2019-03-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add lang specific font stacks * Force font changes Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix icons Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix octicons and icons Signed-off-by: Andrew Thornton <art27@cantab.net> * Just override the semantic ui fonts only Signed-off-by: Andrew Thornton <art27@cantab.net> * Missed the headers... override them too * Missed some more semantic ui stuff * Fix PT Sans Signed-off-by: Andrew Thornton <art27@cantab.net> * More changes Signed-off-by: Andrew Thornton <art27@cantab.net> * Squashed commit of the following: commit 7d1679e9079541359869c9e677ba7412bfcc59f3 Author: Mike L <cl.jeremy@qq.com> Date: Wed Mar 13 13:53:49 2019 +0100 Remove missed YaHei leftover from _home.less commit 0079121ea91860a323ed4e5cc1a9c0d490d9cefd Author: Mike L <cl.jeremy@qq.com> Date: Wed Mar 13 12:03:54 2019 +0100 Fix overdone fixes (inherit, :lang) commit 62c919915928ec1db4731d547e95885f91a0618d Author: Mike L <cl.jeremy@qq.com> Date: Wed Mar 13 02:29:10 2019 +0100 Fix elements w/ explicit lang (language chooser) commit b3117587aa2eb8570d60bed583a11ee5565418be Author: Mike L <cl.jeremy@qq.com> Date: Tue Mar 12 20:17:26 2019 +0100 Fix textarea also (to match body) commit 81cedf2c3012c4dd05a7680782b4a98e1b947f67 Author: Mike L <cl.jeremy@qq.com> Date: Tue Mar 12 19:41:39 2019 +0100 Revert css temporarily to fix conflict commit 80ff82797f3203cbeaf866f22e961334e137df89 Author: Mike L <cl.jeremy@qq.com> Date: Tue Mar 12 19:15:30 2019 +0100 Tweak CJK, fix Yu Gothic, more monospace inherits commit 581dceb9a869646c2c486dabb925c88c2680d70c Author: Mike L <cl.jeremy@qq.com> Date: Mon Mar 11 13:09:26 2019 +0100 Add Lato for latin extd. & cyrillic, improve CJK * update stylesheet
* split setting.go to multiple files (#6154)Lunny Xiao2019-03-165-348/+433
| | | | | | * split setting.go to multiple files * fix lint
* Add InternalTokenURI to load InteralToken from an external file (#5812)techknowlogick2019-03-131-25/+73
|
* Fix reported issue in repo description (#6306)zeripath2019-03-111-0/+48
|
* Use url.PathEscape to escape the branchname (#6304)zeripath2019-03-122-2/+4
| | | | | | * Use url.PathEscape to escape the branchname * GetRepositoryByOwnerAndName should also have url.PathEscape as the owner and reponame are provided by the client
* Remove util.RemoveAll - should have been removed since go 1.7 (#6299)zeripath2019-03-102-30/+0
|
* Integrate OAuth2 Provider (#5378)Jonas Franz2019-03-086-7/+197
|
* Replace linkRegex with xurls library (#6261)mrsdizzie2019-03-072-3/+11
| | | | | | | | | | | | | | | | | | | | * Replace linkRegex with xurls library Rather than maintaining a complicated regex to match URLs for autolinking, gitea can use this existing go library that takes care of the matching with very little code change to gitea itself. After spending a while trying to find the perfect regex for all cases this library still works better as it is more flexible than a single regex ever will be. This will also fix the following issues: #5844 #3095 #3381 This passes all our current tests and I've added new ones mentioned in those issues as well. * Use xurls.StrictMatchingScheme instead of xurls.Strict This is much faster and we only care about https? links to preserve existing behavior.
* Remove visitLinksForShortLinks features (#6257)mrsdizzie2019-03-072-14/+9
| | | | | | | | | | | | | | | | | | | | | | The visitLinksForShortLinks feature would look inside of an <a> tag and run shortLinkProcessorFull on any text, which attempts to create links out of potential 'short links' like [[test]] [[link|example]] etc... This makes no sense because you can't have nested links within an <a> tag. Specifically, the html5 standard says <a> tags can't include interactive content if they contain the href attribute: http://w3c.github.io/html/single-page.html#the-a-element And also defines an <a> element with a href attribute as interactive: http://w3c.github.io/html/single-page.html#interactive-content Therefore you can't really put a link inside of another link. In practice none of this works anyways since browsers won't render it, it would probably be broken if they tried, and it is causing a bug (#4946). No current tests rely on this behavior either. This removes the feature and also explicitly excludes the current visitNodeForShortLinks from looking in <a> tags.
* Fix #6234 : Check organization visibility before everything else (#6235)Zsombor2019-03-051-0/+11
| | | | | | * Fix #6234 : Check organization visibility before everything else * Ensure that Owner is available in the Repo
* Modify linkRegex to require http|https (#6171)mrsdizzie2019-02-282-1/+63
| | | | | Modify the current linkRegex to require http|https which appears to be the intended behavior based on the comments. Right now, it also matches anything starting with www as well. Also add testing for linkRegex
* fix display dashboard even if require to change password (#6214)Lunny Xiao2019-02-281-14/+10
| | | | | | * fix display dashboard even if require to change password * fix comments
* Create a repo redirect when transferring ownership (#6210) (#6211)James E. Blair2019-02-281-1/+1
| | | | | | | When transferring ownership of a repo to a different user/org, create a repo redirect that points to the new location in the same way that is done when a repo is renamed. Signed-off-by: James E. Blair <jeblair@redhat.com>
* Increase Username and Orgname MaxSize 35 -> 40 (#6178)Segev Finer2019-02-254-6/+6
| | | | | | | | | | | | | | * Increase Username and Orgname MaxSize 35 -> 40 Signed-off-by: Segev Finer <segev@codeocean.com> * Dep update code.gitea.io/sdk Signed-off-by: Segev Finer <segev@codeocean.com> * Run generate-swagger Signed-off-by: Segev Finer <segev@codeocean.com>
* fix bug when set indexer as db and add tests (#6173)Lunny Xiao2019-02-243-3/+30
|
* Add more tests and docs for issue indexer, add db indexer type for searching ↵Lunny Xiao2019-02-217-10/+85
| | | | | | | | | | | | | | from database (#6144) * add more tests and docs for issue indexer, add db indexer type for searching from database * fix typo * fix typo * fix lint * improve docs
* refactor issue indexer, add some testing and fix a bug (#6131)Lunny Xiao2019-02-214-16/+219
| | | | | | | | * refactor issue indexer, add some testing and fix a bug * fix error copyright year on comment header * issues indexer package import keep consistent
* Minor UI tweaks (#5980)John Olheiser2019-02-192-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove all CommitStatus when a repo is deleted Signed-off-by: jolheiser <john.olheiser@gmail.com> * Minor UI tweaks (#5782) Added 'No License' option Added link and octicon change for external issue trackers Reset password now notifies right away if the code is invalid Signed-off-by: jolheiser <john.olheiser@gmail.com> * More UI tweaks More info in PR * Generate stylesheet for arc-green * Make gofmt work * Change PR integration since the button is changed * Rebase * Generate stylesheet * UI updates Made the PR button a "basic" button Vertically centered the issue checkboxes Labels will update only once after modal is closed * Commit to reference related issues Resolves #5782 Resolves #5861 Addresses original question in #5993 * Change the comment wording since PR button is no longer little and green. * Revert changes that made Windows work * Regenerate stylesheet * Regenerate stylesheets * make generate-stylesheets * Update integration again, changed button style Signed-off-by: jolheiser <john.olheiser@gmail.com> * Added ID to PR button Changed integration to use the ID to avoid breaking in the future * Added missing semi-colons * Added back distinction between issue actions and filters (overlooked it before) Moved action button over next to other action dropdowns * Remove extra tab formatting in list.tmpl * Remove more formatting from GoLand * Replace hardcoded "No License" with i18n license helper.
* remove unused file (#6121)Lunny Xiao2019-02-191-143/+0
|
* Refactor issue indexer (#5363)Lunny Xiao2019-02-199-17/+656
|
* Fix prohibit login check on authorization (#6106)Lunny Xiao2019-02-191-2/+7
| | | | | | | | | | | | * fix bug prohibit login not applied on dashboard * fix tests * fix bug user status leak * fix typo * return after render
* Implement "conversation lock" for issue comments (#5073)Lanre Adelowo2019-02-183-0/+64
|
* Allow to set organization visibility (public, internal, private) (#1763)Rémy Boulanouar2019-02-183-2/+63
|
* Move to ldap.v3 to fix #5928 (#6105)zeripath2019-02-181-2/+2
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* modules/context/auth.go: fix redirect loop (#5965)xdch472019-02-171-1/+1
| | | Closes #5815
* Allow markdown files to read from the LFS (#5787)zeripath2019-02-122-1/+70
| | | | | | | 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)
* Refactor editor upload, update and delete to use git plumbing and add LFS ↵zeripath2019-02-125-0/+862
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support (#5702) * Use git plumbing for upload: #5621 repo_editor.go: UploadRepoFile * Use git plumbing for upload: #5621 repo_editor.go: GetDiffPreview * Use git plumbing for upload: #5621 repo_editor.go: DeleteRepoFile * Use git plumbing for upload: #5621 repo_editor.go: UploadRepoFiles * Move branch checkout functions out of repo_editor.go as they are no longer used there * BUGFIX: The default permissions should be 100644 This is a change from the previous code but is more in keeping with the default behaviour of git. Signed-off-by: Andrew Thornton <art27@cantab.net> * Standardise cleanUploadFilename to more closely match git See verify_path in: https://github.com/git/git/blob/7f4e64169352e03476b0ea64e7e2973669e491a2/read-cache.c#L951 Signed-off-by: Andrew Thornton <art27@cantab.net> * Redirect on bad paths Signed-off-by: Andrew Thornton <art27@cantab.net> * Refactor to move the uploading functions out to a module Signed-off-by: Andrew Thornton <art27@cantab.net> * Add LFS support Signed-off-by: Andrew Thornton <art27@cantab.net> * Update upload.go attribution header Upload.go is essentially the remnants of repo_editor.go. The remaining code is essentially unchanged from the Gogs code, hence the Gogs attribution. * Delete upload files after session committed * Ensure that GIT_AUTHOR_NAME etc. are valid for git see #5774 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add in test cases per @lafriks comment * Add space between gitea and github imports Signed-off-by: Andrew Thornton <art27@cantab.net> * more examples in TestCleanUploadName Signed-off-by: Andrew Thornton <art27@cantab.net> * fix formatting Signed-off-by: Andrew Thornton <art27@cantab.net> * Set the SSH_ORIGINAL_COMMAND to ensure hooks are run Signed-off-by: Andrew Thornton <art27@cantab.net> * Switch off SSH_ORIGINAL_COMMAND Signed-off-by: Andrew Thornton <art27@cantab.net>
* In basic auth check for tokens before call UserSignIn (#5725)manuelluis2019-02-121-5/+46
| | | | | | | | | | * Check first if user/password is a token * In basic auth check if user/password is a token * Remove unnecessary else statement * Changes of fmt
* Add option to close issues via commit on a non master branch (#5992)Lanre Adelowo2019-02-102-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fixes #5957 * add tests to make sure config option is respected * use already defined struct * - use migration to make the flag repo wide not for the entire gitea instance Also note that the config value can still be set so as to be able to control the value for new repositories that are to be created - fix copy/paste error in copyright header year and rearrange import - use repo config instead of server config value to determine if a commit should close an issue - update testsuite * use global config only when creating a new repository * allow repo admin toggle feature via UI * fix typo and improve testcase * fix fixtures * add DEFAULT prefix to config value * fix test
* Split setting.go as multiple files (#6014)Lunny Xiao2019-02-107-442/+509
| | | | | | * split setting.go as multiple files * fix comments
* add default time out for git operations (#6015)Lunny Xiao2019-02-091-0/+5
|
* Remove extra spaces (#6016)Thomas Loubiou2019-02-091-1/+1
|
* Fix #5799 - swagger for mergePullRequest (#5996)Thomas Loubiou2019-02-081-0/+3
|
* use native golang SSH library but ssh-keygen when enable built-in SSH server ↵Lunny Xiao2019-02-071-2/+43
| | | | | | | | to remove dependent on that command lines (#5976) * use native golang SSH library but ssh-keygen when enable built-in SSH server to remove dependent on that command lines * fix tests and add comment head
* Feature - Pagination for git tree API (#5838)Richard Mahn2019-02-061-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feature - Pagination for git tree API * Handles case when page is negative * Does a for loop over the start and end rather than all entries * Removed redundent logic * Adds per_page as a query parameter * Adds DEFAULT_GIT_TREES_PER_PAGE for settings, ran make fmt * Fix typo in cheat-sheet en * Makes page start at 1, generated swagger * Use updates to SDK * Updates to use latest sdk * Updates swagger for tree api * Adds test for GetTreeBySHA * Updates per PR reviews * Updates per PR reviews * Remove file * Formatting * Fix to swagger file * Fix to swagger * Update v1_json.tmpl * Fix to swagger file
* Allow Macaron to be set to log through to gitea.log (#5667)zeripath2019-02-052-4/+48
| | | | | | * Allow Macaron to be set to log through gitea.log Fix #4291
* add other session providers (#5963)techknowlogick2019-02-051-2/+7
|
* Fix ssh deploy and user key constraints (#1357) (#5939)zeripath2019-02-031-0/+25
| | | | | | | | | | | | | | | | 1. A key can either be an ssh user key or a deploy key. It cannot be both. 2. If a key is a user key - it can only be associated with one user. 3. If a key is a deploy key - it can be used in multiple repositories and the permissions it has on those repositories can be different. 4. If a repository is deleted, its deploy keys must be deleted too. We currently don't enforce any of this and multiple repositories access with different permissions doesn't work at all. This PR enforces the following constraints: - [x] You should not be able to add the same user key as another user - [x] You should not be able to add a ssh user key which is being used as a deploy key - [x] You should not be able to add a ssh deploy key which is being used as a user key - [x] If you add an ssh deploy key to another repository you should be able to use it in different modes without losing the ability to use it in the other mode. - [x] If you delete a repository you must delete all its deploy keys. Fix #1357
* Make log mailer for testing (#5893)zeripath2019-02-022-6/+35
| | | | | | | | | | | | | | | | | | * Create log mailer for testing email settings Signed-off-by: Andrew Thornton <art27@cantab.net> * Switch on the log mailer for the integration tests This ensures that the sending mail process works Signed-off-by: Andrew Thornton <art27@cantab.net> * rename the from user for mysql/mssql * rename log sender to dummy sender * update the integration tests
* Fix bug when read public repo lfs file (#5912)Lunny Xiao2019-01-311-2/+5
| | | | | | * fix bug when read public repo lfs file * add comment on lfs permission check
* Recover panic in orgmode.Render if bad orgfile (#4982) (#5903)zeripath2019-01-301-4/+10
| | | | | | | This PR protects against the panic referred to in chaseadmsio/goorgeous#82 by recovering from the panic and just returning the raw bytes if there is an error. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Provide better panic handling (#5902)zeripath2019-01-302-1/+113
| | | | | | | This PR gitea'ises the macaron.Recovery() handler meaning that in the event of panic we get proper gitea 500 pages and the stacktrace is logged with the gitea logger. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Only allow local login if password is non-empty (#5906)zeripath2019-01-301-1/+1
|