Commit Graph

97 Commits (4f19b082586b38006ce4d119f266f5b74cbde71d)

Author SHA1 Message Date
techknowlogick 3fb038c53a
upgrade version of lib/pq to v1.1.0 ()
Adds SCRAM-SHA-256 authentication
Lunny Xiao e7d7dcb090 Issue indexer queue redis support ()
* add redis queue

* finished indexer redis queue

* add redis vendor

* fix vet

* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

Co-Authored-By: lunny <xiaolunwen@gmail.com>

* switch to go mod

* Update required changes for new logging func signatures
zeripath 704da08fdc
Better logging () ()
* Panic don't fatal on create new logger

Fixes 

Signed-off-by: Andrew Thornton <art27@cantab.net>

* partial broken

* Update the logging infrastrcture

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Reset the skip levels for Fatal and Error

Signed-off-by: Andrew Thornton <art27@cantab.net>

* broken ncsa

* More log.Error fixes

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove nal

* set log-levels to lowercase

* Make console_test test all levels

* switch to lowercased levels

* OK now working

* Fix vetting issues

* Fix lint

* Fix tests

* change default logging to match current gitea

* Improve log testing

Signed-off-by: Andrew Thornton <art27@cantab.net>

* reset error skip levels to 0

* Update documentation and access logger configuration

* Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE

* Fix broken level caching

* Refactor the router log

* Add Router logger

* Add colorizing options

* Adjust router colors

* Only create logger if they will be used

* update app.ini.sample

* rename Attribute ColorAttribute

* Change from white to green for function

* Set fatal/error levels

* Restore initial trace logger

* Fix Trace arguments in modules/auth/auth.go

* Properly handle XORMLogger

* Improve admin/config page

* fix fmt

* Add auto-compression of old logs

* Update error log levels

* Remove the unnecessary skip argument from Error, Fatal and Critical

* Add stacktrace support

* Fix tests

* Remove x/sync from vendors?

* Add stderr option to console logger

* Use filepath.ToSlash to protect against Windows in tests

* Remove prefixed underscores from names in colors.go

* Remove not implemented database logger

This was removed from Gogs on 4 Mar 2016 but left in the configuration
since then.

* Ensure that log paths are relative to ROOT_PATH

* use path.Join

* rename jsonConfig to logConfig

* Rename "config" to "jsonConfig" to make it clearer

* Requested changes

* Requested changes: XormLogger

* Try to color the windows terminal

If successful default to colorizing the console logs

* fixup

* Colorize initially too

* update vendor

* Colorize logs on default and remove if this is not a colorizing logger

* Fix documentation

* fix test

* Use go-isatty to detect if on windows we are on msys or cygwin

* Fix spelling mistake

* Add missing vendors

* More changes

* Rationalise the ANSI writer protection

* Adjust colors on advice from @0x5c

* Make Flags a comma separated list

* Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING

* Ensure matching is done on the non-colored message - to simpify EXPRESSION
Mura Li d77176912b Use Go1.11 module ()
* Migrate to go modules

* make vendor

* Update mvdan.cc/xurls

* make vendor

* Update code.gitea.io/git

* make fmt-check

* Update github.com/go-sql-driver/mysql

* make vendor
Lunny Xiao d578b71d61
move code.gitea.io/git to code.gitea.io/gitea/modules/git ()
* move code.gitea.io/git to code.gitea.io/gitea/modules/git

* fix imports

* fix fmt

* fix misspell

* remove wrong tests data

* fix unit tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* enable Debug to trace the failure tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* comment commit count tests since git clone depth is 50

* fix tests

* update from code.gitea.io/git

* revert change to makefile
mrsdizzie f2de5dc8c8 Replace linkRegex with xurls library ()
* Replace linkRegex with xurls library

Rather than maintaining a complicated regex to match URLs for
autolinking, gitea can use this existing go library that takes care of
the matching with very little code change to gitea itself. After
spending a while trying to find the perfect regex for all cases this library
still works better as it is more flexible than a single regex ever will be.

This will also fix the following issues:   

This passes all our current tests and I've added new ones mentioned in
those issues as well.

