Commit graph

5314 commits

Author SHA1 Message Date
Ethan Koenig
4f3880ff15 Bug fixes and unit tests for org_team (#1016) 2017-02-23 09:36:15 +08:00
Andrey Nering
d181113b82 Merge pull request #1017 from ethantkoenig/fix_lint
Fix lint errors
2017-02-22 21:14:54 -03:00
Ethan Koenig
ec3a696e2d Fix lint errors 2017-02-22 17:10:45 -05:00
Lunny Xiao
1f7837d6d6 Refactor for issues loadattributes of a repository (#971)
* refactor for issues loadattributes of a repository

* refactors
2017-02-22 22:03:59 +08:00
Bo-Yi Wu
29c6f32a3b Fix some links. (#1005) 2017-02-22 21:21:25 +08:00
Bo-Yi Wu
83b6d03231 fix: Wrong repo list on Explore page if user already loggin. (#1009)
* fix: Wrong repo list on Explore page if user already loggin.

* fix: code readable.

* fix: declare variable
2017-02-22 21:15:14 +08:00
Lunny Xiao
d6748284bd fix panic when push but the only log mode console is disabled by serv and update commands (#1007) 2017-02-22 19:44:51 +08:00
Willem van Dreumel
01d957677f Oauth2 consumer (#679)
* initial stuff for oauth2 login, fails on:
* login button on the signIn page to start the OAuth2 flow and a callback for each provider
Only GitHub is implemented for now
* show login button only when the OAuth2 consumer is configured (and activated)
* create macaron group for oauth2 urls
* prevent net/http in modules (other then oauth2)
* use a new data sessions oauth2 folder for storing the oauth2 session data
* add missing 2FA when this is enabled on the user
* add password option for OAuth2 user , for use with git over http and login to the GUI
* add tip for registering a GitHub OAuth application
* at startup of Gitea register all configured providers and also on adding/deleting of new providers
* custom handling of errors in oauth2 request init + show better tip
* add ExternalLoginUser model and migration script to add it to database
* link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed
* remove the linked external account from the user his settings
* if user is unknown we allow him to register a new account or link it to some existing account
* sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers)

* from gorilla/sessions docs:
"Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!"
(we're using gorilla/sessions for storing oauth2 sessions)

* use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
2017-02-22 08:14:37 +01:00
Denis Denisov
fd941db246 Protected branches system (#339)
* Protected branches system

* Moved default branch to branches section (`:org/:reponame/settings/branches`).
* Initial support Protected Branch.
  - Admin does not restrict
  - Owner not to limit
  - To write permission restrictions

* reformat tmpl

* finished the UI and add/delete protected branch response

* remove unused comment

* indent all the template files and remove ru translations since we use crowdin

* fix the push bug
2017-02-21 23:02:10 +08:00
Thomas Boerger
fe5ff8e4b2 Added 1.0.2 to changelog (#998) 2017-02-21 22:38:38 +08:00
Lunny Xiao
70ae6d197b disable console output xorm log on ssh (#993) 2017-02-21 21:34:05 +08:00
Christoph König
ffde33bdfa Fix typo (#990) 2017-02-21 09:14:37 +08:00
Willem van Dreumel
5f234ce2a5 add missing copyright header (#992) 2017-02-21 08:46:14 +08:00
Lunny Xiao
c5f8b96dda update xorm for fixing bug on processor BeforeSet and AfterSet when Find a map (#987) 2017-02-20 19:33:10 +08:00
Lunny Xiao
04fdeb9d8d Make Xorm log configurable (#174)
* make xorm log configable

* bug fixed for other sub commands except web

* rebase and fix xorm log

* bug fix for TrimSpace
2017-02-20 16:11:13 +08:00
Andrew Boyarshin
d4b752def9 Fix table headers (#980)
Signed-off-by: Andrew Boyarshin <andrew.boyarshin@gmail.com>
2017-02-20 11:13:20 +08:00
Lunny Xiao
c2c27891c9 add release cycle to contributing (#949) 2017-02-19 23:23:37 +08:00
Lunny Xiao
b8f70a27a5 Security: fix XSS attack on alert (#973) 2017-02-19 19:18:06 +08:00
Lunny Xiao
6076c95dd1 Security: fix XSS attack on milestone (#976)
Reported by Miguel Ángel Jimeno.
2017-02-19 19:09:59 +08:00
Lunny Xiao
dbe6d2ff8e fix docker link on install page (#964) 2017-02-18 22:19:51 +08:00
Bo-Yi Wu
252adc912d refactor: update debian script. (#965) 2017-02-18 18:23:37 +08:00
Ethan Koenig
be48b32e63 Unit tests for repo watching (#963) 2017-02-17 16:02:11 +08:00
Lunny Xiao
847527fd6d Fix all the bugs in issues and pulls on dashboard (#943)
* fix all the bugs in issues and pulls on dashboard

* small fix and refactor

* add method getRepoIDs for IssueList
2017-02-17 08:58:19 +08:00
Kim "BKC" Carlbäcker
669dad71f8 Add Screenshot-secion to IssueTemplate.md (#939)
For `UI`-bugs we usually require a Screenshot to debug it 😉
2017-02-17 08:58:01 +08:00
Ethan Koenig
140967f002 Unit tests for repo redirects (#961) 2017-02-17 08:55:33 +08:00
Bo-Yi Wu
4c12e2a4b9 fix: fill in ssh key title on setting of repo (#950)
* fix: fill in ssh key title on setting of repo

* fix: Don't overwrite ssh key title if exist.
2017-02-16 05:16:42 +01:00
Lunny Xiao
7fd14bf7bd optimization for team get repos (#953) 2017-02-16 12:07:58 +08:00
Lunny Xiao
46320f9630 refactor notificationsForUser since xorm In support slice of customerize type (#956) 2017-02-16 12:07:00 +08:00
Lunny Xiao
0642cb330c Small opitimization for getUserTeams (#954)
* Small opitimization for getUserTeams

* more compact
2017-02-16 12:06:23 +08:00
Unknwon
134f3e6e09 Security: prevent XSS attach on wiki page
Reported by Miguel Ángel Jimeno.
2017-02-16 04:06:20 +01:00
Bo-Yi Wu
43c94d0a6c test: Add testing for GetUserFork function (#944) 2017-02-15 23:24:23 +08:00
Bo-Yi Wu
a31f64d639 fix: 500 error on /explore/repos page. (#946) 2017-02-15 22:28:11 +08:00
Bo-Yi Wu
9d2b830275 refactor: small optimize for sql query (#940)
* refactor: small optimize for sql query

* fix: get owner name if Searcher is not nil or user star page.
2017-02-15 14:01:50 +08:00
Lunny Xiao
837d346090 fix some older Gogs upgrade to Gitea (#929) 2017-02-15 09:32:03 +08:00
Lunny Xiao
be55460b63 catch error on call setup on serv command (#932) 2017-02-15 09:25:21 +08:00
Lunny Xiao
9c645b54dc bug fixed on issues and pulls 2017-02-15 01:17:07 +01:00
Lunny Xiao
cf47532ebc fix ssh domain default value to domain (#930) 2017-02-15 00:07:37 +08:00
Lunny Xiao
4cfde304df bug fixed for my repository (#933) 2017-02-14 23:37:44 +08:00
Lunny Xiao
7a9a5c8a69 Fix assigned issues dashboard (#920)
* Fix assigned/created issues in dashboard. (#3560)

* Fix assigned/created issues in dashboard.

* Use GetUserIssueStats for getting all Dashboard stats.

* Use gofmt to format the file properly.

* Replace &Issue{} with new(Issue).

* Check if user has access to given repository.

* Remove unnecessary filtering of issues.

* Return 404 error if invalid repository is given.

* Use correct number of issues in paginater.

* fix issues on dashboard
2017-02-14 22:15:18 +08:00
Lunny Xiao
3a91ac51a9 fix bug of multiple forks (#928) 2017-02-14 22:14:29 +08:00
Bo-Yi Wu
d67b278a0d feat: Able to disable non-admin to create new organization (#927) 2017-02-14 20:16:00 +08:00
Bo-Yi Wu
23aba523b5 feat: support search bar on star tab of user profile. (#917)
* feat: support search bar on star tab of user profile.

* fix: update testing.

* fix: Using loadAttributes

* fix: remove empty line.

* remove LOWER

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-02-14 15:28:22 +08:00
Lunny Xiao
7eb8daffa3 Use fingerprint to check instead content for public key (#911)
* use fingerprint to check instead content for public key

* add fingerprint field for ErrKeyAlreadyExist
2017-02-14 14:12:52 +08:00
Lunny Xiao
55ae78208e Small optimization for getTeamIDs (#919)
* small optimization for getTeamIDs

* rename getOrgTeamIDs to getUserTeamIDs and remove orderby
2017-02-14 11:46:46 +08:00
Bo-Yi Wu
1ec6b1a258 fix: gofmt error. (#918) 2017-02-14 10:12:03 +08:00
Andrew Boyarshin
dc8248f8a4 Markdown rendering overhaul (#186)
* Markdown rendering overhaul

Cleaned up and squashed commits into single one.

Signed-off-by: Andrew Boyarshin <boyarshinand@gmail.com>

* Fix markdown API, add markdown module and API tests, improve code coverage

Signed-off-by: Andrew Boyarshin <boyarshinand@gmail.com>
2017-02-14 09:13:59 +08:00
Bo-Yi Wu
5cc275b1de feat: add git version on admin panel. (#921) 2017-02-13 19:49:42 +08:00
Kim "BKC" Carlbäcker
091f063706 Add import-styleguide to Contributing.md (#912)
* Add import-styleguide to Contributing.md

Question: should we group all `code.gitea.io`-packages together as local imports? (including `code.gitea.io/sdk` and `code.gitea.io/git` etc)

* reorg

* be specific FFS
2017-02-13 10:35:57 +08:00
Andrey Nering
05157808de Fix HighlightJS not working on compare diff page (#914) 2017-02-13 10:11:08 +08:00
Sandro Santilli
9b4f6c1c32 Handle SetModel error, fixes one errcheck report (#257) 2017-02-12 09:53:46 +01:00