Commit Graph

166 Commits (f37b87f81e7686fc1d130ddb5e727c9328ed3659)

Author SHA1 Message Date
zeripath fcb535c5c3
Sign merges, CRUD, Wiki and Repository initialisation with gpg key ()
This PR fixes  by providing a configurable way of signing commits across the Gitea instance. Per repository configurability and import/generation of trusted secure keys is not provided by this PR - from a security PoV that's probably impossible to do properly. Similarly web-signing, that is asking the user to sign something, is not implemented - this could be done at a later stage however.

## Features
- [x] If commit.gpgsign is set in .gitconfig sign commits and files created through repofiles. (merges should already have been signed.)
- [x] Verify commits signed with the default gpg as valid
- [x] Signer, Committer and Author can all be different
    - [x] Allow signer to be arbitrarily different - We still require the key to have an activated email on Gitea. A more complete implementation would be to use a keyserver and mark external-or-unactivated with an "unknown" trust level icon.
- [x] Add a signing-key.gpg endpoint to get the default gpg pub key if available
    - Rather than add a fake web-flow user I've added this as an endpoint on /api/v1/signing-key.gpg
    - [x] Try to match the default key with a user on gitea - this is done at verification time
- [x] Make things configurable?
    - app.ini configuration done
    - [x] when checking commits are signed need to check if they're actually verifiable too
- [x] Add documentation

I have decided that adjusting the docker to create a default gpg key is not the correct thing to do and therefore have not implemented this.
kolaente 7408942c80 Update golangci to v1.20 ()
* Update golangci to v1.20

Signed-off-by: kolaente <k@knt.li>

* Use the timeout flag instead of deadline, move it to config

Signed-off-by: kolaente <k@knt.li>
kolaente 249dbbe0bc Update golangci to v1.19.1 ()
Signed-off-by: kolaente <k@knt.li>
Lunny Xiao a8c024043c Improve integration tests ()
* improve integration tests

* fix Makefile

* improve makefile and integration docs
techknowlogick 3f5cdfe359 use go 1.13 ()
* use go 1.13

* use go 1.13 in gomod file

* Update Makefile

* update swagger deps
Antoine GIRARD 9fe4437bda Use vendored go-swagger ()
* Use vendored go-swagger

* vendor go-swagger

* revert un wanteed change

* remove un-needed GO111MODULE

* Update Makefile

Co-Authored-By: techknowlogick <matti@mdranta.net>
Mura Li dd3ba9bb6b Fix make-generate using non-vendor packages ()
Antoine GIRARD 256b178176
Update swagger to 0.20.1 ()
* update swagger to 0.20.1

* fiw swagger version for validate
techknowlogick 99a004c343
Update golangci-lint to v1.17.1 ()
Lars Kistner 714dcf9dad remove `-i` flag from GOFLAGS ()
this flag is not needed for Go versions >=1.10 and creates problems
while building. see https://github.com/golang/go/issues/27285#issuecomment-424382413
Lunny Xiao 87404d7c0b Use vendors when go generate ()
* use vendors when go generate

* update docs about golang minimal requirement from 1.9 to 1.11

* fix build
Cherrg 86750325c7 workaround broken drone build ()
* workaround broken swagger

only master brach is not working, latest release seems to work

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* make vendor

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* Don't export GO111MODULE

* set go-swagger to fixed release version

mentioned here: https://github.com/go-gitea/gitea/pull/7362#discussion_r300831537

Signed-off-by: Michael Gnehr <michael@gnehr.de>
silverwind c37ec66ee2 replace lesshint with stylelint ()
New CSS linter which is much more powerfull than the previous one.
Configuration is default but I had to remove a few rules that were
throwing too many or weird errors.

More importantly, the linter will exit with code 1 on errors so now our
build will fail if the CSS linter fails which should eliminate linter
errors being introduced without notice.
silverwind a71cabbd53 add 'npm' and 'npm-update' make targets and lockfile ()
* add 'npm' and 'npm-update' make targets and lockfile

- `make npm` installs and updates node_modules, triggered automatically
   on `make css` and `make js` as it completes reasonably fast and
   ensures consistent modules.
- `make npm-update` updates all dependencies to their latest version,
   regenerates `node_modules` from scratch and updates
   `package-lock.json`. It uses npm modules `updates` written by yours
   truly to find the latest version of each dependency.

* add suggested make dependencies

* remove package-lock.json during npm-update

* regenerate package-lock.json
silverwind 9ce4d89e99 UI: Fix overflow issues in repo ()
- Fix layout overflow in repo file list.
- Fix invisible status icon in file view and commit list. In file view,
  the icon was moved to the left because I could not figure out a proper
  fix because of HTML tables.
- Added title attribute to commit messages.
- Fixed two CSS linter warnings in existing CSS.
- Fixed CI variable check in 'make css'.

Fixes: https://github.com/go-gitea/gitea/issues/7180
Cherrg 2f39fc7bb6 fix drone build bug ()
kolaente f9ec2f89f2 Add golangci ()
Lunny Xiao 83b90e4199 Use vfsgen instead of go-bindata ()
* use vfsgen instead of go-bindata