* Use xurls.StrictMatchingScheme instead of xurls.Strict

This is much faster and we only care about https? links to preserve
existing behavior.
Lunny Xiao 830ae61456 Refactor issue indexer ()
Lunny Xiao a380cfd8e0 Update bleve dependency to latest master revision ()
* update bleve to master b17287a86f6cac923a5d886e10618df994eeb54b6724eac2e3b8dde89cfbe3a2

* remove unused pkg from dep file

* change bleve from master to recent revision
techknowlogick 9de871a0f8
add other session providers ()
Lauris BH fada6968a8 Fix new release creation API to allow empty target ()
* Fix new release creation API to allow empty target

* Add more test cases

* Update swagger
Lunny Xiao 477a80f658 upgrade go-sql-driver/mysql to fix invalid connection error ()
should fix 
Zsombor c2dcb35148 Fixing : ()
* Format boolean values to true/false even when it is returned as byte-slice,
* Fix the sequence generation, the proper sequence name is used (instead of 'table_id_seq'), and fix the next value be max+1 always
techknowlogick 5c44f751a3
Discord Oauth2 support ()
* add discord auth

* add vendor for discord

* fix syntax error

* make fmt

* update version of goth in use

* update markbates/goth
Zsombor 31aa00fa4b Update xorm to fix issue and ()
Lunny Xiao fe55ab2a68 fix forgot removed records when deleting user ()
* fix forgot removed records when deleting user

* fix migration

* fix rewritekey lock on sqlite

* remove unused codes
kolaente 6db7dbd333 Added test environment for mssql ()
* Added test environment for m$sql

* Added template for test environment for m$sql

* Fix password

* Fix password (again)

* Fix password (again again)

* Fix db

* Ci trigger (Looking at you drone....)

* Ci trigger (Looking at you drone....)

* Ci trigger (Looking at you drone....)

* Ci trigger (Looking at you drone....)

* Create master database for mssql integration tests

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Create database only if master do not exist

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix mssql integration tests by using custom database "gitea"

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Moved defer

* bump xorm

* updated xorm

* Fixed build
Lauris BH 08bf443016 Implement git refs API for listing references (branches, tags and other) ()
* Inital routes to git refs api

* Git refs API implementation

* Update swagger

* Fix copyright

* Make swagger happy add basic test

* Fix test

* Fix test again :)
Antoine GIRARD 4c1f1f9646 Remove x/net/context vendor by using std package ()
* Update dep github.com/markbates/goth

* Update dep github.com/blevesearch/bleve

* Update dep golang.org/x/oauth2

* Fix github.com/blevesearch/bleve to c74e08f039e56cef576e4336382b2a2d12d9e026

* Update dep golang.org/x/oauth2
Stanislav 078c404c3b Prometheus endpoint ()
* Add prometheus collector and route

* dep ensure -add github.com/prometheus/client_golang/prometheus

* dep ensure -update github.com/golang/protobuf

* add metrics to reserved usernames

* add comment head in metrics package

* fix style imports

* add metrics settings

* add bearer token check

* mapping metrics configs

* fix lint

* update config cheat sheet

* update conf sample, typo fix
Kim "BKC" Carlbäcker aeb5655c25 Update go-macaron/session to latest mast to fix RCE-bug ()
Mura Li 317ddb7283 Update vendor/github.com/mattn/go-sqlite3 ()
To fix build failure on Windows/386
Mura Li 2ce72d4e00 Update vendor/go-sqlite3 ()
Lauris BH ab5b245182 Disable debug routes unless PPROF is enabled in configuration ()
OvermindDL1 07af31d004 Fix to follow the OpenID Connect Audiences spec ()
Signed-off-by: Gabriel Robertson <overminddl1@gmail.com>
Lauris BH 0c59edaafa Update xorm to latest version and fix correct `user` table referencing in sql ()
Antoine GIRARD 74f9f98f78 Simply remove tidb and deps ()
techknowlogick 9d4c1ddfa1
Dep upgrade mysql lib ()
*  update gopkg file to add sql dep
Magnus Lindvall cdb9478774 LDAP Public SSH Keys synchronization ()
* Add LDAP Key Synchronization feature

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Add migration: add login source id column for public_key table

