Commit Graph

527 Commits (59f5bbab0d6c1aa00fd58140860093331ab0140f)

Author SHA1 Message Date
Ethan Koenig c58708d3ee Integration test framework ()
* Integration test framework

* udpate drone sign

* Formatting fixes and move router.go to routers/

* update sign for drone
Lunny Xiao 42072783c9 support health check via / and fix ()
Bo-Yi Wu fa2a513c62 feat: add download count field and unit testing for attachment. ()
* feat: add download count field and unit testing.

* fix: unit testing

* refactor: improve testing.

* fix: update comment

* add default value.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Lunny Xiao 2eeae84cbd Add internal routes for ssh hook comands ()
* add internal routes for ssh hook comands

* fix lint

* add comment on why package named private not internal but the route name is internal

* add comment above package private why package named private not internal but the route name is internal

* remove exp time on internal access

* move routes from /internal to /api/internal

* add comment and defer on UpdatePublicKeyUpdated
Lauris BH f42ec6120e Better URL validation ()
* Add correct git branch name validation

* Change git refname validation error constant name

* Implement URL validation based on GoLang url.Parse method

* Backward compatibility with older Go compiler

* Add git reference name validation unit tests

* Remove unused variable in unit test

* Implement URL validation based on GoLang url.Parse method

* Backward compatibility with older Go compiler

* Add url validation unit tests
Bo-Yi Wu 22295944df refactor: show command help message. ()
Lunny Xiao 5c0bee9b20 refactor update ssh key use time ()
Andrey Nering b674460748 Add watch button on issue
Sandro Santilli 129b0d6a4b Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION ()
* Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION

Omit the configuration variable (the default) to be dependent.
Fixes 

* Move OpenID settings under Service object

* Show OpenID SignUp and SignIn status in admin panel / configuration
Pavel Korovin ae9b02b079 Fix FCGI (over TCP) support ()
Fabian Zaremba 9224405155 LFS: Fix SSH authentication for trailing arguments ()
Fixes 
Fabian Zaremba 5586445207 LFS: Return 404 for unimplemented endpoints ()
Without this patch a 401 is returned for unspecified endpoints, making
the LFS client ask for HTTP credentials. This behaviour was introduced
with the new locking API:

https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md
Sandro Santilli 9182a35f18 Show user OpenID URIs in their profile ()
Sandro Santilli e1586898b2 Add change-password admin command ()
* Add change-password admin command
Bo-Yi Wu 1c3bd436cc feat: Only use issue and wiki on repo. ()
Sandro Santilli 71d16f69ff Login via OpenID-2.0 ()
Lunny Xiao ebbcf6fe12 Allow push to init a wiki repo ()
* allow push to init a wiki repo

* compact error check
Ethan Koenig 09fe4a2ae9 Batch updates for issues ()
Ethan Koenig ec0ae5d50c Refactor and fix incorrect comment ()
Sandro Santilli 7d8f9d1c46 Rename /forget_password url to /forgot_password
Also renames `forgot_password` translation key to
`forgot_password_title` and `forget_password` to
`forgot_password`

Includes entry in CHANGELOG about the breaking change
(and some markdown fixes in there)
Lunny Xiao 341b3a0349 bug fix for dump when data directoryis not exist ()
Lunny Xiao cfdc62e7fa Comment force push detect to fix bug ()
* umcomment force push detect to fix bug 

* fix 

* handle global config set and fix 
Lunny Xiao 9084bdd863 fix push ()
Lunny Xiao 50918084bb remove unused struct ()
Lunny Xiao 35548a9d4e remove unused fixme on dump command ()
Lunny Xiao cd1821a7e2 Move push update to post-receive and protected branch check to pre-receive ()
* move all push update to git hook post-receive and protected branch check to git hook pre-receive

* add SSH_ORIGINAL_COMMAND check back

* remove all unused codes

* fix the import
Lunny Xiao 0e6b9ea786 Take back control of hooks ()
* git: delegate all server-side Git hooks ()

* create hooks directories

* take control hooks back

* fix lint

* bug fixed and minor changes

* fix imports style

* fix migration scripts
Willem van Dreumel 01d957677f Oauth2 consumer ()
* 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)
Denis Denisov fd941db246 Protected branches system ()
* 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
Christoph König ffde33bdfa Fix typo ()
Lunny Xiao 04fdeb9d8d Make Xorm log configurable ()
* make xorm log configable

* bug fixed for other sub commands except web

* rebase and fix xorm log

* bug fix for TrimSpace
Lunny Xiao be55460b63 catch error on call setup on serv command ()
Bo-Yi Wu d67b278a0d feat: Able to disable non-admin to create new organization ()
Andrew Boyarshin dc8248f8a4 Markdown rendering overhaul ()
* 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>
Sandro Santilli 9b4f6c1c32 Handle SetModel error, fixes one errcheck report ()
Lunny Xiao c5887b0f28 fix watchers templates breaks ()
Matthias Loibl 17c5e12e6e Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060 ()
* Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060

* Add comment for golint to blank pprof import
surefire c73b7a65f5 Fix remove unix socket listenAddr ()
Because the absence of the listenAddr is what is expected.
The error will only be then when we can't remove.
Lunny Xiao 8a421b1fd7 Add units concept for modulable functions of a repository ()
* 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
Gabriel Jackson bf6f61cc69 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.
Thomas Boerger 78535fb08e Allow custom public files ()
* Allow custom public files

* Gofmt code, lots of places not related to this pr
Bwko 8555e888d8 Add ETag header to avatars ()
Lunny Xiao a8048c19f3 Update xorm and fix dump command ()
* update xorm and fix dump

* catch database init error

* still use dumpTables

* fix dump bool type

* update vendor.json
Andrew 6dd096b7f0 Two factor authentication support ()
* Initial commit for 2FA support

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

* Add vendored files

* Add missing depends

* A few clean ups

* Added improvements, proper encryption

* Better encryption key

* Simplify "key" generation

* Make 2FA enrollment page more robust

* Fix typo

* Rename twofa/2FA to TwoFactor

* UNIQUE INDEX -> UNIQUE
Philip Couling 64375d875b Attach to release ()
* Moved attachaments POST url from /issues/attachments to /attachments

* Implemented attachment upload on release page

* Implemented downloading attachments on the release page

* Added zip and gzip files to default allowed attachments

* Implemented uploading attachments on edit release

* Renamed UploadIssueAttachment to UploadAttachment
Bwko 4a1f36c3cc Don't create a default pid file ()
Manuel Kuhlmann e698654902 Add data directory excluding sessions to dump ()
Andrey Nering 769e0a3ea6 Notifications: mark as read/unread and pin ()
* Use relative URLs

* Notifications - Mark as read/unread

* Feature of pinning a notification

* On view issue, do not mark as read a pinned notification
Bo-Yi Wu 9f575986d8 feat: support pid file.
Andrey Nering 79d527195d Merge pull request from andreynering/notifications-step-2
Notifications - Step 2