* fix templates

* fix fmt

* vendor vsfgen
techknowlogick a83c80a000 Disable arm7 builds ()
* Disable arm7 builds

As arm6 works on arm7 platforms with no noticeable performance difference

* 386
silverwind d9dcd09340 add make targets for js and css, add js linter ()
* add make targets for js,css, add javascript linter

- add `make js`, deprecating `make javascripts`
- add `make css`, deprecating `make generate-stylesheets` and
  `make stylesheets-check`
- changed the unclean css check to only run on CI
- add JS linting via eslint with basic configuration and fixed
  discovered issues
- changed autoprefixer to use official `postcss-cli` avoiding the need
  to loop in the makefile
- moved browserslist to package.json so other future tools can use it
  too.
- update documentation for new make targets and added JS section

* fix indentation

* move functions used in html to 'exported' list

* Run lessc binary without having to install anything to node_modules

* use relative paths to node bin scripts, removing npx

* Revert "use relative paths to node bin scripts, removing npx"

This reverts commit 119b725525.

* fix lessc and postcss plugins

* check for node_modules and use actual bin names
Xaver Maierhofer 3957b40021 Add less linter via npx ()
Xaver Maierhofer 06ae9a3a96 Use single line per selector & don't strip license comments ()
Antoine GIRARD 650df0bd4e Enforce osusergo build tag for releases ()
zeripath 8d0d7bc28d Make CustomPath, CustomConf and AppWorkPath configurable at build ()
zeripath b33f7f792b
Prevent creating empty sessions ()
* Prevent creating empty sessions

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

* Update modules/setting/session.go

* Remove unnecessary option

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

* Add destory to list of ignored misspellings

* rename cookie.go -> virtual.go

* Delete old file

* Add test to ensure that sessions are not created without being logged in

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

* fix tests

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

* Update integrations/create_no_session_test.go
techknowlogick 77ffb1563b
remove bash requirement in makefile ()
techknowlogick 38889f09cb
Fix cross-compile builds ()
Mura Li d8802b1298 Add a new Make target for running single integration test ()
* Add a new Make target for running single integration test

* Use # instead of - as the delimiter
Lunny Xiao 0a8e63c682 add make version on gitea version ()
Richard Mahn 4e3ce71ac9 Fies - Uses space match and adds newline for all sed flavors ()
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
silverwind d86f878b3e optimize all images in public/img ()
Fixes: https://github.com/go-gitea/gitea/pull/6357
techknowlogick d10a668ffc
Make the version within makefile overwriteable ()
Fix 
Lunny Xiao 4a6b011b15 Add test environment for Mysql8 ()
techknowlogick e558f83407
use updated reference of xgo in makefile ()
Antoine GIRARD 9d3732dfd5 [Contrib] Checkout a PR ()
silverwind 28fcbf33dc UI: Make document body a flexbox ()
* UI: Make document body a flexbox

Fixes: https://github.com/go-gitea/gitea/issues/6118

* ie11 fixes

* increase padding to 80px

* add flex-grow
Bo-Yi Wu 05143768d0 Refactor coverage profile with multiple packages ()
John Olheiser eaf9ded182 Makefile changes for Windows and easier development ()
* Added Go Path and node_modules to PATH
* Uses npx now for generate-stylesheets
* Uses `go env GOPATH` to calculate adding GOPATH/bin to PATH
* Added note about installing Node 8.0+ to generate stylesheets
* Added preferred Node version to CONTRIBUTING.md
Antoine GIRARD 9eb00fed13 Run benchmark at tag to track performances ()
silverwind 353282e658 Add autoprefixer to css build ()
* Add autoprefixer to css build

* also use autoprefixer on theme files
zeripath 8917d66571 Add migration test ()
* Add migration test

This commit adds a simple migration test for v1.5.3, v1.6.4 and v1.7.0-rc3

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

* Automigrate based on available dbs

* remove old ini file

* Standardise the dialect names
Jonas Franz 94c3963da0
Fix makefile generate buildstep ()
Signed-off-by: Jonas Franz <info@jonasfranz.software>
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
Bo-Yi Wu 20c54f88b2 refactor: replace lint to revive ()
* refactor: replace lint to revive

* make changes.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
SohnyBohny 294904321c Create Progressive Web App ()
* Create manifest and serviceworker

* Create templates and add AppSubUrl

* Add JSRenderer

* fix ctx type

* Add JSRenderer to static.go

* Complete adding {{AppSubUrl}}

* Add more fonts to urlsToCache

* Add 512px and 192px icons

* Hardcode font MD5

* Default theme doesn't have a specific CSS file
Mura Li 25c49cf930 Update build tags for sqlite_unlock_notify ()
Lauris BH c42b366f0e
Fix golint to new URL ()
Piotr Orzechowski a74426d631 Swagger.v1.json template ()
* Turn swagger.v1.json into template

* Rename ENABLE_SWAGGER_ENDPOINT option to ENABLE_SWAGGER
Lauris BH a7f90905df
Fix drone git@next plugin Gitea version display when building tag ()