Commit Graph

8160 Commits

Author SHA1 Message Date
zeripath 3497efac4a
Add Close() method to gogitRepository (#8901) (#8956)
Backport #8901 

In investigating #7947 it has become clear that the storage component of go-git repositories needs closing.

This PR adds this Close function and adds the Close functions as necessary.

In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files.

Fixes #7947
2019-11-13 13:54:04 +00:00
mrsdizzie 43fc99a7ed Update Github Migration Tests (#8938) (#8945)
Update all Github migration tests to use a new repo created just for
these tests that won't accidentially be modified by regular users
interacting with issues.

Fixes #8895
2019-11-13 00:15:57 -05:00
guillep2k 8693e54426 Backport: Enable punctuations ending mentions (#8889) (#8894)
* Enable punctuations ending mentions

* Improve tests
2019-11-09 20:24:59 -05:00
zeripath b27cac021f
Fix issue with user.fullname (#8903) 2019-11-10 00:06:38 +00:00
guillep2k ca69ded83e Update Github migration test (#8896)
Earlier today #716 was reopened which updated the modification time for
an old milestone (1.6.0) that we use in testing with the assumption that
it is old and won't change. This breaks all builds now, so remove this
test since we have others that test the same code and this milestone
will likely be updated again as that issue changes etc...
2019-11-09 15:15:36 -05:00
guillep2k fbcf235633 Backport: Fix password complexity check on registration (#8887) (#8888)
* Fix registration password complexity

* Fix integration to use a complex password ;)
2019-11-09 11:52:54 +00:00
guillep2k 1275c88589 Backport: Fix require external registration password (#8885) (#8890)
* Fix require external registration password

* Fix ctx on error condition by @jolheiser
2019-11-09 08:30:24 +00:00
mrsdizzie 42d0efd1f3 Fix edit content button on migrated issue content (#8877) (#8884)
Typo on a closing span tag caused edit button not to work properly on
the original issue content for a migrated issue.

Fixes #8876
2019-11-08 23:43:51 +08:00
Lauris BH 68b7f9f3f7
Fix to close opened io resources as soon as not needed (#8839) (#8846)
* Fix to close opened io resources as soon as not needed

* Remove unneeded err checks
2019-11-05 22:14:56 +02:00
Lauris BH 26457782c1 Fix new user form for non-local users (#8826) (#8828) 2019-11-05 08:19:32 +08:00
Lauris BH 1c65ecc1c6
Fix commit expand button to not go to commit link (#8745) (#8825)
* Fix commit expand button to not go to commit link

* Fix message rendering to have correct HTML in result

* Fix check for empty commit message

* Code optimization
2019-11-04 20:59:17 +02:00
6543 c5e5063ec9 Fix SSH2 conditonal in key parsing code (#8806) (#8810)
Avoid out of bounds error by using strings.HasPrefix to check for
starting SSH2 text rather than assuming user input has at least 31
characters.

Add tests for bad input as well.

Fixes #8800
2019-11-03 22:51:32 +08:00
6543 b040a87665 add missing "d" (#8801) 2019-11-03 11:13:38 +08:00
Lunny Xiao 2236375d66 fix 500 when edit hook (#8782) (#8789) 2019-11-02 18:41:06 +02:00
zeripath 646fd8b570 On windows set core.longpaths true (#8776) (#8786) 2019-11-02 12:25:13 +01:00
zeripath 4dac8b2389 Allow to merge if file path contains " or \ (#8629) (#8771)
* if a filename in a repository contains " or \ the owner can't merge pull request with this files
because "git diff-tree" adds double quotes to that filepath
example: filepath is ab"cd but "git diff-tree" returns "ab\"cd"

now, when the owner click "Merge Pull Request" button the server returns 500
this commit fix it

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* add -z option to getDiffTree
escape spec symbols for sparse-checkout

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* go fmt

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* typo

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* escape '\'
escape all spaces and '!'

* use regexp.ReplaceAllString()

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* strings.ReplaceAll was added in go 1.12

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* add '\' to regexp.MustCompile

Signed-off-by: Ilya Pavlov <ilux@cpan.org>
2019-11-01 13:50:59 -04:00
John Olheiser 3341aaf3f0 Changelog 1.9.5 (#8753) (#8756)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-10-30 20:34:13 +00:00
John Olheiser e766f11bd3 Changelog 1.10.0-rc2 (#8750)
* 1.10.0-rc2

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Wording

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Update CHANGELOG.md

Co-Authored-By: jaqra <48099350+jaqra@users.noreply.github.com>
2019-10-30 19:27:52 +02:00
6543 432f9dd1a3 [Fix] milestone close timestamp (#8728) (#8730)
* BugFix: Update closed_date_unix colum on milestone table on close

* go fmt
2019-10-29 03:11:24 +00:00
David Svantesson 8caf05989f Fix deadline on update issue or PR via API (#8698) 2019-10-28 01:36:59 +02:00
Monty Taylor 9bde52ffc1 Fix 500 when getting user as unauthenticated user (#8653) (#8663)
Backport #8653

When doing GET /api/v1/users/{user} as an unauthenticated user,
gitea throws a 500 because it's trying to dereference elements
from the context user. It wants to do this to see whether to
show the primary email and will do that if the logged in user
is admin or the user in question. However, if ctx.User is nil there is a panic
2019-10-25 13:09:15 +01:00
jaqra fa03af8456 make call createMilestoneComment on newIssue func (#8678) (#8681)
* make call createMilestoneComment on newIssue func

* make OldMilestoneID 0 instead of -1
2019-10-25 11:09:19 +01:00
Lunny Xiao 14ebda6fd5 Hide some user information via API if user have no enough permission (#8655) (#8657)
* Hide some user information via API if user have no enough permission

* fix test
2019-10-24 08:59:53 +03:00
zeripath 1d10747514 Use AppSubUrl for more redirections (#8647) (#8651)
Partial backport without changes to locale files.

Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
2019-10-23 18:27:10 -04:00
John Olheiser 83c90e9ba0 Add SubURL to redirect path (#8632) (#8634)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-10-22 22:16:20 +01:00
John Olheiser 2fbd5ae2e5 Fix template error on account page (#8562) (#8622) 2019-10-22 10:08:59 +01:00
guillep2k 0032278a46 Allow externalID to be UUID (#8551) (#8624)
Signed-off-by: Wenxuan Zhao <viz@linux.com>
2019-10-22 09:12:10 +01:00
guillep2k ccf5298a2c Prevent .code-view from overriding font on icon fonts (#8614) (#8627) 2019-10-22 14:39:40 +08:00
zeripath ece768ab6e
Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (#8528) (#8618)
* Expose db.SetMaxOpenConns and allow other dbs to set their connection params
* Add note about port exhaustion

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-10-22 07:00:37 +01:00
guillep2k bac9424a62 fix emoji panel be removed bug in issue page, when the sub issue summit the duplicate emoji (#8609) (#8623) 2019-10-22 02:17:25 +03:00
zeripath afeab941b3
Update heatmap fixtures to restore tests (#8615) (#8616)
* Update heatmap fixtures to restore tests
* Add hint to check the fixture age on fail
2019-10-21 22:15:55 +01:00
6543 cf35355db8 Ensure that diff stats can scroll independently of the diff (#8581) (#8611)
This PR ensures that once opened the diff stats detail box can be scrolled independently of the diff on the compare page.

Fixes #5532 

Details:

* make diff-detail-box the main container
* move file diff at the same level as diff-stats
* make diff-view options sticy again
* make diff-stats scroll if to mouch
* rm useless css info
* less: mv diff-stats to own class
* use new css class
* cleanup less file
* diff-counter: margin-right: 15px;
* make CI work
* make numbers colorful
* add sign (-/+) to numbers
2019-10-21 16:53:34 +08:00
Viktor Szakats 8e9265c402 webhook: set Content-Type for application/x-www-form-urlencoded (#8600)
This header is missing since switching http client from GiteaServer (`code.gitea.io/gitea/modules/httplib`) to Go-http-client/1.1 (`net.http`). The header [was added by default](https://github.com/go-gitea/gitea/blob/release/v1.8/modules/httplib/httplib.go#L301) by the former, but this is no longer true with `net.http`, so it needs to be done explicitly.

Closes: #7700
2019-10-20 18:18:05 +01:00
6543 435ce92935 Fix #8582 by handling empty repos (#8587) (#8594)
* Fix #8582 by handling empty repos

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix tests

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2019-10-19 21:35:22 +01:00
Lunny Xiao 22cea96c18 Fix bug on pull requests when transfer head repository (#8564) (#8569)
* fix bug on pull requests when transfer head repository

* add migration and fix lint

* fix tests and add a cache check on LoadBaseRepo
2019-10-19 08:29:35 +01:00
6543 7565ac02c2 Allow more than 255 characters for tokens in external_login_user tabl… (#8585)
* Allow more than 255 characters for tokens in external_login_user table (#8554)

Signed-off-by: Wenxuan Zhao <viz@linux.com>

* use old xorm repo
2019-10-19 12:54:09 +08:00
zeripath 4e85c8e0d8
Add missed close in ServeBlobLFS (#8527) (#8542) 2019-10-16 20:32:15 +01:00
zeripath 34b8becef0 Ensure that GitRepo is set on Empty repositories (#8539) (#8541)
Both issues/new and settings/hooks/git expect `ctx.Repo.GitRepo` to be set.
This PR changes the context code to open the GitRepo.

Fixes #8538
2019-10-17 00:03:25 +08:00
6543 0752a3895a Fix migrate mirror 500 bug (#8526) (#8530)
* fix migrate mirror 500 bug

* update backport
2019-10-16 10:48:45 +01:00
guillep2k 595033f78e Fix password complexity regex for special characters (backport for v1.10.0) (#8524)
* Fix extra space

* Fix regular expression

* Fix error template name

* Simplify check code, fix default values, add test

* Fix router tests

* Fix fmt

* Fix setting and lint

* Move cleaning up code to test, improve comments

* Tidy up variable declaration
2019-10-16 11:09:27 +08:00
6543 db0d4ffdc7 Changelog for 1.10.0-RC1 (#8510)
* Changelog for 1.10.0
* clean up | remove TESTING and DOCS sction | short BUILD section

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>
Co-Authored-By: zeripath <art27@cantab.net>
2019-10-14 20:34:21 +01:00
David Svantesson 366806db32 Fix errors in create org UI regarding team access permission. (#8506) 2019-10-14 19:20:42 +01:00
GiteaBot 54c137b373 [skip ci] Updated translations via Crowdin 2019-10-14 17:46:01 +00:00
guillep2k eb8975dcce Add nofollow to sign in links (#8509) 2019-10-14 18:43:48 +01:00
GiteaBot 8c8a93c025 [skip ci] Updated translations via Crowdin 2019-10-14 15:45:33 +00:00
Maxim Tkachenko db657192d0 Password Complexity Checks (#6230)
Add password complexity checks. The default settings require a lowercase, uppercase, number and a special character within passwords.

Co-Authored-By: T-M-A <maxim.tkachenko@gmail.com>
Co-Authored-By: Lanre Adelowo <adelowomailbox@gmail.com>
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-10-14 16:24:26 +01:00
Lunny Xiao f9aba9ba0f fix bug on FindExternalUsersByProvider (#8504) 2019-10-14 08:22:46 +01:00
Lunny Xiao e3e44a59d0 Update migrated repositories' issues/comments/prs poster id if user has a github external user saved (#7751)
* update migrated issues/comments when login as github

* add get userid when migrating or login with github oauth2

* fix lint

* add migrations for repository service type

* fix build

* remove unnecessary dependencies on migrations

* add cron task to update migrations poster ids and fix posterid when migrating

* fix lint

* fix lint

* improve code

* fix lint

* improve code

* replace releases publish id to actual author id

* fix import

* fix bug

* fix lint

* fix rawdata definition

* fix some bugs

* fix error message
2019-10-14 09:10:42 +03:00
Antoine GIRARD ba201aaa44 vendor: update mvdan.cc/xurls/v2 to v2.1.0 (#8495) 2019-10-14 08:38:15 +08:00
guillep2k 15809d81f7 Rewrite reference processing code in preparation for opening/closing from comment references (#8261)
* Add a markdown stripper for mentions and xrefs

* Improve comments

* Small code simplification

* Move reference code to modules/references

* Fix typo

* Make MarkdownStripper return [][]byte

* Implement preliminary keywords parsing

* Add FIXME comment

* Fix comment

* make fmt

* Fix permissions check

* Fix text assumptions

* Fix imports

* Fix lint, fmt

* Fix unused import

* Add missing export comment

* Bypass revive on implemented interface

* Move mdstripper into its own package

* Support alphanumeric patterns

* Refactor FindAllMentions

* Move mentions test to references

* Parse mentions from reference package

* Refactor code to implement renderizable references

* Fix typo

* Move patterns and tests to the references package

* Fix nil reference

* Preliminary rendering attempt of closing keywords

* Normalize names, comments, general tidy-up

* Add CSS style for action keywords

* Fix permission for admin and owner

* Fix golangci-lint

* Fix golangci-lint
2019-10-13 23:29:10 +01:00