Commit Graph

373 Commits (6a3c7856c86739a47e6fd7820cb8fdf64487cc42)

Author SHA1 Message Date
Ethan Koenig 474d636794 Update code.gitea.io/git ()
* Update code.gitea.io/git

* Update function calls

* govendor fetch
Ethan Koenig cf02cd7ba0 Fix and test for delete user ()
* Fix and test for delete user

* Run updates in batches

* Unit test
guyzmo 397474ecb1 Added Parent property to the repo API ()
Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
Lauris BH 79494047b0 Show commit status icon in commits table ()
* Show commit status icon in commits table

* Add comments

* Fix icons

* Few more places where commit table is displayed

* Change integration test to use goquery for parsing html

* Add integration tests for commit table and status icons

* Fix status to return lates status correctly on all databases

* Rewrote lates commit status selects
guyzmo 98460a8d9d Exposes in API the Repo entity's Size and IsBare property ()
* Exposes in API the Repo entity's IsBare property as IsEmpty

Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>

* Exposes in API the Repo entity's Size property

Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
Bo-Yi Wu 75f1afd1fd fix: tag contain character ) will http 500 on release page ()
Antoine GIRARD 3edb0c5894 Generate swagger json ()
- Generate swagger.json into public/
- Add swagger-ui auto-installation
- Add footer link to local swagger-ui
- Add /swagger url for using app url.
- Fix Swagger-UI version via git tag
Antoine GIRARD bb5f694fc5 Improve govendor testing ()
- Use `govendor list +outside +unused` for finding missing or unused deps and govendor status for catching modified vendor.  
- Remove appengine import
Lauris BH 3792867955 Update xorm to latest version ()
* Update xorm to latest version

* Update xorm/builder
Willem van Dreumel 950f2e2074 Additional OAuth2 providers ()
* add google+

* sort signin oauth2 providers based on the name so order is always the same

* update auth tip for google+

* add gitlab provider

* add bitbucket provider (and some go fmt)

* add twitter provider

* add facebook provider

* add dropbox provider

* add openid connect provider incl. new format of tips section in "Add New Source"

* lower the amount of disk storage for each session to prevent issues while building cross platform (and disk overflow)

* imports according to goimport and code style

* make it possible to set custom urls to gitlab and github provider (only these could have a different host)

* split up oauth2 into multiple files

* small typo in comment

* fix indention

* fix indentation

* fix new line before external import

* fix layout of signin part

* update "broken" dependency
Lunny Xiao 91d64656a4 update git which fixes ()
Lunny Xiao e3c2963222 remove unused vendor packages ()
Jonas Östanbäck e4a0a04829 Add create_at and updated_at in PR json ()
* Move new fields to object creation (use reference)
 * Vendor: Update SDK
Antoine GIRARD eb1075dd4c Check if missing/modified/unused deps in vendor and fix errors ()
* Check if missing deps in vendor

This will catch import from other repos. (maybe by auto-import)

* Remove github.com/smartystreets unused deps

* Remove github.com/boltdb/bolt unused dep

* Fetch github.com/go-xorm/core + sync gopkg.in/ldap.v2/ldap.go

* Auto-install govendor + reinstall github.com/boltdb/bolt needed by vendor/github.com/blevesearch/bleve/index/store/boltdb

* Update go-xorm/xorm to a5cb21 in vendor.json

* Use a custom repo for implementing change to bolt dep.

* Switching bolt to github.com/go-gitea/bolt

* Switching bolt to github.com/go-gitea/bolt (fork version)

* change the drone sign
Antoine GIRARD cf91cfb993 Migrate WatchInfo struct to api ()
* Remove WatchInfo and link to api struct

* Add vendor temporary update

