2
0
Commit Graph

1406 Commits

Author SHA1 Message Date
Lunny Xiao
b386ed4a8a remove empty file (#1326) 2017-03-19 21:43:04 +08:00
Bo-Yi Wu
2c2c55b683 feat: Only use issue and wiki on repo. (#1297) 2017-03-18 18:59:07 +08:00
Sandro Santilli
aa764ab02b Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
Lunny Xiao
fcd112333e fix wrong log when push to a new branch (#1220) 2017-03-17 10:15:00 +08:00
Ethan Koenig
39d452cea2 Fix nil-dereference bug 2017-03-15 14:09:44 -04:00
Ethan Koenig
f027815046 Fix typos in models/ and modules/ (#1248) 2017-03-15 08:52:01 +08:00
Ethan Koenig
48b4de20eb Refactor and fix incorrect comment (#1247) 2017-03-15 08:51:46 +08:00
Andrey Nering
e9663351c2 Fix Git hooks not being executed on Windows when running as a service (#1149)
Closes #1139
2017-03-09 09:27:43 +08:00
Bo-Yi Wu
6253227f41 refactor: remove redundant slash. (#1109) 2017-03-03 20:47:24 +08:00
Bo-Yi Wu
e980766621 fix: gofmt errors. (#1106) 2017-03-03 16:21:31 +08:00
Schwobaland
737d1b2fb5 add ProxyFromEnvironment if none set (#1096) 2017-03-02 08:36:42 +08:00
Jonas
062a4c93ee Log config pretty printer (#1097)
Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>
2017-03-02 08:25:44 +08:00
Lunny Xiao
5f9009c459 add back the default setting values and fix #739 (#1093) 2017-03-01 23:10:12 +08:00
Thomas Boerger
b91016e37b Fixed custom templates for static builds (#1087) 2017-03-01 09:45:21 +08:00
Lunny Xiao
9e3e1cbf59 fix some typos (#1082) 2017-02-28 12:56:15 +08:00
Jonas
b220f38c21 Fix for #828: Embed build tags (#1051)
* Fix for #828
Add build tags to ldflags and print in version output

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Reworked formatBuiltWith function

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Add tags to version information in admin panel

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Added new variable for use on admin page.

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Fixed incorrect indentation
2017-02-28 08:40:02 +08:00
Andrey Nering
776954b8db Remove test that touch network 2017-02-25 10:32:15 -03:00
Andrew Boyarshin
9658efc1f1 Fix URL handling in the whole markdown module, improve test coverage (#1027)
Amended with string to bool change in API SDK.

Signed-off-by: Andrew Boyarshin <andrew.boyarshin@gmail.com>
2017-02-24 22:59:56 +08:00
puffybsd
6b3ce3dc01 Fixes 1019, install page SMTP user is required to (#1020)
to be an email address.

Signed-off-by: P.B. <puffybsd@yahoo.com>
2017-02-24 09:37:13 +08:00
Lunny Xiao
0946e8ca9b 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
64016ca7ac 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
e6d86ee29c 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
Lunny Xiao
d0afccfb63 disable console output xorm log on ssh (#993) 2017-02-21 21:34:05 +08:00
Lunny Xiao
531ade9165 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
Unknwon
fb8b978593 Security: prevent XSS attach on wiki page
Reported by Miguel Ángel Jimeno.
2017-02-16 04:06:20 +01:00
Lunny Xiao
0b93c45699 fix ssh domain default value to domain (#930) 2017-02-15 00:07:37 +08:00
Bo-Yi Wu
5411e9c468 feat: Able to disable non-admin to create new organization (#927) 2017-02-14 20:16:00 +08:00
Andrew Boyarshin
bd53659aed 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
e3193f34f3 feat: add git version on admin panel. (#921) 2017-02-13 19:49:42 +08:00
Andrew
ec6dea7c14 Add missing copyright header to status table test (#902) 2017-02-11 17:53:47 +08:00
Andrew
48135bb80a Implement archive cleanup (#885)
* Implement archive cleanup

Fixes #769

Signed-off-by: Andrew <write@imaginarycode.com>

* Make sure to close the directory file

* Resolve issues noted by @strk

* edit cheatsheet app.ini [ci skip]

* oops [ci skip]
2017-02-11 12:00:46 +08:00
Andrew
00762eea0c Improve status table implementation (#879)
* Remove superfluous defer calls

* Improve status table implementation as well

This would probably only help with large, high-traffic installs
2017-02-09 14:39:06 +08:00
Ethan Koenig
8ec023cb81 Use assert in legacy unit tests (#867) 2017-02-08 14:29:07 +08:00
Ethan Koenig
d93ad53a2c Redirects for renamed repos (#807)
* Redirects for renamed repos

* Remove unused phrase from locales
2017-02-05 22:35:03 +08:00
Ethan Koenig
f203d56f89 Avoid duplicate queries in auth (#827)
Avoid identical making calls to GetUserByID(..) in SignedInUser(..)
2017-02-05 21:10:46 +08:00
Matthias Loibl
f3c5a6a206 Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060 (#801)
* Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060

* Add comment for golint to blank pprof import
2017-02-05 21:06:25 +08:00
Lunny Xiao
3f446a0c9c Add units concept for modulable functions of a repository (#742)
* Add units concept for modulable functions of a repository

* remove unused comment codes & fix lints and tests

* remove unused comment codes

* use struct config instead of map

* fix lint

* rm wrong files

* fix tests
2017-02-04 23:53:46 +08:00
ʿAhed ʿid
050a4e3330 Allow using custom time format (#798)
* Allow using custom time format

I need to use custom time format in `conf/app.ini' like 

    FORMAT = 2006-01-02 15:04:05

so that Gitea will display '2017-01-30 08:41:49'
check this answer for more constants to format date  <http://stackoverflow.com/a/20234207/2570425> 

PS: First GO commit

* Refactor and validate TimeFormat (must have 2006, 01, 02, 15, 04 and 05)
2017-02-04 20:37:50 +08:00
Gabriel Jackson
e8c47d9765 Cleanup log messaging
This change corrects a few logging issues:

 * Standardized formatting errors with '%v'.
 * Standardized failure warning word usage.
 * Corrected an instance of using the standard log library when
   the gitea log library should be used instead.
2017-02-02 15:24:18 +01:00
Ethan Koenig
a8af939f69 Remove unneeded database loads (#814)
Remove unnecessary calls to repo.GetOwner() in context handlers
2017-02-02 20:33:56 +08:00
Thomas Boerger
5662fe4edf Allow custom public files (#782)
* Allow custom public files

* Gofmt code, lots of places not related to this pr
2017-01-28 23:14:56 +01:00
Bo-Yi Wu
b467f58a14 refactor: Remove unnecessary type conversions (#772) 2017-01-27 23:03:32 +08:00
Andrey Nering
62bbcdcc34 Merge pull request #736 from andreynering/fix-windows-ssh
Fix SSH server on Windows when running as service
2017-01-25 14:19:55 -02:00
Bwko
fa4dc9c78d Update Website binding MaxSize to 255 (#722) 2017-01-25 15:23:20 +08:00
Ethan Koenig
0950716f25 Search bar for issues/pulls (#530) 2017-01-25 10:43:02 +08:00
Andrey Nering
8464404e20 Fix lint 2017-01-23 20:56:25 -02:00
Andrey Nering
98a5ef6cba Fix SSH server on Windows when running as service
Closes #680
2017-01-23 20:44:23 -02:00
Andrey Nering
21655edf73 Merge commit 'af636848622c8ad27cace63be5f9dd9aaa565502' as 'modules/minwinsvc' 2017-01-23 20:40:11 -02:00
DWE
19cf83be38 fix logfile name (#731) 2017-01-23 19:19:12 +08:00
Bwko
ae5d868288 Add option to app.ini to enable local import paths (#724) 2017-01-23 09:19:50 +08:00