2
0
Commit Graph

1580 Commits

Author SHA1 Message Date
Lauris BH
36b7ed7a29 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
Morgan Bazalgette
2173e7d6b1 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
Sandro Santilli
71d32057f8 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
Vlad Temian
92b23dc689 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
Lauris BH
a40e00417c 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
Mike Fellows
10529bd508 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
Ethan Koenig
8b00d90e32 Fix ignored errors when checking if organization, team member (#3177) 2017-12-21 09:43:26 +02:00
Lunny Xiao
1295d48e08 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
Ethan Koenig
9dc492220e Unit tests for routers/repo/issue_label (#3198) 2017-12-15 23:11:02 +02:00
Lunny Xiao
e9f4ff0997 Improvements for supporting UI Location (#3146)
* improvements for supporting UI Location

* improved the comment
2017-12-14 07:45:31 +08:00
Ethan Koenig
4bb3cd064e Fix new pull request link (#3133)
* Fix new pull request link

* Only show button for branches
2017-12-13 13:06:25 +08:00
Lunny Xiao
1539bd5c3b 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
Lunny Xiao
f4e179277d 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
Antoine GIRARD
81e42f6449 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
Ethan Koenig
14ac1f6ddc Fix missing branch in release bug (#3108) 2017-12-08 13:22:02 +08:00
Ethan Koenig
a70356c12b Fix legacy URL redirects (#3100) 2017-12-07 09:09:02 +08:00
Lunny Xiao
cb30fe72b1 fix redis cache failed (#3086) 2017-12-04 23:00:14 +08:00
Ethan Koenig
856188bcef Fix error message sanitiziation (#3082) 2017-12-04 03:48:03 +02:00
Lauris BH
c5bbb9ed4b Add reactions to issues/PR and comments (#2856) 2017-12-04 01:14:26 +02:00
techknowlogick
d1e8a41a10 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
Ethan Koenig
3fa7629bfc Fix avatar URLs (#3069)
* Fix avatar URLs

* import order
2017-12-03 19:55:13 +08:00
Lunny Xiao
5579f632e8 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
Lunny Xiao
a15d8c22e1 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
Piotr Orzechowski
c9c48e4693 Default log level to Info without hardcoding it in installer (#3041) 2017-12-01 15:41:27 +08:00
Ethan Koenig
ffecdec7a8 Unit tests for wiki routers (#3022) 2017-11-30 17:52:15 +02:00
Sondre Nilsen
d8c2c3d35e 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
Ethan Koenig
f1c559cead Removed unused field in form (#3023) 2017-11-29 22:52:34 +02:00
Sandro Santilli
270fc468ff Set OpenID support on by default when installing new instance (#3010) 2017-11-29 14:47:42 +02:00
Duncan Ogilvie
7bc387bffe 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
Antoine GIRARD
dcabc76714 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
Antoine GIRARD
eaff4b06ed 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
Ethan Koenig
7c56820685 Various wiki bug fixes (#2996)
* Update macaron

* Various wiki bug fixes
2017-11-28 17:43:51 +08:00
Lauris BH
b18cd29792 Fix go-get, src and raw urls to new scheme (#2978) 2017-11-27 02:58:54 +02:00
Piotr Orzechowski
18b57056ca Fix language names (#2955) 2017-11-23 12:00:48 +08:00
Ethan Koenig
10d77fe376 Fix over-escaped characters (#2956) 2017-11-22 15:09:48 +08:00
Lunny Xiao
ea4f22c5ac 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
Jonas Bröms
6765671642 Drop deprecated GOGS_WORK_DIR use (#2946) 2017-11-21 09:52:47 +08:00
schaffman5
0506d9bbb4 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
Lauris BH
22647d8d60 Fix memcache support when value is returned as string always (#2924) 2017-11-16 15:06:34 +08:00
Lauris BH
b02813bd48 Update go-ini dependency and remove semicolon hack in translations (#2913) 2017-11-15 11:34:42 +08:00
Sandro Santilli
3b70e49de5 Gogs -> Gitea (#2909)
rename label
2017-11-14 08:55:57 +08:00
Mura Li
7b0f31932b 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
Jochen Rill
d8f1d5cfc1 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
Lauris BH
ff87b3fa33 Fix localization texts that contain semicolon (#2900) 2017-11-13 09:56:10 +02:00
Ethan Koenig
eb5f28951d 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
Ethan Koenig
805b49278b 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
Lauris BH
b30033fa57 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
Lunny Xiao
24158809c1 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
Jacob Parry
d69d13dfbb Fix LFS not returning correct content length when requesting a range of bytes (#2864) 2017-11-07 06:33:04 +02:00
Lunny Xiao
43b02b8141 fix click create pull request button 404 (#2859) 2017-11-05 21:11:35 +02:00