* Return to gitea vendor source
Mura Li edbb9eefd6 Fix race when running commands with timeout ()
Update vendored module code.gitea.io/git
Lunny Xiao 5acfc7c4bc fix migrate failed and org dashboard failed on MSSQL database ()
Damien Gaignon a78a0266c4 Correct broken unaligned load/store in armv5 ()
Update vendor github.com/boltdb/bolt to take care of the issue .
Mura Li 93c25c9a35 Fix races in the log module by using syncmap ()
Antoine GIRARD 14fe9010ae GPG commit validation ()
* GPG commit validation

* Add translation

+ some little fix

* Move hash calc after retrieving of potential key + missing translation

* Add some little test
Sandro Santilli 71d16f69ff Login via OpenID-2.0 ()
Antoine GIRARD ca1c3f1926 Implement GPG api ()
* Implement GPG API

* Better handle error

* Apply review recommendation + simplify database operations

* Remove useless comments
Lunny Xiao fa41ddd3eb fix build failed on aarch64 ()
Mura Li 848293671b Add basic integration test infrastructure (and new endpoint `/api/v1/version` for testing it) ()
* Implement '/api/v1/version'

* Cleanup and various fixes

* Enhance run.sh

* Add install_test.go

* Add parameter utils.Config for testing handlers

* Re-organize TestVersion.go

* Rename functions

* handling process cleanup properly

* Fix missing function renaming

* Cleanup the 'retry' logic

* Cleanup

* Remove unneeded logging code

* Logging messages tweaking

* Logging message tweaking

* Fix logging messages

* Use 'const' instead of hardwired numbers

* We don't really need retries anymore

* Move constant ServerHttpPort to install_test.go

* Restore mistakenly removed constant

* Add required comments to make the linter happy.

* Fix comments and naming to address linter's complaints

* Detect Gitea executale version automatically

* Remove tests/run.sh, `go test` suffices.

* Make `make build` a prerequisite of `make test`

* Do not sleep before trying

* Speedup the server pinging loop

* Use defined const instead of hardwired numbers

* Remove redundant error handling

* Use a dedicated target for running code.gitea.io/tests

* Do not make 'test' depend on 'build' target

* Rectify the excluded package list

* Remove redundant 'exit 1'

* Change the API to allow passing test.T to test handlers

* Make testing.T an embedded field

* Use assert.Equal to comparing results

* Add copyright info

* Parametrized logging output

* Use tmpdir instead

* Eliminate redundant casting

* Remove unneeded variable

* Fix last commit

* Add missing copyright info

* Replace fmt.Fprintf with fmt.Fprint

* rename the xtest to integration-test

* Use Symlink instead of hard-link for cross-device linking

* Turn debugging logs on

* Follow the existing framework for APIs

* Output logs only if test.v is true

* Re-order import statements

* Enhance the error message

* Fix comment which breaks the linter's rule

* Rename 'integration-test' to 'e2e-test' for saving keystrokes

* Add comment to avoid possible confusion

* Rename tests -> integration-tests

Also change back the Makefile to use `make integration-test`.

* Use tests/integration for now

* tests/integration -> integrations

Slightly flattened directory hierarchy is better.

* Update Makefile accordingly

* Fix a missing change in Makefile

* govendor update code.gitea.io/sdk/gitea

* Fix comment of struct fields

* Fix conditional nonsense

* Fix missing updates regarding version string changes

* Make variable naming more consistent

* Check http status code

* Rectify error messages
Lunny Xiao 6bdfadf4a9 fix broken caused by boltdb in mips/mipsle ()
Andrey Nering d7af8f96d7 Update vendor of code.gitea.io/sdk/gitea
Andrew Boyarshin 0602a44b27 Fix URL handling in the whole markdown module, improve test coverage ()
Amended with string to bool change in API SDK.