* Only update keys if needed

* Add function to only list pubkey synchronized from ldap

* Only list pub ssh keys synchronized from ldap. Do not sort strings as ExistsInSlice does it.

* Only get keys belonging to current login source id

* Set default login source id to 0

* Some minor cleanup. Add integration tests (updete dep testify)
Aleksandr Bulyshchenko ee878e3951 Support secure cookie for csrf-token ()
* dep: Update github.com/go-macaron/csrf

Update github.com/go-macaron/csrf with dep to revision 503617c6b372
to fix issue of csrf-token security.

This update includes following commits:
- Add support for the Cookie HttpOnly flag
- Support secure mode for csrf cookie

Signed-off-by: Aleksandr Bulyshchenko <A.Bulyshchenko@globallogic.com>

* routers: set csrf-token security depending on COOKIE_SECURE

Signed-off-by: Aleksandr Bulyshchenko <A.Bulyshchenko@globallogic.com>
Antoine GIRARD 3f3383dc0a Migrate to dep ()
* Update makefile to use dep

* Migrate to dep

* Fix some deps

* Try to find a better version for golang.org/x/net

* Try to find a better version for golang.org/x/oauth2
Antoine GIRARD 8dca5ad526 Fetch missing file in github.com/davecgh/go-spew/spew ()
Jonas Franz 951309f76a Add support for FIDO U2F ()
* Add support for U2F

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add vendor library
Add missing translations

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Minor improvements

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F support for Firefox, Chrome (Android) by introducing a custom JS library
Add U2F error handling

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F login page to OAuth

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Move U2F user settings to a separate file

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add unit tests for u2f model
Renamed u2f table name

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix problems caused by refactoring

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add U2F documentation

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Remove not needed console.log-s

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add default values to app.ini.sample
Add FIDO U2F to comparison

Signed-off-by: Jonas Franz <info@jonasfranz.software>
Antoine GIRARD 917b9641ec Update to last common bleve ()
Lauris BH e74055878f Update xormstore dependency to fix OAuth2 support for MySQL ()
Lauris BH ff64f188fd Switch back to upstream goth repository and update govendor to latest goth version ()
Lauris BH 5a62eb30df
Store OAuth2 session data in database ()
* Store OAuth2 session data in database

* Rename table to `oauth2_session` and do not skip xormstorage initialization error
PJ Eby fc36567ee1 Update blackfriday dependency per ()
Signed-off-by: PJ Eby <pje@telecommunity.com>
Lauris BH ad33730dca
Update markbates/goth libary to fix OAuth2 support ()
Lauris BH 7b297808ce
Update markbates/goth library ()
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
Ethan Koenig a89592d4ab Reduce repo indexer disk usage ()
Lunny Xiao 97fe773491 fix MSSQL bug on org ()
Antoine GIRARD d2736e268b Remove unused vendor github.com/stretchr/testify/require ()
Ethan Koenig 58a7de2aea Update code.gitea.io/git ()
Ethan Koenig b7ebaf6d20 Various wiki bug fixes ()
* Update macaron

* Various wiki bug fixes
Lunny Xiao 10b54df2b2 Add dingtalk webhook ()
* add dingtalk webhook type

* add vendor

* some fixes

* fix name check

* fix name check & improvment
Lauris BH a6f337046f Update go-ini dependency and remove semicolon hack in translations ()
Ethan Koenig 5866eb2321 Code/repo search ()
Indexed search of repository contents (for default branch only)
Jonas Bröms e86a0bf3fe Add support for extra sendmail arguments ()
* Add support for extra sendmail arguments

* Sendmail args to exec.command should be a list

* Add go-shellquote package

* Use go-shellquote lib for parsing Sendmail args

* Only parse if sendmail is configured
Antoine GIRARD 2112eb8741 Update vendor github.com/lib/pq ()
Lunny Xiao a8717e5e3a Use AfterLoad instead of AfterSet on Structs ()
* use AfterLoad instead of AfterSet on Structs

* fix the comments on AfterLoad

* fix the comments on action AfterLoad