Compare commits

..

1744 Commits

Author SHA1 Message Date
799f5e05c9 1.8.0 Changelog (#6678) 2019-04-20 13:23:24 -04:00
497f37bffd Unfortunately MemProvider Init does not actually Init properly (#6692) (#6693)
* Unfortunately MemProvider Init does not actually Init properly

Worse all of its members are private and you cannot update them.
Simple fix copy it in to modules session.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Fix misspelling
2019-04-20 14:42:51 +01:00
d7aa553f1b Prevent creating empty sessions (#6677) (#6690)
Backport #6677 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-04-20 10:24:20 +01:00
ba12463175 backport #6674 - API OTP Context (#6676) 2019-04-19 20:18:10 +08:00
0acaa6bd00 Fix 6655 - there is no need to EscapePound .Link as it is already escaped (#6656) (#6666)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-04-17 16:19:20 -04:00
66a3353c31 Properly escape on the redirect from the web editor (#6657) (#6667) 2019-04-17 15:52:45 -04:00
5236d8a936 Fix forking an empty repository (#6637) (#6653)
Fixes #6633

Signed-off-by: Segev Finer <segev@codeocean.com>
2019-04-16 20:47:09 +01:00
5876e37ed4 Fix dropdown icon padding (#6651) (#6654)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-04-16 14:28:42 -04:00
3c21a0ee80 Add title attributes to all items in the repo list viewer (#6258) (#6650) 2019-04-16 10:25:15 -04:00
f43783f003 [backport] Fix wrong GPG expire date (#6643) (#6644)
* fix expire of gpg relative to key creation https://tools.ietf.org/html/rfc4880#section-5.2.3.6

* add test
2019-04-16 08:52:09 +08:00
b9c5a3acc3 Return a UserList from /api/v1/admin/users (#6629) (#6642) 2019-04-15 17:38:41 -04:00
c363ef5da0 Add json tags for oauth2 form (#6627) (#6641)
(cherry picked from commit 62d3f49c28c9df2991793fe6846b10088fd5d770)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2019-04-15 22:36:14 +02:00
e8ca2da08f Fix cross-compile builds (#6609) (#6615)
* Fix cross-compile builds (#6609)

* Update Makefile

* remove bash requirement
2019-04-14 23:22:48 +03:00
f64b8eb009 1.8.0-rc3 changelog & 1.7.6 changelog backport (#6597) 2019-04-12 23:12:47 -04:00
40f41dc694 Correctly adjust mirror url (#6593) (#6594) 2019-04-12 22:25:06 +01:00
a63b9fbc70 Change summary to full message (#6591) (#6592)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-04-12 20:47:29 +03:00
4b87aa367c fix mail notification when close/reopen issue (#6581) (#6588) 2019-04-12 13:01:34 +01:00
72f4cdf868 Add option to disable refresh token invalidation (#6584) (#6587)
* Add option to disable refresh token invalidation

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

* Add integration tests and remove wrong todos

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

* Fix typo

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

* Fix tests and add documentation

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

(cherry picked from commit 783cd649276c472aa3af97dd311eb4766ff3adfb)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2019-04-12 13:42:44 +03:00
5be1b7df3f fix bug user search API pagesize didn't obey ExplorePagingNum (#6579) (#6586) 2019-04-11 21:45:35 -04:00
95e12be30f Fix new repo alignment (#6583) (#6585)
* Fix new repo alignment (#6583)

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

* Kick Drone

* Make stylesheets again.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-04-11 19:29:00 -04:00
245089b9c9 Prevent server 500 on compare branches with no common history (#6555) (#6558)
* Prevent server 500 on compare branches with no common history (#6555)
* Update code.gitea.io/git module
2019-04-11 21:31:17 +01:00
2551660f49 Properly escape release attachment URL (#6512) (#6523)
Make sure file attachments on a release get a properly escaped URL when
linking.

Fixes #6506
2019-04-05 13:00:20 -04:00
3b28de7d8e fix bug when user login and want to resend register confirmation email (#6482) (#6486) 2019-04-02 09:36:56 +01:00
3725eefb7f Hacky fix for alignment of the create-organization dialog (#6455) (#6462)
* Hacky fix for alignment of the create-organization dialog

* Mangle the post-scripted red-asterisk back in to follow the Visibility Header
2019-03-28 15:17:04 -04:00
73ce02400c Changelog 1.8.0 rc2 (#6451) 2019-03-27 15:16:25 -04:00
197cbd674d Changelog 1.7.5 (#6444) (#6448)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-03-27 14:47:14 -04:00
4a0f7c1eb4 Change order that PostProcess Processors are run (#6445) (#6447)
Make sure Processors that work on full links are run first so that
something matching another pattern doesn't alter a link before we get to
it, for example:

 https://stackoverflow.com/questions/2896191/what-is-go-used-fore

Fixes #4813
2019-03-27 12:06:40 -04:00
e54f7a708c Fix Hook & HookList in Swagger (#6432) (#6440)
Backport from #6432
2019-03-27 09:03:34 +02:00
63f6764dce Clean up ref name rules (#6437) (#6439) 2019-03-26 21:14:22 +00:00
0bf7ed55be routers/repo/setting: display correct error for invalid mirror interval (#6429)
Set Err_Interval in the context data so that the mirror interval box is
highlighted red as expected.

Clear Err_RepoName for the mirror and advanced actions. repo_name is not
set by these forms, causing auth.validate() to set the Err_RepoName
before SettingsPost is called, which would lead to the repository name
box getting erroneously highlighted red.

Fixes: https://github.com/go-gitea/gitea/issues/6396
2019-03-25 20:35:06 -04:00
93e8174e4e Fixed unitTypeCode not being used (#6419) (#6422) 2019-03-24 17:31:34 +00:00
c5ec66a8a3 fix dump table name error and add some test for dump database (#6394) (#6402) 2019-03-21 09:11:44 +00:00
b6fb082b78 fix migrations 82 to ignore unsynced tags between database and git data and missing is_archived on repository table (#6387) (#6403) 2019-03-21 08:39:50 +00:00
3ce195115b Don't Unescape redirect_to cookie value (#6399) (#6401)
redirect_to holds a value that we want to redirect back to after login.
This value can be a path with intentonally escaped values and we
should not unescape it.

Fixes #4475
2019-03-21 08:58:49 +02:00
00619a04f7 fix bug manifest.json will not request with cookie so that session will created every request (#6372) (#6382) 2019-03-19 22:19:16 -04:00
16815306ad make sure units of a team are returned (#6379) (#6381) 2019-03-19 18:40:54 -04:00
3934d9cd2f Disable benchmarking during tag events on DroneIO (#6365) (#6366) 2019-03-19 02:54:34 -04:00
6a6656ae44 1.8.0-rc1 changelog (#6363) 2019-03-18 22:22:04 -04:00
ca46385637 Clean up various use of escape/unescape functions for URL generation (#6334)
* 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
2019-03-18 10:00:23 -04:00
c151682fae Fix headline (#6353) 2019-03-18 09:59:46 -04:00
82fbc82b63 [skip ci] Updated translations via Crowdin 2019-03-18 12:51:30 +00:00
d78bb1d564 Add lang specific font stacks for CJK (#6007)
* 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
2019-03-18 08:49:01 -04:00
cd8cdbd9d2 fix testing instructions in CONTRIBUTING.md (#6305)
* add scripts/test-local.sh and fix CONTRIBUTING.md

- fixes #6243
- partial fix for #6269

Signed-off-by: Steve Traugott <stevegt@t7a.org>

* remove reference to possible automated drone run

* remove bash version of drone-cli test script

* fix issue number links in testing instructions

* remove scripts/test-local.sh
2019-03-18 08:38:08 +08:00
1155f1b02d [skip ci] Updated translations via Crowdin 2019-03-17 19:20:28 +00:00
4a6b011b15 Add test environment for Mysql8 (#5234) 2019-03-17 15:17:18 -04:00
b3ad5eb414 More specific declaration of search disk space (#6338)
Elaborate more on the code search storage space requirement
2019-03-16 22:47:04 -04:00
379289639e split setting.go to multiple files (#6154)
* split setting.go to multiple files

* fix lint
2019-03-16 11:12:44 +08:00
faf446b372 Request to join the maintainers (#6340) 2019-03-15 12:53:53 -04:00
e558f83407 use updated reference of xgo in makefile (#6339) 2019-03-15 12:39:02 -04:00
4f74bad783 Add way to force checkout (#6322) 2019-03-15 12:18:01 -04:00
c55bdca562 Add same changes from issues page to milestone->issues page (#6328) 2019-03-15 11:50:27 -04:00
583968f274 Return 409 when creating repo if it already exists. (#6330) 2019-03-15 10:19:09 -04:00
7780ea8890 Fix ParsePatch function to work with quoted diff --git strings (#6323)
* Fix ParsePatch to work properly with quoted diff --git string

Currently ParsePatch fails when a diff contains a quoted diff line like:

diff --git "a/file" "b/file"

This patch makes it properly parse the line when that happens.

Fixes #6309

* Add test for regular case while here

* Simplify string modification
2019-03-14 18:09:53 +02:00
d7542bfde3 Add InternalTokenURI to load InteralToken from an external file (#5812) 2019-03-13 18:49:43 -04:00
91775c1125 backport 1.7.4 changelog (#6317) 2019-03-13 07:50:20 +00:00
202a8f6ed9 Use correct remote on Windows (#6313) 2019-03-12 19:47:04 +02:00
b2e9894988 Fix reported issue in repo description (#6306) 2019-03-11 22:23:34 -04:00
663874e8be Use url.PathEscape to escape the branchname (#6304)
* Use url.PathEscape to escape the branchname

* GetRepositoryByOwnerAndName should also have url.PathEscape as the owner and reponame are provided by the client
2019-03-12 00:53:41 +02:00
50631b5ac3 Updates vendor/code.gitea.io/git (#6286) 2019-03-11 14:01:00 -04:00
7c205607b5 [skip ci] Updated translations via Crowdin 2019-03-11 11:37:48 +00:00
f9627ede3c Update third-party-tools.en-us.md (#6301)
Add  Gitea Extension for Visual Studio
2019-03-11 19:35:18 +08:00
4334fe754e update git vendor to fix wrong release commit id and add migrations (#6224)
* update git vendor to fix wrong release commit id and add migrations

* fix count

* fix migration release

* fix tests
2019-03-11 11:44:58 +08:00
2315019fef Add support for client basic auth for exchanging access tokens (#6293)
* Add support for client basic auth for exchanging access tokens

* Improve error messages

* Fix tests
2019-03-11 10:54:59 +08:00
e0eb6514d2 [skip ci] Updated translations via Crowdin 2019-03-10 21:58:54 +00:00
dbab98c8e0 Remove util.RemoveAll - should have been removed since go 1.7 (#6299) 2019-03-10 23:56:36 +02:00
e836b8869b [skip ci] Updated translations via Crowdin 2019-03-09 21:18:31 +00:00
f5cf9a8355 Copyedit docs (#6275) 2019-03-09 16:15:45 -05:00
8fffb06168 Add regenerate secret feature for oauth2 (#6291)
* Add regenerate secret functionality

* Fix lint
2019-03-09 17:29:58 +01:00
8211e01d9e Add unit types to repo action URL to correctly show 404 when archived (#6247)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-03-09 11:00:38 +00:00
f7ffb190c6 [skip ci] Updated translations via Crowdin 2019-03-08 20:28:33 +00:00
96f1720d69 Use golang 1.12 to build in dockerfile (#6285) 2019-03-08 15:25:47 -05:00
5c69e31c22 Add security note to issue template (#6281) 2019-03-08 13:15:46 -05:00
062de8e86f [skip ci] Updated translations via Crowdin 2019-03-08 17:43:26 +00:00
bd4be434ff Third party docs (#6282) 2019-03-08 12:42:59 -05:00
489419c330 [skip ci] Updated translations via Crowdin 2019-03-08 16:45:46 +00:00
e777c6bdc6 Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
9d3732dfd5 [Contrib] Checkout a PR (#6021) 2019-03-07 20:54:10 -05:00
9fd8b2621f Add robots.txt as reserved username (#6272)
Fix #6271
2019-03-07 16:30:25 -05:00
f2de5dc8c8 Replace linkRegex with xurls library (#6261)
* 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.
2019-03-07 15:12:01 -05:00
01bd1fcd33 [skip ci] Updated translations via Crowdin 2019-03-07 19:16:42 +00:00
020075e12f Remove visitLinksForShortLinks features (#6257)
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.
2019-03-07 14:13:44 -05:00
ad86b843e1 [skip ci] Updated translations via Crowdin 2019-03-06 00:50:36 +00:00
608781f880 Fix fork button (#6223) 2019-03-05 19:48:30 -05:00
6460cff222 [skip ci] Updated translations via Crowdin 2019-03-05 20:18:01 +00:00
f80caa5a8c Fix #6234 : Check organization visibility before everything else (#6235)
* Fix #6234 : Check organization visibility before everything else

* Ensure that Owner is available in the Repo
2019-03-05 15:15:24 -05:00
b257e0456b Add ability to sort issues by due date (#6206) (#6244)
Signed-off-by: Steve Traugott <stevegt@t7a.org>
2019-03-05 09:39:41 -05:00
4512634604 Make organization dropdown scrollable when using mouse wheel (#5988)
* Fix #5580
2019-03-04 22:13:51 -05:00
f066bd2b3f Prevent double-close of issues (#6233) 2019-03-04 21:52:52 -05:00
19862699cd Override xorm type mapping for U2F counter (#6232) 2019-03-04 21:34:52 -05:00
141c58f5a6 add isAdmin to user model (#6231)
update vendor and add tests

fix swagger
2019-03-03 17:57:24 -05:00
8e202e28ad add create issue via email comparison (#6227) 2019-03-02 15:44:51 -05:00
a5604b1611 Fix renames over redirects (#6216)
In #6211, we started creating repo_redirects for ownership transfers,
however that opens an edge case where a user might perform the
following sequence:

rename org1/repo1 -> org1/repo2  (creates org1/repo1 redirect)
transfer org2/repo1 -> org1/repo1 (org1/repo1 redirect continues to exist)
rename org1/repo1 -> org1/repo3 (fails due to existing org1/repo1 redirect)

This change ensures that each time we rename or transfer a repo,
we delete any existing redirects at the target location.  This
already happens when a new repo is created.  By doing this we ensure
that we'll never have both a repo and a redirect at the same location.

Signed-off-by: James E. Blair <jeblair@redhat.com>
2019-03-02 15:07:19 +02:00
b28e527a2b add service desk to comparison (#6220)
* add service desk to comparison

* add link to issue
2019-03-02 01:57:14 +02:00
afdc0ca41d [skip ci] Updated translations via Crowdin 2019-03-01 20:41:52 +00:00
c01fb4d09e Update to docs README (#6221)
* Update to docs README

* Update Hugo link
2019-03-01 15:39:30 -05:00
8e266c3193 UI: Fix race in update issue labels and assignees (#6194)
Fix #6191 

* fix issue update race condition
* fix similar race same race when clearing assignee
* always load promise polyfill
* replace es6-promise with promise-polyfill
* move promise-polyfill to <head>
2019-02-28 22:10:08 +00:00
4a2e92bcd1 Modify linkRegex to require http|https (#6171)
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
2019-02-28 20:31:53 +08:00
4b7237b63e Doc updates for customization and installation. (#6176)
* Doc updates and changing default sqlite DB path

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

* Update customizing locales and THEMES

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

* Add link to templates directory

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

* Add portion for final step of running Gitea

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

* Add recommended to service file usage

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

* Removed DB path change, moving to another PR
Updated doc sentence structure

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

* Revert change to template wording

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

* Move recommended run-type to top
2019-02-28 20:09:47 +08:00
1cf3fc3bc5 [skip ci] Updated translations via Crowdin 2019-02-28 08:04:31 +00:00
c812ba7f87 fix display dashboard even if require to change password (#6214)
* fix display dashboard even if require to change password

* fix comments
2019-02-28 16:01:42 +08:00
48c101affe Create a repo redirect when transferring ownership (#6210) (#6211)
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>
2019-02-28 11:51:46 +08:00
525f03306f Add "ghost" and "notifications" to list of reserved user names. (#6208) 2019-02-27 19:04:44 -05:00
25b6496f48 Add Changelog for 1.7.3 (#6202) (#6207) 2019-02-27 15:32:25 -05:00
7548037a64 Adds MustChangePassword to user create/edit API, defaults to true (#6193)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-02-27 21:37:57 +02:00
b1ffe7e47b UI: Style tweaks to issue selection (#6196)
- Prevent jump in layout when selecting the first issue
- Remove useless padding on top of first issue
2019-02-27 17:24:21 +00:00
a1214978b3 [skip ci] Updated translations via Crowdin 2019-02-27 16:58:32 +00:00
6cc11eccac Change sqlite DB path default to data directory (#6198) 2019-02-27 11:55:08 -05:00
b03d780ccb [skip ci] Updated translations via Crowdin 2019-02-26 23:10:22 +00:00
1142632f1a Use go 1.12 for tests and deprecate go 1.9 (#6186)
Blocked until 1.12 docker images are released
2019-02-27 07:07:35 +08:00
7afe81f28e fix bug when migrate repository 500 when repo is existed (#6188)
* fix bug when migrate repository 500 when repo is existed

* use 409 but not 422 for error status code when not exist

* translation fix
2019-02-26 09:28:56 -05:00
594f591691 Increase Username and Orgname MaxSize 35 -> 40 (#6178)
* 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>
2019-02-25 13:56:47 -05:00
795f6e04ad [skip ci] Updated translations via Crowdin 2019-02-25 10:39:39 +00:00
d8d24a5619 UI: Fix scrollbar always present on page body (#6177) 2019-02-25 12:37:04 +02:00
28fcbf33dc UI: Make document body a flexbox (#6139)
* UI: Make document body a flexbox

Fixes: https://github.com/go-gitea/gitea/issues/6118

* ie11 fixes

* increase padding to 80px

* add flex-grow
2019-02-24 21:02:45 +00:00
15ecc08475 fix bug when set indexer as db and add tests (#6173) 2019-02-24 11:16:20 -05:00
05143768d0 Refactor coverage profile with multiple packages (#6167) 2019-02-23 12:44:32 +02:00
035c82aec4 feat(docker): speed up docker build. (#6159)
* feat(docker): speed up docker build.

* feat: add docker dryrun

* fix: remove docker username and password if dryrun
2019-02-23 09:16:34 +08:00
4a2fbbeb10 fix bug user could change private repository to public when force private enabled. (#6156) 2019-02-22 21:56:05 +00:00
134e55510e fix bug when update owner team then visit team's repo return 404 (#6119) 2019-02-22 11:14:45 -05:00
df30010dbd Make repo creation for API similar to UI (#6142) 2019-02-21 17:07:58 -05:00
3b61ff1895 Allow display of LFS stored Readme.md on directory page (#6073) (#6099)
* 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
2019-02-21 15:57:16 -05:00
994b1be9d1 Admins can now do unlimited page size user search (listAllUsers & listAllOrgs) (#6143)
Non-admins will default to 10 page size
2019-02-21 15:42:54 -05:00
477ef46251 Add more tests and docs for issue indexer, add db indexer type for searching 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
2019-02-21 13:01:28 +08:00
0751153613 refactor issue indexer, add some testing and fix a bug (#6131)
* refactor issue indexer, add some testing and fix a bug

* fix error copyright year on comment header

* issues indexer package import keep consistent
2019-02-21 08:54:05 +08:00
eaf9ded182 Makefile changes for Windows and easier development (#6103)
* Added Go Path and node_modules to PATH
* Uses npx now for generate-stylesheets
* Uses `go env GOPATH` to calculate adding GOPATH/bin to PATH
* Added note about installing Node 8.0+ to generate stylesheets
* Added preferred Node version to CONTRIBUTING.md
2019-02-20 19:56:40 +00:00
eea1155afe [skip ci] Updated translations via Crowdin 2019-02-19 23:12:29 +00:00
d26d249748 Minor UI tweaks (#5980)
* 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.
2019-02-19 18:09:47 -05:00
2982413f8d [skip ci] Updated translations via Crowdin 2019-02-19 19:28:43 +00:00
fc14344acb Fix heatmap and repository menu display in Internet Explorer 9+ (#6117) 2019-02-19 21:26:27 +02:00
41fbaaba78 Apply for maintainers (#6123) 2019-02-19 12:38:11 -05:00
ba0749b7db Load Issue attributes for API call (#6122)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-02-19 19:07:19 +02:00
987a521e2f remove unused file (#6121) 2019-02-19 17:22:42 +02:00
830ae61456 Refactor issue indexer (#5363) 2019-02-19 09:39:39 -05:00
094263db4d Show email if the authenticated user owns the profile page being requested for (#4981)
* Show email if the authenticated user owns the profile page being
requested for.

Also removed `setting.UI.ShowUserEmail` as it's documentation says it
only controls the email setting on the explore page

* fix current user check... This prevents a panic as a user must be signed in before ctx.User is called

* fix panic in tests

* try to fix tests

* Update year

* Test CI fail

* Revert change

* User 3 is not allowed to authorize

* Set user2 email to be private

* Change to user4 in explore page as user2 now has private email option set
2019-02-19 09:11:50 -05:00
ff2be17e3f dashboard: sort Repositories widget by most recently updated (issue #3963) (#4599)
Similar to Github and other git hosting sites, sort the user's repos on
the dashboard by last updated rather than alphabetically. An alphabetic
sort isn't very useful once a user has more than 15 repos and wants
quick access to recent ones that aren't in the first part of the alphabet.
2019-02-19 10:25:28 +02:00
f5fa22a499 Fix prohibit login check on authorization (#6106)
* fix bug prohibit login not applied on dashboard

* fix tests

* fix bug user status leak

* fix typo

* return after render
2019-02-19 09:19:28 +02:00
538a26d56f Show private organization for admin, fix #6111 (#6112) 2019-02-19 09:16:06 +08:00
b79820f610 [skip ci] Updated translations via Crowdin 2019-02-18 20:57:13 +00:00
44114b38e6 Implement "conversation lock" for issue comments (#5073) 2019-02-18 22:55:04 +02:00
64ce159a6e Allow to set organization visibility (public, internal, private) (#1763) 2019-02-18 18:00:27 +02:00
ae3a913122 [skip ci] Updated translations via Crowdin 2019-02-18 12:37:04 +00:00
22770c324d Move to ldap.v3 to fix #5928 (#6105)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-02-18 12:34:37 +00:00
a380cfd8e0 Update bleve dependency to latest master revision (#6100)
* update bleve to master b17287a86f6cac923a5d886e10618df994eeb54b6724eac2e3b8dde89cfbe3a2

* remove unused pkg from dep file

* change bleve from master to recent revision
2019-02-17 19:50:26 -05:00
11e316654e Fix deadlock in webhook PullRequest (#6102)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-02-17 21:12:39 +00:00
8d3bb86e20 [skip ci] Updated translations via Crowdin 2019-02-17 05:46:51 +00:00
5e7dee0db5 modules/context/auth.go: fix redirect loop (#5965)
Closes #5815
2019-02-17 13:44:25 +08:00
0b72c00fad Allow labels to contain emoji (#6063)
* Add emoji to labels
Minor cleanup of tribute code in footer.tmpl

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

* Quick find/replace in other i18n files containing label translations

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

* Revert "Quick find/replace in other i18n files containing label translations"

This reverts commit ec3e1a3a1775989301bb2c1cd08e8871b317688d.

* Add style to overwrite emoji height in labels

* Revert Makefile change that makes Windows work
2019-02-16 19:33:09 +02:00
8c8ac1a162 add doc/features/comparison zh-cn translation (#6067) 2019-02-16 21:12:42 +08:00
e456fc0110 Backport 1.7.2 changelog (#6082)
* Include changes also from PR #6084
2019-02-15 11:29:26 +02:00
ec540294a1 Revert "Fix wrapping long code lines in UI" (#6074)
This reverts commit e5cd80e0219f10818f43e8cab6b9c814cb1cd796.

Fixes: https://github.com/go-gitea/gitea/issues/6064
2019-02-15 02:23:20 -05:00
7ae59567a2 [skip ci] Updated translations via Crowdin 2019-02-14 18:23:25 +00:00
18d0662bdd Update .drone.yml (#6070) 2019-02-14 20:20:11 +02:00
7a72aa623e [skip ci] Updated translations via Crowdin 2019-02-13 15:47:39 +00:00
f2256d9881 make sure labels are actually returned (#6053) 2019-02-13 10:45:19 -05:00
23414ac2a1 Fix panic: template: repo/issue/list:210: unexpected "=" in operand (#6041) 2019-02-13 10:14:17 +02:00
7f38e2d0de Update and expand information about building Gitea (#6019)
* Update and expand building information

Signed-off-by: Andrew Thornton <art27@cantab.net>

* remove extraneous extra line

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Fix spelling mistake

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Note about documentation for the website

Signed-off-by: Andrew Thornton <art27@cantab.net>

* More changes

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Clarified the automatic build dependency

* Update the from-source to match the hacking information

* Extend quotes

* Update required go and discord link

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update hacking-on-gitea.en-us.md

Add in information about postcss
2019-02-12 16:22:01 +00:00
2a03e96bce Allow markdown files to read from the LFS (#5787)
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)
2019-02-12 15:09:43 +00:00
296814e887 Refactor editor upload, update and delete to use git plumbing and add LFS 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: 7f4e641693/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>
2019-02-12 15:07:31 +02:00
fc038caa69 In basic auth check for tokens before call UserSignIn (#5725)
* 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
2019-02-12 11:20:08 +02:00
48a9025346 [skip ci] Updated translations via Crowdin 2019-02-12 08:40:40 +00:00
7884353a04 Add the Owner Name to differentiate when merging (#3807) 2019-02-12 10:37:32 +02:00
baffea1ddb [skip ci] Updated translations via Crowdin 2019-02-11 17:12:45 +00:00
9eb00fed13 Run benchmark at tag to track performances (#6035) 2019-02-11 12:09:50 -05:00
353282e658 Add autoprefixer to css build (#6029)
* Add autoprefixer to css build

* also use autoprefixer on theme files
2019-02-11 01:13:30 -05:00
d0cb5aa9f9 fix #3200 (#6033) 2019-02-11 03:27:24 +02:00
c71c28eab8 update docs (#6032) 2019-02-10 17:10:00 -05:00
9d8178b3ac Add option to close issues via commit on a non master branch (#5992)
* 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
2019-02-10 21:27:19 +02:00
c0adb5ea8b Create repository on organisation by default on its dashboard (#6026)
* Create repository on organisation by default on its dashboard
* Only show owners the add new repositories to an organisation button.

Fix #3253

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-02-10 13:30:25 +00:00
820e28c904 Split setting.go as multiple files (#6014)
* split setting.go as multiple files

* fix comments
2019-02-10 09:37:37 +08:00
9e8cc3b18d add default time out for git operations (#6015) 2019-02-09 22:44:24 +00:00
681345dc99 UI: Make dashboard navbar and footer full-width (#6013)
* UI: Make dashboard navbar full-width

* more tweaks: full-width footer and consistent padding

* fix page layout causing unneccesary scrollbars on small pages
2019-02-09 15:07:38 +00:00
3a33742e38 disable git fsck for mirrored repos by default (#6018) 2019-02-09 14:34:50 +00:00
d252d4eb8c Remove extra spaces (#6016) 2019-02-09 14:48:28 +02:00
8c865f3ce8 Fix metrics auth token detection (#6006)
Signed-off-by: Pauls Barkans <paulsb@gmail.com>
2019-02-09 00:58:31 -05:00
11a9ce6a2b Increase the version of less (#6010) 2019-02-09 11:00:07 +08:00
c3d8fb73dc fix header menu misalignment (#6002) 2019-02-08 12:18:22 -05:00
db58dbabfc [skip ci] Updated translations via Crowdin 2019-02-08 16:48:45 +00:00
ba91214633 Feature - #3031 - search for org repos (#5986) 2019-02-08 11:45:43 -05:00
7fb09f035a Fix #5799 - swagger for mergePullRequest (#5996) 2019-02-08 08:08:38 +00:00
2e85e70e38 Enhance closed PR and Issue status in the list (#6000)
* working version

* Update options/locale/locale_en-US.ini

Co-Authored-By: adelowo <adelowomailbox@gmail.com>

* update templates
2019-02-08 07:53:58 +00:00
f60b1d8fe2 [skip ci] Updated translations via Crowdin 2019-02-08 07:21:32 +00:00
4c5b585a6f UI: Make navbar full width (#5998) 2019-02-08 07:19:21 +00:00
6606d650fa UI: Fix repo header issues (#5995)
Fixes: https://github.com/go-gitea/gitea/issues/5985
2019-02-07 19:20:26 +02:00
f51e7ed18e Update U2F section defaults (#5994)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-02-07 10:47:40 -05:00
01bbf5ea69 Add API to list tags (#5850)
* Add API to list tags

* update dependency gitea sdk vendor

* fix swagger generation

* fix swagger

* add tests

* update code.gitea.io/git vendor
2019-02-07 12:00:52 +00:00
2d213b64d1 use native golang SSH library but ssh-keygen when enable built-in SSH server 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
2019-02-07 02:13:12 -05:00
06a1739553 fix bug when deleting a linked account will removed all (#5989) 2019-02-07 01:51:23 -05:00
9dfdf80af0 Expose issue stopwatch toggling via API (#5970) 2019-02-06 21:57:25 -05:00
cc48c12d8f Fix empty ssh key importing in ldap (#5984) 2019-02-06 21:38:28 -05:00
44d6a904d3 Support n as a line highlight prefix (#5987)
We're working on rolling out gitea as a replacement for a fairly
large cgit installation. Part of this involves a metric ton of
mod_rewrite rules so that links people have out in the wild will
still work. Unfortunately, cgit uses #n1 in the url to indicate
a single line highlight, which doesn't get passed to the server
and therefore can't be rewritten.

We've got a local workaround by shoving a script block into a
custom header template, but thought it might be nicer to upstream
a simple patch to support #n as a prefix for single line highlights.
(luckily for simplicity, cgit does not support ranges)

Signed-off-by: Monty Taylor <mordred@inaugust.com>
2019-02-06 21:25:23 -05:00
da1edbfb79 Feature - Pagination for git tree API (#5838)
* 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
2019-02-06 18:19:26 +00:00
0c840a924a [skip ci] Updated translations via Crowdin 2019-02-06 16:20:58 +00:00
ad059fdbbc Admin config page mailertype setting option update (#5973)
* Fix #5972
2019-02-06 11:17:58 -05:00
0c721fe016 UI: Dashboard tweaks (#5974)
- Don't show divider below heatmap when it's hidden via media-query
- Make divider between user menu adhere to container width
- Remove excessiv margins on heatmap
2019-02-06 07:09:13 +00:00
f286a5abb4 Allow Macaron to be set to log through to gitea.log (#5667)
* Allow Macaron to be set to log through gitea.log

Fix #4291
2019-02-05 22:06:41 -05:00
3b7f41f9f7 Fix serving of raw wiki files other than .md (#5814)
* Fix serving of raw wiki files other than .md

Closes #4690.
Closes #4395.

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Simplify code at routers/repo/wiki.go

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Add more files to user2/repo1.wiki for testing

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Update macaron to v1.3.2

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Add tests for WikiRaw

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Fix NewResponseWriter usage due to macaron update

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Add raw to reserved wiki names

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>
2019-02-05 20:58:55 -05:00
4a747aef7b Upgrade alpine to 3.9 (#5909) 2019-02-05 17:53:23 -05:00
acaf5c96fe UI: Repo header tweaks (#5945)
* UI: Repo header tweaks

- Use basic buttons on the header buttons, matching gogs
- Make 'Manage topic' text smaller, remove margin-left with no topics
present
- Move various inline styles to CSS
- Use flexbox on header title and buttons

* fix indentation

* reverse media query wrapping

* fix inconsisten whitespace
2019-02-05 16:59:26 -05:00
c20034be31 Display the branch name in the commit view (#5950)
* add branch info

* Remove blank lines

* Remove blank lines

* update git dependency
2019-02-05 21:47:01 +00:00
2ec9bf9048 UI: Fixes for repo topic editor (#5971)
- Properly hides the edit interface when saving a empty topic list
- Align the Done button with the edit box
2019-02-05 22:40:56 +02:00
1772893505 [skip ci] Updated translations via Crowdin 2019-02-05 16:55:17 +00:00
9de871a0f8 add other session providers (#5963) 2019-02-05 11:52:51 -05:00
bf4badad1d Pull request conflict files detection (#5951)
* add conflict detection

* test pull request conflict files

* fix detection files number

* fix comments
2019-02-05 06:54:49 -05:00
680a57ce92 [skip ci] Updated translations via Crowdin 2019-02-05 11:40:36 +00:00
5390791224 Automatically clear stopwatch on merging a PR (#4327)
* Don't display buttons if there are no notices

* clear stopwatch on merging a PR

* remove redundant gt check

* use ctx.Flash as per @bkcsoft comment

* stop timer on closing issues/PRs too

* updated translation as per review

* redirect to login page after successfully activating account

* remove unrelated changes

* stop timer for issues that are closed via commits too..Not just the 'close' UI button
2019-02-05 13:38:11 +02:00
5bd594c858 [skip ci] Updated translations via Crowdin 2019-02-04 15:23:15 +00:00
024871ade6 Add label names as filter in issue search api (#5946) 2019-02-04 10:20:44 -05:00
f21ae12abb [skip ci] Updated translations via Crowdin 2019-02-04 00:59:52 +00:00
24a36e84cc Issue 5924 fix compare button (#5929)
* Revert #5877

This unfortunately was not the solution.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Change permission check to create pull requests to CanReadIssuesOrPulls

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-02-03 19:56:18 -05:00
01c10a951b Fix ssh deploy and user key constraints (#1357) (#5939)
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
2019-02-03 23:56:53 +00:00
634cbaad2b show user who created the repository instead of the organization in action feed (#5948) 2019-02-04 01:21:08 +02:00
746cf22d8a handle milestone events for issues and PR (#5947) 2019-02-03 13:31:58 -05:00
13c0f7dfff Fix notifications on pushing with deploy keys by setting hook environment variables (#5935)
The gitea prerecieve and postrecieve hooks and the gitea PushUpdate function require that the PusherID and PusherName are real users. Previously, these environment variables were not being set when using a deploy key - the main result being that pushing to empty repositories meant that is_empty status was not changed.

I've also added an integration test to ensure that the is_empty status is updated on pushing with a deploy key.

There is a slight issue in that the deploy key is now considered a proxy for the owner - we don't have a way of separating out the deploy key from the owner at present. This can be fixed in another PR.

Fix #3795 

Signed-off-by: Andrew Thornton art27@cantab.net
2019-02-03 14:00:48 +00:00
2902b3a68c Fix #5866: Silence console logger in gitea serv (#5887)
By default, if `setting.NewContext()` prints out any warning logs, these are printed to the stdout breaking `git receive-pack` etc. meaning that even if there is a warning because of a minor problem in your app.ini but gitea starts despite this - you **CANNOT** push or pull over SSH.

This PR disables the console logger whilst in `serv.go`

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-02-03 11:19:28 +00:00
f81c6cc2a9 Remove all CommitStatus when a repo is deleted (#5940)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-02-02 23:03:45 -05:00
ecefa9e724 Add single commit API support (#5843)
* add single commit API support
2019-02-02 22:35:17 -05:00
3d91bb2f2d Make log mailer for testing (#5893)
* 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
2019-02-02 21:06:52 -05:00
67567eff0e fix log output (#5938) 2019-02-02 21:56:15 +00:00
12ee544411 Fix wrapping long code lines in UI (#5927)
Wrapping was initially added in https://github.com/go-gitea/gitea/pull/2789
but it is currently disabled because the rule that applies wrapping to
the wrap class did not have enough CSS specificity.

Resolved the issue by using a general selector that matches all code
boxes. The previous wrap class was removed because it had only been
inconsistenly applied to various code boxes and because I found no easy
way to add classes to code boxes rendered in Markdown.

Also removed a seemingly useless :before on code view and added padding
to restore the spacing.
2019-02-02 16:58:28 +00:00
af22df8314 UI: Better support for long repo names (#5932)
* UI: Make long repo names wrap less often

* also adjust news feed column widths
2019-02-02 14:44:33 +02:00
f9d4bd53e6 support reviewing on a deleted file path (#5880) 2019-02-01 09:37:20 +08:00
1219d46b02 1.7.1 changelog (#5919) 2019-01-31 11:42:22 -05:00
3a7306945c Disable redirect for i18n (#5910) 2019-01-31 09:38:20 -05:00
98feb0ef4d [skip ci] Updated translations via Crowdin 2019-01-31 13:39:54 +00:00
bbad9b6178 Fix bug when read public repo lfs file (#5912)
* fix bug when read public repo lfs file

* add comment on lfs permission check
2019-01-31 13:36:57 +00:00
0823791d17 Recover panic in orgmode.Render if bad orgfile (#4982) (#5903)
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>
2019-01-30 17:17:43 -05:00
ca00ca8ee4 Provide better panic handling (#5902)
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>
2019-01-30 17:00:00 -05:00
0f295ababa Only allow local login if password is non-empty (#5906) 2019-01-30 23:18:54 +02:00
80098bd752 Fix go-get URL generation (#5905) 2019-01-30 21:04:19 +00:00
57a69ef277 don't allow pull requests to be created on an archived repository (#5883)
* don't allow pull requests to be created on an archived repository
Also disable the "PR" button if the repo is archived

* Refuse creating an issue/PR via API calls too
2019-01-30 12:20:40 -05:00
6dc2f401c9 Don't discard the value of DISABLE_REGULAR_ORG_CREATION (#5886)
* Consider the configuration value of DISABLE_REGULAR_ORG_CREATION when
creating a user
2019-01-30 12:04:14 -05:00
7933a950d0 respect value of REQUIRE_SIGNIN_VIEW (#5901) 2019-01-30 11:45:48 -05:00
fada6968a8 Fix new release creation API to allow empty target (#5870)
* Fix new release creation API to allow empty target

* Add more test cases

* Update swagger
2019-01-30 11:33:00 -05:00
8b5f6ced22 if repo does not exist, show a 404 not a 500 (#5900) 2019-01-30 11:13:39 -05:00
a967cf9e99 UI: Correct footer height if screen-width is to small (fixes #5878) (#5889) (#5889) 2019-01-29 19:45:08 -05:00
16678f5255 fix compare button on upstream repo leading to 404 (#5877) 2019-01-29 18:49:07 -05:00
c62c0b669a UI: Change GPG Validation colors and remove inline CSS; fixes #5404 (#5896) 2019-01-29 18:11:53 -05:00
2569363204 Also ensure the repo is loaded (#5895)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-29 22:43:40 +00:00
002e898bcf [skip ci] Updated translations via Crowdin 2019-01-29 21:28:45 +00:00
036964b4a7 Ensure issue.Poster is loaded in mailIssueCommentToParticipants (#5891)
Previous code could potentially dereference nil - this PR ensures
that the poster is loaded before dereferencing it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-29 16:26:17 -05:00
8917d66571 Add migration test (#5773)
* Add migration test

This commit adds a simple migration test for v1.5.3, v1.6.4 and v1.7.0-rc3

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Automigrate based on available dbs

* remove old ini file

* Standardise the dialect names
2019-01-28 11:18:52 -05:00
bc748f205a [skip ci] Updated translations via Crowdin 2019-01-28 15:55:40 +00:00
573650877c Fix wrong URL to download link. (#5881)
* Fix wrong URL to download link.

The link does not contain trailing slash and cause error page displayed.

* Update version
2019-01-28 10:53:16 -05:00
3568d426fe New Issue ?body= query (#5851)
* New Issue ?body= query

* Override issue template with body query

* Add documentation for issue body query
2019-01-28 10:23:59 -05:00
7461c5a75f Fix "pulls.blocked_by_approvals" text (#5879) 2019-01-28 10:05:20 -05:00
56415fa2fc [skip ci] Updated translations via Crowdin 2019-01-28 14:16:11 +00:00
bf47f70c3b API: Fix null pointer in attempt to Sudo if not logged in (#5872)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-28 14:13:59 +00:00
5f4a40c4a3 Revert #3711 overwrite of only show "No Description" to repo admins #2167 (#5836)
Revert #3711 overwrite of only show "No Description" to repo admins  #2167 and add tests to prevent accidental overwrite again.
2019-01-27 21:13:15 +00:00
182a6d6885 Fix wording of #5858 issue.review.reject string (#5869)
As per @lafriks comment this should be: requested changes

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-27 19:39:49 +02:00
34a1c4c514 [skip ci] Updated translations via Crowdin 2019-01-27 11:31:56 +00:00
7e8242ddb1 Fix an error while adding a dependency via UI. (#5862)
Fixes: #5783
2019-01-27 13:31:40 +02:00
2d8520d039 [skip ci] Updated translations via Crowdin 2019-01-27 09:27:05 +00:00
84076211b3 Config option to disable automatic repo watching (#5852)
Add a new config option to enable / disable the automatic watching of
repos for new repositories and if a user is added to a team.

Fixes #653

Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
2019-01-27 09:25:21 +00:00
b8a81cb1b8 Rename reject to 'request changes' (#5858)
* remame reject to 'request changes

* make usee of requested changes in issue's view content
2019-01-26 12:20:56 -05:00
a757920f4e Fix failing migration v67 (#5849)
Fixes #5848
2019-01-26 14:50:36 +00:00
8510ac2687 Fix MinInterval (#5856)
Fixes #5847
2019-01-26 08:26:23 +00:00
ac766fe3de [skip ci] Updated translations via Crowdin 2019-01-26 00:17:00 +00:00
8656a3c62d Move input fields to add members to a team and repos to a team (#5853)
Move input fields to the top so no scrolling is needed to add
new members / repos to a team.

Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
2019-01-25 19:14:35 -05:00
d663930023 fix delete correct temp directory (#5839) 2019-01-25 02:54:09 -05:00
6b0c2e9e35 update swagger for release API pagination (#5841) 2019-01-25 09:10:50 +02:00
892bfd0b19 improve the releases api paging (#5831)
* improve the releases api paging

* add max limit on API paging
2019-01-24 20:59:27 +02:00
9a137faaaf Added docs for the tree api (#5834)
* Added docs for the tree api

* Added missing response definition

* Fixed swagger docs
2019-01-24 13:13:30 -05:00
62da3bee1a [skip ci] Updated translations via Crowdin 2019-01-24 15:23:19 +00:00
d6c229cdbe Include Go toolchain to --version (#5830)
* Include Go version

* fix import order
2019-01-24 10:22:51 -05:00
4aa2f4f45f [skip ci] Updated translations via Crowdin 2019-01-24 14:22:36 +00:00
44371b96f5 Ensure valid git author names passed in signatures (#5774)
* Ensure valid git author names passed in signatures

Fix #5772 - Git author names are not allowed to include `\n` `<` or `>` and
must not be empty. Ensure that the name passed in a signature is valid.

* Account for pathologically named external users

LDAP and the like usernames are not checked in the same way that users who signup are.
Therefore just ensure that user names are also git safe and if totally pathological -
Set them to "user-$UID"

* Add Tests and adjust test users

Make our testcases a little more pathological so that we be sure that integration
tests have a chance to spot these cases.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-24 16:12:17 +02:00
cd83c2ca05 Fix topics saving internal error and disable for archived repos (#5821) 2019-01-24 12:22:27 +02:00
ec31ee1c1c Make sure .git/info is created before generating .git/info/sparse-che… (#5825)
* Make sure .git/info is created before generating .git/info/sparse-checkout

* fix permissions
2019-01-24 09:43:37 +02:00
88aa70bab9 Remove tidb reference from docs (#5823)
* Remove tidb reference from docs

* Update from-source.fr-fr.md

* Update from-source.zh-cn.md

* Update from-source.zh-tw.md
2019-01-24 09:12:42 +02:00
386e5312a4 When creating new repository fsck option should be enabled (#5817) 2019-01-23 22:26:18 -05:00
3b364029f7 Fix TLS errors when using acme/autocert for local connections (#5820) 2019-01-23 19:47:54 -05:00
331c9120e8 Request for public keys only if LDAP attribute is set (#5816)
* Update go-ldap dependency

* Request for public keys only if attribute is set
2019-01-24 01:25:33 +02:00
1b90692844 New API routes added (#5594)
* New API routes added

* Comments added

* Build fix

* swagger_v1_json.tmpl without new line character

* Typo fix

* Code review changes

* Code review changes

* Add copyright

* Add copyright

* Add copyright

* Update per @lafriks feedback

* Update org.go

* Update user.go

* Update user.go

* make fmt
2019-01-23 17:30:19 -05:00
b9f87376a2 [skip ci] Updated translations via Crowdin 2019-01-23 20:11:56 +00:00
904188ce9c Adapt documentation to renamed ENABLE_SWAGGER option (#5811)
Updates documentation to account for the renamed ENABLE_SWAGGER_ENDPOINT from  #3572 (commit a74426d631e3311cc3c460ae9917f76f0221f4de)

Signed-off-by: Peter Colberg <peter@colberg.org>
2019-01-23 20:09:18 +00:00
0b510725c9 Feature: Archive repos (#5009) 2019-01-23 13:58:38 -05:00
6ad834e236 Optimize pulls merging (#4921)
* Optimize pulls merging

By utilizing `git clone -s --no-checkout` rather than cloning the whole
repo.

* Use sparse-checkout to speedup pulls merge

* Use bytes.Buffer instead of strings.Builder for backward compatibility

* Fix empty diff-tree output for repos with only the initial commit

* Fix missing argument for the format string

* Rework diff-tree-list generation

* Remove logging code

* File list for sparse-checkout must be prefix with /

Otherwise, they would match all files with the same name under
subdirectories.

* Update onto the rebased head

* Use referecen repo to avoid fetching objects
2019-01-23 12:26:32 +02:00
7d434376f1 Pooled and buffered gzip implementation (#5722)
* Pooled and buffered gzip implementation

* Add test for gzip

* Add integration test

* Ensure lfs check within transaction

The previous code made it possible for a race condition to occur whereby a LFSMetaObject could be checked into the database twice. We should check if the LFSMetaObject is within the database and insert it if not in one transaction.

* Try to avoid primary key problem in postgres

The integration tests are being affected by
https://github.com/go-testfixtures/testfixtures/issues/39 if we set the
primary key high enough, keep a count of this and remove at the end of
each test we shouldn't be affected by this.
2019-01-23 10:56:51 +02:00
075649572d Add the ability to use multiple labels as filters(#5786) 2019-01-22 23:10:38 -05:00
6a949af8ca [skip ci] Updated translations via Crowdin 2019-01-22 20:31:11 +00:00
4de2bd06da backport 1.7.0 changelog (#5804) 2019-01-22 22:07:07 +02:00
2d9456137e [skip ci] Updated translations via Crowdin 2019-01-21 17:53:09 +00:00
832bf218ec Allow markdown table to scroll (#4401)
* Allow markdown table to scroll

`overflow:auto` isn't effective when a table is wider than the container. Adding `display:block` fixes this issue.
2019-01-21 12:51:28 -05:00
e1fcd6b742 Disallow empty titles (#5785)
* add util method and tests

* make sure the title of an issue cannot be empty

* wiki title cannot be empty

* pull request title cannot be empty

* update to make use of the new util methof
2019-01-21 13:45:32 +02:00
8a92544a3e [skip ci] Updated translations via Crowdin 2019-01-21 10:14:44 +00:00
b80d6490f3 fix migration 78 error mssql (#5791) 2019-01-21 12:12:45 +02:00
f631702299 Ensure error is logged on db reconnection attempts (#5780)
Unfortunately a scoping problem was missed on the previous PR which meant that the only nil error was logged on failure to connect to the db. This pr fixes this.
2019-01-20 09:30:37 +00:00
dbb4aeead9 Change systemd service file to more correctly match Debian & Centos - Fix #4391 (#5777) 2019-01-19 23:55:39 -05:00
b0fbefc76b Fix the v78 migration script (#5776)
Unfortunately the last fix didn't completely fix the migration to v79 of the db
due to bug with schema locking during Sync2. This should fix this issue.

Fix #5759

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-19 20:20:52 -05:00
71c832e043 Add documentation for SHOW_REGISTRATION_BUTTON (#5778)
* Fix #5737
2019-01-19 18:22:47 -05:00
fba1f14779 [skip ci] Updated translations via Crowdin 2019-01-19 21:19:01 +00:00
1bb22b2b47 Make db connect more robust (#5738) 2019-01-19 16:17:08 -05:00
f54e0d2f16 [skip ci] Updated translations via Crowdin 2019-01-19 20:41:54 +00:00
6f194b83c6 Moved defaults in defaults.go to setting.go (#5764)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-01-19 15:39:27 -05:00
6822a8993b ldap: Adjust log settings when a user is not found. (#5771)
Fixes: #3849.
2019-01-19 14:57:27 -05:00
c212c98463 Fix wording when user is unassigned from an issue (#5769)
Previous Gitea would display that the user had unassigned themselves even if the actor
was not the user. Fixes #4418
2019-01-19 19:16:46 +00:00
905e63f5b5 Force the PR close time to 60 days (#5770)
Like the comment that is posted.

Ex: https://github.com/go-gitea/gitea/pull/4749 is closed after 2 weeks and not 2 months
2019-01-19 12:21:03 -05:00
ac0d5517f4 [skip ci] Updated translations via Crowdin 2019-01-19 16:31:25 +00:00
65b6ebf243 Log IP of failed ssh connection (#5766)
Fix #5765 by log the IP address of a connecting remote machine in case of a SSH connection error for the built-in ssh server.

Signed-off-by: Robert Sprunk <github@sprunk.me>
2019-01-19 16:29:17 +00:00
af45648e26 [skip ci] Updated translations via Crowdin 2019-01-18 14:52:26 +00:00
41f19e1a38 fix migration bug (#5762) 2019-01-18 09:50:38 -05:00
47ca1060dd backport 1.7.0-rc3 changelog (#5758) 2019-01-18 17:16:26 +08:00
b0478f1c42 [skip ci] Updated translations via Crowdin 2019-01-18 03:32:53 +00:00
ec9331510c Disable auto-migrate in docker container (#5730) 2019-01-17 22:31:14 -05:00
7d65ddf5e1 [skip ci] Updated translations via Crowdin 2019-01-18 00:01:50 +00:00
07802a2bc5 Refactor repo.isBare to repo.isEmpty #5629 (#5714)
* Refactor repo.isBare to repo.isEmpty #5629

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove Sync call
2019-01-17 19:01:04 -05:00
9edc829c17 update docs to include THEMES config value (#5752)
* update docs to include THEMES

* Update app.ini.sample

* Update config-cheat-sheet.en-us.md
2019-01-17 14:48:01 -05:00
82e08a3364 Refactor notification for indexer (#5111)
* notification for indexer

* use NullNotifier as parent struct
2019-01-17 22:23:22 +08:00
477a80f658 upgrade go-sql-driver/mysql to fix invalid connection error (#5748)
should fix #5736
2019-01-17 06:07:23 +00:00
5ac6da3c41 api: Add missing GET teams endpoints (#5382)
* api: Add an endpoint to list a particular member of team.

* models: Rename `GetUserTeams()` to `GetUserOrgTeams()` in `org_team` model.

`GetUserTeams()` sounds a bit misnomer since it actually returns
the teams that user belongs to in a given organization rather than
all the teams across all the organization that the user has joined.

* models: Add `GetUserTeams()`.

Returns all the teams that a user belongs to.

* api: Add an endpoint for GET '/user/teams'.

A GET request to this endpoint lists all the teams that a user
belongs to.
2019-01-16 19:39:50 -05:00
734834a676 Add Default Pull Request Title (#5735)
* add default PR title
Set default PR title to commit summary if there's a single commit on the head branch, else set it to the head branch name

* set default PR description
If there's a single commit on the head branch, and it's multiline, then set it as the default PR description
2019-01-16 22:50:11 +01:00
c2dcb35148 Fixing #5728: (#5747)
* Format boolean values to true/false even when it is returned as byte-slice,
* Fix the sequence generation, the proper sequence name is used (instead of 'table_id_seq'), and fix the next value be max+1 always
2019-01-16 16:24:09 -05:00
19e651c0dd backport 1.6.4 to HEAD (#5742) 2019-01-16 10:37:57 -05:00
5d384c943f Add Prerequisites (#5734)
Add set system user guide.
Add absolute path for sqlite3 guide.
2019-01-16 22:43:26 +08:00
44759fd66c Add proper CORS preflight origin validation (#5740) 2019-01-15 23:16:45 -05:00
ca3b9aa6a3 [skip ci] Updated translations via Crowdin 2019-01-15 21:33:19 +00:00
1ac8f6fb83 Don't list an issue on its own dependency list UI. (#5658)
Fixes: #4684.
2019-01-15 16:31:35 -05:00
270fa6d63b Support CORS headers to git smart http protocol (#5719) 2019-01-14 16:05:27 -05:00
5a081c7a80 [skip ci] Updated translations via Crowdin 2019-01-14 19:17:19 +00:00
bd75965296 Prioritize "readme.md" (#5691)
* prioritize readme.md

* Improve IsReadmeFile

* Add more tests
2019-01-14 14:15:06 -05:00
6868378673 Ensure that sessions are passed into queries that could use the database to prevent deadlocks (#5718)
* Fixed deadlock in CreateComment

* Fix possible deadlock in UpdateIssueDeadline from createDeadlineComment

* Ensure that calls to IsTimeTracker enabled are called within session

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Ensure that calls to reactionList are also called within session

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Ensure all calls in NewPullRequest with the session are called within the session

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Deal with potential deadlocks in repo

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Ensure that isStaring is checked within our transaction

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Fix mistake in isOrganizationMember

Sorry.
2019-01-13 21:29:58 -05:00
656456441c Add flag to skip repository dumping (#5695) 2019-01-13 16:52:25 -05:00
5c44f751a3 Discord Oauth2 support (#4476)
* add discord auth

* add vendor for discord

* fix syntax error

* make fmt

* update version of goth in use

* update markbates/goth
2019-01-13 14:06:22 -05:00
beab2df122 Refactor mail notification (#5110)
* mail notification implement interface

* fix file comment year

* use NullNotifier as parent struct of notifiers
2019-01-13 16:42:55 +02:00
e5228b8369 fix: use correct value for "MSpan Structures Obtained" #4742 (#5706)
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
2019-01-12 17:49:44 -05:00
9e9d1b8f95 Fix migration for user defined themes (#5682) 2019-01-12 14:43:47 -05:00
2b36bdd490 Do not display the raw OpenID error in the UI (#5705)
* Do not display the raw OpenID error in the UI

If there are no `WHITELIST_URIS` or `BLACKLIST_URIS` set in the openid
section of the app.ini, it is possible that gitea can leak sensitive
information about the local network through the error provided by the
UI. This PR hides the error information and logs it.

Fix #4973

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update auth_openid.go

Place error log within the `err != nil` branch.
2019-01-12 14:24:47 -05:00
bf7a11254d [skip ci] Updated translations via Crowdin 2019-01-12 16:15:40 +00:00
f59bfe893a docker: stop modifying file permission before migrating database (#5707) 2019-01-12 11:14:01 -05:00
abb364f442 allow user fork repo even when as a guest.. This will prompt the user to login and if authentication was successful, the user will be redirected to fork the repo (#5690) 2019-01-10 23:25:14 -05:00
6630a33ec1 [skip ci] Updated translations via Crowdin 2019-01-11 04:00:31 +00:00
915278f237 Add docs about database migration (#5661)
* Add docs about database migration

* Reorder upgrade from Gogs steps
2019-01-10 22:58:28 -05:00
31aa00fa4b Update xorm to fix issue #5659 and #5651 (#5680) 2019-01-09 17:18:06 -05:00
dd13327382 When redirecting clean the path to avoid redirecting to //www.othersite.com (#5669)
Fix #5627

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-09 13:39:01 -05:00
0b84b5ee49 fix public will not be reused as public key after deleting as deploy key (#5671) 2019-01-09 13:10:46 -05:00
530c2b8ad8 document command line flags (#5675) 2019-01-09 12:52:10 -05:00
c04fc677b5 [skip ci] Updated translations via Crowdin 2019-01-09 17:24:47 +00:00
8d2c24f7f9 Allow for user specific themes (#5668)
* add migration and basic UI for changing a user's theme

* update user themem

* use right text on button

* load theme based on users' selection

* load theme based on users' selection in pwa too

* update sample config

* delete older theme loading

* implement AfterLoad to set users' theme properly

* set up default theme when creating a user. This uses the installation wide theme

* use flash messages for error

* set default theme when creating a user from the cli

* fix @lunny review
2019-01-09 12:22:57 -05:00
ea518681d9 Translate home template to Czech (#5665)
Signed-off-by: Jan Breuer <jan.breuer@jaybee.cz>
2019-01-08 14:39:50 +01:00
d3dc07f282 Added URL mapping for Release attachments like on github.com (#1707) 2019-01-06 17:37:30 -05:00
dd006db5a7 Display branch name in delete branch confirmation modal. (#5654)
Fixes: #5630.
2019-01-06 15:08:25 -05:00
c42bde719e Only count users own actions for heatmap contributions (#5647)
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
2019-01-06 21:29:05 +02:00
97dafdc057 fix commit page showing status for current default branch (#5650)
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
2019-01-06 16:32:00 +02:00
0236856924 migrate database if app.ini found (#5290)
* migrate database if app.ini found

* replacing hard-coded user id by env variable

* Update per @zeripath's feedback
2019-01-05 13:16:38 -05:00
cbc14df16a Add docs on passing SSH through to container (#5019)
* Add docs on passing SSH through to container

Wasn't clear how to pass SSH connections through the container, found a
few blog posts which described roughly the same procedure I've
documented here.

Credit should really go to:

* https://blog.sakuragawa.moe/gitea-in-docker-container-and-sharing-ssh-with-host/
* http://www.ateijelo.com/blog/2016/07/09/share-port-22-between-docker-gogs-ssh-and-local-system

Signed-off-by: Dane Elwell <dane.elwell@ukfast.co.uk>

* Add note to resolve @lafriks feedback
2019-01-05 12:53:23 -05:00
6311e4ce6a Fix sqlite deadlock when assigning to a PR (#5640)
* Fix sqlite deadlock when assigning to a PR

Fix 5639

Signed-off-by: Andrew Thornton <art27@cantab.net>

* More possible deadlocks found and fixed

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-04 16:51:27 -05:00
9e901039e7 Add changelog for 1.6.3 and 1.7.0-rc2 (#5636)
* Add changelog for 1.6.3 and 1.7.0-rc2

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

* Add missing point for 1.6.3

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2019-01-04 18:44:26 +01:00
405414d14e [skip ci] Updated translations via Crowdin 2019-01-04 16:16:40 +00:00
fd1e8563f8 SECURITY: protect DeleteFilePost et al with cleanUploadFileName (#5631)
This commit wraps more of the TreePaths with cleanUploadFileName

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-01-04 11:08:26 -05:00
5a1ea37f57 [skip ci] Updated translations via Crowdin 2019-01-04 09:23:34 +00:00
9f476b8d1e Don't close issues via commits on non-default branch. (#5622)
Adds a small check to close the issues only if the referencing commits
are on the default branch.

Fixes: #2314.
2019-01-04 11:22:58 +02:00
0de57fd57c Documentation: Clarity for HTTPS setups (#5626)
[https-setup]
- Made it clearer that HTTP redirection is possible
[config-cheat-sheet]
- Clarified the behavihour of the redirection-related config keys
2019-01-03 16:46:07 +01:00
9863591dca [skip ci] Updated translations via Crowdin 2019-01-03 10:19:43 +00:00
121da08730 Add changelog for 1.7.0-rc1 (#5616)
* Add changelog for 1.7.0-rc1

* Change position of refactoring of heatmap

* Refactoring some items in changelog

* Fix wrong PR title in changelog

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

* Remove backported PRs

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

* Fix wrong date

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

* Add new PR to list

* Security fixes have been backported
2019-01-03 11:17:28 +01:00
76060613ef Fix bug on modifying sshd username (#5624)
Should fix #5623
2019-01-02 17:42:33 -05:00
74b9a13f84 Update @jonasfranz's username (#5619)
* Update @jonasfranz's username

* lowercase'd username
2019-01-02 13:35:18 -05:00
7c3722b366 Update owners & Date in contributing (#5620) 2019-01-02 13:00:19 -05:00
f5be13efb6 [skip ci] Updated translations via Crowdin 2019-01-02 12:59:14 +00:00
8764f1512d branch: Trigger update when deleting branch via UI. (#5617)
Fixes: #5309.
2019-01-02 20:56:58 +08:00
4c52858c39 Issue is not overdue when it is on the same date #5566 (#5568)
* Due date time of issues and milestones is set to 23:59:59

* Add docs

* make gen swagger

* fix swagger gen
2019-01-01 18:56:47 +01:00
63bd1b9203 mirror: Delete tags in mirror which are removed for original repo. (#5609)
This bug was being caused by an error in the logic in `release.go`.
Credit to @yasuokav for tracing the root of the issue.

Fixes: #5192.
2018-12-31 18:00:54 -05:00
b46c279587 update v71.go to resolve #5595 (#5613) 2018-12-31 21:23:03 +08:00
64995bae0f [skip ci] Updated translations via Crowdin 2018-12-31 12:03:07 +00:00
2c7661a524 Fix wrong text getting saved on editing second comment on an issue. (#5608)
* comments: Fix an incorrent DOM element selection.

This commit fixes a bug that was causing text from previously edited
comment to get saved when two comments were edited one after other.
Text area with id of `#content` isn't unique on the page but it was
being treated as unique by the event handling code.

Fixes: #5581.

* templates: Remove `id` from textarea in commit edit form.

An element is assigned an `id` only if it is unique for the whole page
but in this case there can be multiple textarea so it should have one.
2018-12-31 13:01:20 +01:00
945804f800 Webhook for Pull Request approval/rejection (#5027) 2018-12-27 13:04:30 -05:00
8bb0a6f425 Synchronize SSH keys on login with LDAP + Fix SQLite deadlock on ldap ssh key deletion (#5557)
* Synchronize SSH keys on login with LDAP

* BUG: Fix hang on sqlite during LDAP key deletion
2018-12-27 12:28:48 -05:00
2058c362a8 LDAP via simple auth separate bind user and search base (#5055) 2018-12-27 11:51:19 -05:00
6e20b504b1 Delete organization endpoint added (#5601)
* Delete organization endpoint added

* Parameters added in comment

* Typo fix

* Newline character removed
2018-12-27 16:36:58 +01:00
21357a4ae0 fix nil pointer when adding a due date (#5587)
* fix nil pointer

* remove nil check and just call loadRepo regardless
2018-12-27 16:02:43 +01:00
a82ba73346 Make sure argsSet verifies string isn't empty too (#4980) 2018-12-27 14:38:38 +02:00
4a685f8b87 Add rebase with merge commit merge style (#3844) (#4052)
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
2018-12-27 12:27:08 +02:00
58bdff53cd Remove MTecknology from MAINTAINERS (#5599) 2018-12-26 21:03:34 -05:00
b0b35493ec [skip ci] Updated translations via Crowdin 2018-12-26 19:16:27 +00:00
ba2c02b75d Fix route in swagger (#5598) 2018-12-26 21:13:49 +02:00
4586ae390f [skip ci] Updated translations via Crowdin 2018-12-24 11:12:56 +00:00
f0db86b663 Gitlab does have discord integration now (#5589) 2018-12-24 19:11:18 +08:00
9f544e9356 drone/mssql: use golang 1.11 build like the other tests (#5586) 2018-12-23 23:11:22 +02:00
a06ae0bdc7 Fix translation errors in doc advanced part (zh-cn) (#5112)
* ZH-CN translation of Advanced part

* Fix translation errors

* Resolve issues
2018-12-23 18:57:49 +08:00
b77c3eb5bd backport 1.6.2 changelog (#5576) 2018-12-21 12:45:58 -05:00
9a33798b30 Fix type mismatch of format string (#5574) 2018-12-21 11:13:31 -05:00
330bf8d3b3 Immediate fix to htmlEncode user added text (#5570)
There are likely problems remaining with the way that initCommentForm
is creating its elements. I suspect that a malformed avatar url could
be used maliciously.
2018-12-21 08:40:40 -05:00
4a02a783c4 fix bug on upload file name (#5571) 2018-12-20 21:32:11 -05:00
7cb1d8296d Create stale bot config (#5243) 2018-12-20 15:34:55 -05:00
8dc09edb04 [skip ci] Updated translations via Crowdin 2018-12-19 13:00:35 +00:00
9d0dee88d2 fix table name typo on SQL (#5562)
* fix table name typo on SQL

* fix reserved word user when on mssql
2018-12-19 20:58:46 +08:00
b65e37ed72 fix indexer reindex bug when gitea restart (#5563)
* fix issue indexer bug reindex when restart gitea

* also fix code indexer reindex when gitea restart
2018-12-19 16:37:48 +08:00
c64963553a Update Licenses (#5558) 2018-12-18 21:04:43 -05:00
7fd34c0517 fix lfs version check warning log when using ssh protocol (#5501) 2018-12-19 09:17:43 +08:00
2a660a1de1 Support reverse proxy providing email (#5554)
This PR implements #2347
2018-12-18 12:05:48 -05:00
fe55ab2a68 fix forgot removed records when deleting user (#5429)
* fix forgot removed records when deleting user

* fix migration

* fix rewritekey lock on sqlite

* remove unused codes
2018-12-18 11:26:26 -05:00
e726e4b828 Add base repo nil check (#5555)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-12-17 12:35:21 -05:00
8730ee0e45 [skip ci] Updated translations via Crowdin 2018-12-17 14:08:30 +00:00
94c3963da0 Fix makefile generate buildstep (#5556)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-12-17 15:05:49 +01:00
b3b7598ec6 Improve performance of dashboard (#4977) 2018-12-13 10:55:43 -05:00
49ea6e0deb [skip ci] Updated translations via Crowdin 2018-12-12 21:02:34 +00:00
ebef3eff23 Remove a double slash in the HTTPS redirection when Let's Encrypt is enabled (#5537)
Before:

$ curl 0.0.0.0:3001
<a href="https://gitea.example.com:3000//">Found</a>.

After:

$ curl 0.0.0.0:3001
<a href="https://gitea.example.com:3000/">Found</a>.

Fixes #5536
2018-12-12 23:00:24 +02:00
0bd802e3e1 [skip ci] Updated translations via Crowdin 2018-12-12 15:19:11 +00:00
f0374ad1ad fix bug when a read perm user to edit his issue (#5516) 2018-12-12 10:17:25 -05:00
af6bce3ad5 fix detect force push failure on deletion of protected branches (#5522) 2018-12-12 10:46:17 +02:00
6db7dbd333 Added test environment for mssql (#4282)
* Added test environment for m$sql

* Added template for test environment for m$sql

* Fix password

* Fix password (again)

* Fix password (again again)

* Fix db

* Ci trigger (Looking at you drone....)

* Ci trigger (Looking at you drone....)

* Ci trigger (Looking at you drone....)

* Ci trigger (Looking at you drone....)

* Create master database for mssql integration tests

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

* Create database only if master do not exist

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

* Fix mssql integration tests by using custom database "gitea"

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

* Moved defer

* bump xorm

* updated xorm

* Fixed build
2018-12-12 09:01:41 +08:00
b1f3685015 fix approvals limitation (#5521) 2018-12-11 18:49:33 -05:00
58c4559d3b fix permission check on api create org (#5523) 2018-12-11 14:33:24 -05:00
ba75319157 fix clone wiki failed via ssh (#5503) 2018-12-11 13:37:32 -05:00
ccea91652f fix adding reaction fail for read permission (#5515) 2018-12-11 13:12:06 -05:00
6e114f6791 add git protocol v2 support via SSH on Docker image (#5520)
* add git protocol v2 support via SSH on Docker image

* remove new layer on dockerfile
2018-12-11 12:20:04 -05:00
15d6cf179d Fix the Let's Encrypt handler by listening on a valid address (#5525)
* Fix the Let's Encrypt handler by listening on a valid address

Also handle errors in the HTTP server go routine, return a fatal error
when something goes wrong.

Thanks to @gbl08ma for finding the actual bug

Here is an example of the error handling:

    2018/12/11 14:23:07 [....io/gitea/cmd/web.go:87 func1()] [E] Failed to
    start the Let's Encrypt handler on port 30: listen tcp 0.0.0.0:30: bind:
    permission denied

Closes #5280

* Fix a typo
2018-12-11 10:46:12 -05:00
9681c83734 Approvals at Branch Protection (#5350)
* Add branch protection for approvals

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

* Add required approvals

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

* Add missing comments and fmt

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

* Add type = approval and group by reviewer_id to review

* Prevent users from adding negative review limits

* Add migration for approval whitelists

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-12-11 19:28:37 +08:00
64680b72bd Fixing MSSQL timestamp type (#5511)
MSSQL is using the wrong type here which results in a strconv.ParseInt: parsing "2018-12-07T00:00:00Z": invalid syntax error.
The added datediff(SECOND, '19700101', x) results in the unix timestamp to be returned.

Signed-off-by: Christopher Dziomba <christopher.dziomba@gmail.com>
2018-12-11 10:05:24 +08:00
205a533645 [skip ci] Updated translations via Crowdin 2018-12-11 01:12:24 +00:00
284b0e12cb fix code review on mssql (#5502) 2018-12-11 09:09:46 +08:00
8a64e67456 [skip ci] Updated translations via Crowdin 2018-12-10 20:03:39 +00:00
1b3404eaca fix forgot deletion of notification when delete repository (#5506) 2018-12-10 22:01:01 +02:00
928417ae39 Fix empty wiki (#5504)
* fix wiki page when wiki path is exist but empty

* improve the error check
2018-12-09 17:45:44 -05:00
7e5abe2dc4 backport 1.6.1 changelog (#5507) 2018-12-09 23:33:13 +02:00
7c0c965532 Improve team members and repositories settings UI (#5457)
* improve team members and repositories settings UI

* use tab on team pages

* add default description on team members and repos

* add blank on numbers and texts

* improve translation
2018-12-09 08:42:11 +02:00
da5a0b8382 add tests for api user orgs (#5494)
* add tests for api user orgs

* add permission for admin to list user's orgs even he is a private user of org
2018-12-09 10:19:50 +08:00
4b4453cb92 fix topic name length on database (#5493) 2018-12-08 14:27:30 +02:00
8b864a328e Allow link verification for services like Mastodon (#5481) 2018-12-06 22:15:48 +02:00
fdec258c8d [skip ci] Updated translations via Crowdin 2018-12-04 22:42:54 +00:00
a0ecc5f24e improve the git-scm url's in docs and sample.ini (#5467)
* remove old git-version from git-scm url in app.ini

The url includes the version of git, which is not required to view the
page. If you open the page without the version you get the current
version and it's possible to switch the used version.

Signed-off-by: Roman <romaaan.git@gmail.com>

* docs: mention the git-scm url for git configs

Signed-off-by: Roman <romaaan.git@gmail.com>
2018-12-05 00:40:42 +02:00
20c54f88b2 refactor: replace lint to revive (#5422)
* refactor: replace lint to revive

* make changes.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2018-12-03 09:28:46 -05:00
2d707fe5e6 ensure that the closed_at is set for closed (#5449)
right now the `closed_at` field for json responses is not filled during
the `APIIssue` creation for api responses.

For a closed issue you get a result like:
```json
"state":"open","comments":0,"created_at":"2018-11-29T16:39:24+01:00",
"updated_at":"2018-11-30T10:49:19+01:00","closed_at":null,
"due_date":null,"pull_request":null}
```
which has no information about the closing date. (which exists in the
db and ui)
with this PR the result changes to this:

```json
:null,"assignee":null,"assignees":null,
"state":"closed",
"comments":0,"created_at":"2018-11-29T16:43:05+01:00",
"updated_at":"2018-12-02T19:17:05+01:00",
"closed_at":"2018-12-02T19:17:05+01:00",
"due_date":null,"pull_request":null}
```

fixes: https://github.com/go-gitea/gitea/issues/5446
Signed-off-by: Roman <romaaan.git@gmail.com>
2018-12-02 15:43:01 -05:00
ce4885f761 [skip ci] Updated translations via Crowdin 2018-12-02 16:10:08 +00:00
9441bfaccc admin should be able to delete repos even if he is not a member of the organization (#5443) 2018-12-02 11:08:33 -05:00
bc42b3ab6c [skip ci] Updated translations via Crowdin 2018-12-01 06:07:46 +00:00
552014a068 Removing Labels via EditPullRequest API (#5348)
* added the ability to provide an empty array at the EditPullRequests API to remove all labels

Signed-off-by: Lucien Kerl <lucien.kerl@wuerth-it.com>

* Update pull.go
2018-12-01 01:05:57 -05:00
06ef5b68d4 word-break the WebHook url to prevent a ui-break (#5432)
right now, the url is displayed with an anchor tag with no classes. If
the url is really really long, the url will break out of the containing
div and (depending on the url length) the browser shows the horizontal
scrollbar.
This pr makes use of the already existing css class `dont-break-out`
which gives all the anchor the necessary properties to prevent the
break.
Another solution could be to introduce some classes like
`text text-break-word`, but that would duplicate the `dont-break-out`
class just for text elements that use the `text` class.

fixes: https://github.com/go-gitea/gitea/issues/5416
Signed-off-by: Roman <romaaan.git@gmail.com>
2018-11-30 09:52:05 -05:00
c761625c69 [skip ci] Updated translations via Crowdin 2018-11-30 13:01:54 +00:00
f80b4f46ae Fix repository deletion when there is large number of issues in it (#5426) 2018-11-30 14:59:12 +02:00
c8a9384a70 [skip ci] Updated translations via Crowdin 2018-11-30 08:51:59 +00:00
0787056e07 Allow to add organization members as collaborators on organization owned repositories (#4748)
repository... Fixes #4507
2018-11-30 10:49:55 +02:00
a7ee4a6e95 [skip ci] Updated translations via Crowdin 2018-11-29 16:49:36 +00:00
fdb417643d Remove the required class from optional ssh port in installation page (#5428)
the ssh port is optional during the installation process. The
translations even mention that it is optional and can be blank. Right
now it has the `required` class which creates the red `*` behind the
field caption - used for required fields.
If you leave it blank, the SSH option is disabled
(not touched by this PR)

Signed-off-by: Roman <romaaan.git@gmail.com>
2018-11-29 18:47:57 +02:00
5c13ba8d2e Upgrade alpine to 3.8 (#5423) 2018-11-28 21:33:35 -05:00
2dc805c0c6 Milestone issues and pull requests (#5293)
* add milestone issues and pulls page instead of redirecting issues page

* add milestone when creating issue from milestone page

* refactor to merge similiar codes as a new function issues

* remove milestone info on milestone issues list

* fix missing params
2018-11-29 09:46:30 +08:00
d5d847e5c4 Git-Trees API (#5403)
* Git-Trees API

* update vendor'd libs

* added comments to exported function and formatted.

* make fmt

* update per @lafirks feedback
2018-11-28 16:17:09 -05:00
f17524bd0c Fix heatmap colors for Chrome/Safari (#5421) 2018-11-28 18:22:46 +02:00
eabbddcd98 Restrict permission check on repositories and fix some problems (#5314)
* 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
2018-11-28 19:26:14 +08:00
0222623be9 Explicitly disable Git credential helper (#5367)
* Explicitly disable Git credential helper

If the user running Gitea has configured a credential helper, Git
credentials might leak out of Gitea.

There are two problems with credential helpers when combined with Gitea:

1. Credentials entered by a user when doing a migration or setting up a
   mirror will end up in the credential store. In the worst case, this
   is the plain text file ~/.git-credentials.
2. Credentials in the credential store will be used for migrations and
   mirrors by all users. For example, if user A sets up a mirror, their
   credentials will be stored. If user B later sets up a mirror from the
   same host and does not enter any credentials, user A's credentials
   will be used.

This PR prepends -c credential.helper= to all Git commands to clear the
list of helpers. This requires at least Git version 2.9, as previous
versions will try to load an empty helper instead. For more details, see
24321375cd

* Update git module
2018-11-28 09:00:25 +02:00
08bf443016 Implement git refs API for listing references (branches, tags and other) (#5354)
* Inital routes to git refs api

* Git refs API implementation

* Update swagger

* Fix copyright

* Make swagger happy add basic test

* Fix test

* Fix test again :)
2018-11-27 16:52:20 -05:00
294904321c Create Progressive Web App (#4730)
* Create manifest and serviceworker

* Create templates and add AppSubUrl

* Add JSRenderer

* fix ctx type

* Add JSRenderer to static.go

* Complete adding {{AppSubUrl}}

* Add more fonts to urlsToCache

* Add 512px and 192px icons

* Hardcode font MD5

* Default theme doesn't have a specific CSS file
2018-11-27 10:18:26 -05:00
e09fe48773 Refactor heatmap to vue component (#5401) 2018-11-27 10:36:54 +01:00
c03a9b3e42 [skip ci] Updated translations via Crowdin 2018-11-26 19:24:15 +00:00
3a1ed82529 Explicitly decide whether to use TLS in mailer's configuration (#5024)
* explicitly decide on using TLS for mail connections

* explicitly decide on using TLS for mail connections

* keep compatibility
2018-11-26 14:21:41 -05:00
ce9a5173fe fix password variable shadowing (#5405) 2018-11-26 17:00:38 +02:00
5e022a98e6 show only opened milestones on issues page milestone filter (#5051)
* show only opened milestones on issues page milestone filter

* update Godoc

* update Godoc everywhere

* update swagger

* use false instead of 0

* Add seccond ordering by ID for milestones where no deadline is set
2018-11-26 16:45:42 +08:00
d9b0b7f56e Notes on upgrading docker installation (#5395)
* Notes on upgrading docker installation

Basis from [gogs/gogs](https://github.com/gogs/gogs/blob/master/docker/README.md)

* Feedback from @sapk to use docker-compose only
2018-11-25 20:51:02 -05:00
499d132124 Fix dependent issue searching when gitea is run in subpath (#5392) 2018-11-25 12:25:55 -05:00
7e587e097c Fix typos in configuration (#5398) 2018-11-25 11:29:44 -05:00
fd37fb01fd Don't force a password change for the admin user when creating an account via cli (#5391)
* don't force a password change for the admin user

* don't totally dicard -must-change-password flag if creating the first (admin) user via the cli. Use flag if present but make sure to default to not forcing a password update
2018-11-25 09:42:24 +02:00
3379141d81 API: '/orgs/:org/repos': return private repos with read access (#5310) (#3829) (#5383)
Signed-off-by: Daniel Balko <inxonic+github@gmail.com>
2018-11-23 16:23:27 -05:00
49d9900b1f [website] file rendering through external binaries (#5387)
* #3758: [doc] file rendering through external binaries

* fix subsections markup

* include proposed changes from PR review
2018-11-23 10:07:08 -05:00
6467934d29 [skip ci] Updated translations via Crowdin 2018-11-23 07:16:27 +00:00
5af7f8bd72 Backport 1.6.0 changelog to master (#5384) 2018-11-23 15:14:34 +08:00
0dcf31ae49 Show review summary in pull requests (#5132) 2018-11-22 15:17:36 +02:00
cef0f12c51 support envs on external render commands (#5278) 2018-11-20 17:11:21 -05:00
8ef177f8c5 add api for user to create org (#5268)
* add api for user to create org

* remove unused blank line on the swagger file end

* fix create and add test

* fix tests

* fix routes of create org API

* fix bug

* add copyright heads
2018-11-20 12:31:30 -05:00
499bff43d9 dont' send assign webhooks when creating issue (#5365) 2018-11-20 12:10:18 -05:00
3a95e2d0ea app.ini.sample: add ENABLE_USER_HEATMAP default config (#5362)
Doc: b97af15de6/docs/content/doc/advanced/config-cheat-sheet.en-us.md (service-service)
2018-11-20 17:54:09 +08:00
e08c7e521b Add raw blob endpoint to get objects by SHA ID (#5334)
* Add raw blob endpoint

This should make it possible to download raw blobs directly from
/:repo/:username/raw/blob/:sha1 URLs.

* fix: Make it work

* As an SHA-ID is no path getRefNameFromPath can't be used to verify
file specifying parameter
* added relevant change in go-gitea/git #132

Signed-off-by: Berengar W. Lehr <Berengar.Lehr@kompetenztest.de>

* Update Gopkg.lock

Can't update all vendors due to errors

Signed-off-by: Berengar W. Lehr <Berengar.Lehr@kompetenztest.de>

* style: Add Gitea copyright header

* feat: Added integration test for /repo/u/r/raw/blob

* fix: correct year in copyright header
2018-11-18 13:45:40 -05:00
4651ba06c1 [skip ci] Updated translations via Crowdin 2018-11-18 18:27:47 +00:00
d9b51a781c Migration fixes for gogs (0.11.66) to gitea (1.6.0) #5318 (#5341)
* Remove field from migration to support upgrades from older version

That will ensure the field does not get queried in the Select if it does
not exist yet:

```
[I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "name", "content", "milestone_id", "priority", "assignee_id", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix
[...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: column "ref" does not exist
```

see #5318

* Skip remove stale watcher migration if not required

Otherwise the migration will fail if executed from a older database
version without multiple IssueWatch feature.

```
2018/11/11 23:51:14 [I] [SQL] SELECT DISTINCT "issue_watch"."user_id", "issue"."repo_id" FROM "issue_watch" INNER JOIN issue ON issue_watch.issue_id = issue.id WHERE (issue_watch.is_watching = $1) LIMIT 50 []int
[...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: relation "issue_watch" does not exist
```

see #5318
2018-11-18 20:25:32 +02:00
241ee793b7 Set ACL on uploads (#5344)
To support https://github.com/go-gitea/infrastructure/pull/39
2018-11-16 11:44:13 -05:00
e033d217e9 [skip ci] Updated translations via Crowdin 2018-11-16 11:14:34 +00:00
89eea64e10 added the ability to set labels on the "edit pull request" api (#5347)
Signed-off-by: Lucien Kerl <lucien.kerl@wuerth-it.com>
2018-11-16 12:12:44 +01:00
7278372388 Implement pasting image from clipboard for browsers that supports that (#5317) 2018-11-14 20:20:13 -05:00
e110943562 [skip ci] Updated translations via Crowdin 2018-11-15 01:01:52 +00:00
b97af15de6 Block registration based on email domain (#5157)
* implement email domain whitelist
2018-11-14 20:00:04 -05:00
4c1f1f9646 Remove x/net/context vendor by using std package (#5202)
* Update dep github.com/markbates/goth

* Update dep github.com/blevesearch/bleve

* Update dep golang.org/x/oauth2

* Fix github.com/blevesearch/bleve to c74e08f039e56cef576e4336382b2a2d12d9e026

* Update dep golang.org/x/oauth2
2018-11-10 18:55:36 -05:00
b3000ae623 Fix create team, update team missing units (#5188) 2018-11-10 14:45:32 -05:00
d487a76ee2 [skip ci] Updated translations via Crowdin 2018-11-09 12:07:58 +00:00
7dd31eb8fb Fix file edit change preview functionality (#5300) 2018-11-09 14:05:43 +02:00
2852c3576a [skip ci] Updated translations via Crowdin 2018-11-09 06:18:32 +00:00
c5d098c32e fix bug when users have serval teams with different units on different repositories (#5307) 2018-11-09 08:16:52 +02:00
599adde1bc Add option to disable automatic mirror syncing. (#5242)
Setting the interval to 0 will disable to automatic syncing.
2018-11-08 18:58:02 -05:00
de8f98192b Fix U2F if gitea is configured in subpath (#5302) 2018-11-08 17:46:44 -05:00
c2f72b1346 Fix typo in configuration (#5295)
Signed-off-by: Patrick Lühne <patrick@luehne.de>
2018-11-08 10:16:07 -05:00
e8b197d6f6 [skip ci] Updated translations via Crowdin 2018-11-07 04:50:40 +00:00
8f8ff5a295 Remove maxlines option for file logger (#5282) 2018-11-07 06:48:53 +02:00
078c404c3b Prometheus endpoint (#5256)
* Add prometheus collector and route

* dep ensure -add github.com/prometheus/client_golang/prometheus

* dep ensure -update github.com/golang/protobuf

* add metrics to reserved usernames

* add comment head in metrics package

* fix style imports

* add metrics settings

* add bearer token check

* mapping metrics configs

* fix lint

* update config cheat sheet

* update conf sample, typo fix
2018-11-04 22:20:00 -05:00
92fb89f6e1 Clean up docs (#5274)
* make docs more clear

* make docs more clear

* Add analytics

* Update customizing-gitea.en-us.md

* Update app.ini.sample
2018-11-04 21:21:56 -05:00
0fd56a71e4 1.6.0-rc2 changelog (#5276) 2018-11-04 20:01:15 -05:00
18391c1410 Add zeripath to maintainers (#5273) 2018-11-04 16:41:23 +01:00
7096085f2b Fix #5226 by adding CSRF checking to api reqToken and add CSRF to the POST header for deadline (#5250)
* Add CSRF checking to reqToken and place CSRF in the post for deadline creation

Fixes #5226, #5249

* /api/v1/admin/users routes should have reqToken middleware
2018-11-03 21:15:55 -04:00
57a8440db3 Update gitignore list (#5258)
* update gitignore

* Handle symlink in tar

* Add some logs
2018-11-03 18:06:09 -04:00
54259e2f88 Fixed wrong api request url for instances running in subfolders (#5247) 2018-11-03 14:20:02 +02:00
225c48982b Fixed heatmap not working in mssql (#5248) 2018-11-01 14:12:17 -04:00
fa165621ed Update golang version in Dockerfile (#5246) 2018-11-01 12:43:17 -04:00
4b84928874 [skip ci] Updated translations via Crowdin 2018-11-01 13:42:58 +00:00
7d9a191a3c Create AuthorizedKeysCommand (#5236) 2018-11-01 09:41:07 -04:00
00533d3870 Keys API changes (#4960)
* Add private information to the deploy keys api

This commit adds more information to the deploy keys to allow for back
reference in to the main keys list. It also adds information about the
repository that the key is referring to.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add private information to the user keys API

This adjusts the keys API to give out private information to user keys if
the current user is the owner or an admin.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add ability to search keys by fingerprint

This commit adds the functionality to search ssh-keys by fingerprint of
the ssh-key. Deploy keys per repository can also be searched. There is
no current clear API point to allow search of all deploy keys by
fingerprint or keyID.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add integration test
2018-10-31 23:40:49 -04:00
584844eada fix: Accept web-command cli flags if web-command is commited (#5200)
* fix: Accept web-command cli flags if web-command is commited

* Added flags of default cmd CmdWeb to app-wide flags
* If command *is* specified app-wide flags are ignored

Resolves: #5065
Signed-off-by: Berengar W. Lehr <Berengar.Lehr@kompetenztest.de>

* Removed style breaking newline

* broken windows need to be fixed
* provides requested change
2018-10-31 20:36:41 -04:00
6c90dd1f4a Update API link in README (#5241) 2018-10-31 20:18:28 -04:00
c8b4c7af65 [skip ci] Updated translations via Crowdin 2018-10-31 20:58:56 +00:00
794049e824 fix compatibility heatmap with mysql 8 (#5232) 2018-10-31 16:56:32 -04:00
7edb930240 Add command for migrating database (#4954) 2018-10-30 23:14:42 -04:00
6eff62ae09 Add changelog for 1.5.3 release (#5227) 2018-10-30 22:13:14 -04:00
22ad514297 Fix issue where ecdsa and other key types are not synced from LDAP (#5092) (#5094)
* Fix issue where ecdsa and other key types are not synced from LDAP authentication provider fixes #5092

* integrations/auth_ldap_test.go: Add Hermes Conrad new ecdsa-sha2-nistp256 publickey fingerprint

* integrations/auth_ldap_test.go: Use ssh-keygen -lf <filename> -E sha256
2018-10-30 20:08:30 -04:00
b686bd0c94 Fix markdown image with link (#4675)
* Fix markdown image with link

* Add gitea copyright notice

* add a test for markdown image with link

* remove svg related variables
2018-10-30 18:26:28 -04:00
10370651fc This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql (#5136)
* This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql

* fix tests
2018-10-30 17:48:37 -04:00
e5daa2698f Generate random password (#5023)
* add random-password flag

* run make fmt

* add length cli flag rather than use a default value
2018-10-30 17:34:25 -04:00
d0f614a25b only chown directories during docker setup if necessary. Fix #4425 (#5064)
Signed-off-by: Fabian Braun <fabian-braun@mailbox.org>
2018-10-30 11:41:41 -04:00
98ea1a5143 [skip ci] Updated translations via Crowdin 2018-10-30 15:20:31 +00:00
a3e084716e Add AutoHead functionality. (#5186)
Fixes #5153
2018-10-30 11:08:49 -04:00
220ee6ae42 Pass link prefixes to external markup parsers (#5201)
* Pass environment variables for URL prefixes to external markup parser

Signed-off-by: Nicolas Lenz <nicolas@eisfunke.com>

* Document external markup link prefix environment variables

Signed-off-by: Nicolas Lenz <nicolas@eisfunke.com>

* Run format on link prefix changes

Signed-off-by: Nicolas Lenz <nicolas@eisfunke.com>
2018-10-30 10:34:12 -04:00
e61c6cd3db fix data race on migrate repository (#5224) 2018-10-30 10:06:01 -04:00
0ba57949e4 remove unused db init on commands serv, update, hooks (#5225) 2018-10-30 12:41:25 +02:00
5fc0a12627 [skip ci] Updated translations via Crowdin 2018-10-30 06:22:29 +00:00
617a2433a3 Make gitea serv use api/internal (#4886)
* Start to move to internal/private

* Add GetPublicKeyByID

* Add HasDeployKey

* Add private.UpdateDeployKeyUpdated

* Add private.GetUserByKeyID

* Add private.AccessLevel

* Add private.CheckUnitUser

* Fix mistakes I made

* Some cleaning + moving code to separate files

* Fix error handling

* Remove useless error handling for setup

* lint: fix comment on exported func

* fix copyright header

* Fix order of args
2018-10-30 14:20:13 +08:00
aefeb8c465 [skip ci] Updated translations via Crowdin 2018-10-30 03:08:04 +00:00
db30d6d791 Serve audio files using HTML5 audio tag (#5221)
* Serve audio files using HTML5 audio tag

* Correct copy paste error
2018-10-30 10:17:26 +08:00
735b12eaf0 fix sqlite lock (#5210) 2018-10-30 09:21:18 +08:00
1ceae07560 Fix emojis not showing in commit messages (#5168)
Fixes #5150

Signed-off-by: James Anderson <james@jamesa.me>
2018-10-29 17:00:34 -04:00
d4e6278764 [skip ci] Updated translations via Crowdin 2018-10-29 13:50:58 +00:00
70a80e31cf fix sqlite and mssql lock (#5214) 2018-10-29 09:48:37 -04:00
7694c99ab3 Kill testing processes if the test takes too long (#5174)
When timeout, Send ABRT signal to print backtraces for diagnosis.
The timeout value is set to 1200s (20mins) for now.
2018-10-28 21:54:13 -04:00
abf6e0d90b [skip ci] Updated translations via Crowdin 2018-10-29 01:31:15 +00:00
8b4c4bd08f k8s deployment (#5046) 2018-10-28 21:28:06 -04:00
b8451190d8 UX of link account (Step 1) (#5006)
* Show either sign up OR sign in

* disambiguate fresh start from adding recovery options

* use tabs to switch between account link flows

* add active to tab body as well

* changes as per discussion

* handle specific error; fix missing err typo
2018-10-28 18:46:16 -04:00
a2ee2a3c67 fix showing pull request link when delete a branch (#5166) 2018-10-28 18:15:25 -04:00
fb14458010 fix: Add secret to all webhook's payload where it has been missing (#5199)
* fix: Add secret to all webhook's payload where it has been missing

affects webhooks for:
* Delete
* Fork
* IssueComment
* Release
2018-10-28 18:03:02 -04:00
48badd59e9 Fix to 3819 - Filtering issues by tags on main screen issues (#3824)
* Fix to 3819

* Changes suggested

* Empty line removed

* Fix error: non-name opts.Labels on left side of :=
2018-10-28 07:55:01 +01:00
8a9e44d181 Update with-docker.en-us.md (#5203)
Improve grammar in second paragraph.
2018-10-27 23:18:55 -04:00
2b7c366f64 fix sqlite lock (#5184)
* fix sqlite lock

* fix bug

Co-Authored-By: lunny <xiaolunwen@gmail.com>

* fix bug

Co-Authored-By: lunny <xiaolunwen@gmail.com>
2018-10-27 22:45:24 +08:00
99c09dfbfa Update vendor/golang.org/x/sys (#5059) 2018-10-26 19:18:40 -04:00
2af57c7820 Update x/net (#5169) 2018-10-26 19:05:56 -04:00
f887085ee0 Update TRANSLATORS (#5194)
Hi,
I'm the guy who translated gitea during June in Italian.
I would like to have my name added to the translators list.
I translated nearly a thousand and a half words.
Thank you.
2018-10-26 13:37:36 -04:00
e500b82c2c [skip ci] Updated translations via Crowdin 2018-10-26 09:40:17 +00:00
e7822473e9 Fix race on updatesize (#5190)
* fix race on updatesize

* fix more repoPath
2018-10-26 12:37:57 +03:00
aeb5655c25 Update go-macaron/session to latest mast to fix RCE-bug (#5177) 2018-10-25 19:53:39 +08:00
5f938c0c78 Fix sqlite lock (#5176)
* fix sqlite lock

* fix sqlite lock on getUnitType
2018-10-25 18:55:16 +08:00
554581f848 Disable sqlite test (#5178)
For #5172
2018-10-25 18:37:46 +08:00
890a0c3cee [skip ci] Updated translations via Crowdin 2018-10-25 08:52:17 +00:00
c258ae8ada revert #5146 (#5167) 2018-10-25 16:31:26 +08:00
ffd5fb8139 Set heatmap color range configurable (#5165) 2018-10-24 16:38:04 +02:00
7e5eec430d [skip ci] Updated translations via Crowdin 2018-10-24 13:17:43 +00:00
70ad46133f Fix JSON result of empty array (#5154) 2018-10-24 21:17:21 +08:00
317ddb7283 Update vendor/github.com/mattn/go-sqlite3 (#5162)
To fix build failure on Windows/386
2018-10-24 16:18:51 +08:00
efa4e6bc6f Update the docs for sqlite_unlock_notify (#5145) 2018-10-23 12:33:51 -04:00
159c2ffb0e Update outdated Go toolchain version for .drone.yml (#5146) 2018-10-23 12:08:05 -04:00
25c49cf930 Update build tags for sqlite_unlock_notify (#5144) 2018-10-23 19:47:59 +08:00
2ce72d4e00 Update vendor/go-sqlite3 (#5133) 2018-10-23 13:28:10 +08:00
6759237eda User action heatmap (#5131)
* Added basic heatmap data

* Added extra case for sqlite

* Built basic heatmap into user profile

* Get contribution data from api & styling

* Fixed lint & added extra group by statements for all database types

* generated swagger spec

* generated swagger spec

* generated swagger spec

* fixed swagger spec

* fmt

* Added tests

* Added setting to enable/disable user heatmap

* Added locale for loading text

* Removed UseTiDB

* Updated librejs & moment.js

* Fixed import order

* Fixed heatmap in postgresql

* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

Co-Authored-By: kolaente <konrad@kola-entertainments.de>

* Added copyright header

* Fixed a bug to show the heatmap for the actual user instead of the currently logged in

* Added integration test for heatmaps

* Added a heatmap on the dashboard

* Fixed timestamp parsing

* Hide heatmap on mobile

* optimized postgresql group by query

* Improved sqlite group by statement
2018-10-23 10:57:42 +08:00
f38fce916e Add comment replies (#5104)
* Add comment replies

* Replace reviewID with review.ID
2018-10-22 16:13:35 -04:00
9458880c06 Increase the retry limit to 20 times and the interval to 200ms (#5134)
The original settings has less tolerance and would fail on some
environments.
2018-10-21 16:09:17 +02:00
43f9233914 Fix Swagger JSON autogeneration issues. (#4845)
* Fix Swagger JSON.

Remove unnecessary schema references for the forbidden and empty responses

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Fix swagger API for CreateAccessToken

* Fix admin create org swagger

* Fix swagger for adminCreateRepo

* More swagger fixes

Set int64 format for those which are int64
Some more form fixes

* Fix swagger description of GET /repos/{owner}/{repo}/pulls
2018-10-20 23:40:42 -04:00
9b2fcadeef Fix SQL quoting (#5117)
`show` is keyword in MySQL and has to be quoted to reference a column name. Use grave accents (ASCII code 96) for quoting to match rest of the source code. It's non-standard SQL, but it's supported by SQLite and MySQL.

Signed-off-by: Filip Navara <navara@emclient.com>
2018-10-20 18:19:21 -04:00
c2748ea7fe Add must-change-password flag to cli for creating a user (#4955)
* add support for an admin to force a user to change his/her password from thee cli

* use BoolFlag instead

* default to true

* simplify by removing unnneccessary if/else
2018-10-21 01:05:01 +03:00
5a4648cdd6 Remove check for negative length (#5120) 2018-10-20 17:25:14 -04:00
583b1b8429 Retry test-fixtures loading in case of transaction rollback (#5125) 2018-10-20 16:48:33 -04:00
2313121354 fix fading menu in arc-green theme (#5128)
* fix fading menu in arc-green theme

the menu faded white because it missed proper styling.
only visible on viewports narrower than 1200px.

* Generate minimized css

* compiled arc-green.less to apply changes from 76e4f9a58
2018-10-20 16:31:27 -04:00
22274464f4 Add LFS timeout issue to troubleshooting doc (#5129) 2018-10-20 19:49:04 +03:00
dea3d849e1 Give user a link to create PR after push (#4716)
* Give user a link to create PR after push

* Forks now create PR in the base repository + make sure PR creation is allowed

* fix code style
2018-10-20 09:59:06 +03:00
cabdf84f1f Use named const instead of a raw string (#5115) 2018-10-20 10:25:38 +08:00
971dccda16 Use type switch (#5122) 2018-10-19 14:54:26 -04:00
a908b29a74 Remove duplicated if bodies (#5121) 2018-10-19 12:49:36 -04:00
616b8f42f9 Fix deadlock when sqlite (#5118)
* fix deadlock when sqlite

* fix clonelink deadlock on sqlite
2018-10-19 12:36:42 -04:00
47e4efe0c5 [skip ci] Updated translations via Crowdin 2018-10-19 13:38:43 +00:00
fef0410b92 Make switch more clear (#5119) 2018-10-19 21:36:41 +08:00
8db3bdc683 Fix home page template regression (#5102)
Commit 7bb4d610e5cca7ad514e377d2b36254a4cfee5b9 tries to take the app_name from the locale, however, it is a user defined setting. This causes the app name to simply display as `app_name` instead of the correct value.

templates/helper.go automatically injects the AppName variable into every template, so we can safely use that instead.

Signed-off-by: Daniel Derzsi <daniel@tohka.us>
2018-10-18 21:07:30 +08:00
ea619b39b2 Add notification interface and refactor UI notifications (#5085)
* add notification interface and refactor UI notifications

* add missing methods on notification interface and notifiy only issue status really changed

* implement NotifyPullRequestReview for ui notification
2018-10-18 19:23:05 +08:00
dd62ca7ba9 Add support for search by uid (#4876)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2018-10-18 16:44:51 +08:00
7bb4d610e5 Use APP_NAME on home page (#5048)
Would it make sense to actually use the configured app name on the home page?
2018-10-18 15:34:45 +08:00
eb0c848f5b Use native go method to get current user rather than environment variable (#4930)
* Use native go method to get current user rather than environment var

* Use t.Skip instead of return in test
2018-10-18 15:08:20 +08:00
637c5fe1eb ZH-CN translation of Installation part (#5089) 2018-10-18 13:19:00 +08:00
1e34413238 refactor: err != nil check, just return error instead (#5093) 2018-10-18 00:51:07 -04:00
e4b8103ac7 Use fingerprint in place of id (#5099) 2018-10-18 00:15:02 -04:00
97da83d008 Add myself to maintainers (#5101) 2018-10-18 00:04:22 -04:00
486e989a39 feat(topic): search keyword by splitting provided values by , (#4939) 2018-10-17 23:14:28 -04:00
e79e9248fd Fix regex to support optional end line of old section in diff hunk (#5096)
+ Named groups in reges for easier group parsing
2018-10-17 22:03:49 -04:00
c37d1a9e99 CN translation of README (#5049) 2018-10-18 09:44:29 +08:00
384ef124e7 [skip ci] Updated translations via Crowdin 2018-10-18 00:02:30 +00:00
35ae14050e add myself to maintainers (#5098) 2018-10-17 19:59:26 -04:00
1972383216 ZH-CN translation of Usage part (#5086) 2018-10-17 14:19:04 -04:00
25def0a808 [skip ci] Updated translations via Crowdin 2018-10-17 17:07:45 +00:00
cc63985876 Add change log for 1.6.0-rc1 (#5095)
* add change log for 1.6.0-rc1

* Fix some uppercases
2018-10-17 19:05:49 +02:00
8683c72483 [skip ci] Updated translations via Crowdin 2018-10-17 11:23:21 +00:00
4cdab02273 ZH-CN translation of Advanced part (#5090) 2018-10-17 14:21:20 +03:00
34695f460a Update process to include tag vX.Y.0-dev on master branch (#5091) 2018-10-16 22:50:11 +02:00
4090204944 CN translation of README (#5050) 2018-10-15 12:13:21 +08:00
970c690681 fix release creation via API (#5076)
* fix release creation via API

* fix release create tests
2018-10-15 06:52:52 +03:00
0cd8cecdf8 Fix dep for actual goth version used in dep lock file (#5078) 2018-10-12 23:49:27 +03:00
c42b366f0e Fix golint to new URL (#5079) 2018-10-12 23:01:41 +03:00
c0b2c8a5d6 Fixed spelling typos in CONTRIBUTING.md (#5061) 2018-10-10 10:13:34 -04:00
1ecf92ade2 Add HOWTO for releasing Gitea (#5054)
* Add HOWTO for releasing Gitea

Used instructions from: https://github.com/go-gitea/gitea/pull/2609#issuecomment-352159155

* Update CONTRIBUTING.md
2018-10-10 00:08:59 +03:00
f44d066876 Backport 1.5.2 changelog (#5053) 2018-10-09 12:29:08 -04:00
fb3954f9a5 Fix adding review comment in split view (#5038) 2018-10-09 08:46:23 +08:00
6df46c50b1 Remove links from topics in edit mode (#5026) 2018-10-06 17:20:48 -04:00
378af8ea88 Fix missing AppSubUrl in few more templates (#5021) 2018-10-05 19:41:09 -04:00
c6daee6da6 Fix missing AppSubUrl in some templates (#5020) 2018-10-05 20:22:33 +03:00
94cd7bb25b Hide outdated comments in file view (#5017)
* Hide outdated comments in file view

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

* Add unit test by adding "invalidated" comment to fixtures

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-10-05 11:49:30 -04:00
d7ca839c67 Fix a typo in app.ini.sample (#5015) 2018-10-05 11:06:47 +02:00
513db27377 Add missing envionment vars for DB with Docker (#5007)
Current docs demonstrate how to configure a database container but don't
explicitly specify that you should add additional environment variables
to the Gitea container to make it use the database. This just
demonstrates the changes required.

Signed-off-by: Dane Elwell <dane.elwell@ukfast.co.uk>
2018-10-03 17:16:48 +03:00
2b8dc17db7 README: update make command to build full release (#5004)
* update make command to build full release

* use quoted TAGS

`TAGS=bindata` => `TAGS="bindata"`
2018-10-03 08:33:46 +02:00
2e2eacf62a [skip ci] Updated translations via Crowdin 2018-10-02 19:22:42 +00:00
dba955be7c Upgrade gopkg.in/testfixtures.v2 (#4999) 2018-10-02 15:20:02 -04:00
b8d048fa0d [skip ci] Updated translations via Crowdin 2018-09-29 22:45:10 +00:00
ab5b245182 Disable debug routes unless PPROF is enabled in configuration (#4995) 2018-09-29 18:44:06 -04:00
fc0001caa1 Fix #rrggbbaa color to rgba for better browser compatibility (#4990) 2018-09-29 12:57:32 +03:00
81702e6ec9 Detect charset and convert non UTF-8 files for display (#4950)
* 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
2018-09-29 16:33:54 +08:00
6780661192 Fix layout of the topics editing form (#4971)
* Fix layout of the topic edit.

- made right-hand column wider so that it has enough space for "Done" button.

- fixed issue that jQuery's .show() breaks functionality of the Semantic UI Grid.

* Improve switching visibility of the topic edit

Changes to support old browsers that doesn't support 'flex' keyword.

- Removed style "display: none" from index.css so that
  the grid can be displayed without specifying new "display" style.

- Added style "display:none" to the grid element in HTML template
  as the initial style.

- In index.js, visibility of the grid element is changed by
  set "display:none" style to the element or removing it from the element.
2018-09-29 09:28:47 +03:00
e6d54d511d make sure milestone listing is consistent across board (#4987) 2018-09-28 06:59:46 +03:00
31d5488059 Fix user menu item styling (#4985) 2018-09-27 16:58:38 -04:00
39735723f5 [skip ci] Updated translations via Crowdin 2018-09-27 00:51:27 +00:00
b3393b5ca7 Adjust maintainers (#4979) 2018-09-27 08:50:10 +08:00
79b4d4729c [skip ci] Updated translations via Crowdin 2018-09-25 12:37:54 +00:00
4092b32bad Fix preview when adding new code review comment (#4975) 2018-09-25 14:36:45 +02:00
36e7cb9755 Update Swagger API to match the return of /users/search (#4847)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2018-09-21 16:56:26 +08:00
dab02b80fd ADD: Hint to function of docker version tags (#4967)
I wasn't sure about how tags work, maybe this is interesting for people with less knowledge of docker.
2018-09-21 09:43:31 +08:00
07af31d004 Fix #4877 to follow the OpenID Connect Audiences spec (#4878)
Signed-off-by: Gabriel Robertson <overminddl1@gmail.com>
2018-09-20 22:17:34 +03:00
364c029246 [skip ci] Updated translations via Crowdin 2018-09-20 05:50:04 +00:00
043ab2cd59 Fix null pointer dereference in ParseCommitWithSignature (#4962) 2018-09-20 13:49:07 +08:00
8b113cd8b6 [skip ci] Updated translations via Crowdin 2018-09-19 09:03:30 +00:00
91b164c778 Fix interpunction in English translation. (#4958) 2018-09-19 12:02:08 +03:00
552d8d3a4e [skip ci] Updated translations via Crowdin 2018-09-18 07:05:46 +00:00
d6b97c8557 fix url in discord webhook (#4953)
opening issues generates a webhook to discord that contains
a url to the gitea api. the message title in discord is therefore
referencing to the api instead of the issue itself.
2018-09-17 21:04:46 -10:00
4befec242a Code review UI improvements and bugfixes (#4682)
* Code review UI improvements

* More fixes to dark theme

* Style fix

* Fix to allow add code review comments only on review files tab

* More readability dark style fixes

* Fix commenting on deleted files. Fixes #4752

* Fix line blame getting for multiple corner cases
2018-09-17 17:59:49 +03:00
756eafaaf6 Fix some issues with special chars in branch names (#3767)
Signed-off-by: Robin Durner <github@nubenum.de>
2018-09-17 01:28:23 +03:00
acb6f8a518 make sure to catch the right error so it is displayed as an error on the ui not a 500 (#4945) 2018-09-16 18:27:43 +03:00
f6eb669b51 fix(topics): don't redirect to expole page. (#4938) 2018-09-15 06:32:59 -04:00
3e76e7826e [skip ci] Updated translations via Crowdin 2018-09-15 06:30:00 +00:00
661fd901bd doc: add Cloudron package (#4937)
Fixes #4936
2018-09-15 14:28:53 +08:00
2a6d3ba058 Allow admin toggle forcing a password change for newly created users (#4563) 2018-09-13 12:34:36 -04:00
f98040ad50 fix bug forget to remove Stopwatch when remove repository (#4928) 2018-09-13 22:58:01 +08:00
126ba796dc Force user to change password (#4489)
* redirect to login page after successfully activating account

* force users to change password if account was created by an admin

* force users to change password if account was created by an admin

* fixed build

* fixed build

* fix pending issues with translation and wrong routes

* make sure path check is safe

* remove unneccessary newline

* make sure users that don't have to view the form get redirected

* move route to use /settings prefix so as to make sure unauthenticated users can't view the page

* update as per @lafriks review

* add necessary comment

* remove unrelated changes

* support redirecting to location the user actually want to go to before being forced to change his/her password

* run make fmt

* added tests

* improve assertions

* add assertion

* fix copyright year

Signed-off-by: Lanre Adelowo <yo@lanre.wtf>
2018-09-13 15:04:25 +03:00
10a2a904d7 Fix bug when repo remained bare if multiple branches pushed (#4923) 2018-09-13 11:40:35 +08:00
ea20adaa84 feat(repo): support search repository by topic name (#4505)
* feat(repo): support search repository by topic name
2018-09-13 10:33:48 +08:00
7dd93b2441 [skip ci] Updated translations via Crowdin 2018-09-12 14:47:24 +00:00
e91a2cf2ea Add/remove/list oauth providers via cli (#4591) 2018-09-12 10:46:02 -04:00
8e3e59fdb8 Fix: Let's Encrypt configuration settings (#4911)
ENABLE_LETSENCRYPT and LETSENCRYPT_ACCEPTTOS were not being properly loaded from the config file, always resulting in the default settings being in place.
2018-09-12 00:06:44 -04:00
b5b39a56ad [skip ci] Updated translations via Crowdin 2018-09-11 18:55:32 +00:00
08ed515b62 Remove zookeeper documentation (#4910)
Fix #3763
2018-09-11 21:54:23 +03:00
c64c595acc [skip ci] Updated translations via Crowdin 2018-09-11 14:44:00 +00:00
f1ad4bb3d5 Remove traces of embedded TiDB (#4906)
Fix #3357
2018-09-11 10:42:40 -04:00
8ee9922fe6 Add file name and branch to page title (#4902) 2018-09-10 13:01:49 -04:00
e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 2018-09-10 12:15:52 -04:00
387a4b09c1 allow api to create tags for releases (#4890) 2018-09-10 10:57:41 -04:00
15ebe4b853 [skip ci] Updated translations via Crowdin 2018-09-10 14:32:36 +00:00
be48397945 Slack webhook channel name cannot be empty or just contain an hashtag (#4786) 2018-09-10 10:31:08 -04:00
6e03390aa8 [skip ci] Updated translations via Crowdin 2018-09-09 18:12:41 +00:00
eea76a5241 fix: Crippled diff (#4726) (#4900)
* fix: Crippled diff (#4726)

* Regenerate css
2018-09-09 20:11:49 +02:00
vz
e9dbfc70b7 Move README_ZH.md Screenshots to Bottom (#4895)
- Move Screenshots to Bottom
2018-09-09 12:13:48 +08:00
1dee960b45 [skip ci] Updated translations via Crowdin 2018-09-09 03:37:12 +00:00
c43399cad8 Fixes repo branch endpoint summary (#4893)
in browser saw `/repos/{owner}/{repo}/branches/{branch} List a repository's branches` fixed

Addresses https://github.com/go-gitea/debian-packaging/pull/1

Fixes https://github.com/go-gitea/gitea#4892
2018-09-09 11:36:08 +08:00
d293a2b9d6 Add sudo functionality to the API (#4809) 2018-09-06 23:31:29 -04:00
e6a03813d4 Extract header and footer content to separate tmpl (#4797)
This change makes it easier to customize the header and footer content. Before this change, the whole header and footer had to be overridden, including the meta, style and script tags.

Signed-off-by: Lukas Bestle <mail@lukasbestle.com>
2018-09-07 10:59:06 +08:00
fab7937c62 Improve dependency UI (#4503) 2018-09-07 10:32:46 +08:00
fa4663e61e Add push webhook support for mirrored repositories (#4127) 2018-09-06 22:06:09 -04:00
bf55276189 Fix redirect with non-ascii branch names (#4764) (#4810)
* Fix redirect with non-ascii branch names (#4764)

* Add integration tests for non-ascii branch redirect

* Fix mysql test and coverage test
2018-09-06 21:37:02 -04:00
13e8a0fe56 offline use of fonts (#4872) 2018-09-06 21:15:25 -04:00
303d7f7e9c Do not autocreate directory for new user/orgs (#4828) (#4849) 2018-09-06 20:40:58 -04:00
3c6cc56143 docs(comparison): correct GitLab CE multiple assignees for issues (#4885)
GitLab CE doesn't support multiple assignees for issues.  
That's an enterprise feature.  See: https://docs.gitlab.com/ee/user/project/issues/multiple_assignees_for_issues.html
2018-09-06 20:17:31 -04:00
bd1bf2a072 Remove feature global code search from GitLab CE (#4875) 2018-09-05 11:12:09 -04:00
a5cc3a9baf Punctuation changes in documentation (#4866) 2018-09-04 22:47:45 -04:00
061b1aa2d4 update comparsion docs to add file viewer items (#4865) 2018-09-04 22:07:24 -04:00
668a477c69 Fix trimming of markup section names (#4863)
Signed-off-by: Nicolas Lenz <nicolas@eisfunke.com>
2018-09-03 20:59:02 -04:00
e48df3ee47 issues api allow pulls and fix #4832 (#4852) 2018-09-03 13:20:54 -04:00
a4ee5627ed Backport 1.5.1 changelog (#4854) 2018-09-03 01:17:10 -04:00
01fd05a5cb [skip ci] Updated translations via Crowdin 2018-09-03 03:25:34 +00:00
83d1173634 Add missing History link to directory listings (#4829)
The feature to list commits from a subdirectory is already there but
so far the history link to it was missing. There is a History button
in the view_file.tmpl already so avoid showing two history buttons in
that case.

The GitHub webinterface has the same History button in the same place
so this makes gitea a little bit more compatible.

Signed-off-by: Bernhard Froehlich <decke@bluelife.at>
2018-09-02 23:24:19 -04:00
aad5cccec8 [skip ci] Updated translations via Crowdin 2018-08-31 21:23:17 +00:00
9500d394ec Minor fix to TRANSLATORS (#4836)
* Minor fix to TRANSLATORS

Replaced @ with AT and removed " accidentially put in few lines

* Update TRANSLATORS
2018-09-01 00:22:11 +03:00
b9ae16d15e Make reverse proxy auth optional (#4643)
* Make reverse proxy auth optional

If the option ENABLE_REVERSE_PROXY_AUTHENTICATION is enabled, make
reverse proxy auth optional, instead of failing if the authentication
did not succeed.

Fixes #3973

Signed-off-by: Najib Idrissi <najib.idrissi.kaitouni@gmail.com>

* Update http.go
2018-08-29 10:39:16 -04:00
fcea86877f update image used for build-without-gcc step (#4818)
As we've dropped support for go 1.8 (see 1.5.0 release post),
now we need to ensure that a minimum of go 1.9 builds correctly.
2018-08-29 10:01:58 -04:00
a938ddf704 [skip ci] Updated translations via Crowdin 2018-08-29 13:46:42 +00:00
080428b2bf Upgrade images in .drone.yml to more recent versions (#4819) 2018-08-29 09:43:58 -04:00
179123de35 [skip ci] Updated translations via Crowdin 2018-08-28 15:50:29 +00:00
74d65b5b5b Update legacy branch and tag URLs in dashboard to new format (#4812) 2018-08-28 11:48:15 -04:00
34831afaa7 Locale for Edit and Remove due date issue (#4802) 2018-08-27 21:34:12 +03:00
51c3b4b4bf Add Orzech to translator list (#4801) 2018-08-26 23:31:10 -04:00
56d931aeac Hide home button when landing page is not set to home (#4651) 2018-08-26 22:23:27 -04:00
4ae5a54c1f Fix missing release title in webhook (#4783) (#4796) 2018-08-26 11:24:33 -04:00
b63e2e0ded Update en-us and fr-fr versions of the "Upgrade from Gogs" doc (#4618)
* Update "Upgrade from Gogs" en-us doc

- Move "Change gogs specific information" FROM/TO steps up
  to just beneath matching section header, adjust indention
  and explicitly specify syntax of code sample to provide
  highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration (see below)

- Move "Upgrading to most recent ..." section down, remove
  decoration (section header formatting likely covers this
  well enough already)

refs go-gitea/gitea#4286, go-gitea/gitea#3558

* Update "Upgrade from Gogs" fr-fr doc

- Adjust indention and explicitly specify syntax of code
  sample to provide highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration since
  section header formatting likely covers this
  well enough already

refs go-gitea/gitea#4286, go-gitea/gitea#3558
2018-08-25 02:47:47 -04:00
0a24f5cac8 Disable 'May Import Local Repository' when is disabled by setting (Issue #4779) (#4780) 2018-08-24 01:00:22 -04:00
194a11eb11 Don't disclose emails of all users when sending out emails (#4664) 2018-08-24 00:41:26 -04:00
912953e82a API /admin/users/{username} missing parameter (#4775) 2018-08-23 19:59:47 -04:00
127f477056 MySQL TLS (#4642) 2018-08-23 18:42:02 -04:00
0dac1ff677 [skip ci] Updated translations via Crowdin 2018-08-23 18:13:57 +00:00
f766e9713b Add myself to maintainers (#4777) 2018-08-23 14:12:57 -04:00
3c39b6351c [skip ci] Updated translations via Crowdin 2018-08-23 06:16:16 +00:00
33bc2ebdfa Make sure to reset commit count in the cache on mirror syncing (#4720)
* Make sure to reset commit count in the cache on mirror syncing

* reset count of commits in all branches
2018-08-23 14:15:07 +08:00
6ca8fbd2f9 Fixed bug where team with admin privelege type doesn't get any unit attached to the team (#4719) 2018-08-21 13:02:32 -04:00
05dcfcfc33 [skip ci] Updated translations via Crowdin 2018-08-21 13:58:07 +00:00
b82c14b3d2 add letsencrypt to Gitea (#4189) 2018-08-21 09:56:50 -04:00
6c1a31ffaa User shouldn't be able to approve or reject his/her own PR (#4729)
* Make sure author cannot reject/approve their own PR

* Disable buttons in templates too

* Remove unneccessary if check since the switch below catches it

* Fix IsOwner check

* Update template and remove new template variable

* Add alert template and redirect to diff page on review failure

* Redirect to files diff as a little update to #4632
2018-08-20 07:04:01 +02:00
fa93857117 allow WIP marker to contains < or > (#4709) 2018-08-19 15:00:10 -04:00
a6cdda115d Display error when adding a user to a team twice (#4746) 2018-08-19 21:49:19 +03:00
b1ad5734c6 Add whitespace between chinese characters and english characters. (#4731)
Signed-off-by: Tosone <i@tosiney.com>
2018-08-17 09:26:00 +08:00
1b2aff02a2 [skip ci] Updated translations via Crowdin 2018-08-16 11:53:51 +00:00
50ce19eff7 Fix failure on creating pull request with assignees (#4419) (#4583) 2018-08-16 19:52:51 +08:00
8273479b41 [skip ci] Updated translations via Crowdin 2018-08-15 22:59:13 +00:00
b30f6b4099 Remove UsePrivilegeSeparation from the Docker sshd_config, see #2876 (#4722)
Signed-off-by: Andrew Phillips <theasp@gmail.com>
2018-08-16 01:58:12 +03:00
f24ba27d79 [skip ci] Updated translations via Crowdin 2018-08-15 11:56:09 +00:00
8f86c43b90 Fix incorrect caption of webhook setting (#4701) (#4717) 2018-08-15 14:55:17 +03:00
bc06ab4a31 [skip ci] Updated translations via Crowdin 2018-08-15 06:30:05 +00:00
92466129ec Improve URL validation for external wiki and external issues (#4710)
* Improve URL validation for external wiki  and external issues

* Do not allow also localhost address for external URLs
2018-08-15 09:29:37 +03:00
0449330dbc Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706) 2018-08-14 23:16:37 +03:00
ca112f0a04 Add whitespace handling to PR-comparsion (#4683)
* Add whitespace handling to PR-comparsion

In a PR we have to keep an eye on a lot of different things. But sometimes the
bare code is the key-thing we want to care about and just don't want to care
about fixed indention on some places. Especially if we follow the pathfinder
rule we face a lot of these situations because these changes don't break the
code in many languages but improve the readability a lot.

So this change introduce a fine graned button to adjust the way how the
reviewer want to see whitespace-changes within the code.

The possibilities reflect the possibilities from git itself except of the
`--ignore-blank-lines` flag because that one is also handled by `-b` and is
really rare.

Signed-off-by: Felix Nehrke <felix@nehrke.info>
2018-08-14 13:49:33 -04:00
03e558c29b [skip ci] Updated translations via Crowdin 2018-08-14 06:11:45 +00:00
e6777f7b9d Focus title input when clicking helper link (#4696) 2018-08-14 09:10:26 +03:00
df0eb7372c [skip ci] Updated translations via Crowdin 2018-08-13 19:05:41 +00:00
7781e8cef2 Disable merging a WIP Pull request (#4529)
* prevent pull request to be merged when PR is a WIP

* add tests

* add helper to prepend WIP: in PR title

* move default wip prefixes into settings

* use configurable WIP prefixes in javascript and default to first one in templates

* add documentation

* add unit test on pull model

Signed-off-by: Julien Tant <julien@craftyx.fr>
2018-08-13 22:04:39 +03:00
52c2cb15db add vendor to user reserved words and format words list according alphabet (#4685) 2018-08-13 08:02:18 +03:00
a4fa6bbc89 Hide org/create menu item in Dashboard if user has no rights (#4678) (#4680) 2018-08-12 20:16:10 +03:00
6e68b61479 Fix dark theme diff box header backround color (#4674) 2018-08-12 21:55:48 +08:00
ce7c64c7e1 Use updated docs link on install page (#4668)
Fix #4665
2018-08-11 21:05:52 -04:00
3422077a89 make sure to set pr split view (#4617)
Signed-off-by: Lanre Adelowo <yo@lanre.wtf>
2018-08-11 20:20:33 -04:00
7fbdd4f2ac Enable swagger validation back as issue with it has been fixed upstream (#4673) 2018-08-11 20:08:17 -04:00
3ad5399a31 Update gitea version in install-from-binary docs (#4670) 2018-08-11 15:47:14 -04:00
69a855f3d4 log user in after a successful sign up (#4615) 2018-08-11 15:33:19 -04:00
4a7de87071 Add gitea/issues link to 500 page (#4654) 2018-08-11 13:04:43 -04:00
5dfe8b4340 Add 1.5.0 changelog (#4661) 2018-08-11 04:38:44 -04:00
8da45ae2b3 improve comparison to add issue dependency (#4658) 2018-08-10 08:22:07 +03:00
0e04a2091a Fix Split-View line adjustment (#4622)
The $-function is unreachable in the previous implementation because jQuery is
not loaded yet. I fix this by executing the function after the content is
loaded, so jQuery is loaded at the time of execution and the call will not fail
anymore.

Signed-off-by: Felix Nehrke <felix@nehrke.info>
2018-08-09 16:28:55 +08:00
578cf52ce5 Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
* site admin could create repos even MAX_CREATION_LIMIT=0

* Optimize if structure
2018-08-09 09:04:16 +08:00
0e464995ce Remove link to GitHub issues (#4639) 2018-08-08 11:07:34 -04:00
152c6af97e Fix custom templates being ignored (#4638) 2018-08-08 14:15:48 +03:00
00bd6277a8 [skip ci] Updated translations via Crowdin 2018-08-08 05:21:16 +00:00
3b51c4f3fb Show review comment box only on a pull request page (#4636)
* Show review comment box only on a pull request page

* Fixed template check
2018-08-08 08:20:04 +03:00
32145b6de8 Push whitelist now doesn't apply to branch deletion (#4601) (#4607) 2018-08-08 11:17:10 +08:00
67a8688538 [skip ci] Updated translations via Crowdin 2018-08-07 18:49:38 +00:00
b1bc08e268 cmd/serve: pprof cpu and memory profile dumps to disk (#4560) 2018-08-07 14:49:18 -04:00
ed3589f429 [skip ci] Updated translations via Crowdin 2018-08-07 18:37:15 +00:00
5ae8408725 Fix starring icon after semantic ui update (#4628) 2018-08-07 14:36:21 -04:00
a42900c17f [skip ci] Updated translations via Crowdin 2018-08-07 17:16:52 +00:00
0df7cab4fb prevent empty review comment (#4632)
* prevent empty review comment

This would only require a comment for rejection and comment

* add tests

* add comment
2018-08-07 20:15:41 +03:00
59b10e66f7 An inactive user shouldn't be able to be added as a collaborator (#4535)
* an inactive user shouldn't be able to be a collaborator

* use translated error message

* add active user check when adding a new collaborator via the api

* fix translation text

* added collaborator test

* improvee testcases
2018-08-07 13:01:06 +03:00
c7a6ee5c0b Don't fail silently if trying to add a collaborator twice (#4533)
* don't fail silently if trying to add a collaborator twice

* fix translation text

* added collaborator test

* improvee testcases

* Added tests to make sure a collaborator cannot be added twice
2018-08-07 09:59:42 +08:00
7cb1c1cf20 [skip ci] Updated translations via Crowdin 2018-08-06 11:54:16 +00:00
9c0a374f3f Fix integer constant overflows in tests (#4616)
* Use integer limit value [1] instead of hard-coded magic constant for
  NonexistentID.

* Explicitly use int64 in order to avoid the following errors on 32 bit
  architectures:

  # code.gitea.io/gitea/integrations
  ./api_admin_test.go:50:34: constant 9223372036854775807 overflows int
  ./api_token_test.go:47:34: constant 9223372036854775807 overflows int
  [...]
  # code.gitea.io/gitea/models
  ./action_test.go:179:15: constant 9223372036854775807 overflows int

[1] https://golang.org/pkg/math/#pkg-constants

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
2018-08-06 14:52:53 +03:00
9ea327f1f7 [skip ci] Updated translations via Crowdin 2018-08-06 04:44:17 +00:00
6e64f9db8e Pull request review/approval and comment on code (#3748)
* Initial ui components for pull request review

* Add Review
Add IssueComment types

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

(cherry picked from commit 2b4daab)
Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Replace ReviewComment with Content

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

* Add load functions
Add ReviewID to findComments

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

* Add create review comment implementation
Add migration for review
Other small changes

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

* Simplified create and find functions for review

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

* Moved "Pending" to first position

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

* Add GetCurrentReview to simplify fetching current review

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

* Preview for listing comments

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

* Move new comment form to its own file

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

* Implement Review form
Show Review comments on comment stream

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

* Add support for single comments
Showing buttons in context

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

* Add pending tag to pending review comments

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

* Add unit tests for Review

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

* Fetch all review ids at once
Add unit tests

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

* gofmt

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

* Improved comment rendering in "Files" view by adding Comments to DiffLine

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

* Add support for invalidating comments

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

* Switched back to code.gitea.io/git

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

* Moved review migration from v64 to v65

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

* Rebuild css

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

* gofmt

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

* Improve translations

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

* Fix unit tests by updating fixtures and updating outdated test

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

* Comments will be shown at the right place now

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

* Add support for deleting CodeComments

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

* Fix problems caused by files in subdirectories

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

* Add support for showing code comments of reviews in conversation

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

* Add support for "Show/Hide outdated"

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

* Update code.gitea.io/git

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

* Add support for new webhooks

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

* Update comparison

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

* Resolve conflicts

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

* Minor UI improvements

* update code.gitea.io/git

* Fix ui bug reported by @lunny causing wrong position of add button
Add functionality to "Cancel" button
Add scale effects to add button
Hide "Cancel" button for existing comments

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

* Prepare solving conflicts

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

* Show add button only if no comments already exist for the line

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

* Add missing vendor files

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

* Check if reviewer is nil

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

* Show forms only to users who are logged in

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

* Revert "Show forms only to users who are logged in"

This reverts commit c083682

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

* Save patch in comment
Render patch for code comments

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

* Add link to comment in code

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

* Add reply form to comment list
Show forms only to signed in users

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

* Add 'Reply' as translatable
Add CODE_COMMENT_LINES setting

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

* gofmt

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

* Fix problems introduced by checking for singed in user

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

* Add v70

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

* Update generated stylesheet

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

* Fix preview
Beginn with new review comment patch system

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

* Add new algo to generate diff for line range
Remove old algo used for cutting big diffs (it was very buggy)

* Add documentation and example for CutDiffAroundLine

* Fix example of CutDiffAroundLine

* Fix some comment UI rendering bugs

* Add code comment edit mode

* Send notifications / actions to users until review gets published
Fix diff generation bug
Fix wrong hashtag

* Fix vet errors

* Send notifications also for single comments

* Fix some notification bugs, fix link

* Fix: add comment icon is only shown on code lines

* Add lint comment

* Add unit tests for git diff

* Add more error messages

* Regenerated css

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

* fmt

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

* Regenerated CSS with latest less version

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

* Fix test by updating comment type to new ID

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

* Introducing CodeComments as type for map[string]map[int64][]*Comment
Other minor code improvements

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

* Fix data-tab issues

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

* Remove unnecessary change

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

* refactored checkForInvalidation

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

* Append comments instead of setting

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

* Use HeadRepo instead of BaseRepo

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

* Update migration

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

* Regenerated CSS

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

* Add copyright

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

* Update index.css

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-08-06 06:43:21 +02:00
9c354a539a fix bugs when too many IN variables (#4594) 2018-08-02 21:49:05 +08:00
c40f5d2d4c api: repos/search: add parameters to control the sort order (#3964)
The backend SearchRepositoryByName function supports several sort order
options, hook these up to the /repos/search API.

New parameters for /repos/search:
    'sort':  alpha, created, updated, size, or id
    'order': asc or desc

'sort' defaults to alpha.
'order' defaults to ascending, and is ignored if 'sort' is not specified.
The overall default behavior is unchanged (alphabetically ascending).

This partially implements issue #3963

Signed-off-by: Allen Wild <allenwild93@gmail.com>
2018-08-02 16:10:02 +08:00
819f50ccd5 fix panic issue on update avatar email (#4580) (#4581)
fix #4580
2018-08-01 17:38:56 +08:00
ced08d18a4 fix IsPullReuqestBroken->IsPullRequestBroken (#4578)
Signed-off-by: Julien Tant <julien@craftyx.fr>
2018-08-01 11:00:35 +08:00
d57233680b Add documentation on how to update Gitea to new version (#4500) 2018-07-30 11:35:05 -04:00
b11ddd8d4c fix status code label for a successful webhook (#4540) 2018-07-30 10:27:31 +03:00
e277b3e0e4 [skip ci] Updated translations via Crowdin 2018-07-30 06:05:23 +00:00
895e538836 Update jQuery to v1.12.4 (#4551)
Fix #4384
2018-07-30 02:04:24 -04:00
a74426d631 Swagger.v1.json template (#3572)
* Turn swagger.v1.json into template

* Rename ENABLE_SWAGGER_ENDPOINT option to ENABLE_SWAGGER
2018-07-28 03:19:01 +03:00
412583a3f2 [skip ci] Updated translations via Crowdin 2018-07-27 19:12:26 +00:00
c1224124ea Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) (#4525) 2018-07-27 22:11:24 +03:00
5927599e43 [skip ci] Updated translations via Crowdin 2018-07-27 12:55:56 +00:00
adf3f004b6 Switch plaintext scratch tokens to use hash instead (#4331) 2018-07-27 08:54:50 -04:00
ac968c3c6f Fix out-of-transaction query in removeOrgUser (#4521) (#4522) 2018-07-27 02:41:36 +03:00
be4ec0cbba env var GITEA_PUSHER_EMAIL (#4516)
* env var GITEA_PUSHER_EMAIL

* set pusher email only if email address is not private
2018-07-26 19:38:55 +03:00
a847d16f5b [skip ci] Updated translations via Crowdin 2018-07-26 15:26:44 +00:00
8d1ad55598 Responsive design fixes (#4508)
* reset to master

* build css

* Fixed spacing
2018-07-26 18:25:41 +03:00
f847884d16 Fix doc typo (#4517)
* fix language list

Standardized the languages' names within the list displayed when picking up a language at the bottom of the webpages

* typo

fix a typo into documentation (template rather than templete)

* fix languages list
2018-07-26 12:57:45 +02:00
1b9b894731 Fix uk-UA locale. Fixes #4518 2018-07-26 13:30:56 +03:00
7a30208e05 [skip ci] Updated translations via Crowdin 2018-07-25 17:55:49 +00:00
630f234223 Add flash message after an account has been successfully activated (#4510)
* added new locale text
2018-07-25 20:54:56 +03:00
32f25598b3 [skip ci] Updated translations via Crowdin 2018-07-25 12:12:34 +00:00
4bf0cae1f5 Respect email privacy option in user search via API (#4512)
* respect user's email privacy option

* make email visible to admin irrespective of privacy option
2018-07-25 15:11:22 +03:00
d0fef4395f [skip ci] Updated translations via Crowdin 2018-07-24 10:22:04 +00:00
344dc07239 Add shortcut to save wiki page (#4452)
This allows saving the wiki page with Ctrl-Enter.
2018-07-24 12:20:52 +02:00
ba358ecbf5 Make max commits in graph configurable (#4498) 2018-07-23 17:12:06 +03:00
ae9dd239fb Fix migration from older releases (#4495) 2018-07-21 23:15:11 -04:00
ec43e5619b [skip ci] Updated translations via Crowdin 2018-07-21 18:18:18 +00:00
bed623600d Accept 'Data:' in commit graph (#4487) 2018-07-21 14:17:09 -04:00
5fa403c874 [skip ci] Updated translations via Crowdin 2018-07-20 21:09:20 +00:00
0bb1c84208 Add csv file render support defaultly (#4105)
* add csv file render support defaultly

* escaping csv column content
2018-07-21 00:08:15 +03:00
b174817b6a Improve English translation for new features. (#4481) 2018-07-20 12:40:08 -04:00
cc9fa062e6 [skip ci] Updated translations via Crowdin 2018-07-20 02:11:33 +00:00
0c59edaafa Update xorm to latest version and fix correct user table referencing in sql (#4473) 2018-07-20 10:10:17 +08:00
1e2da5d396 [skip ci] Updated translations via Crowdin 2018-07-19 17:59:34 +00:00
492ec97a46 Redirect to correct page after using scratch token (#4458) 2018-07-19 13:58:33 -04:00
d1337299e2 add valid for lfs oid (#4461) 2018-07-19 11:39:19 -04:00
9ca8aaecb4 [skip ci] Updated translations via Crowdin 2018-07-19 15:26:27 +00:00
91373901f6 Prevent html entity escaping (#4471) 2018-07-19 18:25:17 +03:00
fe78154895 relative URLs for LibreJS page (#4460)
Fix #4449
2018-07-18 17:23:40 +08:00
1bff02de55 Added dependencies for issues (#2196) (#2531) 2018-07-17 17:23:58 -04:00
7be5935c55 Add BSDmakefile to prevent errors when make is called under FreeBSD (#4446)
The syntax of the gitea Makefile is not platform-agnostic and is
specific to the GNU version of `make`. BSD platforms such as FreeBSD
ship with bmake (BSD make) as their default `make` program; attempting
to compile gitea by simply executing `make` causes a wall of errors to
show as a result of syntax incompatible with BSD make.

If a file named `BSDmakefile` is present, `bmake` will give it
preference over a generic `Makefile`. This `BSDmakefile` is taken from
the BSD-licensed `gmake-proxy` project [0], which transparently proxies
all `make` commands to `gmake` (GNU make) on systems where `bmake` is
the default, and if `gmake` is not installed an error message is
displayed.

[0]: https://github.com/neosmart/gmake-proxy
2018-07-16 20:45:51 +02:00
ef6813abc9 Issue due date api (#3890)
* Implemented basic api endpoint to manage deadlines

* Fixed checking for permissions

* Updating a deadline from the ui is now entirely done via the api

* cleanup

* Cosmetics

* fixed lint + fmt

* Added swagger model definition for deadline response

* Updated gitea-sdk

* Updated gitea-sdk

* More cleanup

* Generate swagger json

* Merge branch 'master' of https://github.com/go-gitea/gitea into issue-due-date-api

# Conflicts:
#	public/swagger.v1.json

* Fixed permission to update a deadline via api

* Re-added form to change a deadline

* Added client-side validation + not ignore error messages from the api

* Added locale for error message

* Merge branch 'master' of https://github.com/go-gitea/gitea

# Conflicts:
#	models/issue_comment.go

* Proper date validation

* Fixed indention

* moved css to css file

* added documentation for error codes

* after merge cleanup

* Added swagger description

* DO NOTHING BUT TRIGGER THAT F*CKIN CI SO IT PICKS UP THE LATEST COMMIT AS IT SHOULD

* DO NOTHING BUT TRIGGER THAT F*CKIN CI SO IT PICKS UP THE LATEST COMMIT AS IT SHOULD

* regenerated stylesheets
2018-07-16 14:43:00 +02:00
55d9ddf24a [skip ci] Updated translations via Crowdin 2018-07-15 00:44:24 +00:00
ca474af3c6 Added front-end topics validation (#4316) 2018-07-14 20:43:32 -04:00
8e103d3e76 [skip ci] Updated translations via Crowdin 2018-07-14 06:08:34 +00:00
a7c5e58635 Clean up arc-green theme (#4443)
* Resolve some issues with Arc Green

* Fix editor styles

* zeebra stripes

* generate CSS file
2018-07-14 09:07:30 +03:00
ca8c7bb2b5 [skip ci] Updated translations via Crowdin 2018-07-13 20:58:18 +00:00
aa27cbf229 Locale for button Edit on protected branch (#4442) 2018-07-13 16:57:20 -04:00
6813640d2f [skip ci] Updated translations via Crowdin 2018-07-13 15:22:00 +00:00
e95417ea2c Fix column droping for MSSQL that need new transaction for that (#4440) 2018-07-13 11:20:40 -04:00
659bc727bd Fix query parameter name comment in issue API (#4421) 2018-07-12 16:40:41 +03:00
e6b51200ab Final CSP header fix (#4432) 2018-07-12 19:48:33 +08:00
a7f90905df Fix drone git@next plugin Gitea version display when building tag (#4380) 2018-07-12 06:32:01 +03:00
8afd500c48 Add missing font hosts to CSP header (#4429) 2018-07-11 19:24:06 -04:00
8b21cdba78 Fix CSP header for docs (#4428) 2018-07-12 00:27:48 +02:00
3e950ef112 Use correct site id for netlify (#4427) 2018-07-11 23:45:03 +02:00
c55caeaf0c Update npm dependencies, regenerate CSS (#4415) 2018-07-11 10:54:28 -04:00
d84490a0df Replaced docker docs with netlify deployment (#4420) 2018-07-11 16:43:33 +02:00
c2ec38f9b7 Disable swagger validation while it is not fixed in upstream (#4423) 2018-07-11 10:03:52 -04:00
61f4ad2fc5 [skip ci] Updated translations via Crowdin 2018-07-11 11:37:10 +00:00
c9687c036d update TRANSLATORS (#4406) 2018-07-11 14:36:04 +03:00
3e445cce06 [skip ci] Updated translations via Crowdin 2018-07-08 20:42:36 +00:00
80169460ec Added question for Gitea hosted Gitea (#4397)
Currently some issues need to be resolved and features need to be implemented before we can move the Gitea development workflow to a Gitea instance. Many ask why Gitea isn't hosted on Gitea, now that's in the FAQ.
2018-07-08 22:41:31 +02:00
efd202f40f [skip ci] Updated translations via Crowdin 2018-07-07 01:55:43 +00:00
ab55ca7ebd Add ability to delete a token (#4235)
Fix #4234
2018-07-06 21:54:30 -04:00
1675fc4301 add git timeout settings docs (#4383) 2018-07-06 08:49:37 +03:00
61b40520ba GPG verification docs (#4381)
* GPG verification docs

* update URL
2018-07-06 09:36:54 +08:00
f1d6a1fffc Add the ability to have built in themes in Gitea (#4198)
This makes it easier for user who want to theme but
don't have the ability to know how to customize templates
all that is required is a change in a config option

The reason why I chose the DEFAULT_THEME as variable,
as perhaps in the future we will allow users to chose their
theme whon logged in just like we do with languages
2018-07-05 17:25:04 -04:00
28c1c90230 [skip ci] Updated translations via Crowdin 2018-07-05 20:42:15 +00:00
2a60e72fcd Replace src with raw to fix image paths (#4377)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-07-05 22:36:45 +02:00
cfb76cd99e [skip ci] Updated translations via Crowdin 2018-07-05 17:49:07 +00:00
7c943b1cad Implemented hover text showing user FullName (#4261)
For each action that is displayed in either the public activity overview
of a user, or in the dashboard overview, the link to the username is now
extended with a title attribute to show the FullName as hover text

Signed-off-by: Guido Diepen <site-github@guidodiepen.nl>
2018-07-05 19:48:18 +02:00
5bc8782d33 Don't display buttons if there are no system notifications (#4280)
* Don't display buttons if there are no notices

* remove redundant gt check
2018-07-05 17:35:42 +02:00
e07d3ad0fc Fixes repo membership check in API (#4341)
Untested, since I can't compile (yet).
2018-07-05 15:14:56 +08:00
f035dcd4f2 Add Recaptcha functionality to Gitea (#4044) 2018-07-05 00:13:05 -04:00
54fedd4070 Add default merge options when adding new repository (#4369) 2018-07-05 11:02:54 +08:00
07063e3e11 [skip ci] Updated translations via Crowdin 2018-07-05 00:05:18 +00:00
69e2ab1611 Allow administrator to create repository for any organization (#4368) 2018-07-05 01:51:02 +02:00
4eae810d63 [skip ci] Updated translations via Crowdin 2018-07-04 22:53:06 +00:00
4a8ee0b5cc Check that repositories can only be migrated to own user or organizations (#4366)
* Repositories can only migrated to own user or organizations

* Add check for organization that user does not belong to

* Allow admin to migrate repositories for other users
2018-07-05 01:45:15 +03:00
b46066f17c fix repository last updated time update when delete a user who watched the repo (#4363) 2018-07-05 00:47:05 +03:00
95f0f62ea4 [skip ci] Updated translations via Crowdin 2018-07-04 20:24:23 +00:00
74f9f98f78 Simply remove tidb and deps (#3993) 2018-07-04 16:23:23 -04:00
2e3475f02c Fix typos in i18n variable names. (#4080) 2018-07-04 19:43:21 +08:00
df77ad31d5 [skip ci] Updated translations via Crowdin 2018-07-04 09:28:27 +00:00
c3bbf43970 Fix docker build (#4358)
/app/gitea/gitea is the file, and /usr/local/bin is where the symlink will be located
2018-07-04 12:27:30 +03:00
fc53f95f23 [skip ci] Updated translations via Crowdin 2018-07-04 00:45:44 +00:00
823318bfbe Add missing path in the Docker app.ini template (#2181) 2018-07-03 20:44:46 -04:00
5676f60cba Keep preseeded database password (#4284) 2018-07-03 20:09:55 -04:00
3fed13b0ee [skip ci] Updated translations via Crowdin 2018-07-03 23:53:28 +00:00
51ba3df5ff Add noreferrer to rel='noopener` for <a> tags (#4328) 2018-07-03 19:52:36 -04:00
4b654ad17f Update notification icon (#4343) 2018-07-03 19:16:46 -04:00
5d1a6382b6 #4354 Fix translation (#4355) 2018-07-03 19:03:31 -04:00
c71ee33057 Increase default TOTP secret size to 320 bits (#4287) 2018-07-03 18:10:35 -04:00
9d4c1ddfa1 Dep upgrade mysql lib (#4161)
*  update gopkg file to add sql dep
2018-07-03 17:58:31 -04:00
280ebcbf7c Update changelog
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-07-03 23:24:48 +03:00
100a538622 [skip ci] Updated translations via Crowdin 2018-07-03 20:23:00 +00:00
1c7f951534 Change 1.5.0 RC1 release date in changelog
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-07-03 23:21:44 +03:00
a4dfe4b9b1 [skip ci] Updated translations via Crowdin 2018-07-03 19:58:30 +00:00
5f52178421 Change 1.5.0 RC1 release date in changelog
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-07-03 22:57:59 +03:00
83e72f17f6 [skip ci] Updated translations via Crowdin 2018-07-03 19:38:06 +00:00
9c6801c8d4 Add changelog for 1.5.0-RC1 (#4324) 2018-07-03 22:37:07 +03:00
bbf9abde49 [skip ci] Updated translations via Crowdin 2018-07-03 03:57:42 +00:00
cbee921c28 Limit uploaded avatar image-size to 4096x3072 by default (#4353) 2018-07-03 06:56:32 +03:00
69796ddd64 [skip ci] Updated translations via Crowdin 2018-07-02 12:43:33 +00:00
3089833167 Update TRANSLATORS (#4349) 2018-07-02 15:42:28 +03:00
f4b7b424c1 [skip ci] Updated translations via Crowdin 2018-07-01 06:03:32 +00:00
547f95417d Add myself as a maintainer (#4345) 2018-07-01 09:02:18 +03:00
e8a17e4558 [skip ci] Updated translations via Crowdin 2018-06-30 17:14:19 +00:00
4ee52b7161 Add scope to Gitlab oauth request (#4330)
Fix #3449
2018-06-30 20:13:17 +03:00
e87c540a87 Backport 1.4.3 changelog to master branch (#4323) 2018-06-27 15:06:39 +08:00
a711d41f54 [skip ci] Updated translations via Crowdin 2018-06-27 05:25:28 +00:00
91ff87c0e5 Fixed violation of the unique constraint for v68 migration (#4297) 2018-06-27 01:23:10 -04:00
a9ffbeb679 [skip ci] Updated translations via Crowdin 2018-06-26 14:46:26 +00:00
801843b011 Fix open redirect vulnerability on login screen (#4312)
* Fix open redirect vulnerability on login screen

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

* Reorder imports

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

* Replace www. from Domain too

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-06-26 22:45:18 +08:00
b8c2420ae2 [skip ci] Updated translations via Crowdin 2018-06-25 12:13:56 +00:00
aaf6be3ee6 Create api-usage doc page (#4306)
* add api user guides in doc

* update user-guides api page

* fix typo: user guides -> user guide

* move api-usage page under advanced category

* flesh out API usage docs

* Build on work by @tungsheng

* Address issues raised in #4037, #3673, and #4243

* Close #4247

Signed-off-by: Steve Traugott <stevegt@t7a.org>
2018-06-25 20:12:46 +08:00
8bb9b67a29 [skip ci] Updated translations via Crowdin 2018-06-24 21:25:00 +00:00
3e6d9b355e Add a basic SMF manifest for SunOS platforms (#4238)
Signed-off-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
2018-06-25 00:24:00 +03:00
3f0d9beece fix exclude files .sha265 to .sha256 (#4304) 2018-06-24 14:10:11 +03:00
a747a5d05f Add gpg-sign step to drone (#4188)
* Add gpg-sign step to drone

* add compressed releases to gpg-sign targets

* Use exclude to simplify file list

drone-plugins/drone-gpgsign#2
2018-06-24 14:40:30 +08:00
212fef0866 Add details about USER_UID and USER_GID environment variables (#4301) 2018-06-23 22:55:48 -04:00
e2721b6190 Remove call to update certs (#4296) 2018-06-21 17:12:56 -04:00
0b3ea42847 hide issues from org private repos w/o team assignment (#4034) 2018-06-21 12:00:13 -04:00
46d19c4676 Fix topics addition (Another solution) (#4031) (#4258)
* Added topics validation, fixed repo topics duplication (#4031)

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added tests

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed fmt

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added comments to exported functions

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Deleted RemoveDuplicateTopics function

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed messages

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added migration

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fmt migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fixed lint

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added Copyright

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Added query solution for duplicates

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed migration query

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Changed RegExp. Fixed migration

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* fmt migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Fixed test for changed regexp

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Removed validation log messages

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed migration file

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed validate function

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-06-21 17:09:46 +08:00
9ae7664df7 Fix webhook type conflation. (#4285)
- Fix typo that caused Gogs hooks to be created as Gitea hooks.
- Fix typo that caused Gogs hooks to be duplicated upon edit (though this bug was masked by the previous one).

Signed-off-by: Russell Aunger <rba@live.com>
2018-06-21 07:22:03 +02:00
ac110d1b73 [skip ci] Updated translations via Crowdin 2018-06-20 16:04:23 +00:00
cd29888906 Updated drone config to use the "next" git plugin (#4281) 2018-06-20 19:03:22 +03:00
d84da8fe65 Change parsing of postgresql settings (#4275)
* Change parsing of postgresql settings

Fix #4200

* Add copyright

* update postgresql connection string

* add tests
2018-06-20 08:06:01 +03:00
a93f13849c Fix not removed watches on unallowed repositories (#4201) 2018-06-19 15:44:33 -04:00
467ff4d343 Fix milestone appliance and permission checks (#4271)
* Fix milestone appliance
Fix missing permission check

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

* Fix comment

* Add Gitea copyright line
2018-06-19 23:15:11 +08:00
3f2f5752cb [skip ci] Updated translations via Crowdin 2018-06-19 08:51:02 +00:00
8c6b2324a7 Fix missing close tags in U2F (#4256) 2018-06-19 11:48:50 +03:00
69bfd81b1c fix missing data on redirects (#3975) 2018-06-18 14:24:45 -04:00
6e39f3d422 [skip ci] Updated translations via Crowdin 2018-06-18 17:18:22 +00:00
90ad73ae21 Reorganized feature comparison (#4264) 2018-06-18 13:16:53 -04:00
85414d8b75 Show second line by using >= 1 instead of > 1 (#4251)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-06-15 10:07:48 -04:00
3aafa0400e [skip ci] Updated translations via Crowdin 2018-06-15 12:43:56 +00:00
23ba5c870f markup: escape short wiki link (#4091) 2018-06-15 20:42:49 +08:00
c919b07a53 [skip ci] Updated translations via Crowdin 2018-06-15 07:48:26 +00:00
a7aaacb633 fix CreateIssueCommentOption reference (#4239)
* fixes a warning remaining from #4010 and #4220
2018-06-15 15:47:13 +08:00
a75f251195 [skip ci] Updated translations via Crowdin 2018-06-15 03:43:54 +00:00
adba2ad609 fix not respecting landing page setting (#4209)
* fix not respecting landing page setting

* fmt

* add landing page test
2018-06-15 11:42:46 +08:00
6efdcaed86 Fix swagger security parts (#4236) 2018-06-12 19:23:00 -04:00
2b8c0bb5e2 Delete reactions added to issues and comments when deleting repository (#4232) 2018-06-12 13:02:51 -04:00
406031d3cc fix bug when deleting a release (#4207) 2018-06-12 12:44:17 -04:00
908e8942cc Fix swagger errors (#4220)
Fix all the resting errors to have a valid swagger file.

They are still some warnings but nothing blocking.

Doing so I found that some request still misses son parameters for some POST/PUT/PATCH request. This means the a client generated from the swagger file will not work completely. 

Fix #4088 by activating validation in drone
Should fix #4010.
2018-06-12 22:59:22 +08:00
0ba165e2ea Improve wiki content width. (#4195) 2018-06-12 14:27:18 +03:00
0ea18698af [skip ci] Updated translations via Crowdin 2018-06-12 10:36:20 +00:00
7b773bd49f Fixed drone command in readme (#4222)
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-06-12 13:34:56 +03:00
37359aee68 [skip ci] Updated translations via Crowdin 2018-06-11 22:55:33 +00:00
da898d4066 fix delete comment bug (#4216) 2018-06-11 18:54:30 -04:00
508092a248 [skip ci] Updated translations via Crowdin 2018-06-11 07:13:54 +00:00
3da0d437e9 Fixed spelling + clarity (#4213)
Message given when password was too short was incorrectly spelled and was not clear enough.
2018-06-11 03:12:38 -04:00
e3b77f92c1 [skip ci] Updated translations via Crowdin 2018-06-10 18:43:21 +00:00
2bb73fe12c HTML-escape text READMEs (#4192) 2018-06-10 21:42:16 +03:00
af57d6ab8a undo #3142 because processes don't use the util.Timestamp (#4203) 2018-06-10 09:48:45 +08:00
f54626df0b Add config path as an optional flag when changing pass via CLI (#4184) 2018-06-09 18:35:14 -04:00
9033eaeec1 Only show "You cannot fork a repository you own" when needed (#4130) 2018-06-09 16:51:10 -04:00
ef0bc57ae7 [skip ci] Updated translations via Crowdin 2018-06-09 19:16:38 +00:00
47f59589c5 Update backup and restore doc usage (#4165)
Edit example of `./gitea dump` to include -c option to pass app.ini

Signed-off-by: Jesse Lucas <jesse@jesselucas.com>
2018-06-09 15:16:16 -04:00
048468560f Add security advice to contrib guide (#4187)
* Improve contributing guidelines for security
2018-06-09 12:03:23 -04:00
8786c15221 [skip ci] Updated translations via Crowdin 2018-06-09 00:14:00 +00:00
512678a5a3 Move Screenshots to Bottom (#4128)
The 'above the fold' space is very important, it seems possibly wasted with screenshots which aren't legible without enlarging.

This is a proposal to move them down.
2018-06-08 20:13:41 -04:00
ed51aa9c92 improve backup document and add zh-cn backup document (#4145) 2018-06-08 19:47:51 -04:00
d41084c54a [skip ci] Updated translations via Crowdin 2018-06-08 18:10:06 +00:00
b5f61f1d15 Improve logging for e-mail and OpenID already in use errors (#4174) 2018-06-08 14:09:10 -04:00
3fbba2553a [skip ci] Updated translations via Crowdin 2018-06-08 01:24:38 +00:00
c9c5d164d5 Add myself as a maintainer (#4172) 2018-06-08 09:23:39 +08:00
a89d6253e0 Show only needed values in database configuration section depending on type (#4164) 2018-06-06 18:13:42 -05:00
e5fd43c231 [skip ci] Updated translations via Crowdin 2018-06-06 14:04:02 +00:00
83d956ce6b Fix typo (#4151)
Fix incorrect tmpl in oauth when we have a custom authorize url. The tmpl will append an additional character "v" every time we save the settings.
2018-06-06 22:02:37 +08:00
fa3ceb610d Fix link in HTTPS doc (#4135) 2018-06-05 17:36:15 +03:00
25b1a8099b [skip ci] Updated translations via Crowdin 2018-06-05 13:26:26 +00:00
1a6c97be9c update debian binary information (#4132) 2018-06-05 09:24:52 -04:00
2fcd9b69b7 [skip ci] Updated translations via Crowdin 2018-06-05 07:39:40 +00:00
1aee261aae More detailed documentation on how to set up from binary (#4121)
* More detailed documentation on how to set up from binary
Also change recommended file locations
2018-06-04 22:02:04 -04:00
6400d8a3cb 1.4.2 changelog (#4124) 2018-06-05 03:56:29 +03:00
0b718535b6 Add pronunciation to README.md (#4123) 2018-06-04 20:15:32 -04:00
b9be49cd96 Minor 'Installation with Docker' docs page fix (#4122) 2018-06-05 02:08:56 +03:00
809babb562 Update comparison.en-us.md with RhodeCode Community edition (#4112)
Added RhodeCode Community edition into comparison page
2018-06-04 15:01:35 -04:00
1bcabb8b1e Removed unnecessary line referencing LFS struct (#4113)
https://github.com/go-gitea/gitea/pull/4035#issuecomment-394286204

@ohwgiles points out that the config section should, in fact, still be in accordance with the "server" struct, which contains the "LFS" struct. I should just remove the line
```
sec = Cfg.Section("LFS")
```
2018-06-04 21:07:42 +03:00
d62bc3362b [skip ci] Updated translations via Crowdin 2018-06-04 05:35:46 +00:00
1f877f8c87 Add tag check to release draft creation (#3729) 2018-06-04 08:34:44 +03:00
fb1daad13d Add how-to for enabling HTTPS (#4101)
Signed-off-by: Jonas Franz <info@jonasfranz.de>
2018-06-03 09:55:23 +08:00
da466b0505 [skip ci] Updated translations via Crowdin 2018-06-03 01:15:41 +00:00
85b7fd1e61 Remove dupelicate link (#4100) 2018-06-03 09:14:37 +08:00
7893e5939a Update gitgraph.js to fix "Cannot read property color of undefined" (#4095)
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-06-02 18:54:40 +03:00
9a1772b0fa [skip ci] Updated translations via Crowdin 2018-06-02 15:21:24 +00:00
a5f63fc4d1 swagger: add 'required: true' for params in URL (#4097)
* Partial fix for #4010

Swagger validation needs 'required: true' for parameters that are in
the URL path.

Signed-off-by: Steve Traugott <stevegt@t7a.org>
2018-06-02 18:20:28 +03:00
b8c1dc55b4 [skip ci] Updated translations via Crowdin 2018-06-02 11:30:08 +00:00
28fb255d91 Add make command to validate swagger file (#4096)
Partial fix for #4088
2018-06-02 14:29:12 +03:00
0549762fd0 [skip ci] Updated translations via Crowdin 2018-06-01 05:52:46 +00:00
39f2aa7c12 add simple descriptions for file API responses (#4089)
* Partial fix for #4010

Swagger needs a description field in each swagger:operation response.  Adding
minimal text for now on the way to getting swagger validate to pass.  Many
standard swagger client libraries will not work with gitea until validate
passes, so prioritizing that over better descriptions for now.

Signed-off-by: Steve Traugott <stevegt@t7a.org>
2018-06-01 13:51:49 +08:00
7707ad7a0a add simple descriptions for swagger validate (#4087)
* Partial fix for #4010

Swagger needs a comment line above each swagger:response comment -- it
uses these to populate the description: fields.  Adding minimal text
for now on the way to getting swagger validate to pass.  Many standard
swagger client libraries will not work at all with gitea until validate
passes, so prioritizing that over better descriptions for now.

Signed-off-by: Steve Traugott <stevegt@t7a.org>
2018-05-31 19:13:55 +08:00
728cc27284 Update Contribution docs with non-404 link (#4077) 2018-05-30 18:06:57 -04:00
af05212bf8 [skip ci] Updated translations via Crowdin 2018-05-30 13:25:15 +00:00
35c3510335 Fix #4081 Check for leading / in base before removing it (#4082) 2018-05-30 21:23:43 +08:00
15f6ec9632 LFS: make HTTP auth period configurable (#4035)
* LFS: make HTTP auth period configurable

* Formatting: Removed semicolon

Due to automated fmt-check failure (drone.gitea.io)

* applying code reviews

* Applied code review comment: Change HTTPAuthExpiry to time.Duration

* Updated config cheat sheet
2018-05-29 16:07:16 +08:00
832ca509d3 Remove autolink.js references (#4072)
* Autolink.js no longer used

Fixes #4069

* Remove autolink.js references

* Fix reference to u2f js
2018-05-29 13:54:15 +08:00
2139c152cb Fix relative markdown links with anchors (#4058)
* Replace '%28' with '#'
Add test case

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

* Use ResolveReference instead of strings.Replace

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-05-28 23:51:42 -04:00
f86f56e19c Added deletion of an empty line at the end of the file (#4050) (#4054)
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-05-29 11:08:55 +08:00
9aa8fdc5d7 [skip ci] Updated translations via Crowdin 2018-05-29 00:26:42 +00:00
dc789ad7db Fix drone CLI install link (#4071)
Fixes #4070
2018-05-29 08:25:13 +08:00
5c95f7c7ce fix attachment ENABLED (#4064)
* fix attachment ENABLED

* change wrong name on app.ini.sample
2018-05-28 22:56:54 +08:00
fd274ffcd9 Fix wiki redirects (#3919)
When creating or editing a wiki page, the redirect to the wiki page does
not work because the file name is used instead of the page name.
2018-05-28 09:38:20 -04:00
0be2b34cec update git vendor (#4059) 2018-05-27 21:47:34 +03:00
b6604505e7 Update drone test instructions in CONTRIBUTING.md (#4055) 2018-05-27 13:01:02 -04:00
5095dfaed6 [skip ci] Updated translations via Crowdin 2018-05-27 10:49:19 +00:00
2986e942ee Mac OS X -> macOS (#4056) 2018-05-27 18:47:58 +08:00
2eabf18c9b add api section to config cheat sheet (#4037) 2018-05-24 16:36:45 -04:00
2a9799493a Make home.tmpl visible with Signin-View enabled (#4040)
Fix #3846
2018-05-24 15:51:28 -04:00
8ebd15e6a6 fix add a Ukrainian language (#4036) (#4042) 2018-05-24 15:35:46 -04:00
69e82c1761 [skip ci] Updated translations via Crowdin 2018-05-24 18:08:15 +00:00
3b35c6e47c add i18n section in config cheat sheet, reordered app.ini.sample (#4038)
* add i18n section in config cheat sheet, reordered app.ini.sample

* fix wrong default config
2018-05-24 14:07:02 -04:00
062111de3b [skip ci] Updated translations via Crowdin 2018-05-24 15:30:53 +00:00
e225b5c512 add a Ukrainian language (#4036) 2018-05-24 23:29:33 +08:00
81241b9380 [skip ci] Updated translations via Crowdin 2018-05-24 14:30:48 +00:00
3623f12a28 fix writer cannot read bare repo guide (#4033) 2018-05-24 22:28:53 +08:00
11da1e6146 [skip ci] Updated translations via Crowdin 2018-05-24 05:00:07 +00:00
cdb9478774 LDAP Public SSH Keys synchronization (#1844)
* Add LDAP Key Synchronization feature

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Add migration: add login source id column for public_key table

* Only update keys if needed

* Add function to only list pubkey synchronized from ldap

* Only list pub ssh keys synchronized from ldap. Do not sort strings as ExistsInSlice does it.

* Only get keys belonging to current login source id

* Set default login source id to 0

* Some minor cleanup. Add integration tests (updete dep testify)
2018-05-24 07:59:02 +03:00
b908ac9fab Added repository search ordered by stars or forks. Forks column in admin repo list. (#3969)
* Added repository search order by stars or forks.
Added Forks column to admin repository list.

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>

* Renamed search repo template

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2018-05-24 09:03:42 +08:00
ea2a938e8a [skip ci] Updated translations via Crowdin 2018-05-24 00:25:30 +00:00
48797e7199 Gitea with Caddy with sub-path documentation. (#4028)
Matches rest of headings
2018-05-24 08:24:04 +08:00
4ba9745cee [skip ci] Updated translations via Crowdin 2018-05-23 15:33:10 +00:00
b299d7bceb Add Environment Variables to Docker template (#4012)
* Add disable registration as an environment variable

for docker

* Add REQUIRE_SIGNIN_VIEW as env var to docker

* Add variables to template

* Update docker docs
2018-05-23 23:31:12 +08:00
60d95a0b85 fix bugs caused by #3929 (#3999) 2018-05-23 15:23:23 +08:00
71a8fe3e7c [skip ci] Updated translations via Crowdin 2018-05-23 06:13:29 +00:00
4ec8551490 fix webhook bug of response info is not displayed in UI (#4000) 2018-05-23 14:12:02 +08:00
a2f0c57584 [skip ci] Updated translations via Crowdin 2018-05-23 05:22:18 +00:00
416ded5f3e Add documentation for reverse proxies (#4022)
Fixes #3904
2018-05-23 13:21:17 +08:00
2c4b54dccc [skip ci] Updated translations via Crowdin 2018-05-22 23:10:02 +00:00
6f31911497 Add $GOPATH/bin to PATH for make releases (#4020)
Needed to access go tool gxz
2018-05-22 12:12:10 -04:00
45f3d4a719 [skip ci] Updated translations via Crowdin 2018-05-22 05:34:25 +00:00
dd3d78ffed Fix support channels (#4014)
Now matches navigation on Gitea website
2018-05-22 08:34:02 +03:00
b3a3024f03 doc: update LOCAL_ROOT_URL description for PROTOCOL = 'unix' case (#3760)
Update the sample configuration and config cheat sheet description for
the LOCAL_ROOT_URL configuration variable to mention the special case
required if PROTOCOL is set to 'unix'.

Fixes #3741.

Signed-off-by: Timothée Ravier <tim@siosm.fr>
2018-05-22 09:35:36 +08:00
d97bb9516c [skip ci] Updated translations via Crowdin 2018-05-21 23:10:17 +00:00
ee878e3951 Support secure cookie for csrf-token (#3839)
* dep: Update github.com/go-macaron/csrf

Update github.com/go-macaron/csrf with dep to revision 503617c6b372
to fix issue of csrf-token security.

This update includes following commits:
- Add support for the Cookie HttpOnly flag
- Support secure mode for csrf cookie

Signed-off-by: Aleksandr Bulyshchenko <A.Bulyshchenko@globallogic.com>

* routers: set csrf-token security depending on COOKIE_SECURE

Signed-off-by: Aleksandr Bulyshchenko <A.Bulyshchenko@globallogic.com>
2018-05-22 02:09:48 +03:00
31067c0a89 remove collaborative repositories from search on user profiles (#3996)
* remove collaborative repositories from search on user profiles

* rename 'My Repositories' to 'Repositories'
2018-05-21 23:07:34 +03:00
08c9617caa Provide compressed releases (#3991)
* Add release-compress to provide compressed releases

* check after compress
2018-05-21 14:50:39 -04:00
75982127c8 [doc] Update vendor tool section to dep (#4008) 2018-05-21 14:10:35 -04:00
b2bf1c9422 [skip ci] Updated translations via Crowdin 2018-05-21 17:24:25 +00:00
74e05e60ca Fix typo in U2F description (#4007) 2018-05-21 13:15:25 -04:00
d94472e89b fix #4003 (#4004)
Webhook and hook_task not cleaned up when delete repository
2018-05-21 21:30:30 +08:00
2690542adb [skip ci] Updated translations via Crowdin 2018-05-21 12:35:56 +00:00
3f3383dc0a Migrate to dep (#3972)
* Update makefile to use dep

* Migrate to dep

* Fix some deps

* Try to find a better version for golang.org/x/net

* Try to find a better version for golang.org/x/oauth2
2018-05-21 15:34:20 +03:00
d7fd9bf7bb [skip ci] Updated translations via Crowdin 2018-05-21 02:29:30 +00:00
6bdc556b7f Fix some webhooks bugs (#3981)
* fix some webhooks bugs

* update vendor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix test

* fix clearlabels

* fix pullrequest webhook bug fix #3492

* update release webhook description

* remove unused code

* fix push webhook in pull request

* small changes
2018-05-21 10:28:29 +08:00
dc0ef38950 [skip ci] Updated translations via Crowdin 2018-05-21 01:06:08 +00:00
1ef98a6eaa Added doc for 'IMPORT_LOCAL_PATHS' (#3997) 2018-05-21 09:04:41 +08:00
d7cf7393d4 [skip ci] Updated translations via Crowdin 2018-05-20 10:10:05 +00:00
edc78b9633 Update to last common x/text (#3994) 2018-05-20 18:09:00 +08:00
000b2d33a9 [skip ci] Updated translations via Crowdin 2018-05-20 06:10:47 +00:00
8dca5ad526 Fetch missing file in github.com/davecgh/go-spew/spew (#3995) 2018-05-20 09:09:35 +03:00
81b4d38f01 [skip ci] Updated translations via Crowdin 2018-05-19 14:58:24 +00:00
c7a4317231 Update TRANSLATORS (#3933)
* Update TRANSLATORS

* Update TRANSLATORS

* Update TRANSLATORS

* Move to correct position so that list stays in alphabetical order
2018-05-19 22:57:32 +08:00
01835a4206 [skip ci] Updated translations via Crowdin 2018-05-19 14:13:44 +00:00
951309f76a Add support for FIDO U2F (#3971)
* Add support for U2F

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

* Add vendor library
Add missing translations

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

* Minor improvements

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

* Add U2F support for Firefox, Chrome (Android) by introducing a custom JS library
Add U2F error handling

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

* Add U2F login page to OAuth

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

* Move U2F user settings to a separate file

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

* Add unit tests for u2f model
Renamed u2f table name

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

* Fix problems caused by refactoring

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

* Add U2F documentation

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

* Remove not needed console.log-s

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

* Add default values to app.ini.sample
Add FIDO U2F to comparison

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-05-19 17:12:37 +03:00
f933bcdfee [skip ci] Updated translations via Crowdin 2018-05-19 13:23:21 +00:00
44754774f1 Re-enable random avatar feature (#3988)
* reenable random avatar feature

* replace Size check by Filename check
2018-05-19 21:22:09 +08:00
917b9641ec Update to last common bleve (#3986) 2018-05-19 20:49:46 +08:00
1b7cd3d0b0 [skip ci] Updated translations via Crowdin 2018-05-19 01:03:22 +00:00
0857e289d5 fix links to prevent 404 after e.g. submitting a faulty form (#3982) 2018-05-18 21:02:04 -04:00
b574af27b8 [skip ci] Updated translations via Crowdin 2018-05-18 09:18:02 +00:00
0fa07ccf99 Added docs for configuring fail2ban (#3949) 2018-05-18 17:16:30 +08:00
2aabfc1afa Splitted the user settings code into several files to be more maintainable (#3968)
* refactor setting router code

splitted up one huge router settings file into the smaller files
representing the actual page structure

* move code to subfolder

* rename functions

* renamed files

* add copyright information
2018-05-17 12:05:00 +08:00
8f4d11af0b [skip ci] Updated translations via Crowdin 2018-05-17 01:36:23 +00:00
8176345c0e Add cli commands to regen hooks & keys (#3979)
* Add cli commands to regen hooks & keys

* make fmt

* Allow passing path to config as an option

* add docs
2018-05-17 09:35:07 +08:00
ecfc401eaa Allow Gitea to run as different USER in Docker (#3961)
* If using a different $USER then rename git user

* Chown based on $USER env

* Target only one part of passwd

* su-exec based on $USER

not a hardcoded value
2018-05-16 23:58:44 +08:00
4ceb92f311 [skip ci] Updated translations via Crowdin 2018-05-16 14:26:58 +00:00
80d1998981 add missing token validation and fix missing alert on application settings page (#3976) 2018-05-16 22:18:13 +08:00
d79829fc47 [skip ci] Updated translations via Crowdin 2018-05-16 14:03:37 +00:00
24941a1046 Add more webhooks support and refactor webhook templates directory (#3929)
* add more webhook support

* move hooks templates to standalone dir and add more webhooks ui

* fix tests

* update vendor checksum

* add more webhook support

* move hooks templates to standalone dir and add more webhooks ui

* fix tests

* update vendor checksum

* update vendor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* load attributes when created release

* update comparsion doc
2018-05-16 22:01:55 +08:00
188fe6c301 [skip ci] Updated translations via Crowdin 2018-05-15 14:16:11 +00:00
e45331d6d2 add user language value to hidden input to enable saving of profile without changing language (#3967) 2018-05-15 17:14:40 +03:00
d3dce01cf7 [skip ci] Updated translations via Crowdin 2018-05-15 10:08:59 +00:00
099372d76c Refactor User Settings (#3900)
* moved avatar to profile page

* combined password change, email and account deletion into account settings page

* combined totp, access tokens, linked accounts and openid into security settings page

* move access tokens to applications settings page

* small change to restart drone build

* fix change avatar url on profile page

* redirect old settings urls to new ones

* enforce only one autofocus attribute on settings pages

* set correct redirect status code

* fmt fix
2018-05-15 13:07:32 +03:00
1546458f7d issue-2768: added new option allow_only_external_registration (#3910) 2018-05-13 15:51:16 +08:00
e74055878f Update xormstore dependency to fix OAuth2 support for MySQL (#3955) 2018-05-13 13:10:50 +08:00
2c34ef5d97 [skip ci] Updated translations via Crowdin 2018-05-13 01:51:56 +00:00
f6828e0b66 Fix blank topic on explore repo list (#3956) 2018-05-13 09:50:39 +08:00
c14870c5ac fix blank topic (#3948) 2018-05-11 16:15:18 +08:00
bc8400747a [skip ci] Updated translations via Crowdin 2018-05-11 07:56:33 +00:00
ff3971b830 Add LDAP integration tests (#3897)
* Add LDAP service for tests

* Add LDAP login source and test user sign-in

* Add checks to test if user data is correct

* Add LDAP user sync test

* Add failed user sign-in test
2018-05-11 15:55:32 +08:00
aafb0ea1c6 Activating Open Collective (#3821)
* Added backers and sponsors on the README

* Added call to donate after npm install (optional)

* Remove npm changes

* Update readme to leave only needed sections
2018-05-11 13:53:23 +08:00
20acbdfe03 Remove another mention of matrix (#3947) 2018-05-11 13:18:34 +08:00
91b3615219 Adjust z-index for floating labels (#3939) 2018-05-11 11:28:26 +08:00
253a2d636b [skip ci] Updated translations via Crowdin 2018-05-11 02:32:27 +00:00
8c7e632a3d remove build tag information for redis and memcache (#3940) 2018-05-11 10:31:33 +08:00
e5f7f7dbc7 [skip ci] Updated translations via Crowdin 2018-05-11 01:44:55 +00:00
54c73bdaf0 Fix comments in config1 (#3946)
* Fix some comments in custom/conf/app.ini.sample

Some comments in app.ini.sample were very vague, didn't contain much information.
Some of them have been fixed, but mistakes that need to be fixed by an expert still remain, see #3928

Signed-off-by: Mikolaj Holysz <miki123211@gmail.com>

* Add an additional comment pointing to more documentation.

Add an additional comment to the top of the sample configuration file.
It contains a link pointing to gitea's docs and the configcheat sheet, which contains
some explanations about the parameters in the config.

Signed-off-by: Mikolaj Holysz <miki123211@gmail.com>
2018-05-11 09:43:46 +08:00
4dc43b37be [skip ci] Updated translations via Crowdin 2018-05-11 00:43:53 +00:00
87ebaa97ee Add documentation in regards to issues/pull request templates (#3942)
* Add documentation in regards to issues/pull request templates

Fixes #3491

* update per suggestion to use list
2018-05-11 08:42:22 +08:00
6be7387ffb Fix release tag on README (#3945) 2018-05-10 23:38:57 +03:00
15d0ac7ed4 [skip ci] Updated translations via Crowdin 2018-05-10 15:46:04 +00:00
14ff2f840e Discord is the official channel - update README (#3943)
Matrix (and IRC) bridge drop too many messages which frustrate new user.
Let's only promote the official communication tool.
2018-05-10 17:43:52 +02:00
4607e1ac3d [skip ci] Updated translations via Crowdin 2018-05-10 12:55:00 +00:00
2431fc71da update multiple assignes feature in comparison (#3938) 2018-05-10 20:53:32 +08:00
0e0036106f [skip ci] Updated translations via Crowdin 2018-05-10 08:33:20 +00:00
af62ec5cc0 Note about adding permisions to binary (#3936)
in regards to binding to lower ports than 1024
2018-05-10 16:32:01 +08:00
2efdb0907c [skip ci] Updated translations via Crowdin 2018-05-10 07:00:07 +00:00
32deee9e52 Fix #3828 (#3935) 2018-05-10 14:58:49 +08:00
abff697f31 Update less.js to latest version (#3932) 2018-05-10 13:36:47 +08:00
60424b7bad Fixed issue deadline not showing on issue page (#3930) 2018-05-10 07:05:12 +03:00
ce791454cb [skip ci] Updated translations via Crowdin 2018-05-10 01:19:03 +00:00
382e7276b8 Fix multiple asssingee table migration (#3931) 2018-05-10 09:18:01 +08:00
95f2e2b57b Multiple assignees (#3705) 2018-05-09 19:29:04 +03:00
238a997ec0 [skip ci] Updated translations via Crowdin 2018-05-09 14:54:02 +00:00
14f16d6c2e snap-packaging for gitea (#2568)
* Modify tbraeutigam/gogs-snap for gitea

* Fix building on 16.04 (manually build go-bindata).
-> add _source.tar.bz2 to .gitignore (used by snapcraft cleanbuild)

* Streamline Snap packaging:
 - Take advantage of install-hooks (snapd 2.27)
 - Use snapctl configuration storage for unchanging values

* Move to using Snap Hooks for configuration

* Missed re-adding daemon statement

* Fix two warnings from Codacy.
2018-05-09 22:52:51 +08:00
02ecc03d6d [skip ci] Updated translations via Crowdin 2018-05-09 09:58:04 +00:00
16b34448d4 Compare git services in docs page (#3911) 2018-05-09 12:57:02 +03:00
139ebf806e [skip ci] Updated translations via Crowdin 2018-05-08 12:42:15 +00:00
b11b3a7a7c Fix English translation grammar and consistency. (#3921) 2018-05-08 15:40:52 +03:00
bb8014885f [skip ci] Updated translations via Crowdin 2018-05-08 06:06:49 +00:00
ea01decb6b fix wrong issue endpoints in swagger doc (#3914) 2018-05-08 14:05:18 +08:00
773530c917 [skip ci] Updated translations via Crowdin 2018-05-07 18:46:25 +00:00
9ae445c28f lock npm packages (#3912) 2018-05-07 21:46:04 +03:00
0b718e0d7b feat: testing in go 1.10 version. (#3899) 2018-05-07 22:49:57 +08:00
eec2179e73 [skip ci] Updated translations via Crowdin 2018-05-07 09:52:15 +00:00
73370b8cf7 consistent IsOverdue field name capitalization (#3909)
Milestone.IsOverDue vs Issue.IsOverdue, the former was also causing the
milestone list page template to fail to render if any milestones have a
due date assigned.

Signed-off-by: Travis J Parker <travis.parker@gmail.com>
2018-05-07 12:50:27 +03:00
e6b0a2db62 [skip ci] Updated translations via Crowdin 2018-05-07 05:09:51 +00:00
3a6f3c8c11 Fix code tab link when viewing tags (#3908)
Signed-off-by: Ambrose Chua <ambrose@chua.family>
2018-05-07 13:08:35 +08:00
04889b7ae5 [skip ci] Updated translations via Crowdin 2018-05-06 21:27:36 +00:00
c6a881e71b Fix placeholder of due date form (#3906) 2018-05-07 00:26:40 +03:00
8685b315a2 [skip ci] Updated translations via Crowdin 2018-05-05 14:31:50 +00:00
501fb228e6 Add option to use paged LDAP search when synchronizing users (#3895) 2018-05-05 17:30:47 +03:00
7467ff3d94 [skip ci] Updated translations via Crowdin 2018-05-05 00:29:34 +00:00
1fdf560678 Added user language setting (#3875)
* Added user language setting

* Added translation string for setting

* Fixed import order + typo

* improved checking if the user has a language saved in the db

* The current saved language is now set a default inside the dropdown

* fmt

* When a user signs in and doesn't have a language saved, the current browser language is saved

* updated gitea-sdk

* Merge branch 'master' of https://github.com/go-gitea/gitea into save-user-language

# Conflicts:
#	models/migrations/migrations.go
#	models/migrations/v62.go

* Made tests work again

* trigger CI

* trigger CI

* fmt

* re-trigger that FUCKING CI SO IT REALLY PICKS UP THE LATEST COMMIT ISTEAD OF PREDENDING TO DO SO

* re-trigger that FUCKING CI SO IT REALLY PICKS UP THE LATEST COMMIT ISTEAD OF PREDENDING TO DO SO

* When loggin in, only the language col gets updated instead of everything
2018-05-05 08:28:30 +08:00
795dcc8ecf [skip ci] Updated translations via Crowdin 2018-05-04 13:24:58 +00:00
5f4cff6159 Release 1.4.x changelog (#3894) 2018-05-04 21:23:39 +08:00
1e1ece8f3d Do not allow to reuse TOTP passcode (#3878) 2018-05-02 18:02:02 +03:00
c58e1e437b test: reduce testing time. (#3885) 2018-05-02 21:56:19 +08:00
0ca359cdb4 [skip ci] Updated translations via Crowdin 2018-05-02 13:24:19 +00:00
b66d6b3449 Do not allow inactive users to access repositories using private keys (#3887) 2018-05-02 16:22:56 +03:00
9495429982 Add "error" as reserved username (#3882) 2018-05-02 11:06:31 +03:00
954e69f66d [skip ci] Updated translations via Crowdin 2018-05-02 06:11:27 +00:00
5ffdf9388b Fix to use only needed columns from tables to get repository git paths (#3870) 2018-05-02 09:10:19 +03:00
9ec7f6b954 pass secrets to drone build step for docker (#3879) 2018-05-02 00:33:49 +03:00
a98add1974 [skip ci] Updated translations via Crowdin 2018-05-01 19:05:52 +00:00
1a97030017 Issue due date (#3794)
* Started adding deadline to ui

* Implemented basic issue due date managing

* Improved UI for due date managing

* Added at least write access to the repo in order to modify issue due dates

* Ui improvements

* Added issue comments creation when adding/modifying/removing a due date

* Show due date in issue list

* Added api support for issue due dates

* Fixed lint suggestions

* Added deadline to sdk

* Updated css

* Added support for adding/modifiying deadlines for pull requests via api

* Fixed comments not created when updating or removing a deadline

* update sdk (will do properly once go-gitea/go-sdk#103 is merged)

* enhanced updateIssueDeadline

* Removed unnessecary Issue.DeadlineString

* UI improvements

* Small improvments to comment creation
+ ui & validation improvements

* Check if an issue is overdue is now a seperate function

* Updated go-sdk with govendor as it was merged

* Simplified isOverdue method

* removed unessecary deadline to 0 set

* Update swagger definitions

* Added missing return

* Added an explanary comment

* Improved updateIssueDeadline method so it'll only update `deadline_unix`

* Small changes and improvements
* no need to explicitly load the issue when updating a deadline, just use whats already there
* small optimisations

* Added check if a deadline was modified before updating it

* Moved comment creating logic into its own function

* Code cleanup for creating deadline comment

* locale improvement

* When modifying a deadline, the old deadline is saved with the comment

* small improvments to xorm session handling when updating an issue deadline
+ style nitpicks

* style nitpicks

* Moved checking for if the user has write acces to middleware
2018-05-01 22:05:28 +03:00
85d14cc229 Symlink icons (#1416) (#3826)
* Updated vendor code for code.gitea.io/git

* Display symlinks correctly for files and directories

* Added symlink tests

* Applied silverwinds stylesheet patch

Signed-off-by: Tris Forster <tris.git@shoddynet.org>
2018-05-01 10:04:36 +03:00
1928920a08 [skip ci] Updated translations via Crowdin 2018-05-01 01:46:31 +00:00
181b3a8f09 Fix path cleanup in multiple places (#3871) 2018-05-01 09:46:04 +08:00
fff022ef8a [skip ci] Updated translations via Crowdin 2018-04-30 17:55:00 +00:00
3e578b5d29 Fix docs site index page (#3868) 2018-04-30 20:54:38 +03:00
ca4a84a2d6 chore: simplify docker build process. (#2827)
* chore: simplify docker build process.

* chore: update docker plugin.
2018-04-30 03:47:39 +02:00
ff64f188fd Switch back to upstream goth repository and update govendor to latest goth version (#3863) 2018-04-30 09:05:59 +08:00
6f62d4f180 [skip ci] Updated translations via Crowdin 2018-04-29 19:36:12 +00:00
fb8535e305 Make Generate New Token panel shown by default (#3832)
This is mostly a 'feel' change. The behaviour that is currently on the
access tokens pages is, as far as I know, not present in any other parts
of the frontend, and there's no real good reason to keep the 'Generate
New Token' panel hidden by default in my opinion.
2018-04-29 22:34:59 +03:00
7ea4bfc561 API endpoint for testing webhook (#3550)
* API endpoint for testing webhook

* Empty commit to rerun CI
2018-04-29 14:21:33 +08:00
5a62eb30df Store OAuth2 session data in database (#3660)
* Store OAuth2 session data in database

* Rename table to `oauth2_session` and do not skip xormstorage initialization error
2018-04-29 09:09:24 +03:00
8d5f58d834 Shows total tracked time in issue and milestone list (#3341)
* Show total tracked time in issue and milestone list
Show total tracked time at issue page

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

* Optimizing TotalTimes by using SumInt

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

* Fixing wrong total times for milestones caused by a missing JOIN
Adding unit tests for total times

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

* Logging error instead of ignoring it

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

* Correcting spelling mistakes

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

* Change error message to a short version

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

* Add error handling to TotalTimes
Add variable for totalTimes

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

* Introduce TotalTrackedTimes as variable of issue
Load TotalTrackedTimes by loading attributes of IssueList
Load TotalTrackedTimes by loading attributes of single issue
Add Sec2Time as helper to use it in templates

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

* Fixed test + gofmt

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

* Load TotalTrackedTimes via MilestoneList instead of single requests

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

* Add documentation for MilestoneList

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

* Add documentation for MilestoneList

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

* Fix test

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

* Change comment from SQL query to description

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

* Fix unit test by using int64 instead of int

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

* Fix unit test by using int64 instead of int

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

* Check if timetracker is enabled

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

* Fix test by enabling timetracking

Signed-off-by: Jonas Franz <info@jonasfranz.de>
2018-04-29 13:58:47 +08:00
e3028d124f don't reset team/repo count when updating team via API (#3831)
fixes #3600
2018-04-29 13:22:57 +08:00
fc36567ee1 Update blackfriday dependency per #2994 (#3857)
Signed-off-by: PJ Eby <pje@telecommunity.com>
2018-04-29 13:07:36 +08:00
76106ab080 [skip ci] Updated translations via Crowdin 2018-04-29 04:48:36 +00:00
fd8d6405c8 Fix only updated_unix when adding a comment (#3855) 2018-04-29 12:48:14 +08:00
c3f2b8803f [skip ci] Updated translations via Crowdin 2018-04-28 20:46:38 +00:00
5424f75a63 Fix building of docs with latest hugo version (#3856) 2018-04-28 23:46:05 +03:00
fb2f8dcf3c [skip ci] Updated translations via Crowdin 2018-04-23 05:56:09 +00:00
320c9817bc Don't force due date to current time (#3830)
Fixes #3827
2018-04-23 13:55:03 +08:00
bae26421aa [skip ci] Updated translations via Crowdin 2018-04-21 01:23:11 +00:00
48b19a5d14 Explanation for missing releases (#3823)
Searched for missing releases/tags for some time, thought the solution might be helpful to others
2018-04-21 09:22:02 +08:00
725835b5b1 [skip ci] Updated translations via Crowdin 2018-04-20 09:15:19 +00:00
3506717e9c Add swagger check (#3811) 2018-04-20 17:13:50 +08:00
cf8c2e5951 [skip ci] Updated translations via Crowdin 2018-04-20 00:26:45 +00:00
f6013d5098 Some small template fixes (#3820) 2018-04-20 08:25:15 +08:00
bac6d05e78 Improve English grammar and consistency. (#3614)
* Start improving English grammar and consistency.

* Apply review comments, push translation further.

* Additional review changes; expand translation.

* Undo team/organization change, further translation.

* Add site administration; review comments; merge.

* Update hardcoded branch protection string tests.

* Update hardcoded branch deletion string test.

* Update another hardcoded translation string test.

* Add my nickname to the list of translators.

* Implement @lafriks review comments.

* Remove (now) unused branch deletion warnings.

* Remove (now) unused branch deletion warnings.
2018-04-19 17:24:31 +03:00
1d82e775cc [skip ci] Updated translations via Crowdin 2018-04-19 12:31:42 +00:00
7cc96de6cf Fix for UI broke when a repo is starred & watched (#3630) (#3810) 2018-04-19 20:30:11 +08:00
a0ea370c8c [skip ci] Updated translations via Crowdin 2018-04-19 01:10:26 +00:00
f86af9c280 Mention the possibility of resetting the password for new accounts (#3812)
This solves the problem of administrators creating accounts for users
that then do not know their initial password (without the administrator
sending it to them via some other channel).
2018-04-19 09:08:51 +08:00
66d3c541a0 [skip ci] Updated translations via Crowdin 2018-04-17 09:11:59 +00:00
071ca771fd Add opencollective badges on READMEs (#3808) 2018-04-17 17:10:34 +08:00
9add96a872 [skip ci] Updated translations via Crowdin 2018-04-17 00:57:59 +00:00
9f7c4d92c9 Added explanation for docker environment variables to docs (#3804) 2018-04-17 08:56:28 +08:00
b84e165ab4 [skip ci] Updated translations via Crowdin 2018-04-16 05:28:09 +00:00
5ba4ba3957 Fixed 0 closed issues not show 50% closed on activty page (#3802)
Fixes #3656. Also adds a light grey bar when there are both 0 merged
prs/closed issues and 0 open prs/issues.
2018-04-16 08:26:53 +03:00
804bc0aa2f [skip ci] Updated translations via Crowdin 2018-04-16 04:05:22 +00:00
775d487557 Removes extra space from the body and footer to prevent scrolling on a page that fits into the viewport (#3792)
Signed-off-by: Liam Cottam <killtheidols@hotmail.co.uk>
2018-04-16 07:04:36 +03:00
bec69f702b Add topic support (#3711)
* 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
2018-04-11 10:51:44 +08:00
1946ce2954 [skip ci] Updated translations via Crowdin 2018-04-10 12:40:23 +00:00
f321980a32 Fix typo in deleteUser (#3781)
num_watches was used where num_stars should have been used.
2018-04-10 20:39:01 +08:00
38a9cda4bb Remove unnecessary Safe tags (#3778) 2018-04-10 06:43:37 +03:00
8ee45eb614 Add EnableTimetracking option to app settings (#3719) 2018-04-09 23:15:32 +08:00
30c81a126c fix: show Clipboard button if disable HTTP of git protocol (#3773) 2018-04-09 22:49:59 +08:00
daf70d3a4e Use the active branch for the code tab (#3720) 2018-04-09 13:34:19 +03:00
1610296f54 Modify pagination. (#3766)
I wanted navigation to the page "first" and the page
"last" of the pages of commits. I discovered this
has already been implemented in one of the templates.

Signed-off-by: Tan Pheng Heong <phtan90@gmail.com>
2018-04-08 08:54:21 +08:00
7000b41851 [skip ci] Updated translations via Crowdin 2018-04-04 21:09:19 +00:00
ed4935e696 Clarify purpose of ROOT_URL (#3759) 2018-04-05 00:08:55 +03:00
5512ed3699 [skip ci] Updated translations via Crowdin 2018-04-04 12:01:02 +00:00
6b6c414bc3 Enhance healthcheck for database connectivity (#3754)
Modify the call to ping the database to fail gracefully if the
database has not yet been configured by the end user, such as
after a clean install. This allows /healthcheck to return a 200
with a modified status message instead of causing a PANIC.

Signed-off-by: Evan Sherwood <evan@sherwood.io>
2018-04-04 17:34:27 +08:00
3e06490d38 Add Size column to attachment (#3734)
* Add size column to attachment
Migrate attachments by calculating file sizes

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

* Calculate attachment size on creation

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

* Log error instead of returning error

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-31 09:10:44 +08:00
d877bf7e15 Add config option to enable or disable log executed SQL (#3726)
* add config option to enable or disable log executed SQL

* rename ShowSQL to LogSQL
2018-03-30 22:49:46 +08:00
45d1fc03cb fix go vet error (#3740) 2018-03-30 07:21:27 +08:00
36ea53332d [skip ci] Updated translations via Crowdin 2018-03-29 13:34:02 +00:00
1c5cbc390b refactor: import order. (#3736) 2018-03-29 21:32:40 +08:00
a8beef890d [skip ci] Updated translations via Crowdin 2018-03-29 01:41:06 +00:00
ab5cc6f3a9 Correctly check http git access rights for reverse proxy authorized users (#3721) 2018-03-29 09:39:51 +08:00
4c6e170ceb [skip ci] Updated translations via Crowdin 2018-03-27 14:14:57 +00:00
15c6bb500b Add repository setting to enable/disable health checks (#3607)
New Feature:
  * Repository struct field for IsFsckEnabled (default true of course)
  * Admin Settings section on repo options page, accessible only by
    admin users

Possible Enhancements:
  * There's no way to force running health checks on all repos
    regardless of their IsFsckEnabled setting. This would be useful if
    there were an admin API or dashboard button to run fsck immediately.

Issue: https://github.com/go-gitea/gitea/issues/1712
Signed-off-by: Allen Wild <allenwild93@gmail.com>
2018-03-27 22:13:20 +08:00
321cc2a3d0 Set default branchname on first push (#3715) 2018-03-25 21:00:07 +08:00
cb87f29b76 Update certificates to enable self-signed certs (#3708)
Why:

* We are using self-signed ssl certificates for internal services, which results in failures when gitea tries to communicate through webhooks with these. We would like to enable gitea to be able to use these certificates without having to build custom docker images.

How

* We add the internal certificates to /usr/local/share/ca-certificates on the host
* We read-only mount /usr/local/share/ca-certificates from the host to /usr/local/share/ca-certificates in the container 
* We do a update-ca-certificates in the alpine container before starting gitea

This should have no consequence for users that do not have the need to handle self-signed certificates, as update-ca-certificates should be idempotent.
2018-03-25 13:47:06 +03:00
9350ba7947 Add protected branch whitelists for merging (#3689)
* Add database migrations for merge whitelist

* Add merge whitelist settings for protected branches

* Add checks for merge whitelists
2018-03-25 13:01:32 +03:00
04b7fd87b9 [skip ci] Updated translations via Crowdin 2018-03-23 14:12:13 +00:00
2dc6f15eca Don't warn users about *every* dirty form (#3707)
The choice regarding which forms should or should not trigger a warning
is subjective. I tried to be consistent and not warn about forms that:
 - run an action, rather than edit data: search, send an email.
 - delete data: a warning about losing data would be confusing

Note that forms on sign-in pages were already ignored (using a selector,
rather than an explicit class on the form element).

Fixes #3698.
2018-03-23 22:10:42 +08:00
e64aa18dc9 Change protected branch settings title to existing locale entry (#3694) 2018-03-21 20:12:49 +02:00
05abd03011 [skip ci] Updated translations via Crowdin 2018-03-20 21:40:24 +00:00
4ebdcbc5df Fix style of "In your repositories" when selected (#3699)
Signed-off-by: Alex Ward <alxwrd@googlemail.com>
2018-03-20 23:39:14 +02:00
43fc430c07 Improve release page UI (#3693)
* Improve release page ui by adding size

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

* Add documentation to a.MustSize()

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-19 18:06:00 +02:00
47422c2635 [skip ci] Updated translations via Crowdin 2018-03-19 14:30:44 +00:00
59e70c5ee9 Escape branch name in dropdown menu (#3691)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-19 22:29:16 +08:00
c28bf94252 [skip ci] Updated translations via Crowdin 2018-03-18 01:33:53 +00:00
88aef6eea9 Codesearch message fix (#3684) 2018-03-18 03:32:36 +02:00
86bf3704ea [skip ci] Updated translations via Crowdin 2018-03-17 03:55:24 +00:00
3da0e3c404 Add myself to MAINTAINERS (#3680)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-16 21:49:03 +02:00
1324d62cd3 [skip ci] Updated translations via Crowdin 2018-03-16 14:05:58 +00:00
9e5d0a09eb Global code search support (#3664)
* add global code search on explore

* fix bug when no anyone public repos

* change the icon

* fix typo and add UnitTypeCode check for login non-admin user

* fix ui description when no match
2018-03-16 22:04:33 +08:00
4163cdf3ea [skip ci] Updated translations via Crowdin 2018-03-15 21:14:38 +00:00
7b2b900e13 Refactor and simplify redirect to url (#3674) 2018-03-15 22:13:34 +01:00
a2a49c93c7 Added checks for protected branches in pull requests (#3544)
* Added checks for protected branches in pull requests

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Moved check for protected branch into new function CheckUserAllowedToMerge

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Removed merge conflict lines from last commit

Signed-off-by: Christian Wulff <NChris@posteo.net>

* Explicit check for error type in ViewIssue

Signed-off-by: Christian Wulff <NChris@posteo.net>
2018-03-13 11:46:14 +08:00
c0d41b1b77 Add label descriptions (#3662)
* Add label descriptions

* Add default descriptions to label template
2018-03-13 10:03:55 +08:00
ad33730dca Update markbates/goth libary to fix OAuth2 support (#3661) 2018-03-13 01:35:46 +02:00
575c109a02 [skip ci] Updated translations via Crowdin 2018-03-12 10:00:16 +00:00
0e26db8bcd Docker multi-stage (#2927)
* Setup docker multi-stage and little sugar at it

* Make codacy happy ?

* Revert back to what the official docker documentation suggest

Codacy don't seems to follow https://docs.docker.com/engine/reference/builder/#maintainer-deprecated

* Update golang version
2018-03-12 11:59:13 +02:00
b333e7129d Add separate string for the 'Create Team' button. (#3647)
* Add separate string for the 'Create Team' button.

* Add separate string for the 'Create Team' button.
2018-03-09 19:37:24 +02:00
f0aee3c467 [skip ci] Updated translations via Crowdin 2018-03-09 01:22:23 +00:00
de8a091767 Fix MySQL and PostgreSQL column drop SQL (#3649) 2018-03-09 09:20:57 +08:00
1a83581121 Added issue search via api (#3612)
* Started implementing issue api search

* Implemented issue search via api

* Added search to swagger.json

* Removed todo

* fmt

* Added comment to generate swagger json via "generate-swagger"

* Simplified search

* fmt

* Removed unessecary comment

* Removed unessecary declaration of the issues-variable

* Removed unessecary comment

* Removed unessecary comment

* Added explanation keyword

* Simplified check for empty keyword

* corrected check if keyword is empty
2018-03-07 12:00:56 +02:00
d71f510c62 [skip ci] Updated translations via Crowdin 2018-03-07 06:45:23 +00:00
dc4afef07f Fix column removal in MSSQL (#3638)
* Fix column removal in MSSQL

* Use xorm session in MSSQL drop column operations

* Add transaction as MSSQL alter table is transactional
2018-03-07 14:44:12 +08:00
4009c245a3 Make columns in split view of the same width (#3619)
as well as fix indentation and add 1px border to line counter of the new
code on the right.
2018-03-07 00:44:45 +02:00
9fc418a652 Add string to confirm wiki data erasure (#3629)
* Add a string to confirm wiki data erasure.

* Add a string to confirm wiki data erasure.
2018-03-06 15:25:21 +08:00
9a5e628a7e Add Attachment API (#3478)
* Add Attachment API
* repos/:owner/:repo/releases (add attachments)
* repos/:owner/:repo/releases/:id (add attachments)
* repos/:owner/:repo/releases/:id/attachments
* repos/:owner/:repo/releases/:id/attachments/:attachment_id

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

* Add unit tests for new attachment functions
Fix comments

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

* fix lint

* Update vendor.json

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

* remove version of sdk

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

* Fix unit tests
Add missing license header

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

* Add CreateReleaseAttachment
Add EditReleaseAttachment
Add DeleteReleaseAttachment

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

* Add filename query parameter for choosing another name for an attachment

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

* Fix order of imports

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

* Restricting updatable attachment columns

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

* gofmt

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

* Update go-sdk
Replace Attachments with Assets

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

* Update go-sdk

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

* Updating go-sdk and regenerating swagger

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

* Add missing file of go-sdk

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

* Change origin of code.gitea.io/sdk to code.gitea.io/sdk
Update code.gitea.io/sdk

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

* Update swagger

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

* Update updateAttachment
2018-03-06 09:22:16 +08:00
69ea5e4385 Fix wiki inter-links with cases and add tests for this case (#3560) 2018-03-05 20:39:12 +02:00
171914e9a7 Log attachment blocked events (#3615)
Include both a log entry and the blocked mime type in the gitea log when
an attachment upload is blocked.

Chosen log level is info; this may need to be dialed down to trace.
2018-03-05 08:51:10 +08:00
19d5192e8c Use Segoe UI for Latin characters before falling back to YaHei (#3616)
* Use Segoe UI for Latin characters before falling back to YaHei

This fixes issues with character rendering on hidpi displays and other
aliasing/hinting issues, as Segoe UI has been painstakingly hinted by
typographers for Microsoft while YaHei has not. See #3237 for more
details.

Closes #3237

* Include transformed LESS -> CSS in commit
2018-03-04 14:47:46 +08:00
7ea7c57406 [skip ci] Updated translations via Crowdin 2018-03-04 02:46:24 +00:00
b730498f02 Don't write to log NoCommitterAccount (#3621)
* Don't write to log NoCommitterAccount

It's way too verbose, and the information is also printed to the user
already. Fixes #3602.

* ignore err only if it's a ErrUserNotExist

* Replace with IsErrUserNotExist
2018-03-04 10:45:01 +08:00
78b54b49fa fix: Add feed for organization (#3594)
* feat: Add feed for organization

* fix: testing

* fix: testing

* fix: testing

* fix: testing
2018-03-03 13:21:16 +08:00
990709da8f [skip ci] Updated translations via Crowdin 2018-03-02 20:32:20 +00:00
595da53d3c Fix incorrect 'Erase Wiki Data' string identifier. (#3613) 2018-03-02 22:31:15 +02:00
f44c31f869 [skip ci] Updated translations via Crowdin 2018-03-02 09:11:11 +00:00
8606d9f5bc Add admin dashboard option to run health checks (#3606)
There's one for git gc, why not git fsck too?

Also add a couple more trace logs to GitFsck to see progress
2018-03-02 11:09:43 +02:00
2cd3622ddc [skip ci] Updated translations via Crowdin 2018-02-27 07:10:26 +00:00
535445c32e Rework special link parsing in the post-processing of markup (#3354)
* Get rid of autolink

* autolink in markdown

* Replace email addresses with mailto links

* better handling of links

* Remove autolink.js from footer

* Refactor entire html.go

* fix some bugs

* Make tests green, move what we can to html_internal_test, various other changes to processor logic

* Make markdown tests work again

This is just a description to allow me to force push in order to restart
the drone build.

* Fix failing markdown tests in routers/api/v1/misc

* Add license headers, log errors, future-proof <body>

* fix formatting
2018-02-27 09:09:18 +02:00
769ab1e424 fix gpg expired bug when time is zero (#3584) 2018-02-26 12:25:45 +02:00
521945a2d2 Fix missing translations when updating username. (#3564)
* Fix missing translations when updating username.

* Fix reserved username translated string test.

* Fix 'username reserved' string test a bit more.
2018-02-25 15:56:25 +02:00
fc265b036f feat: Add branch link in branch list. (#3576) 2018-02-24 23:17:59 +02:00
d2d0aea8a1 Fix the protected branch panic issue (#3567) 2018-02-23 18:10:03 +08:00
2d1c5c3756 Fix remove team member issue (#3566)
Put sess.Commit() out of the RemoveOrgUser function

Add an empty line to separate import packages
2018-02-23 16:42:02 +08:00
19bf4ddf80 Fix query protected branch bug (#3563)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>
2018-02-22 20:14:15 -06:00
845ba9d153 fix: if Mirrors repo no content is fetched, updated time should not b… (#3551)
* fix: if Mirrors repo no content is fetched, updated time should not be changed

* fix: sync update time from mirror repo.

* fix: one single session.

* update comment.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2018-02-22 18:27:09 -06:00
e7cea92535 Update gogs to gitea migration manual (#3559)
Updates the manual for latest gogs changes.
2018-02-22 20:55:26 +08:00
04b3e8cbdc refactor: reduce sql query in retrieveFeeds (#3547) 2018-02-21 18:55:34 +08:00
d27d720f05 Use unique temp dirs in unit tests (#3494)
* Use unique temp dirs in unit tests

* Remove temp dirs after tests run

* os.RemoveAll -> removeAllWithRetry
2018-02-21 01:38:52 -06:00
2f5c1ba1db Bug fix for repo releases sorted (#3522)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>

Use TimeStampNow function
2018-02-21 09:38:03 +08:00
7b104f0cd0 Populate URL field of API commits (#3546)
* Populate URL field of API commits

* fix orgmode_test
2018-02-20 20:50:42 +08:00
7b297808ce Update markbates/goth library (#3533)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-19 07:10:51 +02:00
6f751409b4 Document generate commands (#3532)
* Document generate commands

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>

* Fix examples and grammar

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-18 21:23:41 -06:00
58893384e8 Add issue closed time column to fix activity closed issues list (#3537)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-19 10:39:26 +08:00
fb2c176491 [skip ci] Updated translations via Crowdin 2018-02-18 21:20:48 +00:00
3a9c698821 Force remove test repo root path in case previous test is still locking it (#3528)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-18 23:19:40 +02:00
ae30315a62 Fix escaping changed title in comments (#3530)
* Fix escaping changed title in comments

* Fix escaping of wiki page titile

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-18 22:06:37 +02:00
96c268c0fc Implements generator cli for secrets (#3531)
Signed-off-by: Codruț Constantin Gușoi <codrut.gusoi@gmail.com>
2018-02-18 20:14:37 +02:00
e59fe7c8d9 [skip ci] Updated translations via Crowdin 2018-02-18 14:39:52 +00:00
02bc92a5c9 Fix app.ini sample file link in docs (#3529)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2018-02-18 22:38:50 +08:00
b29c358315 [skip ci] Updated translations via Crowdin 2018-02-16 14:03:54 +00:00
9303fc2015 Fix ellipses, 'a[n]' and 'username' (issue #3512). (#3518) 2018-02-16 08:02:40 -06:00
4b48a45bac [skip ci] Updated translations via Crowdin 2018-02-16 01:57:33 +00:00
869d73a25c Add info from #2286, minor fixes to YAML indentation (#3338)
* Add info from #2286, minor fixes to YAML indentation

* Add space to make YAML valid again
2018-02-15 19:56:10 -06:00
b104ab3ca1 Add option to enable or disable swagger endpoints (#3502) 2018-02-14 06:46:00 +02:00
4c9d9c221a Improve wiki test (#3493) 2018-02-13 11:19:49 +02:00
e87c063c90 Add missing licenses (#3497)
Signed-off-by:  Jonas Franz <info@jonasfranz.de>
2018-02-13 07:10:40 +02:00
fbdc00f464 Updating generate-licenses.go to fetch licenses from maintained repository. (#3484)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-02-12 20:20:30 +02:00
2cb4649acf Escape search query (#3486)
Signed-off-by: Jonas Franz <info@jonasfranz.de>
2018-02-11 15:42:28 +02:00
6eaeb01ecf Update code.gitea.io/git (#3482) 2018-02-10 20:19:26 +02:00
58771acacb Add EUPL v1.2 as license (Fixes go-gitea/gitea#3439) (#3475)
Signed-off-by: Jonas Franz <info@jonasfranz.de>
2018-02-09 15:11:19 +02:00
011f128c89 Fixes missing avatars in offline mode (#3471)
Signed-off-by: Codruț Constantin Gușoi <codrut.gusoi@gmail.com>
2018-02-08 16:43:08 +01:00
9720f90905 Docs: Fix broken markdown with unescaped character (#3470) 2018-02-07 21:29:42 -06:00
be825aaa88 Clarify Indexer MAX_FILE_SIZE (#3469) 2018-02-07 20:10:36 -06:00
ffd0062438 Fix checklist padding (#3460)
* Changed style of checklist in issuelist.

* Adjusted padding for progressbar, updated index.css.

* Fixed another wrong tab to spaces.

Signed-off-by: modmew8 <modmew8@gmail.com>
2018-02-06 12:22:31 +02:00
a2648281a0 Improvements to git integration test (#3466) 2018-02-06 11:27:24 +02:00
a89592d4ab Reduce repo indexer disk usage (#3452) 2018-02-05 20:29:17 +02:00
283e87d814 Fix rendering of wiki page list if wiki repo contains other files (#3454)
* Fix rendering of wiki page list if wiki repo contains other files

* Improve wiki filename tests
2018-02-05 16:56:30 +02:00
b16c84de7b Fix synchronization bug in repo indexer (#3455) 2018-02-05 10:39:51 +02:00
17655cdf1b Enable caching on assets and avatars (#3376)
* Enable caching on assets and avatars

Fixes #3323

* Only set avatar in user BeforeUpdate when there is no avatar set

* add error checking after stat

* gofmt

* Change cache time for avatars to an hour
2018-02-04 00:37:05 +02:00
77f8bad2fb Update hard-coded version to 1.5.0-dev (#3450)
Now that 1.4.0 is out the new target is 1.5.0

(See #2390 and #2988 for more context if needed)
2018-02-03 17:03:43 +02:00
e9e2a9cdcc Allow square brackets in external issue patterns (#3408)
* Allow square brackets in external issue patterns

* Added false test cases for checklist elements
2018-02-03 11:51:02 +02:00
e08b3a592e Emoji Autocomplete (#3433)
* Implemented emoji autocomplete.

* Changed emoji access url.

* Reverted vendor css to default, moved all style changes to _tribute.less

* Made no-results overwriteable, added missing autocomplete to edit issue field.

Signed-off-by: modmew8 <modmew8@gmail.com>
2018-02-03 10:09:35 +02:00
b62ce2e246 [skip ci] Updated translations via Crowdin 2018-01-31 15:41:59 +00:00
10171b7e2f add changelog for 1.4.0 (#3435)
* add changelog for 1.4.0

* remove docs

* Remove some more noise

* Small reorganization, removed bugfixes that were not present in last stable version

* Move LFS lock to features, add just merged bugfix info
2018-01-31 17:40:57 +02:00
f9a5cc4d8e Use correct transaltion key for delete email button (#3422) 2018-01-31 00:31:06 +02:00
b3fd94c13d Add sensitive headers (#3429)
* Add HeaderWithSensitiveCase methods to respect casing

* Update webhook.go
2018-01-31 00:09:16 +02:00
d09704e903 [skip ci] Updated translations via Crowdin 2018-01-30 12:30:54 +00:00
ca4f5c37e6 Fix branch deletion for squash or rebase merged pull requests (#3425) 2018-01-30 14:29:39 +02:00
5911f98392 [skip ci] Updated translations via Crowdin 2018-01-29 17:50:28 +00:00
aef30071c9 Fix go-get content type (#3426) 2018-01-29 19:50:04 +02:00
7af81973cb [skip ci] Updated translations via Crowdin 2018-01-29 11:15:41 +00:00
46c7fe371d Fix PR merge error (#3421) 2018-01-29 12:18:20 +02:00
28b81899d0 Add doctype to go-get=1 reponse (#3423) 2018-01-29 03:12:04 +02:00
3968c1149e Fix SQL type error for webhooks (#3424) 2018-01-29 02:26:01 +02:00
e189b06baa Add mising LOCAL_WIKI_PATH documentation (#3420) 2018-01-28 19:16:28 +02:00
7fd2d8e392 [skip ci] Updated translations via Crowdin 2018-01-28 12:25:26 +00:00
bac6ac033a Fix race condition in repo renaming (#3418) 2018-01-28 14:24:59 +02:00
c55a027da3 Fix empty checkout bug (#3419) 2018-01-28 13:27:42 +02:00
36a94da8da doc: Improve integrations examples (#3416) 2018-01-27 20:52:41 +02:00
bcd7f42529 Added quoting for passwords in sample.app.ini and documentation (#3395) 2018-01-27 20:35:49 +02:00
b627f1131b Change local copy origin url after repository rename (#3399)
Fix #3378
2018-01-27 19:54:26 +02:00
9e842c8a72 Fix SSH auth lfs locks (#3152)
* Fix SSH auth LFS locks

* Activate SSH/lock test

* Remove debug

* Follow @lunny recommendation for AfterLoad method
2018-01-27 18:48:15 +02:00
97fe773491 fix MSSQL bug on org (#3405) 2018-01-27 17:20:59 +02:00
a0c397df08 Recognize more characters in crossreferenced repo name (#3413) 2018-01-27 14:33:32 +02:00
9e87fe8c06 [skip ci] Updated translations via Crowdin 2018-01-27 02:18:45 +00:00
07b4e47a56 Add myself to TRANSLATORS (#3415) 2018-01-26 20:17:26 -06:00
82a7b0292e [skip ci] Updated translations via Crowdin 2018-01-25 14:03:22 +00:00
d644e88107 HTML escape all lines of the search result (#3402)
Fixes #3383.
2018-01-22 23:28:16 +02:00
00d08473b8 Use GiteaServer as the user agent for http requests (#3404)
Otherwise we're still presenting ourselves as GogsServer...
2018-01-22 22:37:14 +02:00
1ce3572409 Remove useless check (#3384)
In #3377, I put check inside all write key function. This one is useless no.
2018-01-19 21:45:53 +02:00
05ab747054 Force-push to base repo's ref/pull/#/head (#3393)
* Force-push to base repo's ref/pull/#/head

Fixes force-pushing to pull request branches, otherwise failing with:

[...gitea/models/pull.go:1022 AddTestPullRequestTask()] [E] PushToBaseRepo: Push: exit status 1 - To /path/to/gitea-repositories/org/repo.git
 ! [rejected]        issue-fix -> refs/pull/20/head (non-fast-forward)

* format
2018-01-19 08:53:45 +02:00
ca306985d3 Change how merged PR commit info are prepared (#3368)
* Change how merged PR commits and diff are made

* Update code.gitea.io/git dependency

* Fix typo

* Remove unneeded local variable
2018-01-19 08:18:51 +02:00
b0d5bb909b Delete indexer DB entries when (re)creating index (#3385)
* comment
2018-01-17 23:51:07 +02:00
a880b17296 [skip ci] Updated translations via Crowdin 2018-01-16 21:27:57 +00:00
e722bdbb03 Update source installation requirements (#3124)
* Update source installation requirements

We require Golang 1.8 since we use `net/url.PathEscape` which was not introduced until then

* Use Golang 1.8 for build and test

If we state Golang 1.8 we should test using that version as well

* Use golang 1.8 only for single build to see if everything compiles

* Change back edge also for commented out sqlite test
2018-01-16 22:18:11 +01:00
095fb9f2e3 Add integrations tests from git cli (#3377)
* test: integration add git cli tests

Extracted form for easing review process and debug #3152

* test: integration add git cli big file commit

* fix:  Don't rewrite key if internal server
2018-01-16 13:07:47 +02:00
695b10bedd Fix API-Endpoint release (#3012)
* Fixes API-Endpoint release (#3005)

* Using context.ReferencesGitRepo(); doing the same in the PATCH route.

* Add release create, get and update test
2018-01-16 10:54:13 +02:00
cc0c4a30a7 [skip ci] Updated translations via Crowdin 2018-01-15 22:45:41 +00:00
a68bf746a4 Change reserved avatar name to correct - avatars (#3375) 2018-01-16 00:45:13 +02:00
e2bb7933e8 [skip ci] Updated translations via Crowdin 2018-01-15 06:04:51 +00:00
bec09378f9 Fix Delete repository message (#3260) 2018-01-15 08:03:30 +02:00
d29aa76777 Fix en-US locale (#3371) 2018-01-15 00:27:57 +02:00
6b9073b3a4 [skip ci] Updated translations via Crowdin 2018-01-14 22:10:15 +00:00
18bf6be398 Add myself as a translator (#3370) 2018-01-15 00:09:30 +02:00
6da5ed2594 [skip ci] Updated translations via Crowdin 2018-01-14 17:35:34 +00:00
ccdb94992d Asynchronously populate the repo indexer (#3366)
* Populate repo indexer in background

* Check if no repos exist

* race cond
2018-01-14 19:34:41 +02:00
a8325dd1cb [skip ci] Updated translations via Crowdin 2018-01-13 09:46:18 +00:00
7a2a3fbafc refactor(model): update user method. (#3360) 2018-01-13 11:45:16 +02:00
f7088292bb [skip ci] Updated translations via Crowdin 2018-01-12 22:17:50 +00:00
2b52f77e1b General refactor of the cmd package (#3328)
* General refactor of the cmd package

* Address breakage in runCreateUser

* Place "common" functions into cmd.go
2018-01-12 23:16:49 +01:00
079273e2ff Add MSSQL to supported database list of intall page (#3359) 2018-01-12 19:23:28 +02:00
eb0f166f50 Address issues pointed out by @lunny in #3339 (#3352) 2018-01-12 08:37:30 -06:00
51a18f7e54 [skip ci] Updated translations via Crowdin 2018-01-11 22:20:44 +00:00
e5b8b4b5ec Cleanup models.User.HashPassword (#3334) 2018-01-12 00:19:38 +02:00
9aed18073d [skip ci] Updated translations via Crowdin 2018-01-11 19:57:53 +00:00
ffc0bff46e Improve documentation about custom templates. (#3345)
Now includes all the template hooks in the page, and a detailed
example for the common case of adding an "about" page.
2018-01-11 21:56:40 +02:00
be1330ec89 Remove hardcoded paths to fix randomly failing tests (#3347)
* Remove hardcoded paths to fix randomly failing tests

* Use correct function for merge path
2018-01-11 00:46:59 +01:00
d8dff304c0 Fix randomly failing LFS lock tests in drone (#3346) 2018-01-11 00:09:56 +02:00
65861900cd Handle refactor (#3339)
* Replace all ctx.Handle with ctx.ServerError or ctx.NotFound

* Change Handle(403) to NotFound, avoid using macaron's NotFound
2018-01-10 23:34:17 +02:00
45c264f681 Templates for extra links in top navbar and repo tool tabs. (#3308)
These templates add content to the top navbar
and to the repository page.
This way we do not have to copy and modify the whole
template, and re-modify it after upgrading Gitea if
it changes.

Signed-off-by: Alberto González Palomo <bugs@sentido-labs.com>
2018-01-10 08:19:50 +02:00
88a3bb6d42 Make the default action for the gitea executable that of running the webserver (#3331) 2018-01-10 06:58:08 +02:00
b5fba4cd42 Fix organization profile on mobile devices (#3332) 2018-01-10 01:11:01 +02:00
6070c9a5b8 [skip ci] Updated translations via Crowdin 2018-01-09 18:41:13 +00:00
84feb016f5 Remove useless fmt.Errorf("%v", err) (#3337) 2018-01-09 16:40:05 -02:00
e7295f27a9 Add MTecknology to MAINTAINERS list (#3335) 2018-01-09 07:27:26 +02:00
f737d37804 Add CodeTriage link to README (#3299) 2018-01-09 00:01:08 +01:00
3ee8be3849 General documentation cleanup (#3317)
* Clean up spelling, grammar, perspective, whitespace, language, markup, etc.
2018-01-08 23:48:42 +01:00
923c0105f4 Update gitea version on docs/install-from-binary (#3333)
* Update gitea version on docs/install-from-binary

* Update all versions
2018-01-09 00:48:05 +02:00
674cfb7cac Change EncodePasswd to HashPassword (#3329)
* Change EncodePasswd to HashPassword

* Create test+benchmark for HashPassword
2018-01-08 23:28:18 +01:00
f2b841d0ec Add some instructions about running integration tests (#3319)
* Add some instructions about running integration tests

* Add missing newline escape

* Suggest running a clean build
2018-01-08 18:29:52 +02:00
d663cef2a5 Fix branch name escaping in compare url (#3311)
* Fixes #3303
2018-01-08 17:17:24 +02:00
f48680888c Remove IsOwner, NumTeams from OrgUser (#3269) 2018-01-08 09:48:37 +02:00
cb868b7851 Add missing indexer doc in configuration (#3324)
* Add missing indexer doc in configuration

* Unify MAX_FILE_SIZE to 1024 * 1024
2018-01-08 07:03:52 +02:00
44053532bb Serve .patch for pull requests (#3305)
* Serve .patch for pull requests

Closes #3259
Updates "git" module, for GetFormatPatch

* Handle io.Copy error
2018-01-07 15:10:20 +02:00
18bb0f8f13 Ensure docs makefile downloads theme if failed before. (#3322)
The makefile did not download the theme if the directory "themes/gitea"
is there, even if empty.
On a fresh Ubuntu install, curl is not included, so the theme rule fails
just after creating the empty directory. When you try again after
installing curl, the rule is not triggered.

This could also happen if the download fails for other reasons.

This change makes the theme rule depend on the file "theme.toml"
which will be there only after unpacking a successfully downloaded
theme archive.

Signed-off-by: Alberto González Palomo <bugs@sentido-labs.com>
2018-01-07 14:11:17 +02:00
9d8260b3d6 [skip ci] Updated translations via Crowdin 2018-01-07 09:42:08 +00:00
6a6439c5c2 Enable Libravatar by default in new installations (#3287)
Pre-existing installs still have it default to off.
This is consistent with OpenID setting.
2018-01-07 11:41:09 +02:00
87f67fd392 [skip ci] Updated translations via Crowdin 2018-01-07 09:14:19 +00:00
835b890329 fix bug when a user delete but assigned on issue (#3318) 2018-01-07 11:13:10 +02:00
4002328179 [skip ci] Updated translations via Crowdin 2018-01-06 22:56:53 +00:00
e78786ef39 Writable deploy keys (closes #671) (#3225)
* Add is_writable checkbox to deploy keys interface

* Add writable key option to deploy key form

* Add support for writable ssh keys in the interface

* Rename IsWritable to ReadOnly

* Test: create read-only and read-write deploy keys via api

* Add DeployKey access mode migration

* Update gitea sdk via govendor

* Fix deploykey migration

* Add unittests for writable deploy keys

* Move template text to locale

* Remove implicit column update

* Remove duplicate locales

* Replace ReadOnly field with IsReadOnly method

* Fix deploy_keys related integration test

* Rename v54 migration with v55

* Fix migration hell
2018-01-07 00:55:53 +02:00
70b6c07590 Add defaults to config cheatsheet, and minor language cleanup. (#3290)
* Add defaults to config cheatsheet, and clean up document.

* Updates and touchups, per review.
2018-01-06 22:15:14 +02:00
52d93f7c31 [skip ci] Updated translations via Crowdin 2018-01-06 19:53:48 +00:00
6032682fc1 Add myself to MAINTAINERS (#3313) 2018-01-06 21:52:57 +02:00
8ef1711055 Make the space for repo actions wider on repo header (#3312) 2018-01-06 19:20:13 +02:00
2d31986236 [skip ci] Updated translations via Crowdin 2018-01-06 11:29:31 +00:00
bf78c95d80 add external tool docs (#3301) 2018-01-06 05:28:31 -06:00
15b8720c5d [skip ci] Updated translations via Crowdin 2018-01-05 18:57:58 +00:00
8ac1501ad7 Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge (#3188)
* Pull request options migration and UI in settings

* Add ignore whitespace functionality

* Fix settings if pull requests are disabled

* Fix migration transaction

* Merge with Rebase functionality

* UI changes and related functionality for pull request merging button

* Implement squash functionality

* Fix rebase merging

* Fix pull request merge tests

* Add squash and rebase tests

* Fix API method to reuse default message functions

* Some refactoring and small fixes

* Remove more hardcoded values from tests

* Remove unneeded check from API method

* Fix variable name and comment typo

* Fix reset commit count after PR merge
2018-01-05 20:56:50 +02:00
a192f3052e Serve pull request .diff files (#3293)
* Serve pull request .diff files

Closes #3259

* Add test for pull request redirection and .diff access

* Typo

* There's no need to test for pr.BaseRepo being nil after calling GetBaseRepo
2018-01-05 12:56:52 +02:00
ce7ae17b81 Fix swagger docs (#3300) 2018-01-04 14:31:40 +08:00
30fb81c71e Use issue number/index instead of id for API URL. (#3298)
Using the API calls, the issue objects retrieved by
/repos/{owner}/{repo}/issues
contains the wrong value in the "url" field:
it uses the "id" value instead of the "number" value.

For instance, in a new repo in try.gitea.io with just one issue:
[{
  "id": 896,
  "url": "https://try.gitea.io/api/v1/repos/AlbertoGP/uno/issues/896",
  "number": 1,
   ...
}]

The given URL does not work, but if you replace the "896" by "1" it
does.
2018-01-03 19:41:33 -06:00
9f8349af06 Fixed asterisk based tasklist items, fixed requirement for one char after last blank to be a valid task. (#3296)
Signed-off-by: modmew8 <modmew8@gmail.com>
2018-01-03 21:45:21 +02:00
5057c6b43f Fix guide link for webhooks in repository settings (#3291) (#3292)
Signed-off-by: Elouan Martinet <exa@elou.world>
2018-01-03 23:50:09 +08:00
daf08aeacd [skip ci] Updated translations via Crowdin 2018-01-03 08:35:03 +00:00
d996da6bab Added progressbar for issues (#1146). (#3171)
* Added progressbar for issues (#1146).

* Updated the generated index.css.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed stored progress percentage and changed it to css calc. Also added the issue task progress to the user/dashboard/issues.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed unnecessary blanks.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Formatted the files correctly, fmt-check terminates now without errors.

Signed-off-by: modmew8 <modmew8@gmail.com>

* Removed variables, made computing the tasks on demand with precompiled regexp.

Signed-off-by: modmew8 <modmew8@gmail.com>
2018-01-03 02:34:13 -06:00
22a7a7ec9b Update standard copyright header for new year (#3289) 2018-01-02 20:03:24 -06:00
de9e36e90e [skip ci] Updated translations via Crowdin 2018-01-02 12:14:47 +00:00
732d31f750 refactor: ignore LGTM from author of pull request. (#3283) 2018-01-02 06:13:49 -06:00
274241c044 [skip ci] Updated translations via Crowdin 2018-01-02 10:33:40 +00:00
c4a8d4ce45 Add more additional template snippets (#3286) 2018-01-02 11:32:41 +01:00
a22037713e [skip ci] Updated translations via Crowdin 2018-01-02 02:38:10 +00:00
50b7ba1b70 Fix MS AD Search Attributes English translation (#3282) 2018-01-02 10:37:16 +08:00
289cd1ceb7 Update CONTRIBUTING.md with new Owners (#3281)
* Add in new owners to contributing.md

* Update date
2018-01-01 19:30:51 +02:00
7944ff7e71 [skip ci] Updated translations via Crowdin 2018-01-01 13:39:43 +00:00
bccbbcf12e Add build instruction in README, reorganize some sections (#3257)
* Add build instruction in README, reorganize some sections

* Add link to https://docs.gitea.io/en-us/install-from-source/
2018-01-01 15:38:49 +02:00
b05a17249b [skip ci] Updated translations via Crowdin 2017-12-31 14:47:00 +00:00
8cd987af0c Add repo-sync-releases admin command (#3254)
* Add repo-sync-releases admin command

Will help recovering corrupted database, see #3247

* Load repos in chunks of 10, exit with error if unable to get a list, scan private repos, fix typo

* Fix debug output about num releases

* Introduce RepositoryListDefaultPageSize constant, set to 64

Use it from the new admin command

* Use RepositoryListDefaultPageSize in more places

* Document RepositoryListDefaultPageSize
2017-12-31 16:45:46 +02:00
ae9cc8f972 [skip ci] Updated translations via Crowdin 2017-12-31 03:09:06 +00:00
c64924682e Fix race condition in team functions (#3268) 2017-12-30 21:08:08 -06:00
edce41ae65 go back to using CFB for AES decryption/encryption for 2FA (#3274) 2017-12-31 04:19:42 +02:00
d2736e268b Remove unused vendor github.com/stretchr/testify/require (#3273) 2017-12-31 09:11:08 +08:00
3850bad4c0 Remove unused consts/vars (#3270) 2017-12-30 19:10:48 -06:00
3d3faa2624 Responsive view (#2750)
* Viewport meta tag

* responsive: dashboard

* responsive: issues page

* responsive: Explore page

* responsive: navbar, and some navbar css refactoring

* responsive: button for collapsing navbar in mobile view

* Mark the hamburger button as active when pressed

* better homepage for responsive views

* Bring back jump class in navbar

The class was necessary, because this way the
dropdown doesn't assume the contents of the
selected item.

* make repository homes responsive

* Make file view page responsive

* Make forms look good on responsive views

* make commits and commit diff view responsive

* issues and PRs

* responsive wiki

* Don't place auto-init far off the page

* Minor changes to amend broken stuff

minor improvements

- make login/sign up in navbar stackable
- make navbar in explore and sign in not stackable

Change selected class in TestPullCompare

Fix typo that happened when rebasing

fix dashboard on org view

improve profile UI

Use clearing on file diff to fix broken UI caused by floating elements

remove unresolved merge conflict, and | Sanitize

Fix repo home not loading
2017-12-30 18:47:52 -06:00
2f8c65c885 Fixed link to Issue 165 in comment, that was broken by commit 2d68bd1ef98849da54c869b103e93719d1accb5e (index 8110ac85..0f6163c4 100644). (#3267) 2017-12-29 22:19:38 -06:00
08cf7d90ef Add docs for REDIRECT_OTHER_PORT and PORT_TO_REDIRECT config options (#3262) 2017-12-27 08:35:19 -06:00
4c9341f689 Fix bugs in issue dashboard stats (#3073) 2017-12-26 01:25:16 +02:00
fabf3f2fc2 Add an option to allow redirect of http port 80 to https. (#1928)
* Add an option to allow redirect of http port 80 to https.

This is an "opt in" option (default is to not redirect).  It will only redirect
if protocol is https and the new REDIRECT_PORT_80 option is set to true.

The Port to redirect in previous commit was hardcoded to 80, now it can be
specified in the app.ini, defaulting to 80.  The boolean option to turn
redirection on has been changed to REDIRECT_OTHER_PORT to be logically
consistent with the new port option.

Signed-off-by: Mike Fellows <mike.fellows@shaw.ca>
2017-12-25 23:23:43 +01:00
f5155b9913 Small improve on deleting attachements (#3145)
* Small improve on deleting attachements

* improve the sequence of deletion
2017-12-24 23:04:22 +02:00
cc7b8e3379 Add more bench (#3161)
* Improve makefile + Add benchs

* Apply recommendations of @ethantkoenig
2017-12-24 02:33:34 +02:00
a995ad90e1 [skip ci] Updated translations via Crowdin 2017-12-22 07:01:25 +00:00
156aa42ba0 Update code.gitea.io/git (#3251) 2017-12-22 09:00:30 +02:00
515cdaa85d Fix ignored errors when checking if organization, team member (#3177) 2017-12-21 09:43:26 +02:00
529482135c Support default private when creating or migrating repository (#3239)
* support default private when creating or migrating repository

* fix fmt

* use string constants on repository default private in app.ini

* fix fmt
2017-12-20 06:59:56 -06:00
e67b4055f9 Fix repo-transfer-and-team-repo-count bug (#3241) 2017-12-19 23:37:56 -06:00
7cf17e376b [skip ci] Updated translations via Crowdin 2017-12-20 03:42:21 +00:00
456648adac chore: upgrade gitea/git version (#3240)
ref: https://github.com/go-gitea/gitea/pull/3190
2017-12-19 21:41:29 -06:00
7b28154e8b Add missing repository setting docs in cheat sheet (#3230) 2017-12-19 04:40:21 -06:00
5332052019 Fixed missing end tag for organization link (#3229) 2017-12-19 09:47:30 +02:00
1123313240 Use correct camel casing for JavaScript (#3224)
JavaScript should be spelt with an uppercase 'S' as per seen in [Mozilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
2017-12-18 19:31:32 -06:00
7e59587173 Open external tracker in blank window, consistently with wiki (#3227)
Closes #3216
2017-12-18 19:30:34 -06:00
0e384c6376 Check ignored errors for issue and milestone count (#3213) 2017-12-18 16:06:51 +02:00
9a0e2a8b07 Improve cron.archive_cleanup docs in cheat sheet and app.ini.sample (#3215)
Include defaults in cheat sheet, for that section
2017-12-17 16:37:34 +02:00
6abfa48c0e Remove unnecessary updates to issue indexer (#3212) 2017-12-17 13:53:02 +02:00
eb2b4df0ed Change SSL Mode from checkbox to string in admin page (#3208)
Closes #3207

Use a string, not a checkbox because "require", "verify-full",
"verify-ca" and "disable" values are supported ...
2017-12-16 23:25:00 +02:00
befa7445d2 Unit tests for routers/repo/issue_label (#3198) 2017-12-15 23:11:02 +02:00
bde0409433 Fix repo links on user profile (#3197) 2017-12-15 06:55:08 +02:00
1687aa59e6 Improve suppressed diff boxes (#3193) 2017-12-14 20:26:59 +02:00
f94c1b3943 Improvements for supporting UI Location (#3146)
* improvements for supporting UI Location

* improved the comment
2017-12-14 07:45:31 +08:00
b6d2243ac0 Make spacing in configuration file consistent (#3186)
This makes the spacing consistent across all options.

Signed-off-by: Patrick Lühne <patrick-github@luehne.de>
2017-12-14 00:22:59 +02:00
c06cc740de Reorder migrations, skip errors if running migration again (#3160)
* Reorder migrations, skip errors if running migration again

* Rename migration file names to match migration version

* Add note about ingored error
2017-12-13 16:52:18 +02:00
d3c5911ffc Fix wiki page list not rendering after updatedunix changes (#3175) 2017-12-13 21:46:56 +08:00
00bfa1d055 fix run web with -p push failed (#3154) 2017-12-13 16:57:28 +08:00
0b77dbc11c Fix new pull request link (#3133)
* Fix new pull request link

* Only show button for branches
2017-12-13 13:06:25 +08:00
e693fda325 [skip ci] Updated translations via Crowdin 2017-12-12 22:27:18 +00:00
859b9ad7ea fix org owner cannot be removed if there is not in owner team (#3164) 2017-12-13 00:26:31 +02:00
9f033bf2b5 Make test more robust (#3167) 2017-12-12 15:17:08 +08:00
2ad633344e [skip ci] Updated translations via Crowdin 2017-12-12 06:46:42 +00:00
e3f88719ab fix source download link when no code unit allowed (#3166) 2017-12-12 08:45:02 +02:00
f27a6461e3 Enable emoji for wiki view (#3158)
Enable emoji for wiki page content. It is enabled in the edit preview so the view should match.

Signed-off-by: Hamish Carpenter <hamish@hamishcarpenter.com>
2017-12-12 03:02:55 +02:00
4b5197beb4 Fix Uninitialized variable in ParsePatch (#3156) 2017-12-12 02:32:36 +02:00
3b525d5696 fix gpg tmpl (#3153) 2017-12-11 22:07:25 +08:00
b82519cadc Move build without gcc step up so that it's binary is not used in docker (#3147) 2017-12-11 10:42:13 +01:00
956354885a simple usage of x (#3144) 2017-12-11 09:16:23 +02:00
03ec35ed79 Mention completion for issue editor. (#3136)
* new issue mention

* Mention completion on new issue and view issue page.

* Code format.

* Require tribute in pull request page.
2017-12-11 14:03:04 +08:00
f2e20c81b6 Refactor struct's time to remove unnecessary memory usage (#3142)
* refactor struct's time to remove unnecessary memory usage

* use AsTimePtr simple code

* fix tests

* fix time compare

* fix template on gpg

* use AddDuration instead of Add
2017-12-11 06:37:04 +02:00
c082c3bce3 Restore make test target (#3139)
* Restore make test target

* make build -> go build
2017-12-11 10:31:07 +08:00
58a7de2aea Update code.gitea.io/git (#3137) 2017-12-11 10:23:34 +08:00
682ac11958 Log unexpected responses in integration tests (#3138)
* Log flash error message in integration tests

* Also log short, non-HTML responses
2017-12-11 10:15:27 +08:00
defc97afc2 Fixtures for public_key table (#3140) 2017-12-11 09:50:29 +08:00
d1efe2078a Fix integration tests (#3141) 2017-12-11 08:52:05 +08:00
41d6afe0e7 Fix compile failed without gcc (#3130)
* fix comile failed without gcc

* add sqlite tag for unit test
2017-12-10 16:08:19 +02:00
eb6cbedcc0 [skip ci] Updated translations via Crowdin 2017-12-10 02:52:04 +00:00
23ffdf42c8 Update alpine to 3.7 (#3121) 2017-12-10 10:50:50 +08:00
b8e45b1e19 Fix missing drone test on release/* (#3126)
* fix missing drone test on release/*

* remove test coverage on release/*
2017-12-09 12:17:40 +02:00
5b30964e54 [skip ci] Updated translations via Crowdin 2017-12-08 17:21:10 +00:00
d5d28721e2 Backport changelog for 1.3 release (#3120) 2017-12-08 18:20:48 +01:00
f8967fc638 [skip ci] Updated translations via Crowdin 2017-12-08 12:23:00 +00:00
ef78309b65 Improve LFS tests + fix lfs url refs + keep path upper/lowercase in db. (#3092)
* 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
2017-12-08 20:21:37 +08:00
aecfc56156 [skip ci] Updated translations via Crowdin 2017-12-08 05:23:04 +00:00
596308f213 Fix missing branch in release bug (#3108) 2017-12-08 13:22:02 +08:00
68179dc676 Remove unnecessary function call (#3109) 2017-12-08 09:02:34 +08:00
5e4427e4e7 Fix repo indexer and submodule bug (#3107) 2017-12-07 15:18:04 +08:00
311c83ad17 Allow adding collaborators with (fullname) (#3103)
* Allow adding collaborators with (fullname)

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Refactor username suffix to utils pkg

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>
2017-12-07 15:00:09 +08:00
7ec6cddd27 Add 'mark all read' option to notifications (#3097)
* Add 'mark all read' option to notifications

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Fix exported comment

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Format method comments

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

* Fix exported comment

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

Format method comments

Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com>

Tests for reactions (#3083)

* Unit tests for reactions

* Fix import order

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>

Fix reaction possition when there is attachments (#3099)

Refactor notifications swap function

* Accept change to drop beforeupdate call

* Update purge notifications error message for consistency

* Drop unnecessary check for mark all as read button

* Remove debugging comment
2017-12-07 13:52:57 +08:00
1ed7f18815 Rework button styles on repo and commit page (#3104) 2017-12-07 09:26:12 +08:00
54907dfbd1 Fix legacy URL redirects (#3100) 2017-12-07 09:09:02 +08:00
469ab99e9a Delete a user's public key via admin api (closes #3014) (#3059)
* Delete a user's public key via admin api

* Test admin ssh endpoint for creating a new ssh key

* Adapt public ssh key test to also test the delete operation

* Test that deleting a missing key will result in a 404

* Test that a normal user can't delete another user's ssh key

* Make DeletePublicKey return err

* Update swagger doc
2017-12-06 12:27:10 +02:00
c7fb6e3087 Fix reaction possition when there is attachments (#3099) 2017-12-06 11:17:50 +08:00
f1d8dda5b4 Tests for reactions (#3083)
* Unit tests for reactions

* Fix import order

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
2017-12-05 22:57:01 +02:00
3b89ee5501 fix button heights on commits page (#3091) 2017-12-05 14:31:33 +08:00
e2968b4c98 add quotation around ports in docker-compose.yml (#3090) 2017-12-05 14:03:40 +08:00
03eb47b216 Fix repo links (#3093) 2017-12-05 13:52:53 +08:00
2738effddf fix redis cache failed (#3086) 2017-12-04 23:00:14 +08:00
0332b8fb18 [skip ci] Updated translations via Crowdin 2017-12-04 14:06:04 +00:00
f4445510ae fixed in-page-link in CONTRIBUTING.md (#3087) 2017-12-04 16:05:12 +02:00
c0a7899416 Sort repos in issues dashboard sidebar (#3072)
* Sort repos in issues dashboard sidebar

* Sort repos by name
2017-12-04 12:39:01 +08:00
3c1b1ca78e Fix error message sanitiziation (#3082) 2017-12-04 03:48:03 +02:00
5dc37b187c Add reactions to issues/PR and comments (#2856) 2017-12-04 01:14:26 +02:00
e59adcde65 Use httptest in integration tests (#3080) 2017-12-04 00:46:01 +02:00
993b86628b Minor copy changes (#3074)
* Minor copy changes
Fixes #3058

* Use TrN for translations that depend on count
Fix minor type with branches count
2017-12-03 22:52:30 +02:00
ab62da283a Fix avatar URLs (#3069)
* Fix avatar URLs

* import order
2017-12-03 19:55:13 +08:00
7bab3d2fb1 Enable content trust when building image (#2972) 2017-12-03 18:21:10 +08:00
6d99840d1f [skip ci] Updated translations via Crowdin 2017-12-03 05:31:04 +00:00
a0964775ab Sanitize logs for mirror sync (#3057) 2017-12-03 13:29:41 +08:00
3163abedd6 Fix ref parsing in commit messages (#3067) 2017-12-03 10:20:12 +08:00
b0971ae37c Reduce overhead of upgrades for users with custom stylesheets/JS (#3051) 2017-12-03 02:26:06 +02:00
4947cfb7b0 Remove box-shadow from UI, fix dashboard issue (#3065) 2017-12-03 01:16:35 +02:00
ef5364950b fix issue list branch link broken (#3061) 2017-12-02 21:57:47 +02:00
d44aa831f3 Convert tabs to spaces in .less files (#3064) 2017-12-02 21:48:43 +02:00
f9db60e3bd Adjust branch button size (#3063) 2017-12-02 19:57:51 +02:00
8cd616e977 Fix misalignment issue in repo header (#3062) 2017-12-02 19:20:52 +02:00
b3d5ba6f90 Fix missing password length check when change password (#3039)
* fix missing password length check when change password

* add tests for change password
2017-12-02 19:11:22 +02:00
35cc5b0402 Remove GetRepositoryByRef and add GetRepositoryByOwnerAndName (#3043)
* remove GetRepositoryByRef and add GetRepositoryByOwnerAndName

* fix tests

* fix tests bug

* some improvements
2017-12-02 15:34:39 +08:00
674422b642 Fix CSS instructions in CONTRIBUTING.md (#3053) 2017-12-02 13:48:57 +08:00
d8d38ed059 Dashboard: Fix line height problem in issue titles (#3054) 2017-12-02 10:49:39 +08:00
57edc3155f Default log level to Info without hardcoding it in installer (#3041) 2017-12-01 15:41:27 +08:00
9a8805d785 remove duplicated sanitize (#3037) 2017-11-30 21:38:33 +02:00
13e59c8b7a remove unused variable (#3038) 2017-11-30 20:44:25 +02:00
91f3d77ceb Unit tests for wiki routers (#3022) 2017-11-30 17:52:15 +02:00
82e8486f13 Update docs for LDAP (via BindDN) user sync option. (#2985) 2017-11-30 21:36:53 +08:00
474dfcc798 French translation for docs (#3030)
original PR go-gitea/docs#147 and author @0xbaadf00d
2017-11-30 20:45:48 +08:00
d517b56682 add notice for docker run gitea http port issue (#3020) 2017-11-30 19:18:35 +08:00
86ee41ec03 Expandable commit bodies (#2980)
* Initial working state of expandable commit bodies

* Fix all commits having showing button for multiline commits

* Refactor checking multiline messages method

* Force newlines with <br> in commit body

* Show multiple lines in the list view of repositories

* Fixed proper newlines and minor refactor

Use <pre> instead of <p>, this is so we can use \n instead of having to manually place <br> into the HTML. Makes it easier to display commit bodies.

* Fix commit list messages jumping around

* Fix indentation in view_list.tmpl

* Use vertical-align: baseline instead of top

* Refactor commit button toggle function

* Remove RenderCommitBodyLink function

* Add comments

* Add newline at the end of _repository.less

* Fix long commit bodies not properly wrapping inside <pre>

* Don't split on double newlines

* Show the commit body in commit view

* Update stylesheets

* Add/fix comments and run make fmt

* Fix spaces not being tabs
2017-11-30 13:08:40 +08:00
4cf90aa865 [skip ci] Updated translations via Crowdin 2017-11-29 20:53:22 +00:00
013db70fce Removed unused field in form (#3023) 2017-11-29 22:52:34 +02:00
033ad9a79f [skip ci] Updated translations via Crowdin 2017-11-29 12:50:43 +00:00
67b0d2175d Set OpenID support on by default when installing new instance (#3010) 2017-11-29 14:47:42 +02:00
b9452c48ac [skip ci] Updated translations via Crowdin 2017-11-29 09:11:10 +00:00
899c900e59 use unique name for docs docker build step in CI (#3018)
Otherwise drone may combine the logs
2017-11-29 11:08:23 +02:00
dab2b354c7 Removing disqus from docs site (#3015)
Gitea now has a forum which is probably a better venue for
these types of conversations
2017-11-29 11:57:29 +08:00
cbc6bbfbeb [skip ci] Updated translations via Crowdin 2017-11-29 01:52:11 +00:00
551f3cbe42 Memory usage improvements (#3013)
* 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>
2017-11-29 09:50:39 +08:00
4035ab05fa Fix git lfs path (#3016)
* add suffix .git

* Remove Content-Type on GET methods

* Add migrations to force creation before any further potential migration
2017-11-29 01:35:23 +02:00
c80d147fa9 Improve memory usage when reaching diff limits (#2990)
Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
2017-11-29 01:22:24 +02:00
d39b88ae88 Fix master build for docs docker (#3004) 2017-11-29 00:17:23 +02:00
d99f4ab003 Git LFS lock api (#2938)
* Implement routes

* move to api/sdk and create model

* Implement add + list

* List return 200 empty list no 404

* Add verify lfs lock api

* Add delete and start implementing auth control

* Revert to code.gitea.io/sdk/gitea vendor

* Apply needed check for all lfs locks route

* Add simple tests

* fix lint

* Improve tests

* Add delete test + fix

* Add lfs ascii header

* Various fixes from review + remove useless code + add more corner case testing

* Remove repo link since only id is needed.

Save a little of memory and cpu time.

* Improve tests

* Use TEXT column format for path + test

* fix mispell

* Use NewRequestWithJSON for POST tests

* Clean path

* Improve DB format

* Revert uniquess repoid+path

* (Re)-setup uniqueness + max path length

* Fixed TEXT in place of VARCHAR

* Settle back to maximum VARCHAR(3072)

* Let place for repoid in key

* Let place for repoid in key

* Let place for repoid in key

* Revert back
2017-11-28 22:58:37 +02:00
6ad4990a65 Add fingerprint to ssh key endpoints. (#3009)
* Add fingerprint to ssh key endpoints.

* Update gitea sdk vendor
2017-11-28 17:21:39 +02:00
0c69b768b9 [skip ci] Updated translations via Crowdin 2017-11-28 09:44:21 +00:00
b7ebaf6d20 Various wiki bug fixes (#2996)
* Update macaron

* Various wiki bug fixes
2017-11-28 17:43:51 +08:00
6a58e3f9fc Dockerfile for docs copy proper files into image (#2989)
fixes docker build from: #2874
2017-11-27 14:08:25 +02:00
1028ef2def Don't print SQL in unit tests (#2995)
* Add GITEA_UNIT_TESTS_VERBOSE environment variable to enable printing SQL
2017-11-27 12:29:48 +02:00
8b58772659 [ci skip] Fix #2964 Document updated proposal process (#2999) 2017-11-27 09:14:34 +02:00
621efaa340 Update link for tips on how to get faster reviews (#2997)
Kubernetes merged guides, and this is now the current location of guide
2017-11-27 08:11:15 +02:00
8ee08fe8bc Remove duplicate "Max Diff Lines" from config view (#2987)
Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
2017-11-27 06:56:50 +02:00
0e76f38e4d [ci skip] Add @techknowlogick to MAINTAINERS file (#2993) 2017-11-27 11:38:49 +08:00
cc2b1fea9a Adding time tracking to feature list (#2982)
Now that 1.3 is out time tracking is a new feature
go-gitea/docs#148
2017-11-27 10:47:43 +08:00
238bb80cdd Update hard-coded version to 1.4.0-dev (#2988)
Now that 1.3.0 is out the new target is 1.4.0
2017-11-27 10:12:45 +08:00
0d4c63fd70 Fix go-get, src and raw urls to new scheme (#2978) 2017-11-27 02:58:54 +02:00
fb5c6b6444 Import docs into main repository (#2874)
* import docs into main repository

Signed-off-by: Matti Ranta <matti@mdranta.net>
2017-11-26 23:44:32 +02:00
f148a4a1ed Fix coverage reports (#2974) 2017-11-26 20:07:40 +02:00
4d85c1d3c8 Fix fault PR renaming app.ini (#2977) 2017-11-26 18:02:38 +02:00
7091db8192 Rename conf dir > custom.sample (#1522)
* Explain app.ini purpose
2017-11-26 17:16:58 +08:00
716ac1214f Enable admin to search by email (#2888) 2017-11-26 16:40:38 +08:00
061c501d54 Fix error when add user has full name to team (#2973)
* fix error when add user has full name to team

* add comment for extra uname check
2017-11-26 10:01:48 +02:00
16c55e1a5b [skip ci] Updated translations via Crowdin 2017-11-26 02:01:56 +00:00
d23a3e96f1 Fix bench deps since #2916 (#2971) 2017-11-26 10:00:57 +08:00
40c545ddbc Fix files/commits of merged PRs (#2937) 2017-11-25 21:47:19 +08:00
183da4c2c1 Fix language names (#2955) 2017-11-23 12:00:48 +08:00
42d781a709 Update gitgraph.js to fix blurry commit graph on HiDPI screens (#2957) 2017-11-23 00:08:26 +08:00
2cb6c51158 Fix over-escaped characters (#2956) 2017-11-22 15:09:48 +08:00
dbb7715b0b Remove render issue link (#2954)
* Remove function that does nothing

* Remove unused import
2017-11-22 08:25:47 +02:00
ea78a6db57 Spaces to tabs in templates (#2953) 2017-11-21 13:43:00 +08:00
0f6dc411df Remove unnecessary IssueList attribute loads (#2936) 2017-11-21 13:28:22 +08:00
10b54df2b2 Add dingtalk webhook (#2777)
* add dingtalk webhook type

* add vendor

* some fixes

* fix name check

* fix name check & improvment
2017-11-21 06:26:43 +02:00
420fc8efc2 Disable add key button if SSH is disabled (#2873) 2017-11-21 11:49:33 +08:00
1f7aab6e19 Drop deprecated GOGS_WORK_DIR use (#2946) 2017-11-21 09:52:47 +08:00
fd09d1ffb8 Drop unmaintained gogs migration script (#2947) 2017-11-21 08:52:48 +08:00
e00df9fb8e [skip ci] Updated translations via Crowdin 2017-11-20 23:37:46 +00:00
e4f96c60cd App restarts to quickly if it fails to start. (#2945) 2017-11-21 01:37:23 +02:00
7e6c198f21 Apply LANDING_PAGE config options for logged in users (#2894)
* Extended LANDINGPAGE config variable to logged in users and added switch for 'organizations' in addition to 'home' and 'explore'.

* Updated comments.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Extended LANDINGPAGE config variable to trigger when user logs in and added switch for 'organizations' in addition to 'home' and 'explore'.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Extended LANDINGPAGE config variable to logged in users and added switch for 'organizations' in addition to 'home' and 'explore'.

* Updated comments.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Extended LANDINGPAGE config variable to trigger when user logs in and added switch for 'organizations' in addition to 'home' and 'explore'.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Removed superfluous conditional and correct whitespace.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>

* Update app.ini

Reverted new line.

* Formatting.

Signed-off-by: Mike Schaffer <mschaff@gmail.com>
2017-11-20 15:48:09 +08:00
c3b6383b3a Fix comment API paths (#2813) 2017-11-20 15:24:07 +08:00
876bafb7ef Fix API status code for hook creation (#2814)
* Fix API status code for hook creation

* Named constants for response statuses
2017-11-20 15:00:53 +08:00
061f65ff29 Restore build as the default make rule (#2935) 2017-11-19 09:50:23 +02:00
6ee65757c7 Combine identical Makefile rules (#2916) 2017-11-17 18:17:39 +08:00
1cb01817c9 [skip ci] Updated translations via Crowdin 2017-11-17 03:17:21 +00:00
b23cf16981 Fix govendor for x/crupto curve25519 (#2925) 2017-11-17 11:16:47 +08:00
b33ce46a48 [skip ci] Updated translations via Crowdin 2017-11-16 13:17:13 +00:00
dac0f14f34 Docker multi-arch base (#1985)
* Create docker/manifest/base.yml

serve as base for build docker image for most platform (386,amd64,arm,arm64)

* Add make task docker-multi-arch-push-manifest

To update references of a multi-arch image on docker registry.

* Use SED_INPLACE generic sed command

* Delete Dockerfile.aarch64

Delete Dockerfile.rpi

* Use gitea/gitea-base as base

and replace deprecated MAINTAINER by LABEL (https://docs.docker.com/engine/reference/builder/#maintainer-deprecated)

* Fix rebase

* Use sapk/gitea-base as base

* Split makefile for docker

* Fix version to v3.6

Could use in later version edge of alpine official library that support multi-arch for armhf.

* Remove sapk/gitea-base and use directly new official alpine multi-arch
2017-11-16 15:16:40 +02:00
7c3e605698 Fix memcache support when value is returned as string always (#2924) 2017-11-16 15:06:34 +08:00
222e7c3f06 [skip ci] Updated translations via Crowdin 2017-11-16 05:54:31 +00:00
3138417c63 Update golang x/crypto dependencies (#2923) 2017-11-16 07:53:23 +02:00
074f6c1b49 [skip ci] Updated translations via Crowdin 2017-11-15 08:12:05 +00:00
d22a8dc022 Page parameter for repo search API (#2915) 2017-11-15 16:10:26 +08:00
a30cc637c6 [skip ci] Updated translations via Crowdin 2017-11-15 03:35:51 +00:00
a6f337046f Update go-ini dependency and remove semicolon hack in translations (#2913) 2017-11-15 11:34:42 +08:00
bd23e36bec Add owner to delete repo message (#2886) 2017-11-15 09:37:16 +08:00
a8832e1227 [skip ci] Updated translations via Crowdin 2017-11-14 23:40:26 +00:00
fb6348976e Backport 1.2.x changelog to master (#2904) 2017-11-15 01:39:17 +02:00
72fc829b05 [skip ci] Updated translations via Crowdin 2017-11-14 11:25:14 +00:00
84498301ca update screenshots on README (#2910) 2017-11-14 13:23:55 +02:00
44bd5ff466 [skip ci] Updated translations via Crowdin 2017-11-14 00:57:08 +00:00
e735d8cb25 Gogs -> Gitea (#2909)
rename label
2017-11-14 08:55:57 +08:00
afa85f9b55 [skip ci] Updated translations via Crowdin 2017-11-13 14:54:11 +00:00
f4d12f8d97 Fix run command race (#1470)
* Use exec.CommandContext to simplfy timeout handling

And fixing the data races which can be identified by the added tests when -race enabled.

* Use sleep commmand instead of reading from stdin

* Make the error handling go-esque
2017-11-13 22:51:45 +08:00
e9728bf3b4 [skip ci] Updated translations via Crowdin 2017-11-13 09:33:29 +00:00
f94e6fd7a5 Correct ldap username validation. (#2880)
PR #342 was only partially applied. Spaces should not be at the start
and end of a username but they can be inside.
2017-11-13 11:32:16 +02:00
134958fd9f Fix localization texts that contain semicolon (#2900) 2017-11-13 09:56:10 +02:00
4725f91543 Fix inconsistencies in user settings ui (#2901) 2017-11-13 09:21:41 +02:00
f26f4a7e01 Update swagger documentation (#2899)
* Update swagger documentation

Add docs for missing endpoints
Add documentation for request parameters
Make parameter naming consistent
Fix response documentation

* Restore delete comments
2017-11-13 09:02:25 +02:00
4287d100b3 [skip ci] Updated translations via Crowdin 2017-11-13 01:37:21 +00:00
5481be0ac5 Fix issue link rendering in commit messages (#2897)
* Fix issue link rendering in commit messages

* Update page.tmpl

* No links for parens

* remove comment
2017-11-13 09:35:55 +08:00
47f40ccd5e Add integration test for user deleting account (#2891) 2017-11-12 21:36:16 +08:00
5abd1d2a68 Add integration test for logging out (#2892) 2017-11-11 23:29:07 -06:00
1ebf257bed [skip ci] Updated translations via Crowdin 2017-11-11 23:19:22 +00:00
dd026a4ebb Fix adding a new authentication source after selecting OAuth (#2889) 2017-11-12 01:18:21 +02:00
524cca3a1e [skip ci] Updated translations via Crowdin 2017-11-11 01:33:50 +00:00
0a9fd454da Fix new branch creation to new url scheme (#2884) 2017-11-10 19:32:46 -06:00
e22be08ab6 [skip ci] Updated translations via Crowdin 2017-11-08 13:06:17 +00:00
ba2e0240c6 Add LFS object verification step after upload (#2868)
* Add LFS object verification step after upload

* Fix file verification condition and small refactor

* Fix URLs

* Remove newline and return status 422 on failed verification

* Better error hadling
2017-11-08 15:04:19 +02:00
61f5c22503 [skip ci] Updated translations via Crowdin 2017-11-07 06:34:16 +00:00
62d0a4d882 Add external markup render support (#2570)
* add external markup render support

* bug fixed

* refacotr codes and fix wrong error log

* fix comments and add check to prevent leaks

* add check for config file and improve the example

* check file close error

* use ioutil.TempFile instead uuid

* correct Render -> Parser

* improve warning when incorrect markup setting

* fix typos
2017-11-07 08:33:06 +02:00
ddb75191ec [skip ci] Updated translations via Crowdin 2017-11-07 04:34:18 +00:00
6e2e7b325f Fix LFS not returning correct content length when requesting a range of bytes (#2864) 2017-11-07 06:33:04 +02:00
cdc4600725 Fix fork repository cycle to self (#2860)
* fix fork repository cycle to self

* rename testForkRepo to traverseParentRepo
2017-11-06 12:12:55 +08:00
ff9daa3e9b fix click create pull request button 404 (#2859) 2017-11-05 21:11:35 +02:00
80a4643359 Fix attachments icon size on zoom in/out (#2853)
* fix attachments icon size on zoom in/out

* make public/css/index.css
2017-11-05 14:12:27 +02:00
9bdce5d21b Launch Gitea with custom UID/GID for 'git' user (fixes #2286) (#2791) 2017-11-05 10:40:31 +08:00
be523152a8 Clean repository ROOT directory name with filepath.Clean (#2846)
For better compatibility with Windows.
2017-11-04 23:36:49 +02:00
d91fe5254d Fix ignored errors in API route (#2850)
* Fix ignored errors in API route
2017-11-04 19:10:01 +01:00
57de1ff991 Fix API raw file content access for default branch (#2849) 2017-11-04 19:26:38 +02:00
76b8c3c68f "[skip ci] Updated translations via Crowdin" 2017-11-04 15:56:28 +00:00
6a49ada260 Update TRANSLATORS (#2843)
* Update TRANSLATORS

* Change order to alphabetical
2017-11-04 17:56:06 +02:00
1febbf0da9 "[skip ci] Updated translations via Crowdin" 2017-11-04 13:33:10 +00:00
bd6f24b4ab Add deleted_branch table fixture (#2832)
* Add deleted_branch table fixture

* Fix deleted branches tests

* Remove unneeded global variable
2017-11-04 15:31:59 +02:00
1621069f83 "[skip ci] Updated translations via Crowdin" 2017-11-04 11:54:55 +00:00
091f3669ba change the email and name to GitBot account. (#2848)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-11-04 06:53:59 -05:00
93f726352c Link members and repositories count to each page on org home. (#2787) 2017-11-04 13:46:34 +08:00
dcb009aa86 '[skip ci] Updated translations via Crowdin' 2017-11-03 23:24:26 +00:00
08b124dd47 Fix API raw requests for commits and tags (#2841) 2017-11-04 01:23:59 +02:00
e6bb8e7a4d Translator pt-BR (#2838)
* Translator pt-BR

* rectification translators pt-BR
2017-11-03 16:45:21 +02:00
240609432b Issue content should not be updated when closing with comment (#2833) 2017-11-03 17:23:17 +08:00
8798cf4e3b Set session and indexers' data files rel to AppDataPath (#2192)
* Set session and indexers' data files rel to AppDataPath

The setting AppDataPath is now relative to the working directory.
The session svc's PROVIDER_CONFIG now defaults to AppDataPath/data/sessions.
The issue indexer's IssuePath now defaults to AppDataPath/indexers/issues.bleves.

* fix bug
2017-11-03 10:56:20 +02:00
95637e046f Fix order of comments (#2835) 2017-11-03 11:11:42 +08:00
2e08f230ca Use different directories for session files in integration tests (#2834) 2017-11-03 02:48:47 +02:00
3ee7248970 '[skip ci] Updated translations via Crowdin' 2017-11-02 23:33:59 +00:00
9500ad1e92 Fix removing backslash before quotes in translations (#2831) 2017-11-03 01:33:43 +02:00
1f04c00e2f Fix redirect url of legacy commits route (#2825) 2017-11-03 00:01:22 +02:00
529f9d03ce Fix ordering in app.ini and fix run mode option (#2829) 2017-11-02 23:08:21 +02:00
f70758dec9 Add git clone test on integration test (#1682) 2017-11-02 18:51:03 +01:00
eecaba2031 Configurable SSH key exchange algorithm and MAC suite (#2806) 2017-11-02 23:26:41 +08:00
d94e2a1c22 '[skip ci] Updated translations via Crowdin' 2017-11-02 13:01:46 +00:00
8a9cc86bf6 added myself to the translation list (#2828) 2017-11-02 15:00:42 +02:00
122a66f6e0 Fix commits page url (#2823)
* Fix commits page url

* Check all view types
2017-11-02 08:30:19 +08:00
85e99b6a6b '[skip ci] Updated translations via Crowdin' 2017-11-01 19:44:17 +00:00
25acd6c822 Use custom search for each filter type in dashboard (#2343)
* Do custom search for each filter in repo-search

* Fix search url

* Simplify code

* Remove loader and reset counts when changing filter
2017-11-01 21:39:05 +02:00
266ebf8200 Revert en-US locale (#2821) 2017-11-02 00:03:10 +08:00
3217102516 '[skip ci] Updated translations via Crowdin' 2017-11-01 15:47:40 +00:00
c7ade55d39 fix update-translations on drone (#2822) 2017-11-01 23:46:28 +08:00
1ccaddcfbb '[skip ci] Updated translations via Crowdin' 2017-11-01 12:53:57 +00:00
de9915023d Fix wrong translations (#2818)
* fix wrong translations

* fix tab on yml
2017-11-01 20:52:48 +08:00
6f84569629 '[skip ci] Updated translations via Crowdin' 2017-11-01 09:14:08 +00:00
c22f443f58 add gitea remote in drone. (#2817)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-11-01 04:13:47 -05:00
dc6dad87d4 add remote name for git push. (#2816)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-11-01 03:48:40 -05:00
e9595a962b Download and pushing translations (#2727)
* Download and pushing translations

* Adding empty line between build steps
2017-11-01 14:14:49 +08:00
1b6a962e70 Include HTTP method in test error message (#2815) 2017-11-01 00:54:24 -05:00
e6a97b6675 Use api.TrackedTime in API (#2807)
* Use api.TrackedTime in API

* APIFormat() method

* Rename function
2017-11-01 10:25:14 +08:00
e22549747c Fix dropdown menu position on explore repo (#2808)
Signed-off-by: Mulia Arifandi Nasution <mul14.net@gmail.com>
2017-10-31 21:16:07 +02:00
605038dca9 Fix typo (#2810)
Signed-off-by: Mulia Arifandi Nasution <mul14.net@gmail.com>
2017-10-31 19:10:22 +02:00
d545e32b56 Add environment variable support for Docker image (#2201)
* Add `gettext` dependencies as we need `envsubst` command;
* Modified s6's gitea setup script, instead of `cp` the template if no
`app.ini` exist, it will substitude the envvars and generate the new
`app.ini`;
* Make `/docker/etc/templates/app.ini` a template contains environment
variables;

Signed-off-by: Tao Wang <twang2218@gmail.com>
2017-10-31 16:55:46 +08:00
b0b24a2dbb Use RelAvatarLink() in GetActAvatar() (#2800) 2017-10-31 16:08:23 +08:00
82fc50f4ee Fix Git LFS object/repo link storage in database and small refactoring (#2803) 2017-10-30 20:11:56 +08:00
513375c429 Make URL scheme unambiguous (#2408)
* 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
2017-10-30 10:04:25 +08:00
6e98812ecf Fix copy in email templates (#2801) 2017-10-29 23:57:05 +02:00
638509b217 Add Safari pinned tab icon (#2799)
Closes #2753

Signed-off-by: Bastian Rinsche <bastian.rinsche@gmail.com>
2017-10-28 20:01:42 -05:00
9ddbbd9d5a improve force push detect when push (#2798) 2017-10-28 22:36:20 +03:00
1da17db717 Fix Various Grammar Issues and Adjust Unnatural Wording (#2737)
* Fix Comma Splices

Replace comma splices with more fitting punctuation—usually semicolons.

Signed-off-by: Omar Assadi <omar@assadi.ru>

* Turn Some Conjunctions into Sentences

Turn conjunctions—which are capable of standing on their own—into their standalone sentences.

Signed-off-by: Omar Assadi <omar@assadi.ru>

* Reword Sections and Fix Issues in Docs

Reword sections of the contributing docs and readme file to be more
natural and clear. Additionally, fix the majority of the grammar
mistakes.

Signed-off-by: Omar Assadi <omar@assadi.co.il>
2017-10-28 18:22:44 +03:00
5866eb2321 Code/repo search (#2582)
Indexed search of repository contents (for default branch only)
2017-10-27 09:10:54 +03:00
762f1d7237 Add wrapping to long diff lines (#2789)
* Add wrapping to long diff lines to fix #1827

* Fix  css class and make changes to source (less) files

* Fix wrong space indentation

* Fix indentation inconsistencies and remove very old WebKit workaround
2017-10-27 12:30:54 +08:00
ddb7f59ef4 Add search mode option to /api/repo/search (#2756)
* Add repo type option to /api/repo/search

* Add tests and fix result of collaborative filter in specific condition

* Fix/optimize search & tests

* Improve integration tests

* Fix lint errors

* Fix unit tests

* Change and improve internal implementation of repo search

* Use NonexistentID

* Make search api more general

* Change mirror and fork search behaviour

* Fix tests & typo in comment
2017-10-27 00:16:13 +03:00
4d01ecaef3 Show Sendmail settings on admin config page (#2782)
* Show Sendmail settings on admin config page

* Remove unecessary if statement
2017-10-26 16:47:16 +08:00
6a107e57f6 Add checks for commits with missing author and time (#2771)
* Add checks for commits with missing author and time

* Fix validate commits with emails if it has no Author
2017-10-26 15:45:14 +08:00
bc84110989 don't check minimum key size when disabled (#1754)
* cleanup old comments for ed25519

These comments were added when x/crypto/ed25519 could not yet handle
ed25519. It does now, so it should be removed.
Also the key type is now replaced with the proper constant.

* move the minimum key size config before the check

This moves the actual config lookup before any check is done. This
avoids problems with calling to ssh-keygen which doesn't support the
expected output format and returning an error, when the check is disabled.
2017-10-26 09:49:41 +08:00
eca05b09aa Add commit count caching (#2774)
* Add commit count caching

* Small refactoring

* Add different key prefix for refs and commits

* Add configuratuion option to allow to change caching time or disable it
2017-10-26 09:37:33 +08:00
3ab580c8d6 Add branch overiew page (#2108)
* Add branch overiew page

* fix changed method name on sub menu

* remove unused code
2017-10-26 08:49:16 +08:00
e86a0bf3fe Add support for extra sendmail arguments (#2731)
* Add support for extra sendmail arguments

* Sendmail args to exec.command should be a list

* Add go-shellquote package

* Use go-shellquote lib for parsing Sendmail args

* Only parse if sendmail is configured
2017-10-25 22:27:25 +03:00
3af5b67ed0 Sync MaxGitDiffLineCharacters with conf/app.ini (#2779)
MAX_GIT_DIFF_LINE_CHARACTERS was updated in #1845 but the corresponding
default value of MaxGitDiffLineCharacters was not changed. This can lead
to inconsistencies.
2017-10-25 16:28:58 +08:00
178bd498b9 fix imports 2017-10-25 13:30:29 +08:00
219ca5cadb some fixes 2017-10-25 13:26:14 +08:00
796be03e9b fix discord hook bug (#2778) 2017-10-25 13:13:45 +08:00
b0f04e7593 Fix Polish language name spelling (#2766) 2017-10-24 21:35:34 -05:00
6eeadb2082 Hide unactive on explore users and some refactors (#2741)
* hide unactive on explore users and some refactors

* fix test for removed Organizations

* fix test for removed Organizations

* fix imports

* fix logic bug

* refactor the toConds

* Rename TestOrganizations to TestSearchUsers and add tests for users

* fix other tests

* fix other tests

* fix watchers tests

* fix comments and remove unused code
2017-10-24 20:36:19 +03:00
03900303a9 add default ssh ciphers (#2761) 2017-10-23 23:20:44 +08:00
9ba7898911 Update vendor git (#2765) 2017-10-23 16:36:14 +03:00
81d1e54a49 Use identicon image for default gravatar. (#2767)
* Use identicon image for default gravatar.

* Fixed tests.
2017-10-23 03:50:07 -05:00
e4990ba205 Fix emojify image URL (#2769) 2017-10-23 03:48:56 -05:00
a257f88a09 Remove manual of unsupported option (#2757) 2017-10-21 21:17:48 -02:00
0e9e48bd5c Fix activity css conflit with semantic ui (#2758) 2017-10-21 18:07:06 -02:00
619b9b5547 Move swagger-ui under /api/v1 (#2746)
* Move swagger interface under /api/v1

* Update swagger-ui

* Add /api/swagger and prepare for multiple api version

* Update test links

* Fix footer link
2017-10-21 22:05:50 +08:00
bc8d72666c Admin grammar fixes and improvements (#2056) 2017-10-21 16:30:21 +03:00
7131c7d40d Configurable SSH cipher suite (#913)
* Configurable SSH cipher suite

* Update configuration file comment

* Add default in settings loading code

* Fix fmt and log messsage

* Remove default from code as this could probably might not be good idea
2017-10-21 16:13:41 +03:00
985a39590b Use buffersize to reduce database connection when iterate (#2724)
* use buffersize to reduce database connection when iterate

* fix typo

* add default value on app.ini comment
2017-10-21 14:26:23 +08:00
2112eb8741 Update vendor github.com/lib/pq (#2752) 2017-10-21 12:05:58 +08:00
d4c9399576 Set default lfs content path (#2521) 2017-10-19 09:52:37 +03:00
222244836f Fix IE unsupported javascript construction (#2736) 2017-10-19 14:00:36 +08:00
847272a70d Only update mirror last update after successful sync (#2730) 2017-10-18 21:50:41 +03:00
30afce1523 Fix tabs according to semantic-ui docs (#2733) 2017-10-18 21:18:31 +03:00
2a184f5924 Fix typos in app.ini (#2732) 2017-10-17 21:11:23 -05:00
ccd3577970 Fix repository search function (#2689)
* Fix and remove FIXME

* Respect membership visibility

* Fix/rewrite searchRepositoryByName function

* Add unit tests

* Add integration tests

* Remove Searcher completely

* Remove trailing space
2017-10-17 23:20:22 +08:00
af4a094e5d Fix semantic-ui style conflict with v-cloak (#2722) 2017-10-17 02:24:43 -05:00
f4190f8df8 Render plain text README.txt monospaced (#2721)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2017-10-17 02:17:22 +03:00
33647aa43b Fixing wrong translations on sorttype oldest/latest (#2720) 2017-10-16 23:26:11 +03:00
9e865cee67 Merge password and 2fa page on user settings (#2695)
* merge password and 2fa page on user settings
2017-10-16 11:14:12 +02:00
c1b0c9e7c4 Fix PR, milestone and label functionality if issue unit is disabled (#2710)
* Fix PR, milestone and label functionality if issue unit is disabled or not assigned to user

* Fix multi-actions in PR page

* Change error message

* Fix comment update and delete functionality in PR
2017-10-16 10:55:43 +03:00
a75d5c72bb Fix plain readme didn't render correctly on repo home page (#2705)
* fix plain readme didn't render correctly on repo home page

* fix missing render

* remove unused template variables
2017-10-16 09:04:34 +02:00
c7f4f07765 Integration test for activity page (#2704)
* Integration test for activity page

* Small code refactoring for acitvity page

* Move activity stats calculation logic to model
2017-10-16 00:54:53 +03:00
f3833b7ce4 Create new branch from branch selection dropdown (#2130)
* Create new branch from branch selection dropdown and rewrite it to VueJS

* Make updateLocalCopyToCommit as not exported

* Move branch name validation to model

* Fix possible race condition
2017-10-15 22:59:24 +03:00
c25303b11c Fix activity locale (#2709) 2017-10-15 21:30:26 +03:00
4ccb0fe338 fix .netrc authentication (#2700)
* provide both possible authentication solutions

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-10-15 18:35:43 +03:00
1ec4dc6c1d Fix so that user can still fork his own repository to owned organizations (#2699)
* Fix so that user can still fork his own repository to his organizations

* Fix to only use owned organizations

* Add integration test for forking own repository to owned organization
2017-10-15 18:06:07 +03:00
32ca299650 Remove direct user adding to organization members (#2641) 2017-10-15 10:24:24 +08:00
f42dbdbae5 Add Activity page to repository (#2674)
* Add Activity page to repository

* Add request data for activity

* Add issue data for activity

* Add user unit right checks

* Add releases to activity

* Log repository unit loading error
2017-10-15 02:17:39 +03:00
8863e74f2a Fix organization watch migration (#2703) 2017-10-14 20:47:05 +03:00
e89bb7ef6a Allow custom SSH user in UI for built-in SSH server (#2617) (#2678)
* Allow custom SSH user in UI for built-in SSH server (#2617)

* Some fixes

* Did make fmt

* Updated according to review

- Renamed config to BUILTIN_SSH_SERVER_USER
- Removed unnecessary default string value for config item

* Updated according to review

* Fixed some minor issues
2017-10-14 18:51:00 +03:00
514006a2e5 Fix orgnization user watch repository (#2670)
* remove orgnization watch repositories

* fix migration

* fix typo and missing change

* remove unused code
2017-10-14 22:37:43 +08:00
a4cd4616c6 Update hard-coded version to 1.3.0-dev (#2390)
* Use -dev (1.3.0-dev is less than 1.3.0, according to semver)

* Use fake version for testing purpose
2017-10-12 14:40:42 +03:00
dff26e25ca Remove redudant functions and code (#2652)
* Remove redudant functions and code
2017-10-10 22:37:18 +02:00
c2346e4469 Add repository search unit and integration tests (#2575)
* Add more repo search tests

* Fix repo search tests

* Always test returned repos length

* Add test with lower pagesize limit (test more pages)

* Add and fix /api/repo/search integration tests

* Simplify unit tests code

* Simplify and unify integration tests code

* Improve test coverage

* Temporary fix tests due to bugs in current repo search implementation

* Revert removing not nil Searcher

* Add more checks to tests

* Simplify privacy checks in /api/repo tests

* Temporary remove privacy check from repo search tests
2017-10-10 09:23:29 +08:00
0cef8ce192 fix panic on gogs webhook creation (#2675)
* fix panic on gogs webhook creation

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix panic in gogs webhook edit

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-10-08 19:37:31 +08:00
ebac051e72 Rewrite migrations to not depend on future code changes (#2604)
* v38 migration used an outdated version of RepoUnit model (#2602)

* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix lint error

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Fix time tracking migration

* Refactor code

* Fix migration from Gogs

* v38 migration used an outdated version of RepoUnit model (#2602)

* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix lint error

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Fix time tracking migration

* Refactor code

* Fix migration from Gogs

* add error check

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Additiomal fixes for migrations

* Fix timetracking migration

* Add back nil check
2017-10-08 19:08:18 +08:00
92123fe82a GPG key email verification no longer case sensitive (#2661) (#2663)
* GPG key email verification no longer case sensitive (#2661)

* case insensitive GPG key email verification now cached (#2661)

Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
2017-10-06 23:28:21 +03:00
ffab139c91 table pull_request wasn't updated correctly (#2649)
* Fix: table `pull_request` won't be updated correctly

* Update also status column when manually merged
2017-10-06 00:25:40 +03:00
6b62f042c6 Update MAINTAINERS (#2660) 2017-10-05 03:57:37 -05:00
68674649df Add maintainer label for docker file (#2658)
* Add maintainer label for docker file

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-10-05 03:41:10 -05:00
67e1c29dc5 Refactor duplicated code in repo handlers (#2657)
* Refactor duplicated code in repo handlers

* ctx.Handle
2017-10-05 10:32:25 +03:00
43253202e9 Change default sort order (#2647)
* sort repositories by `updated_unix` in Explore

* Fix UI problem

* Added missing sort order "newest"

* Change default sort order

* fmt
2017-10-05 08:02:43 +03:00
aa962deec0 Replace deprecated Id method with ID (#2655) 2017-10-05 07:43:04 +03:00
e1266a19c8 Change pull description text (#2075) (#2646)
* Change pull description text

* move duplicated code into helper function
2017-10-04 20:35:01 +03:00
fcca037576 hide navbar when only 1 sign-in method is available (#2648) 2017-10-04 19:57:00 +03:00
a79af9cf6f Fix index column deletion (#2651) 2017-10-04 14:26:13 +03:00
4b2c8ca533 Use session when creating user (#2638) 2017-10-03 09:29:26 +03:00
b3cfa5a77e Use Semantic UI's Search component for user and repo search (#2636)
* Use search component on org invitation user input.

* Search component for collaboration and members.

* Search component for repo search.

* minCharacters for search input

* Display full_name for user search.

* Fixed missing uid query parameter for repo search.

* Removed unused comment.
2017-10-03 06:27:48 +03:00
a04718a2a6 Remove repo unit index (#2621)
* Remove repo unit index

* Fix sqlite
2017-10-02 23:22:25 +03:00
46cc45f049 Fix go get response if only app URL is custom in configuration (#2634)
* Fix go get response if only app URL is custom in configuration

* Rewrite to update Domain setting to match AppURL
2017-10-02 21:55:09 +08:00
a8717e5e3a Use AfterLoad instead of AfterSet on Structs (#2628)
* use AfterLoad instead of AfterSet on Structs

* fix the comments on AfterLoad

* fix the comments on action AfterLoad
2017-10-01 19:52:35 +03:00
1ad902d529 Fix implementation of repo Home func (#2601)
* Fix implementation of repo Home func

* Make fixture changes for testing
2017-10-01 16:50:56 +03:00
bae9cbce9c Remove redudant CheckUnit calls in router (#2627) 2017-09-30 12:04:16 +08:00
fbaa52a3a8 Link to gitea-specific Vagrant example (#2624)
.. rather than a gogs one
2017-09-30 08:50:19 +08:00
26e49b8e3d Fix doubled issue tab introduced in migration v16 (#2611)
* fix duplicate issue tab as UnitTypeIssue and UnitTypeExternalTracker are existing at the same time

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-28 16:14:51 +03:00
cc84ca40d7 Remove redudant issue LoadAttributes() calls (#2614) 2017-09-27 09:41:52 -03:00
339d7de409 Fix translation upload to crowdin (#2599) 2017-09-25 10:59:19 +03:00
dd55534b82 Reduce usage of allcols on update (#2596)
* reduce usage of allcols on update

* fix bug and tests
2017-09-25 12:59:27 +08:00
6b6f16cfae backport from v1.2 branch: add secrets for github release (#2588) (#2598) 2017-09-25 11:40:34 +08:00
fa28de820e Make indexer code more reusable (#2590) 2017-09-25 03:08:48 +03:00
0b0d85c90d Add pre-build step for nodejs stuff (#2581) 2017-09-25 00:49:32 +03:00
086eb62691 Compress css with nodejs (#2580) 2017-09-24 22:47:10 +03:00
fa6d7c7b99 Automatic update of translations (#2585)
* Adding build step for uploading translations

* Fixing crowdin project name

* Using crowdin plugin

* Changing secret name

* Adding pull: true
2017-09-23 19:08:42 +03:00
2ef8b8bcbe fix go get subpackage bug (#2584)
* fix go get subpackage bug

* merge the duplicated funtions
2017-09-23 16:24:24 +03:00
2db424c3f1 Fix broken migration to add can_push field back to table (#2574) 2017-09-23 16:45:41 +08:00
ccff57103a Automatically regenerate indexer for incompatible versions (#2524) 2017-09-23 00:30:56 +03:00
28f4de205f Fix drone for tags (#2573) 2017-09-22 18:34:02 +03:00
9a75a5d59b Use custom type and constants to hold order by options (#2572) 2017-09-22 15:53:21 +03:00
ca68a75b5b Expand fixtures (#2571)
* Add more repo search tests

* Add and fix /api/repo/search integration tests

* Add owner to access table for organization repositories

* Remove tests
2017-09-22 13:51:16 +03:00
b4b0280e33 Ctrl + Enter to submit forms (#2540)
* Hotfix for "Add time manually" (https://github.com/go-gitea/gitea/pull/2211#issuecomment-328780125)

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

* Submit forms if Ctrl+Enter is pressed inside a textarea

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

* Adding separate class for Ctrl+Enter-Submit
Checking if alt key is pressed too

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

* Changing .ctrlenter to .js-quick-submit

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2017-09-22 14:17:31 +08:00
1be2b4a262 fix readme view bug (#2566) 2017-09-21 21:24:19 +03:00
1eedd983ea Complete push webhooks (#2530)
* implemented missing 'delete' push webhooks

moreover created ActionDeleteBranch and ActionDeleteTag

* add CommitRepoAction tests for tag/branch creation/deletion

* fixed error where push webhook not called if is new branch or tag
removed unnecessary code

* moved prepare unit test environment into separate method to be used across unit tests

* add missing if clause in pushUpdate

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-21 10:43:26 +03:00
0d80af649a Add init support of orgmode document type on file view and readme (#2525)
* 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
2017-09-21 13:20:14 +08:00
66bc0ac251 Fix sending mail with a non-latin display name. #2102 (#2559)
* Fix sending mail with a non-latin display name. #2102

Signed-off-by: Rémi Saurel <contact@remi-saurel.com>

* Take into account the possibility that setting.MailService.From is in `name <email@address>` format. #2102

Signed-off-by: Rémi Saurel <contact@remi-saurel.com>
2017-09-21 12:29:45 +08:00
1fbfccb4fc Use standard lessc and minify CSS using Node.js (#2337)
* Use standard lessc and minify CSS using Node.js

This changes the previous nonstandard `lessc` to the official one and
enables CSS minification via the clean-css module.

To build CSS, Node.js is required along with a `npm install` to get the
tools installed locally in node_modules so there is no dependency on
binaries in PATH. Benefits include:

- Allows one to have a standard lessc in PATH.
- Can now use command line switches on lessc.
- Minified CSS brings faster page load times and also has the benefit
  of discouraging contributors from editing CSS directly.

To build CSS, Node.js is required along with a `npm install` to get the
tools installed locally based on the information in `package.json`.

The 'make stylesheet' task was modified to run without condition. This
makes it easier to work on the make task itself without having to delete
files.

Also fixes: https://github.com/go-gitea/gitea/issues/2198

* install node, npm and modules on drone

* .PHONY

* use 'minify' to minify CSS
2017-09-21 11:35:11 +08:00
fa1cbc2896 Always run fmt check in CI (#2546) 2017-09-21 09:34:32 +08:00
6718ea6ff1 Fix can_push value to false in protected_branch (#2560) 2017-09-20 17:52:23 +03:00
6f380a22a4 Remove go version check for make fmt (#2558) 2017-09-20 08:58:29 -03:00
80b430d7c0 Fix /api/repo/search integration tests (#2550) 2017-09-20 12:24:38 +03:00
7a0297819d Sync releases table with tags on push and for mirrors (#2459)
* Sync releases table with tags on push and for mirrors

* Code style fixes

* Fix api to return only releases

* Optimize release creation and update
Minimize posibility of race conditions

* Fix release lower tag name updating

* handle tag reference update by addionally comparing commit id
2017-09-20 13:26:49 +08:00
8b6236d67b Fix duplicated rel attribute (#2549)
According to the HTML 5.1 recommendation "The rel attribute on a
and area elements controls what kinds of links the elements create.
The attribute’s value must be a set of space-separated tokens."
(source https://www.w3.org/TR/html51/links.html#links-created-by-a-and-area-elements)
2017-09-20 07:20:11 +03:00
acecedc410 Use named ActionType constants in template helper (#2545) 2017-09-20 09:22:42 +08:00
4eed85db56 add @daviian as maintainer (#2552)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-19 23:03:31 +02:00
a1ed239bf2 Fix fmt errors (#2544) 2017-09-19 19:44:49 +08:00
23645fe05f Sort repository tree entries in natural way (#2506)
* 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
2017-09-19 11:37:03 +03:00
4cb9394a97 Fix lint errors (#2547) 2017-09-19 11:08:30 +03:00
d155d0e665 Make basic functionality work without JavaScript (#2541) 2017-09-19 01:03:01 +02:00
566e8ecce0 Fork permission bug fixes (#2534)
* Hotfix for "Add time manually" (https://github.com/go-gitea/gitea/pull/2211#issuecomment-328780125)

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

* Checking if Code unit is enabled before creating a fork.

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

* Adding a discrete function for RepoIDAssignment

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

* Improved Documentation
2017-09-18 22:52:20 +08:00
6c6533fb31 Make integration tests more user-friendly (#2536) 2017-09-18 16:35:42 +08:00
b0f7457d9e Improve issue search (#2387)
* Improve issue indexer

* Fix new issue sqlite bug

* Different test indexer paths for each db

* Add integration indexer paths to make clean
2017-09-16 23:16:21 +03:00
52e11b24bf Restructure markup & markdown to prepare for multiple markup language… (#2411)
* restructure markup & markdown to prepare for multiple markup languages support

* adjust some functions between markdown and markup

* fix tests

* improve the comments
2017-09-16 20:17:57 +03:00
911ca02153 Convert spaces to tabs in footer.tmpl (#2520) 2017-09-16 17:04:27 +08:00
d766d0c4e0 Prevent sending emails and notifications to inactive users (#2384)
* Filter inactive users before sending emails or creating browser notifications

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix formatting issues

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* included requested changes

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* optimized database queries

* rebasing new master and add tablenames for clarification in xorm queries

* remove escaped quotationmarks using backticks

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-16 08:18:25 +08:00
b496e3e1cc Fix unit test race condition (#2516) 2017-09-15 10:54:25 +03:00
cbe50587ba Added bucket name to s3 drone plugin (#2505) 2017-09-15 14:45:38 +08:00
ad24a3134d Fixes 500 error on dashboard when using MSSQL (#2504)
MSSQL rejects the query:
  SELECT "repository"."id" FROM "repository"
  INNER JOIN "team_repo" ON "team_repo".repo_id="repository".id AND
  "repository".is_mirror=1
  WHERE (
    ("repository".owner_id=2 AND "repository".is_private=0)
        OR team_repo.team_id IN (1)
        )
        GROUP BY "repository".id ORDER BY updated_unix DESC

when the order by term (updated_unix) is not included in the group by
term.
2017-09-15 09:14:06 +03:00
0f9e20b3d7 fix updated update on public key (#2514)
* fix updated update on public key

* update vendor.json

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix root path

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-09-15 11:23:48 +08:00
e5d80b7090 Implementation of all repositories of a user from user->settings (#1740)
* Implementation of all repositories of a user from user->settings

* Update message when no repository found

* Update according to comments

* Change UI to have a better look

* improved user repositories UI
2017-09-14 14:46:14 +03:00
1739e84ac0 improve protected branch to add whitelist support (#2451)
* improve protected branch to add whitelist support

* fix lint

* fix style check

* fix tests

* fix description on UI and import

* fix test

* bug fixed

* fix tests and languages

* move isSliceInt64Eq to util pkg; improve function names & typo
2017-09-14 16:16:22 +08:00
be3319b3d5 Display commit status on landing page of repo (#1784)
* 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
2017-09-14 14:51:31 +08:00
a89692d158 fix wrong rendering of commit detail page (#2503)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-14 08:12:56 +02:00
633de01cf7 Hotfix for "Add time manually" (https://github.com/go-gitea/gitea/pull/2211#issuecomment-328780125) (#2499)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2017-09-13 21:02:04 +02:00
35b473d8d3 Remove repository mirrors from "collaborative" list (#2497) 2017-09-13 19:02:37 +03:00
3e89e89670 add codecov.io service. (#2493)
* add codecov.io service.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* only PR or master branch (for coverage badge)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update init

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-09-13 20:57:55 +08:00
9ef83a98e5 fix release (#2496) 2017-09-13 17:20:15 +08:00
fb1ed5de94 Dockerfile: Updated alpine image to 3.6. (#2486)
Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2017-09-13 14:37:42 +08:00
377cd1ae38 Allow changing integration test database connection using env variables (#2484) 2017-09-13 14:03:20 +08:00
005900baea Use created & updated instead BeforeInsert & BeforeUpdate (#2482)
* use created & updated instead BeforeInsert & BeforeUpdate

* fix vendor checksum

* only show generated SQL when development mode

* remove extra update column updated_unix

* remove trace config
2017-09-13 08:18:22 +03:00
4c2b1be3a4 Basic VSCode configuration for building and debugging (#2483)
* Basic VSCode configuration for building and debugging

* Fix building and debugging in Windows

* Move to contrib folder and add instructions
2017-09-12 20:27:44 +08:00
8c3a2e817b Add missing fixture to clean gpg_key table (#2494)
* Add missing fixture to clean gpg_key table

* Fix possible too fast request execution in timetracker start/stop test
2017-09-12 13:54:45 +03:00
9bdbfbf6f3 Disable custom Git Hooks globally via configuration file (#2450)
* Create option to disable githooks globally via configuration file

* Update comment in app.ini to align with @ethantkoenig's suggestion

Signed-off-by: Matti Ranta <matti@mdranta.net>
2017-09-12 12:25:42 +03:00
3fecf94086 Open external wiki in new window (#2489) 2017-09-12 10:29:35 +03:00
5ccecb44ad 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>
2017-09-12 09:48:13 +03:00
69dfe43ffc Fix some tests : make coverage -> test (#2492)
* Fix test : make coverage -> test

* Refactor integration tests to be able to run them in parallel

* Add custom local repository temp path
2017-09-12 13:51:12 +08:00
eab4579e17 Fix fmt error in mailer (#2490) 2017-09-12 09:04:14 +08:00
01d7189c2d Fix slice out of bounds error in mailer (#2479) 2017-09-11 14:33:28 +08:00
250f1236dc * Fix fileview rendering bug #2470 (#2477) 2017-09-10 22:21:26 +02:00
fd85e25f5f Hotfix for integration testing (#2473)
* Hotfix for integration testing

* Comment sqlite tests because of database locking issues
2017-09-10 09:54:11 +08:00
4b8fef143e Changes for latest DroneCI (#2362) 2017-09-07 19:22:15 +02:00
95c408ffa5 hide branch on pull request view or create UI (#2454) 2017-09-06 15:02:51 +03:00
4f9a28e1f5 Make repo private to no interfere with other tests (#2467) 2017-09-06 00:33:33 +03:00
7c417bbb0d Only check at least one email gpg key (#2266)
* Only require one email (possibly not yet validated)

* Update message error and check validation of commit

* Add integrations tests

* Complete integration for import

* Add pre-check/optimization

* Add some test (not finished)

* Finish

* Fix fixtures

* Fix typo

* Don't guess key ID
2017-09-05 21:45:18 +08:00
5f4210a9b0 add release notes of v1.1.4 (#2463) 2017-09-05 09:00:55 +03:00
a569d3dedc Fix migration from pre-v15 to 1.2.0 (#2460) 2017-09-05 08:28:06 +08:00
32238e0ac9 Add changelog config file for generate changelog (#2461) 2017-09-04 13:07:57 +03:00
caa61a2b99 bug fixed 2017-09-04 14:22:07 +08:00
b689bb6180 Webhooks for repo creation/deletion (#1663)
* Webhooks for repo creation/deletion

* add createHookTask

* Add handles for GetSlackPayload and GetDiscordPayload
2017-09-03 11:20:24 +03:00
79f7839633 Wrap most text to 80 columns (#2452) 2017-09-02 22:38:31 +03:00
04ec79579c fix orgnization webhooks (#2422)
* fix org webhooks

* remove trace code
2017-08-30 13:36:52 +08:00
5de94a67cf some refactors for issue and comments (#2419) 2017-08-30 07:31:33 +03:00
edc817a1dc Wrap most paragraphs to 80 columns (#2396)
Reduces patches size and makes them more readable
2017-08-30 09:27:23 +08:00
3e6fed368b fix webhook test (#2415)
* fix webhook test

* fix error message

* fix typo
2017-08-29 22:55:24 +08:00
491f0ebc58 Fix route handler order (#2409)
* Fix route handler order

* Fix more routes
2017-08-29 14:53:51 +08:00
15d3872281 fix missing orgnization discord webhook (#2414) 2017-08-29 09:20:35 +08:00
019c90ab8f Update CONTRIBUTING following #2329 discussion
Creation of release branch before end of release dev and releases candidates + follow semver semantic (minor, patch)
2017-08-28 19:08:24 +02:00
edb95faba2 Fix releases to be counted from database not tags (#2389) 2017-08-28 22:06:10 +08:00
d23b36c598 Error message for integration test (#2410) 2017-08-28 21:36:02 +08:00
8e61823ec4 Fix tests code to prevent some runtime errors (#2381)
* Fix tests code to prevent some runtime errors

* Reduce nesting
2017-08-28 12:17:45 +03:00
ced50e0ec1 Implementation of discord webhook (#2402)
* implementation of discord webhook

* fix webhooks

* fix typo and unnecessary color values

* fix typo

* fix imports and revert changes to webhook_slack.go
2017-08-28 13:06:45 +08:00
e41da3845d fix duplicated feed (#2370) 2017-08-28 10:26:04 +08:00
0f2c98adcd Fix "index out of range" runtime error in repo_list tests (#2376) 2017-08-28 09:33:38 +08:00
ae08e6c5be Clarify Translation Process. Also fix branch names (#2378)
* Clarify Translation Process. Also fix branch names

* Update CONTRIBUTING.md
2017-08-28 09:26:27 +08:00
d9d8fad230 Add UseCompatSSHURI setting (#2356)
* Add UseCompatSSHURI setting

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com> (+1 squashed commits)

Squashed commits:

[dda2dc79] Add ForceCloneSSHURL setting

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>

* Make protocol if construct more readable

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>
2017-08-26 15:57:41 +02:00
f61a1d210c Fix missing collabrative repos (#2367)
* fix missing collabrative repos

* fix bug of collabrative

* fix SQL quotes
2017-08-24 22:01:03 +08:00
da230a2872 Add possibility to record branch or tag information in an issue (#780) 2017-08-24 15:30:27 +03:00
174255e74e Log failed authentication attempts with remote address for fail2ban (#2334)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-08-24 08:57:54 +03:00
233bbcfa94 Fix integration test after librejs location change (#2374)
Fixes #2373
2017-08-24 08:54:06 +03:00
874f9be3e6 Move themes to plugin directory. Fixes #2372 (#2375) 2017-08-24 08:52:42 +03:00
0fd9289810 update translation from crowdin (#2368) 2017-08-23 23:17:25 +08:00
a915a09e4f Moved vendored js/css into public/vendor and documented sources (#1484) (#2241)
* Cleaning up public/ and documenting js/css libs.

This commit mostly addresses #1484 by moving vendor'ed plugins into a
vendor/ directory and documenting their upstream source and license in
vendor/librejs.html.

This also proves gitea is using only open source js/css libraries which
helps toward reaching #1524.

* Removing unused css file.

The version of this file in use is located at:
  vendor/plugins/highlight/github.css

* Cleaned up librejs.html and added javascript header

A SafeJS function was added to templates/helper.go to allow keeping
comments inside of javascript.

A javascript comment was added in the header of templates/base/head.tmpl
to mark all non-inline source as free.

The librejs.html file was updated to meet the current librejs spec. I
have now verified that the librejs plugin detects most of the scripts
included in gitea and suspect the non-free detections are the result of
a bug in the plugin. I believe this commit is enough to meet the C0.0
requirement of #1534.

* Updating SafeJS function per lint suggestion

* Added VERSIONS file, per request
2017-08-23 16:58:05 +02:00
3736 changed files with 504736 additions and 295866 deletions

44
.changelog.yml Normal file
View File

@ -0,0 +1,44 @@
repo: go-gitea/gitea
groups:
-
name: BREAKING
labels:
- kind/breaking
-
name: FEATURE
labels:
- kind/feature
-
name: BUGFIXES
labels:
- kind/bug
-
name: ENHANCEMENT
labels:
- kind/enhancement
- kind/refactor
- kind/ui
-
name: SECURITY
labels:
- kind/security
-
name: TESTING
labels:
- kind/testing
-
name: TRANSLATION
labels:
- kind/translation
-
name: BUILD
labels:
- kind/build
- kind/lint
-
name: DOCS
labels:
- kind/docs
-
name: MISC
default: true

View File

@ -1,5 +0,0 @@
*
!gitea
!docker
!public
!templates

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,4 @@
# http://editorconfig.org
root = true
[*]
@ -15,11 +14,11 @@ indent_size = 8
indent_style = tab
indent_size = 4
[*.{less}]
[*.less]
indent_style = space
indent_size = 4
[*.{yml}]
[*.{yml,json}]
indent_style = space
indent_size = 2

View File

@ -1,7 +1,9 @@
<!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue -->
<!--
1. Please speak English, this is the language all of us can speak and write.
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io).
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your issue doesn't already exist.
4. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.

53
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,53 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 14
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- status/blocked
- kind/security
- lgtm/done
- reviewed/confirmed
- priority/critical
- kind/proposal
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you
for your contributions.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed because of inactivity.
You can re-open it if needed.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
pulls:
daysUntilStale: 60
daysUntilClose: 60
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you
for your contributions.
closeComment: >
This pull request has been automatically closed because of inactivity.
You can re-open it if needed.

32
.gitignore vendored
View File

@ -10,6 +10,9 @@ _test
# IntelliJ
.idea
# MS VSCode
.vscode
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
@ -27,6 +30,7 @@ _testmain.go
*.prof
*coverage.out
coverage.all
/modules/options/bindata.go
/modules/public/bindata.go
@ -36,6 +40,7 @@ _testmain.go
*.log
/gitea
/debug
/integrations.test
/bin
@ -45,4 +50,29 @@ _testmain.go
/indexers
/log
/public/img/avatar
/integrations/gitea-integration
/integrations/gitea-integration-mysql
/integrations/gitea-integration-mysql8
/integrations/gitea-integration-pgsql
/integrations/gitea-integration-sqlite
/integrations/gitea-integration-mssql
/integrations/indexers-mysql
/integrations/indexers-mysql8
/integrations/indexers-pgsql
/integrations/indexers-sqlite
/integrations/indexers-mssql
/integrations/mysql.ini
/integrations/mysql8.ini
/integrations/pgsql.ini
/integrations/mssql.ini
/node_modules
/modules/indexer/issues/indexers
# Snapcraft
snap/.snapcraft/
parts/
stage/
prime/
*.snap
*.snap-build
*_source.tar.bz2

3
.lgtm
View File

@ -1,2 +1,3 @@
self_approval_off = false
pattern = "(?)LGTM"
self_approval_off = true
ignore_maintainers_file = true

25
.revive.toml Normal file
View File

@ -0,0 +1,25 @@
ignoreGeneratedHeader = false
severity = "warning"
confidence = 0.8
errorCode = 1
warningCode = 1
[rule.blank-imports]
[rule.context-as-argument]
[rule.context-keys-type]
[rule.dot-imports]
[rule.error-return]
[rule.error-strings]
[rule.error-naming]
[rule.exported]
[rule.if-return]
[rule.increment-decrement]
[rule.var-naming]
[rule.var-declaration]
[rule.package-comments]
[rule.range]
[rule.receiver-naming]
[rule.time-naming]
[rule.unexported-return]
[rule.indent-error-flow]
[rule.errorf]

51
BSDmakefile Normal file
View File

@ -0,0 +1,51 @@
# GNU makefile proxy script for BSD make
# Written and maintained by Mahmoud Al-Qudsi <mqudsi@neosmart.net>
# Copyright NeoSmart Technologies <https://neosmart.net/> 2014-2018
# Obtain updates from <https://github.com/neosmart/gmake-proxy>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
JARG =
GMAKE = "gmake"
#When gmake is called from another make instance, -w is automatically added
#which causes extraneous messages about directory changes to be emitted.
#--no-print-directory silences these messages.
GARGS = "--no-print-directory"
.if "$(.MAKE.JOBS)" != ""
JARG = -j$(.MAKE.JOBS)
.endif
#by default bmake will cd into ./obj first
.OBJDIR: ./
.PHONY: FRC
$(.TARGETS): FRC
$(GMAKE) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG)
.DONE .DEFAULT: .SILENT
$(GMAKE) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG)
.ERROR: .SILENT
if ! which $(GMAKE) > /dev/null; then \
echo "GNU Make is required!"; \
fi

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,41 @@
FROM alpine:3.5
MAINTAINER Thomas Boerger <thomas@webhippie.de>
###################################
#Build stage
FROM golang:1.12-alpine3.9 AS build-env
ARG GITEA_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata $TAGS"
#Build deps
RUN apk --no-cache add build-base git
#Setup repo
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
#Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean generate build
FROM alpine:3.9
LABEL maintainer="maintainers@gitea.io"
EXPOSE 22 3000
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
bash \
ca-certificates \
curl \
gettext \
git \
linux-pam \
s6 \
curl \
openssh \
s6 \
sqlite \
su-exec \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
@ -28,7 +50,6 @@ RUN addgroup \
ENV USER git
ENV GITEA_CUSTOM /data/gitea
ENV GODEBUG=netdns=go
VOLUME ["/data"]
@ -36,4 +57,5 @@ ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
COPY docker /
COPY gitea /app/gitea/gitea
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
RUN ln -s /app/gitea/gitea /usr/local/bin/gitea

View File

@ -1,40 +0,0 @@
FROM multiarch/alpine:aarch64-v3.5
EXPOSE 22 3000
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
bash \
git \
linux-pam \
s6 \
curl \
openssh \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
adduser \
-S -H -D \
-h /data/git \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
ENV USER git
ENV GITEA_CUSTOM /data/gitea
COPY docker /
COPY gitea /app/gitea/gitea
ENV GODEBUG=netdns=go
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]

View File

@ -1,39 +0,0 @@
FROM multiarch/alpine:armhf-v3.5
MAINTAINER Thomas Boerger <thomas@webhippie.de>
EXPOSE 22 3000
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
bash \
git \
linux-pam \
s6 \
curl \
openssh \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
adduser \
-S -H -D \
-h /data/git \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
ENV USER git
ENV GITEA_CUSTOM /data/gitea
ENV GODEBUG=netdns=go
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
COPY docker /
COPY gitea /app/gitea/gitea

1341
Gopkg.lock generated Normal file

File diff suppressed because it is too large Load Diff

119
Gopkg.toml Normal file
View File

@ -0,0 +1,119 @@
ignored = ["google.golang.org/appengine*"]
[prune]
go-tests = true
unused-packages = true
non-go = true
[[constraint]]
branch = "master"
name = "code.gitea.io/git"
[[constraint]]
branch = "master"
name = "code.gitea.io/sdk"
[[constraint]]
revision = "05d86ea8f6e30456949f612cf68cf4a27ce8c9c5"
name = "github.com/blevesearch/bleve"
[[constraint]]
revision = "12dd70caea0268ac0d6c2707d0611ef601e7c64e"
name = "golang.org/x/crypto"
[[constraint]]
branch = "master"
name = "golang.org/x/sys"
[[constraint]]
revision = "2bf8f2a19ec09c670e931282edfe6567f6be21c9"
name = "golang.org/x/text"
[[constraint]]
branch = "master"
name = "golang.org/x/net"
[[override]]
name = "github.com/go-xorm/xorm"
revision = "a6300f2a45e05a8f75f00a1d6188049fe7851915"
[[override]]
name = "github.com/go-xorm/builder"
version = "0.3.3"
[[override]]
name = "github.com/go-sql-driver/mysql"
revision = "c45f530f8e7fe40f4687eaa50d0c8c5f1b66f9e0"
[[override]]
name = "github.com/mattn/go-sqlite3"
revision = "c7c4067b79cc51e6dfdcef5c702e74b1e0fa7c75"
[[override]]
name = "github.com/gorilla/mux"
revision = "757bef944d0f21880861c2dd9c871ca543023cba"
[[constraint]]
name = "github.com/gorilla/context"
version = "1.1.1"
[[constraint]]
name = "github.com/lafriks/xormstore"
version = "1.0.0"
[[constraint]]
branch = "master"
name = "github.com/lunny/dingtalk_webhook"
[[constraint]]
name = "github.com/markbates/goth"
version = "1.47.2"
[[constraint]]
branch = "master"
name = "github.com/mcuadros/go-version"
[[constraint]]
branch = "master"
name = "github.com/russross/blackfriday"
[[constraint]]
branch = "master"
name = "github.com/tstranex/u2f"
[[constraint]]
name = "gopkg.in/editorconfig/editorconfig-core-go.v1"
version = "1.2.0"
[[constraint]]
branch = "v2"
name = "gopkg.in/gomail.v2"
[[constraint]]
name = "gopkg.in/ini.v1"
version = "1.31.1"
[[constraint]]
name = "gopkg.in/ldap.v3"
version = "3.0.1"
[[constraint]]
name = "gopkg.in/macaron.v1"
version = "1.2.4"
[[constraint]]
name = "gopkg.in/testfixtures.v2"
version = "2.0.0"
[[override]]
branch = "master"
name = "golang.org/x/oauth2"
[[constraint]]
name = "github.com/prometheus/client_golang"
version = "0.9.0"
[[constraint]]
name = "github.com/mvdan/xurls"
version = "2.0.0"

View File

@ -7,6 +7,7 @@ Kim Carlbäcker <kim.carlbacker@gmail.com> (@bkcsoft)
LefsFlare <nobody@nobody.tld> (@LefsFlarey)
Lunny Xiao <xiaolunwen@gmail.com> (@lunny)
Matthias Loibl <mail@matthiasloibl.com> (@metalmatze)
Morgan Bazalgette <the@howl.moe> (@thehowl)
Rachid Zarouali <nobody@nobody.tld> (@xinity)
Rémy Boulanouar <admin@dblk.org> (@DblK)
Sandro Santilli <strk@kbt.io> (@strk)
@ -16,3 +17,14 @@ Patrick G <geek1011@outlook.com> (@geek1011)
Antoine Girard <sapk@sapk.fr> (@sapk)
Lauris Bukšis-Haberkorns <lauris@nix.lv> (@lafriks)
Jonas Östanbäck <jonas.ostanback@gmail.com> (@cez81)
David Schneiderbauer <dschneiderbauer@gmail.com> (@daviian)
Peter Žeby <morlinest@gmail.com> (@morlinest)
Matti Ranta <matti@mdranta.net> (@techknowlogick)
Jonas Franz <info@jonasfranz.software> (@jonasfranz)
Alexey Terentyev <axifnx@gmail.com> (@axifive)
Lanre Adelowo <yo@lanre.wtf> (@adelowo)
Konrad Langenberg <k@knt.li> (@kolaente)
He-Long Zhang <outman99@hotmail.com> (@BetaCat0)
Andrew Thornton <art27@cantab.net> (@zeripath)
John Olheiser <john.olheiser@gmail.com> (@jolheiser)
Richard Mahn <rich.mahn@unfoldingword.org> (@richmahn)

292
Makefile

File diff suppressed because it is too large Load Diff

101
README.md
View File

@ -4,36 +4,58 @@
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg)](https://drone.gitea.io/go-gitea/gitea)
[![Join the Discord chat at https://discord.gg/NsatcWJ](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
[![Join the Matrix chat at https://matrix.to/#/#gitea:matrix.org](https://img.shields.io/badge/matrix-%23gitea%3Amatrix.org-7bc9a4.svg)](https://matrix.to/#/#gitea:matrix.org)
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
[![Coverage Status](https://coverage.gitea.io/badges/go-gitea/gitea/coverage.svg)](https://coverage.gitea.io/go-gitea/gitea)
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
[![Release](https://github-release-version.herokuapp.com/github/go-gitea/gitea/release.svg?style=flat)](https://github.com/go-gitea/gitea/releases/latest)
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://i.imgur.com/3iEQsux.jpg)|![Repository](https://i.imgur.com/glqFnj8.jpg)|![Commits History](https://i.imgur.com/ad1FEpi.jpg)|
|![Profile](https://i.imgur.com/q81EcGa.jpg)|![Admin Dashboard](https://i.imgur.com/L2CQeN0.jpg)|![Diff](https://i.imgur.com/cNuvMum.jpg)|
|![Issues](https://i.imgur.com/xCYRqaF.jpg)|![Releases](https://i.imgur.com/ILpRBCe.jpg)|![Organization](https://i.imgur.com/0BHnrcL.jpg)|
[![GitHub release](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest)
[![Help Contribute to Open Source](https://www.codetriage.com/go-gitea/gitea/badges/users.svg)](https://www.codetriage.com/go-gitea/gitea)
[![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backer/badge.svg?label=backer&color=brightgreen)](https://opencollective.com/gitea)
## Purpose
The goal of this project is to make the easiest, fastest, and most painless way of setting up a self-hosted Git service. Using Go, this can be done with an independent binary distribution across **all platforms** which Go supports, including Linux, macOS, and Windows on x86, amd64, ARM and PowerPC architectures. Want to try it before doing anything else? Do it [with the online demo](https://try.gitea.io/)! This project has been [forked](https://blog.gitea.io/2016/12/welcome-to-gitea/) from [Gogs](https://gogs.io).
The goal of this project is to make the easiest, fastest, and most
painless way of setting up a self-hosted Git service.
Using Go, this can be done with an independent binary distribution across
**all platforms** which Go supports, including Linux, macOS, and Windows
on x86, amd64, ARM and PowerPC architectures.
Want to try it before doing anything else?
Do it [with the online demo](https://try.gitea.io/)!
This project has been
[forked](https://blog.gitea.io/2016/12/welcome-to-gitea/) from
[Gogs](https://gogs.io) since 2016.11 but changed a lot.
## Notes
## Building
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
2. If you found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
3. If you're interested in using our APIs, we have experimental support with [documentation](https://godoc.org/code.gitea.io/sdk/gitea).
From the root of the source tree, run:
## Docs
TAGS="bindata" make generate all
For more information and instructions about how to install Gitea please look at our [documentation](https://docs.gitea.io/en-us/). If you cannot find some specific information, then head over to our [Discord server](https://discord.gg/NsatcWJ) or [Matrix room](https://matrix.to/#/#gitea:matrix.org) to chat with us or use the [forum](https://discourse.gitea.io/).
More info: https://docs.gitea.io/en-us/install-from-source/
## Using
./gitea web
NOTE: If you're interested in using our APIs, we have experimental
support with [documentation](https://try.gitea.io/api/swagger).
## Contributing
Fork -> Patch -> Push -> Pull Request
Expected workflow is: Fork -> Patch -> Push -> Pull Request
NOTES:
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
2. If you have found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
## Further information
For more information and instructions about how to install Gitea, please look
at our [documentation](https://docs.gitea.io/en-us/). If you have questions
that are not covered by the documentation, you can get in contact with us on
our [Discord server](https://discord.gg/NsatcWJ),
or [forum](https://discourse.gitea.io/)!
## Authors
@ -41,6 +63,49 @@ Fork -> Patch -> Push -> Pull Request
* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
* [Translators](options/locale/TRANSLATORS)
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/gitea#backer)]
<a href="https://opencollective.com/gitea#backers" target="_blank"><img src="https://opencollective.com/gitea/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/gitea#sponsor)]
<a href="https://opencollective.com/gitea/sponsor/0/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/1/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/2/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/3/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/4/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/5/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/6/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
## FAQ
**How do you pronounce Gitea?**
Gitea is pronounced [/ɡɪti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea" with a hard g.
**Why is this not hosted on a Gitea instance?**
We're [working on it](https://github.com/go-gitea/gitea/issues/1029).
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file for the full license text.
This project is licensed under the MIT License.
See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file
for the full license text.
## Screenshots
Looking for an overview of the interface? Check it out!
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Wiki](https://image.ibb.co/dYV9YG/9.png)|
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|

View File

@ -8,17 +8,12 @@
[![Coverage Status](https://coverage.gitea.io/badges/go-gitea/gitea/coverage.svg)](https://coverage.gitea.io/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
[![Release](https://github-release-version.herokuapp.com/github/go-gitea/gitea/release.svg?style=flat)](https://github.com/go-gitea/gitea/releases/latest)
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://i.imgur.com/3iEQsux.jpg)|![Repository](https://i.imgur.com/glqFnj8.jpg)|![Commits History](https://i.imgur.com/ad1FEpi.jpg)|
|![Profile](https://i.imgur.com/q81EcGa.jpg)|![Admin Dashboard](https://i.imgur.com/L2CQeN0.jpg)|![Diff](https://i.imgur.com/cNuvMum.jpg)|
|![Issues](https://i.imgur.com/xCYRqaF.jpg)|![Releases](https://i.imgur.com/ILpRBCe.jpg)|![Organization](https://i.imgur.com/0BHnrcL.jpg)|
[![GitHub release](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest)
[![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backer/badge.svg?label=backer&color=brightgreen)](https://opencollective.com/gitea)
## 目标
Gitea的首要目标是创建一个极易安装运行非常快速安装和使用体验良好的自建 Git 服务。我们采用Go作为后端语言这使我们只要生成一个可执行程序即可。并且他还支持跨平台支持 Linux, macOS 和 Windows 以及各种架构除了x86amd64还包括 ARM 和 PowerPC。
Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了 x86amd64还包括 ARM 和 PowerPC。
如果您想试用一下,请访问 [在线Demo](https://try.gitea.io/)
@ -45,3 +40,12 @@ Fork -> Patch -> Push -> Pull Request
## 授权许可
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) 文件中。
## 截图
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Wiki](https://image.ibb.co/dYV9YG/9.png)|
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|

File diff suppressed because it is too large Load Diff

View File

@ -90,16 +90,16 @@ func pemBlockForKey(priv interface{}) *pem.Block {
}
}
func runCert(ctx *cli.Context) error {
if len(ctx.String("host")) == 0 {
log.Fatal("Missing required --host parameter")
func runCert(c *cli.Context) error {
if err := argsSet(c, "host"); err != nil {
return err
}
var priv interface{}
var err error
switch ctx.String("ecdsa-curve") {
switch c.String("ecdsa-curve") {
case "":
priv, err = rsa.GenerateKey(rand.Reader, ctx.Int("rsa-bits"))
priv, err = rsa.GenerateKey(rand.Reader, c.Int("rsa-bits"))
case "P224":
priv, err = ecdsa.GenerateKey(elliptic.P224(), rand.Reader)
case "P256":
@ -109,23 +109,23 @@ func runCert(ctx *cli.Context) error {
case "P521":
priv, err = ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
default:
log.Fatalf("Unrecognized elliptic curve: %q", ctx.String("ecdsa-curve"))
log.Fatalf("Unrecognized elliptic curve: %q", c.String("ecdsa-curve"))
}
if err != nil {
log.Fatalf("Failed to generate private key: %v", err)
}
var notBefore time.Time
if len(ctx.String("start-date")) == 0 {
notBefore = time.Now()
} else {
notBefore, err = time.Parse("Jan 2 15:04:05 2006", ctx.String("start-date"))
if startDate := c.String("start-date"); startDate != "" {
notBefore, err = time.Parse("Jan 2 15:04:05 2006", startDate)
if err != nil {
log.Fatalf("Failed to parse creation date: %v", err)
}
} else {
notBefore = time.Now()
}
notAfter := notBefore.Add(ctx.Duration("duration"))
notAfter := notBefore.Add(c.Duration("duration"))
serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
@ -147,7 +147,7 @@ func runCert(ctx *cli.Context) error {
BasicConstraintsValid: true,
}
hosts := strings.Split(ctx.String("host"), ",")
hosts := strings.Split(c.String("host"), ",")
for _, h := range hosts {
if ip := net.ParseIP(h); ip != nil {
template.IPAddresses = append(template.IPAddresses, ip)
@ -156,7 +156,7 @@ func runCert(ctx *cli.Context) error {
}
}
if ctx.Bool("ca") {
if c.Bool("ca") {
template.IsCA = true
template.KeyUsage |= x509.KeyUsageCertSign
}

48
cmd/cmd.go Normal file
View File

@ -0,0 +1,48 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// Package cmd provides subcommands to the gitea binary - such as "web" or
// "admin".
package cmd
import (
"errors"
"fmt"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"github.com/urfave/cli"
)
// argsSet checks that all the required arguments are set. args is a list of
// arguments that must be set in the passed Context.
func argsSet(c *cli.Context, args ...string) error {
for _, a := range args {
if !c.IsSet(a) {
return errors.New(a + " is not set")
}
if util.IsEmptyString(a) {
return errors.New(a + " is required")
}
}
return nil
}
func initDB() error {
return initDBDisableConsole(false)
}
func initDBDisableConsole(disableConsole bool) error {
setting.NewContext()
models.LoadConfigs()
setting.NewXORMLogService(disableConsole)
if err := models.SetEngine(); err != nil {
return fmt.Errorf("models.SetEngine: %v", err)
}
return nil
}

View File

@ -48,6 +48,10 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
Name: "database, d",
Usage: "Specify the database SQL syntax",
},
cli.BoolFlag{
Name: "skip-repository, R",
Usage: "Skip the repository dumping",
},
},
}
@ -68,24 +72,38 @@ func runDump(ctx *cli.Context) error {
if _, err := os.Stat(tmpDir); os.IsNotExist(err) {
log.Fatalf("Path does not exist: %s", tmpDir)
}
TmpWorkDir, err := ioutil.TempDir(tmpDir, "gitea-dump-")
tmpWorkDir, err := ioutil.TempDir(tmpDir, "gitea-dump-")
if err != nil {
log.Fatalf("Failed to create tmp work directory: %v", err)
}
log.Printf("Creating tmp work dir: %s", TmpWorkDir)
log.Printf("Creating tmp work dir: %s", tmpWorkDir)
// work-around #1103
if os.Getenv("TMPDIR") == "" {
os.Setenv("TMPDIR", TmpWorkDir)
os.Setenv("TMPDIR", tmpWorkDir)
}
reposDump := path.Join(TmpWorkDir, "gitea-repo.zip")
dbDump := path.Join(TmpWorkDir, "gitea-db.sql")
dbDump := path.Join(tmpWorkDir, "gitea-db.sql")
log.Printf("Dumping local repositories...%s", setting.RepoRootPath)
fileName := fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix())
log.Printf("Packing dump files...")
z, err := zip.Create(fileName)
if err != nil {
log.Fatalf("Failed to create %s: %v", fileName, err)
}
zip.Verbose = ctx.Bool("verbose")
if err := zip.PackTo(setting.RepoRootPath, reposDump, true); err != nil {
log.Fatalf("Failed to dump local repositories: %v", err)
if ctx.IsSet("skip-repository") {
log.Printf("Skip dumping local repositories")
} else {
log.Printf("Dumping local repositories...%s", setting.RepoRootPath)
reposDump := path.Join(tmpWorkDir, "gitea-repo.zip")
if err := zip.PackTo(setting.RepoRootPath, reposDump, true); err != nil {
log.Fatalf("Failed to dump local repositories: %v", err)
}
if err := z.AddFile("gitea-repo.zip", reposDump); err != nil {
log.Fatalf("Failed to include gitea-repo.zip: %v", err)
}
}
targetDBType := ctx.String("database")
@ -99,16 +117,6 @@ func runDump(ctx *cli.Context) error {
log.Fatalf("Failed to dump database: %v", err)
}
fileName := fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix())
log.Printf("Packing dump files...")
z, err := zip.Create(fileName)
if err != nil {
log.Fatalf("Failed to create %s: %v", fileName, err)
}
if err := z.AddFile("gitea-repo.zip", reposDump); err != nil {
log.Fatalf("Failed to include gitea-repo.zip: %v", err)
}
if err := z.AddFile("gitea-db.sql", dbDump); err != nil {
log.Fatalf("Failed to include gitea-db.sql: %v", err)
}
@ -126,10 +134,7 @@ func runDump(ctx *cli.Context) error {
var sessionAbsPath string
if setting.SessionConfig.Provider == "file" {
if len(setting.SessionConfig.ProviderConfig) == 0 {
setting.SessionConfig.ProviderConfig = "data/sessions"
}
sessionAbsPath, _ = filepath.Abs(setting.SessionConfig.ProviderConfig)
sessionAbsPath = setting.SessionConfig.ProviderConfig
}
if err := zipAddDirectoryExclude(z, "data", setting.AppDataPath, sessionAbsPath); err != nil {
log.Fatalf("Failed to include data directory: %v", err)
@ -149,10 +154,10 @@ func runDump(ctx *cli.Context) error {
log.Printf("Can't change file access permissions mask to 0600: %v", err)
}
log.Printf("Removing tmp work dir: %s", TmpWorkDir)
log.Printf("Removing tmp work dir: %s", tmpWorkDir)
if err := os.RemoveAll(TmpWorkDir); err != nil {
log.Fatalf("Failed to remove %s: %v", TmpWorkDir, err)
if err := os.RemoveAll(tmpWorkDir); err != nil {
log.Fatalf("Failed to remove %s: %v", tmpWorkDir, err)
}
log.Printf("Finish dumping in file %s", fileName)

83
cmd/generate.go Normal file
View File

@ -0,0 +1,83 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"code.gitea.io/gitea/modules/generate"
"github.com/urfave/cli"
)
var (
// CmdGenerate represents the available generate sub-command.
CmdGenerate = cli.Command{
Name: "generate",
Usage: "Command line interface for running generators",
Subcommands: []cli.Command{
subcmdSecret,
},
}
subcmdSecret = cli.Command{
Name: "secret",
Usage: "Generate a secret token",
Subcommands: []cli.Command{
microcmdGenerateInternalToken,
microcmdGenerateLfsJwtSecret,
microcmdGenerateSecretKey,
},
}
microcmdGenerateInternalToken = cli.Command{
Name: "INTERNAL_TOKEN",
Usage: "Generate a new INTERNAL_TOKEN",
Action: runGenerateInternalToken,
}
microcmdGenerateLfsJwtSecret = cli.Command{
Name: "LFS_JWT_SECRET",
Usage: "Generate a new LFS_JWT_SECRET",
Action: runGenerateLfsJwtSecret,
}
microcmdGenerateSecretKey = cli.Command{
Name: "SECRET_KEY",
Usage: "Generate a new SECRET_KEY",
Action: runGenerateSecretKey,
}
)
func runGenerateInternalToken(c *cli.Context) error {
internalToken, err := generate.NewInternalToken()
if err != nil {
return err
}
fmt.Printf("%s\n", internalToken)
return nil
}
func runGenerateLfsJwtSecret(c *cli.Context) error {
JWTSecretBase64, err := generate.NewJwtSecret()
if err != nil {
return err
}
fmt.Printf("%s\n", JWTSecretBase64)
return nil
}
func runGenerateSecretKey(c *cli.Context) error {
secretKey, err := generate.NewSecretKey()
if err != nil {
return err
}
fmt.Printf("%s\n", secretKey)
return nil
}

View File

@ -9,7 +9,6 @@ import (
"bytes"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
@ -18,6 +17,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"github.com/urfave/cli"
)
@ -37,7 +37,7 @@ var (
},
Subcommands: []cli.Command{
subcmdHookPreReceive,
subcmdHookUpadte,
subcmdHookUpdate,
subcmdHookPostReceive,
},
}
@ -48,7 +48,7 @@ var (
Description: "This command should only be called by Git",
Action: runHookPreReceive,
}
subcmdHookUpadte = cli.Command{
subcmdHookUpdate = cli.Command{
Name: "update",
Usage: "Delegate update Git hook",
Description: "This command should only be called by Git",
@ -62,12 +62,6 @@ var (
}
)
func hookSetup(logPath string) {
setting.NewContext()
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
models.LoadConfigs()
}
func runHookPreReceive(c *cli.Context) error {
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
return nil
@ -79,14 +73,15 @@ func runHookPreReceive(c *cli.Context) error {
setting.CustomConf = c.GlobalString("config")
}
hookSetup("hooks/pre-receive.log")
setup("hooks/pre-receive.log")
// the environment setted on serv command
repoID, _ := strconv.ParseInt(os.Getenv(models.ProtectedBranchRepoID), 10, 64)
isWiki := (os.Getenv(models.EnvRepoIsWiki) == "true")
//username := os.Getenv(models.EnvRepoUsername)
//reponame := os.Getenv(models.EnvRepoName)
//repoPath := models.RepoPath(username, reponame)
username := os.Getenv(models.EnvRepoUsername)
reponame := os.Getenv(models.EnvRepoName)
userIDStr := os.Getenv(models.EnvPusherID)
repoPath := models.RepoPath(username, reponame)
buf := bytes.NewBuffer(nil)
scanner := bufio.NewScanner(os.Stdin)
@ -104,38 +99,39 @@ func runHookPreReceive(c *cli.Context) error {
continue
}
//oldCommitID := string(fields[0])
oldCommitID := string(fields[0])
newCommitID := string(fields[1])
refFullName := string(fields[2])
// FIXME: when we add feature to protected branch to deny force push, then uncomment below
/*var isForce bool
// detect force push
if git.EmptySHA != oldCommitID {
output, err := git.NewCommand("rev-list", oldCommitID, "^"+newCommitID).RunInDir(repoPath)
if err != nil {
fail("Internal error", "Fail to detect force push: %v", err)
} else if len(output) > 0 {
isForce = true
}
}*/
branchName := strings.TrimPrefix(refFullName, git.BranchPrefix)
protectBranch, err := private.GetProtectedBranchBy(repoID, branchName)
if err != nil {
log.GitLogger.Fatal(2, "retrieve protected branches information failed")
fail("Internal error", fmt.Sprintf("retrieve protected branches information failed: %v", err))
}
if protectBranch != nil {
if !protectBranch.CanPush {
// check and deletion
if newCommitID == git.EmptySHA {
fail(fmt.Sprintf("branch %s is protected from deletion", branchName), "")
} else {
fail(fmt.Sprintf("protected branch %s can not be pushed to", branchName), "")
//fail(fmt.Sprintf("branch %s is protected from force push", branchName), "")
if protectBranch != nil && protectBranch.IsProtected() {
// check and deletion
if newCommitID == git.EmptySHA {
fail(fmt.Sprintf("branch %s is protected from deletion", branchName), "")
}
// detect force push
if git.EmptySHA != oldCommitID {
output, err := git.NewCommand("rev-list", "--max-count=1", oldCommitID, "^"+newCommitID).RunInDir(repoPath)
if err != nil {
fail("Internal error", "Fail to detect force push: %v", err)
} else if len(output) > 0 {
fail(fmt.Sprintf("branch %s is protected from force push", branchName), "")
}
}
userID, _ := strconv.ParseInt(userIDStr, 10, 64)
canPush, err := private.CanUserPush(protectBranch.ID, userID)
if err != nil {
fail("Internal error", "Fail to detect user can push: %v", err)
} else if !canPush {
fail(fmt.Sprintf("protected branch %s can not be pushed to", branchName), "")
}
}
}
@ -153,7 +149,7 @@ func runHookUpdate(c *cli.Context) error {
setting.CustomConf = c.GlobalString("config")
}
hookSetup("hooks/update.log")
setup("hooks/update.log")
return nil
}
@ -169,9 +165,10 @@ func runHookPostReceive(c *cli.Context) error {
setting.CustomConf = c.GlobalString("config")
}
hookSetup("hooks/post-receive.log")
setup("hooks/post-receive.log")
// the environment setted on serv command
repoID, _ := strconv.ParseInt(os.Getenv(models.ProtectedBranchRepoID), 10, 64)
repoUser := os.Getenv(models.EnvRepoUsername)
isWiki := (os.Getenv(models.EnvRepoIsWiki) == "true")
repoName := os.Getenv(models.EnvRepoName)
@ -209,6 +206,47 @@ func runHookPostReceive(c *cli.Context) error {
}); err != nil {
log.GitLogger.Error(2, "Update: %v", err)
}
if newCommitID != git.EmptySHA && strings.HasPrefix(refFullName, git.BranchPrefix) {
branch := strings.TrimPrefix(refFullName, git.BranchPrefix)
repo, pullRequestAllowed, err := private.GetRepository(repoID)
if err != nil {
log.GitLogger.Error(2, "get repo: %v", err)
break
}
if !pullRequestAllowed {
break
}
baseRepo := repo
if repo.IsFork {
baseRepo = repo.BaseRepo
}
if !repo.IsFork && branch == baseRepo.DefaultBranch {
break
}
pr, err := private.ActivePullRequest(baseRepo.ID, repo.ID, baseRepo.DefaultBranch, branch)
if err != nil {
log.GitLogger.Error(2, "get active pr: %v", err)
break
}
fmt.Fprintln(os.Stderr, "")
if pr == nil {
if repo.IsFork {
branch = fmt.Sprintf("%s:%s", repo.OwnerName, branch)
}
fmt.Fprintf(os.Stderr, "Create a new pull request for '%s':\n", branch)
fmt.Fprintf(os.Stderr, " %s/compare/%s...%s\n", baseRepo.HTMLURL(), util.PathEscapeSegments(baseRepo.DefaultBranch), util.PathEscapeSegments(branch))
} else {
fmt.Fprint(os.Stderr, "Visit the existing pull request:\n")
fmt.Fprintf(os.Stderr, " %s/pulls/%d\n", baseRepo.HTMLURL(), pr.Index)
}
fmt.Fprintln(os.Stderr, "")
}
}
return nil

85
cmd/keys.go Normal file
View File

@ -0,0 +1,85 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import (
"errors"
"fmt"
"strings"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
)
// CmdKeys represents the available keys sub-command
var CmdKeys = cli.Command{
Name: "keys",
Usage: "This command queries the Gitea database to get the authorized command for a given ssh key fingerprint",
Action: runKeys,
Flags: []cli.Flag{
cli.StringFlag{
Name: "expected, e",
Value: "git",
Usage: "Expected user for whom provide key commands",
},
cli.StringFlag{
Name: "username, u",
Value: "",
Usage: "Username trying to log in by SSH",
},
cli.StringFlag{
Name: "type, t",
Value: "",
Usage: "Type of the SSH key provided to the SSH Server (requires content to be provided too)",
},
cli.StringFlag{
Name: "content, k",
Value: "",
Usage: "Base64 encoded content of the SSH key provided to the SSH Server (requires type to be provided too)",
},
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
},
}
func runKeys(c *cli.Context) error {
if c.IsSet("config") {
setting.CustomConf = c.String("config")
}
if !c.IsSet("username") {
return errors.New("No username provided")
}
// Check username matches the expected username
if strings.TrimSpace(c.String("username")) != strings.TrimSpace(c.String("expected")) {
return nil
}
content := ""
if c.IsSet("type") && c.IsSet("content") {
content = fmt.Sprintf("%s %s", strings.TrimSpace(c.String("type")), strings.TrimSpace(c.String("content")))
}
if content == "" {
return errors.New("No key type and content provided")
}
if err := initDBDisableConsole(true); err != nil {
return err
}
publicKey, err := models.SearchPublicKeyByContent(content)
if err != nil {
return err
}
fmt.Println(publicKey.AuthorizedString())
return nil
}

52
cmd/migrate.go Normal file
View File

@ -0,0 +1,52 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
)
// CmdMigrate represents the available migrate sub-command.
var CmdMigrate = cli.Command{
Name: "migrate",
Usage: "Migrate the database",
Description: "This is a command for migrating the database, so that you can run gitea admin create-user before starting the server.",
Action: runMigrate,
Flags: []cli.Flag{
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
},
}
func runMigrate(ctx *cli.Context) error {
if ctx.IsSet("config") {
setting.CustomConf = ctx.String("config")
}
if err := initDB(); err != nil {
return err
}
log.Trace("AppPath: %s", setting.AppPath)
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
log.Trace("Custom path: %s", setting.CustomPath)
log.Trace("Log path: %s", setting.LogRootPath)
models.LoadConfigs()
if err := models.NewEngine(migrations.Migrate); err != nil {
log.Fatal(4, "Failed to initialize ORM engine: %v", err)
return err
}
return nil
}

Some files were not shown because too many files have changed in this diff Show More