Signed-off-by: Andrew Boyarshin <andrew.boyarshin@gmail.com>
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)
Lunny Xiao c5f8b96dda update xorm for fixing bug on processor BeforeSet and AfterSet when Find a map ()
Lunny Xiao 46320f9630 refactor notificationsForUser since xorm In support slice of customerize type ()
Lunny Xiao 284c0160c3 update xorm vendor and also fix ()
Ethan Koenig d2329e1c26 Use assert in legacy unit tests ()
Zsombor e388db311b Add checkbox to search for all the branches by commit message ()
and updating the vendor directory
Thomas Boerger ea8c8cdaf3 Fix master builds on mips* again ()
* Use local folder for xgo

* Always do crosscompile and testing to fail early

* Added mips* values for boltdb

In order to get master building again I have applied these 2 additional
files to boltdb. This should get dropped when
https://github.com/boltdb/bolt/issues/656 gets solved.
Andrey Nering e7c3be5f2f Merge pull request from andreynering/fix-windows-ssh
Fix SSH server on Windows when running as service
Bo-Yi Wu 691fbdf1d3 fix: delete attachment after remove comment.
Bwko 8555e888d8 Add ETag header to avatars ()
Ethan Koenig 833f8b94c2 Search bar for issues/pulls ()
Andrey Nering 2009f4cbda Remove original minwinsvc from vendor
Lunny Xiao 907b6f943c update xorm for bugs fix ()
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
Lunny Xiao 7209917fd7 bug fix release
Lunny Xiao 61306fa737 Make releases faster than before and resolved ()
* make releases faster than before and resolved 

* fix comment
Lunny Xiao 980dd0bf51 Update xorm and dependencies vendor for feature to dump to other database ()
* update xorm and dependencies vendor for feature to dump to other database

* fix golint
Ethan Koenig 0c301f7b5c Release API endpoints
Ethan Koenig de8b73dd92 Unit tests for token and update models
Ethan Koenig b75450ad36 API endpoints for forks ()
Lunny Xiao 527c2dd665 Support http service graceful restart ()
* support http service graceful restart

* fix dependencies
Sl@ny c22f9114c7 Implementation of Folder Jumping
Fabian Zaremba 2e7ccecfe6 Git LFS support v2 ()
* Import github.com/git-lfs/lfs-test-server as lfs module base

Imported commit is 3968aac269a77b73924649b9412ae03f7ccd3198

Removed:

Dockerfile CONTRIBUTING.md mgmt* script/ vendor/ kvlogger.go
.dockerignore .gitignore README.md

* Remove config, add JWT support from github.com/mgit-at/lfs-test-server

Imported commit f0cdcc5a01599c5a955dc1bbf683bb4acecdba83

* Add LFS settings

* Add LFS meta object model

* Add LFS routes and initialization

* Import github.com/dgrijalva/jwt-go into vendor/

* Adapt LFS module: handlers, routing, meta store

* Move LFS routes to /user/repo/info/lfs/*

* Add request header checks to LFS BatchHandler / PostHandler

* Implement LFS basic authentication

* Rework JWT secret generation / load

* Implement LFS SSH token authentication with JWT

Specification: https://github.com/github/git-lfs/tree/master/docs/api

* Integrate LFS settings into install process

* Remove LFS objects when repository is deleted

Only removes objects from content store when deleted repo is the only
referencing repository

* Make LFS module stateless

Fixes bug where LFS would not work after installation without
restarting Gitea

* Change 500 'Internal Server Error' to 400 'Bad Request'

* Change sql query to xorm call

* Remove unneeded type from LFS module

* Change internal imports to code.gitea.io/gitea/

* Add Gitea authors copyright

* Change basic auth realm to "gitea-lfs"

* Add unique indexes to LFS model

* Use xorm count function in LFS check on repository delete

* Return io.ReadCloser from content store and close after usage

* Add LFS info to runWeb()

* Export LFS content store base path

* LFS file download from UI

* Work around git-lfs client issue with unauthenticated requests

Returning a dummy Authorization header for unauthenticated requests
lets git-lfs client skip asking for auth credentials
See: https://github.com/github/git-lfs/issues/1088

* Fix unauthenticated UI downloads from public repositories

* Authentication check order, Finish LFS file view logic

* Ignore LFS hooks if installed for current OS user

Fixes Gitea UI actions for repositories tracking LFS files.
Checks for minimum needed git version by parsing the semantic version
string.

* Hide LFS metafile diff from commit view, marking as binary

* Show LFS notice if file in commit view is tracked

* Add notbefore/nbf JWT claim

* Correct lint suggestions - comments for structs and functions

- Add comments to LFS model
- Function comment for GetRandomBytesAsBase64
- LFS server function comments and lint variable suggestion

* Move secret generation code out of conditional

Ensures no LFS code may run with an empty secret

* Do not hand out JWT tokens if LFS server support is disabled
Ethan Koenig 8de8ec027d Update sdk
btrepp 25b5ffb6af Enables mssql support ()
* Enables mssql support

Port of dlobs work in gogs.
Enables options in index.js
Enables MSSQL as a database option in go.
Sets ID to 0 on initial migration. Required for
MSSQL insert statements.

Signed-off-by: Beau Trepp <beautrepp@gmail.com>

* Vendors in denisenkom/go-mssqldb

Includes golang.org/x/crypto/md4
as this is required by go-msssqldb

Signed-off-by: Beau Trepp <beautrepp@gmail.com>
Lunny Xiao 47a7529d96 update code.gitea.io/git ()
Martin Hebnes Pedersen b11843b8dc Update gitea/sdk vendor ()
Lunny Xiao d771e978a1 Don't use custom PBKDF2 function ()
Thomas Boerger b6a95a8cb3 Integrate public as bindata optionally ()
* Dropped unused codekit config

* Integrated dynamic and static bindata for public

* Ignore public bindata

* Add a general generate make task

* Integrated flexible public assets into web command

* Updated vendoring, added all missiong govendor deps

* Made the linter happy with the bindata and dynamic code

* Moved public bindata definition to modules directory

* Ignoring the new bindata path now

* Updated to the new public modules import path

* Updated public bindata command and drop the new prefix
Kim "BKC" Carlbäcker 57dc9efaae Update gitea/sdk vendor
Thibault Meyer 871c964ef7 Upgrade vendor "git" ()
Thibault Meyer 54e6ed3431 Upgrade vendor "git" ()
Lunny Xiao a8c6698de8 Fix error 500 on organization dashboard page ()
Sandro Santilli a1c5f02444 Fix import path of go-sdk ()
From code.gitea.io/go-sdk/gitea
  To code.gitea.io/sdk/gitea
Sandro Santilli 4247304f5a Update import paths from github.com/go-gitea to code.gitea.io ()
- Update import paths from github.com/go-gitea to code.gitea.io
- Fix import path for travis

See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
Matthias Loibl a5d0b4de5b
Vendor github.com/stretchr/testify for the assert package
Sandro Santilli 864d1b1f9f Fix type in unused constant name ()
* Write LDAP, SMTP, PAM, DLDAP back to all uppercase

* Fix type in unused constant name

* Other MixCased fixes

* Complete MixerCasing of template constants

* Re uppercase LTS and LDAPS suffixes

* Uppercase JSON suffix in constant names

* Proper case LoginNoType

* Prefix unexported template path constants with "tpl"
Sandro Santilli 0b62aeb495 More MixedCase consts
Sandro Santilli 80eea77953 Use MixedCase constant names
See https://github.com/golang/go/wiki/CodeReviewComments#mixed-caps
Thomas Boerger e378648c79
Added updated go-sdk
Thomas Boerger 6f3097f9e6
Dropped github.com/gogits/go-gogs-client vendored dep
Sandro Santilli 6e4252dad4 Replace gogits/git-module dependency with go-gitea/git ()
* Replace gogits/git-module dependency with go-gitea/git

Fixes 

* Remove git alias for git module import (not needed)
Thomas Boerger 1ebb35b988
Added all required dependencies
Thomas Boerger 78f86abba4
Added vendoring config for govendor