390 Commits (forgejo)

Author SHA1 Message Date
silverwind 87e1438005 avoid useless fomantic rebuilds (#9999)
the `fomantic` target for some reason does sometimes not update the
timestamp on the directory, leading to useless rebuild. Manually update
the timestamp at the end of the build to avoid this and also added the
same to js/css targets.
4 years ago
Lauris BH 59510d6227
Change font to Roboto to support more charsets (#9803) 4 years ago
silverwind 8ca07305fb make node_modules a order-only prerequisite (#9923)
* make node_modules a order-only prerequisite

Package installations and our fomantic step results in changes inside
node_modules which lead to make triggering that target unnecessarily.

Moved all node_modules prerequisites to order-only which will make skip
the timestamp check on in and eliminate useless npm calls.

Changes in package-lock.json will still result in reinstallation so
node_modules should stay consistent.

* revert change to clean-all
4 years ago
silverwind bfdfa9a8b3 move fomantic target, update 'make help' (#9945)
I'd like to run webpack without fomantic in the prereqs so move it to
the `generate` target.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago
silverwind c7fe028db4 misc webpack tweaks (#9924)
- reduce verbosity during build
- use array form `use` to allow easier extension
- disable uninteresting source maps
- disable symlink resolution for a speedup

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
4 years ago
Lunny Xiao 5cf241b312
Use npm to manage fomantic and only build needed components (#9561)
* Use npm to manage fomantic

* Only build needed semantic components

* Fix make

* Don't import fonts from google sites since we have loaded

* [misc] devendor fomantic-ui and rebuild upon src or config changes only

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* Change sort alphabetically of semantic components

* Fix trailing slash

* fix makefile

* Remove dependency to gulp from package.json

* Fix something

* Simplife the makefile

* add missed fomantic compnent

Co-authored-by: Jakob Ackermann <das7pad@outlook.com>
4 years ago
guillep2k ad1b6d439f Add support for database schema in PostgreSQL (#8819)
* Add support for database schema

* Require setting search_path for the db user

* Add schema setting to admin/config.tmpl

* Use a schema different from default for psql tests

* Update postgres scripts to use custom schema

* Update to xorm/core 0.7.3 and xorm/xorm c37aff9b3a

* Fix migration test

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago
Antoine GIRARD 8dd5ab2a14 ci: simplify tag/release by always running coverage (#9774)
* ci: simplify tag/release by always running coverage

* use mod and vendor for unit test coverage

* remove not needed lfs for unit test
4 years ago
silverwind f00961abe7 move swagger-ui to webpack/npm (#9714)
Created a second webpack output file for swagger-ui which is loaded on
the /api/swagger route. One notable difference is the absence of the
swagger favicon that was previously used which is now the gitea icon. I
see no easy way to restore that favicon, so I decided to not keep it.
4 years ago
guillep2k 565eb1811c Add test for git + git lfs (#9753) 4 years ago
Antoine GIRARD dfe4564072
ci: go back to golangci-lint 1.20.0 (#9742)
Revert https://github.com/go-gitea/gitea/pull/9711
4 years ago
silverwind 74e35aae11 remove deprecated targets from Makefile (#9729)
- remove deprecated targets
- ensure 1 empty line between targets

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
4 years ago
techknowlogick fef49f5e2e golangci-lint 1.22.2 (#9711) 4 years ago
6543 7e4f490482 [Docs] introduce "make help" (#9604)
* introduce "make help"

* fix + add more routienes

* Update Makefile

* add make vet

Co-authored-by: techknowlogick <matti@mdranta.net>
4 years ago
dankm d66ae50fd5 Address minor portability issues (#9414)
* Add os specific sed for FreeBSD.

* Replace hardcoded "make" with $(MAKE)

Some systems don't use GNU make by default, and use something like
gnumake or gmake. Respect that when determining the make version.
4 years ago
silverwind 7217b703e9 Combine Drone release steps (#9338)
* Combine Drone release steps

Fixes missing JS/CSS because drone did unwanted parallelization of the
js/css task and the generate task. Combined the tasks into one and made
'make release' work standalone.

Fixes: https://github.com/go-gitea/gitea/issues/9324
Fixes: https://github.com/go-gitea/gitea/issues/9362

* move js/css to generate dependencies

* remove unneccessary go-all target

* remove go target as well
4 years ago
techknowlogick c34fdf7e33
prebuild CSS/JS before xgo release binaries (#9293)
* prebuild CSS/JS before xgo release binaries

* Update .drone.yml

* Update Makefile

* update per @lafriks feedback
5 years ago
silverwind 3f42934b9a Remove explicit 'generate' calls, fix release task (#9288)
* Remove more explicit 'generate' calls

`generate` is now implicit during `build` since #9114, it is no longer
necessary or desired to specify it explicitely.

* add js,css,generate dependencies to release task

* remove generate warning as per @lunny
5 years ago
silverwind 9ff5b75559 Switch CSS minifier to cssnano (#9260)
This results in around 4kB saving in CSS size and also resolves with a
particular issue on git bash which had issues with the format of the
lessc arguments.
5 years ago
silverwind d9c67a8c90 Add Node.js build dep, remove built js/css files (#9114)
- Added Node.js as build dependency and removes build files from git.
- Added version checks for both Go and Node.js.
- Overhauled the js/css make target to only run when needed.
- Merged the `generate` make target into `build` as per suggestion.

Fixes: https://github.com/go-gitea/gitea/issues/6782
Fixes: https://github.com/go-gitea/gitea/issues/9216
5 years ago
Gary Kim 9feab29405 Check compiled files during build (#9042)
Signed-off-by: Gary Kim <gary@garykim.dev>
5 years ago
Lunny Xiao afe50873a5 Move index.js to web_src and use webpack to pack them (#8598)
* Move index.js to web_src and use webpack

* Fix initHeatMap

* update eslint and move webpack to devDependencies

* update index.js

* add eslint env node
5 years ago
Lunny Xiao e4e6d48e30 Move less from public/ to web_src/ so that it will not be packe… (#8908) 5 years ago
6543 5a187f4bcc Add API for Issue set Subscription (#8729)
* add issue subscriber API

* subscribers return []user.APIFormat

* add comments

* more meaningfull description

* without "reqToken()" api works ...
 * should be still secure beause ctx.user has to be there or nothing will hapen

* FIX: getIssueWatchers() get only aktive suscriber

* add return avter error on right position

* Revert "FIX: getIssueWatchers() get only aktive suscriber"

This reverts commit 5eca9291858a821981992b0aaa38cef610d84bca.

* Update routers/api/v1/repo/issue.go

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* test go linter again

* update swagger

* GetIssueWatchers -> GetIssueSubscribers

part one

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* GetIssueWatchers -> GetIssueSubscribers
part two

* Revert "test go linter again"

This reverts commit bab12356227e44334de113b76f12099de0b8aaa6.

* change description for unsubscribe too

* golangci-lint timeout avter 5min

* move issueSubscription to seperate file

* dont create black entitys

* use IsWatching until refactoring

* Update License Info

* better swagger description

* Update .golangci.yml

because functions moved from issue.go to issue_subscription.go

* add IssueWatchList type

* batch tasks

* use e Engien

* add error handling

* error should be the last type when returning multiple items

* short version

* reurn empy UserList instead of nil
5 years ago
zeripath fcb535c5c3
Sign merges, CRUD, Wiki and Repository initialisation with gpg key (#7631)
This PR fixes #7598 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.
5 years ago
kolaente 7408942c80 Update golangci to v1.20 (#8432)
* 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>
5 years ago
kolaente 249dbbe0bc Update golangci to v1.19.1 (#8414)
Signed-off-by: kolaente <k@knt.li>
5 years ago
Lunny Xiao a8c024043c Improve integration tests (#8276)
* improve integration tests

* fix Makefile

* improve makefile and integration docs
5 years ago
techknowlogick 3f5cdfe359 use go 1.13 (#8088)
* use go 1.13

* use go 1.13 in gomod file

* Update Makefile

* update swagger deps
5 years ago
Antoine GIRARD 9fe4437bda Use vendored go-swagger (#8087)
* Use vendored go-swagger

* vendor go-swagger

* revert un wanteed change

* remove un-needed GO111MODULE

* Update Makefile

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

* fiw swagger version for validate
5 years ago
techknowlogick 99a004c343
Update golangci-lint to v1.17.1 (#7848) 5 years ago
Lars Kistner 714dcf9dad remove `-i` flag from GOFLAGS (#7778)
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
5 years ago
Lunny Xiao 87404d7c0b Use vendors when go generate (#7340)
* use vendors when go generate

* update docs about golang minimal requirement from 1.9 to 1.11

* fix build
5 years ago
Cherrg 86750325c7 workaround broken drone build (#7362)
* 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>
5 years ago
silverwind c37ec66ee2 replace lesshint with stylelint (#7305)
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.
5 years ago
silverwind a71cabbd53 add 'npm' and 'npm-update' make targets and lockfile (#7246)
* 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
5 years ago
silverwind 9ce4d89e99 UI: Fix overflow issues in repo (#7190)
- 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
5 years ago
Cherrg 2f39fc7bb6 fix drone build bug (#7192) 5 years ago
kolaente f9ec2f89f2 Add golangci (#6418) 5 years ago
Lunny Xiao 83b90e4199 Use vfsgen instead of go-bindata (#7080)
* use vfsgen instead of go-bindata

* fix templates

* fix fmt

* vendor vsfgen
5 years ago
techknowlogick a83c80a000 Disable arm7 builds (#7037)
* Disable arm7 builds

As arm6 works on arm7 platforms with no noticeable performance difference

* 386
5 years ago
silverwind d9dcd09340 add make targets for js and css, add js linter (#6952)
* 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 119b725525a8430b32ee7a6e6009b4ece544e39b.

* fix lessc and postcss plugins

* check for node_modules and use actual bin names
5 years ago
Xaver Maierhofer 3957b40021 Add less linter via npx (#6936) 5 years ago
Xaver Maierhofer 06ae9a3a96 Use single line per selector & don't strip license comments (#6919) 5 years ago
Antoine GIRARD 650df0bd4e Enforce osusergo build tag for releases (#6862) 5 years ago
zeripath 8d0d7bc28d Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631) 5 years ago
zeripath b33f7f792b
Prevent creating empty sessions (#6677)
* 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
5 years ago
techknowlogick 77ffb1563b
remove bash requirement in makefile (#6617) 5 years ago
techknowlogick 38889f09cb
Fix cross-compile builds (#6609) 5 years ago
Mura Li d8802b1298 Add a new Make target for running single integration test (#6500)
* Add a new Make target for running single integration test

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

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

* ie11 fixes

* increase padding to 80px

* add flex-grow
5 years ago
Bo-Yi Wu 05143768d0 Refactor coverage profile with multiple packages (#6167) 5 years ago
John Olheiser eaf9ded182 Makefile changes for Windows and easier development (#6103)
* 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
5 years ago
Antoine GIRARD 9eb00fed13 Run benchmark at tag to track performances (#6035) 5 years ago
silverwind 353282e658 Add autoprefixer to css build (#6029)
* Add autoprefixer to css build

* also use autoprefixer on theme files
5 years ago
zeripath 8917d66571 Add migration test (#5773)
* 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
5 years ago
Jonas Franz 94c3963da0
Fix makefile generate buildstep (#5556)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
5 years ago
kolaente 6db7dbd333 Added test environment for mssql (#4282)
* 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
6 years ago
Bo-Yi Wu 20c54f88b2 refactor: replace lint to revive (#5422)
* refactor: replace lint to revive

* make changes.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
6 years ago
SohnyBohny 294904321c Create Progressive Web App (#4730)
* 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
6 years ago
Mura Li 25c49cf930 Update build tags for sqlite_unlock_notify (#5144) 6 years ago
Lauris BH c42b366f0e
Fix golint to new URL (#5079) 6 years ago
Piotr Orzechowski a74426d631 Swagger.v1.json template (#3572)
* Turn swagger.v1.json into template

* Rename ENABLE_SWAGGER_ENDPOINT option to ENABLE_SWAGGER
6 years ago
Lauris BH a7f90905df
Fix drone git@next plugin Gitea version display when building tag (#4380) 6 years ago
techknowlogick f1d6a1fffc
Add the ability to have built in themes in Gitea (#4198)
This makes it easier for user who want to theme but
don't have the ability to know how to customize templates
all that is required is a change in a config option

The reason why I chose the DEFAULT_THEME as variable,
as perhaps in the future we will allow users to chose their
theme whon logged in just like we do with languages
6 years ago
Fluf 28fb255d91 Add make command to validate swagger file (#4096)
Partial fix for #4088
6 years ago
Antoine GIRARD 08c9617caa Provide compressed releases (#3991)
* Add release-compress to provide compressed releases

* check after compress
6 years ago
Antoine GIRARD 3f3383dc0a Migrate to dep (#3972)
* 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
6 years ago
Lauris BH abff697f31 Update less.js to latest version (#3932) 6 years ago
Antoine GIRARD 3506717e9c Add swagger check (#3811) 6 years ago
Antoine GIRARD cc7b8e3379 Add more bench (#3161)
* Improve makefile + Add benchs

* Apply recommendations of @ethantkoenig
6 years ago
Ethan Koenig c082c3bce3 Restore make test target (#3139)
* Restore make test target

* make build -> go build
7 years ago
Lunny Xiao 41d6afe0e7 Fix compile failed without gcc (#3130)
* fix comile failed without gcc

* add sqlite tag for unit test
7 years ago
Ethan Koenig f148a4a1ed Fix coverage reports (#2974) 7 years ago
Antoine GIRARD d23a3e96f1 Fix bench deps since #2916 (#2971) 7 years ago
Ethan Koenig 061f65ff29 Restore build as the default make rule (#2935) 7 years ago
Ethan Koenig 6ee65757c7 Combine identical Makefile rules (#2916) 7 years ago
Antoine GIRARD dac0f14f34 Docker multi-arch base (#1985)
* Create docker/manifest/base.yml

serve as base for build docker image for most platform (386,amd64,arm,arm64)

* Add make task docker-multi-arch-push-manifest

To update references of a multi-arch image on docker registry.

* Use SED_INPLACE generic sed command

* Delete Dockerfile.aarch64

Delete Dockerfile.rpi

* Use gitea/gitea-base as base

and replace deprecated MAINTAINER by LABEL (https://docs.docker.com/engine/reference/builder/#maintainer-deprecated)

* Fix rebase

* Use sapk/gitea-base as base

* Split makefile for docker

* Fix version to v3.6

Could use in later version edge of alpine official library that support multi-arch for armhf.

* Remove sapk/gitea-base and use directly new official alpine multi-arch
7 years ago
Ethan Koenig f26f4a7e01 Update swagger documentation (#2899)
* Update swagger documentation

Add docs for missing endpoints
Add documentation for request parameters
Make parameter naming consistent
Fix response documentation

* Restore delete comments
7 years ago
Antoine GIRARD 619b9b5547 Move swagger-ui under /api/v1 (#2746)
* Move swagger interface under /api/v1

* Update swagger-ui

* Add /api/swagger and prepare for multiple api version

* Update test links

* Fix footer link
7 years ago
Morlinest 086eb62691 Compress css with nodejs (#2580) 7 years ago
silverwind 1fbfccb4fc Use standard lessc and minify CSS using Node.js (#2337)
* Use standard lessc and minify CSS using Node.js

This changes the previous nonstandard `lessc` to the official one and
enables CSS minification via the clean-css module.

To build CSS, Node.js is required along with a `npm install` to get the
tools installed locally in node_modules so there is no dependency on
binaries in PATH. Benefits include:

- Allows one to have a standard lessc in PATH.
- Can now use command line switches on lessc.
- Minified CSS brings faster page load times and also has the benefit
  of discouraging contributors from editing CSS directly.

To build CSS, Node.js is required along with a `npm install` to get the
tools installed locally based on the information in `package.json`.

The 'make stylesheet' task was modified to run without condition. This
makes it easier to work on the make task itself without having to delete
files.

Also fixes: https://github.com/go-gitea/gitea/issues/2198

* install node, npm and modules on drone

* .PHONY

* use 'minify' to minify CSS
7 years ago
Ethan Koenig fa1cbc2896 Always run fmt check in CI (#2546) 7 years ago
Lauris BH 6f380a22a4 Remove go version check for make fmt (#2558) 7 years ago
Ethan Koenig b0f7457d9e Improve issue search (#2387)
* Improve issue indexer

* Fix new issue sqlite bug

* Different test indexer paths for each db

* Add integration indexer paths to make clean
7 years ago
Bo-Yi Wu 3e89e89670 add codecov.io service. (#2493)
* add codecov.io service.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* only PR or master branch (for coverage badge)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update init

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
7 years ago
Lauris BH 377cd1ae38 Allow changing integration test database connection using env variables (#2484) 7 years ago
Antoine GIRARD 69dfe43ffc Fix some tests : make coverage -> test (#2492)
* Fix test : make coverage -> test

* Refactor integration tests to be able to run them in parallel

* Add custom local repository temp path
7 years ago
Thomas Boerger 4b8fef143e Changes for latest DroneCI (#2362) 7 years ago
Michael Lustfield a915a09e4f Moved vendored js/css into `public/vendor` and documented sources (#1484) (#2241)
* Cleaning up public/ and documenting js/css libs.

This commit mostly addresses #1484 by moving vendor'ed plugins into a
vendor/ directory and documenting their upstream source and license in
vendor/librejs.html.

This also proves gitea is using only open source js/css libraries which
helps toward reaching #1524.

* Removing unused css file.

The version of this file in use is located at:
  vendor/plugins/highlight/github.css

* Cleaned up librejs.html and added javascript header

A SafeJS function was added to templates/helper.go to allow keeping
comments inside of javascript.

A javascript comment was added in the header of templates/base/head.tmpl
to mark all non-inline source as free.

The librejs.html file was updated to meet the current librejs spec. I
have now verified that the librejs plugin detects most of the scripts
included in gitea and suspect the non-free detections are the result of
a bug in the plugin. I believe this commit is enough to meet the C0.0
requirement of #1534.

* Updating SafeJS function per lint suggestion

* Added VERSIONS file, per request
7 years ago
Bo-Yi Wu be4f6a754c Revert "Changes for latest DroneCI (#2355)" (#2358)
This reverts commit faf4b503b2.
7 years ago
Thomas Boerger faf4b503b2 Changes for latest DroneCI (#2355) 7 years ago
Sandro Santilli 100ec93a65 Remove integration test executables on `make clean` (#2340) 7 years ago
Bo-Yi Wu 722bcefbbf refactor(Makefile): allow overriding default go program (#2310) 7 years ago
Antoine GIRARD a804f0e052 go get github.com/wadey/gocovmerge when needed (#2235) 7 years ago
silverwind d74d8ecc2e Generate small and large logos at 4x resolution (#2233)
To support High-DPI displays, generate images at 4 times their displayed
resolution, which should be enough to support all current devices
according to https://material.io/devices/.
7 years ago
Lunny Xiao a9cc538ab5 remove unused variable on makefile (#2225) 7 years ago
Lauris BH 60d7e56c69 Add task to generate images from SVG and change to new logo (#2194)
* Add makefile task to generate images from SVG and change to new logo

* use absolute path on generate-images
7 years ago
Bo-Yi Wu f011d6d4d7 fix: replace tmp with TMPDIR. (#2152) 7 years ago
Bo-Yi Wu 2c3efd72ce fix typo (#2145)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
7 years ago
Bo-Yi Wu 2b05b104ef Add verify changed less-file step to Makefile (#1861) 7 years ago
Roy Marples c016d48735 Use POSIX complaint ! operator in find (#2132)
* Use POSIX complaint ! operator in find

-not is a GNU extension and not all find(8) implementations
support it. It's just an alias for ! which is POSIX compliant.

Now gitea compiles on NetBSD at least.

* Revert change in vendor directory as requested
7 years ago
Lunny Xiao dde9a8648e Add make command update-translations for update translations from crodwin (#2097)
* add make command update-translations for update translations from crowdin to options/locale

* use curl & resolve double quote on make file
7 years ago
Mura Li 754482bf5d Add integration test for repository migration (#1983) 7 years ago
Antoine GIRARD 2bcd9471c9 Separate generate swagger + fix sed os specific (#1791)
* Separate generate-swagger

* Remove go generate rules

* Add missing definition replacement + remove use of -i sed flag

for compatibility with mac os default sed version.
This is a little hacky a better solution could be use.

* Use custom SED_INPLACE

depending of platform detection

* Use SED_INPLACE for swagger-ui also
7 years ago
Ethan Koenig 792cde7081 Coverage reports for integration tests (#1960) 7 years ago
Sandro Santilli f6b58964d7 Include formatting check to the `make test` (and thus also `check`) rule (#1366)
* Include formatting check to the `make check` rule

... and give it its own standalone target too (make fmt-check)

Show diff on fmt-check failure
Do not allow running "fmt-check" with incompatible go version
Also simplify the `fmt` rule

* Forbid running "make fmt" with Go version != 1.7 or 1.8

* Ignore bindata.go for spelling and formatting checks

also remove duplicated variable assignment for GOFILES

* Run `make fmt`
7 years ago
Bo-Yi Wu 703d18e50d feat: add check misspelling (#1877) 7 years ago
Bo-Yi Wu e7ae13deef fix: error from mktemp command in MacOS. (#1837)
* fix: error from mktemp command in MacOS.

* [ci skip] udpate temp name.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
7 years ago
himaaaatti 0f5b399e35 Add variable for docker tag (#1825)
Signed-off-by: Shunsuke Mie <sux2mfgj@gmail.com>
7 years ago
Ethan Koenig cb74f1b84d Remove stale rule from Makefile (#1782) 7 years ago
Ethan Koenig ff96bda138 Only run coverage on merges/pushes to master (#1783) 7 years ago
Lunny Xiao d98a86d2a2 remove sqlite tag when integration test with mysql/postgres AND recreate database when init integration test (#1693) 7 years ago
Thomas Boerger c864ccf9b1 Enforce netgo build tag while cross-compilation (#1690) 7 years ago
Antoine GIRARD 3edb0c5894 Generate swagger json (#1402)
- 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
7 years ago
Antoine GIRARD bb5f694fc5 Improve govendor testing (#1623)
- Use `govendor list +outside +unused` for finding missing or unused deps and govendor status for catching modified vendor.  
- Remove appengine import
7 years ago
Lauris BH 0144817971 Do not allow commiting to protected branch from online editor (#1502)
* Do not allow commiting to protected branch from online editor

* Add editor integration tests for adding new file and not allowing to add new file to protected branch
7 years ago
Ethan Koenig 66c803fae2 MySQL, Postgres integration tests in drone (#1638)
* MySQL, Postgres integration tests in drone

* Fix .drone.yml

* sign drone

* resign drone
7 years ago
Kim "BKC" Carlbäcker cebe3a6b2f Revert "Set VERSION from git once, in a variable (#1447)"
This reverts commit 410af6971b.
7 years ago
Lunny Xiao fca7ddc6ea improve integration test to resue models/fixtures and store git repos with tests (#1627)
* improve integration test to resue models/fixtures and store git repos with source

* use gitea-integration-meta dir instead .tar.gz and cleanup every before every test

* fix import package name
7 years ago
Ethan Koenig c58708d3ee Integration test framework (#1290)
* Integration test framework

* udpate drone sign

* Formatting fixes and move router.go to routers/

* update sign for drone
7 years ago
Antoine GIRARD eb1075dd4c Check if missing/modified/unused deps in vendor and fix errors (#1468)
* 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
7 years ago
Sandro Santilli 410af6971b Set VERSION from git once, in a variable (#1447) 7 years ago
Mura Li 2d1efcc270 Add GOFLAGS and EXTRA_GOFLAGS (#1438) 7 years ago
Thomas Boerger 7ed00b6e8d Split the binary build (#985)
As we can not compile darwin binaries with static flags I have split the
build process into different make tasks. Now we get static linked
binaries especially for linux so that it also can run on older versions
of CenOS and so on.

Signed-off-by: Thomas Boerger <thomas@webhippie.de>
7 years ago
Mura Li 848293671b Add basic integration test infrastructure (and new endpoint `/api/v1/version` for testing it) (#741)
* 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
7 years ago
Jonas a201977590 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
7 years ago
silverwind ab462fb95f Makefile: Use hash over which (#1069)
`hash` is a much faster shell-builtin alternative to `which`.
7 years ago
silverwind 5bd22a2f4a Makefile: Also redirect stderr on which calls (#1068) 7 years ago
Dan Morrill 832477b1bc Tweak docker target to work by default. (#1033)
Fix for #1013: adds "bindata" to tags by default, as without this the
resulting docker image won't start, as it doesn't contain locale files.
Verified to work even if you specify TAGS="bindata" such that it appears
twice.
7 years ago
Andrey Nering e4031b822a Makefile: install on build (#874)
This install Go package on building for caching and faster builds
7 years ago
Thomas Boerger ea8c8cdaf3 Fix master builds on mips* again (#815)
* 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.
7 years ago
Thomas Boerger 369972b116 Set the ldflags to static value within makefile (#709) 7 years ago
Thomas Boerger d0ad7921f8 Enforce custom LDFLAGS within makefile (#684) 7 years ago
Andrey Nering b7e1bccc50 Makefile: on Windows, executable should have ".exe" (#550) 7 years ago
Bo-Yi Wu cb18941e63 replcae go fmt with gofmt command.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
7 years ago
Thomas Boerger 6aacf4d2f0 Properly handle drone tags and release/* branches (#466) 8 years ago
Thomas Boerger b33078fa33 Bindata is optional and over-writable on restart (#354)
* Moved conf assets into options folder

* Dropped old bindata

* Started to integrate options bindata and accessors

* Do not enforce a builtin app.ini

* Replaced bindata calls with options

* Dropped bindata task from makefile, it's the generate task now

* Always embedd app.ini to provide sane config defaults

* Use sane defaults for the configuration

* Defined default value for SSH_KEYGEN_PATH

* Dropped "NEVER EVER MODIFY THIS FILE" header from app.ini

* Fixed new paths in latest test additions

* Drop bindata with make clean task

* Set more proper default values
8 years ago
Thomas Boerger 618407c018 Do not override the binary version name from drone (#436)
Signed-off-by: Thomas Boerger <tboerger@suse.de>
8 years ago
Thomas Boerger c6b6a61bf1 Fixing multiple docker issues (#386)
* Added stupid docker task to makefile

* Dropped unknown option PrintLastLog from docker ssh config

* OpenSSH should log to docker stdout

* Set random pw for docker git user, otherwise it is locked

* Stop using templates and public within docker
8 years ago
Kim "BKC" Carlbäcker 1d1c01875d Autogenerate Version on build (#190)
* Autogenerate Version On Build

* Fixes

* Changed Version to v0.9.0

* balls

* I hate newlines

* Don't remove .VERSION-file on `make clean`

* v0.9.0 => 1.0.0

* damn new-lines...

* Always rebuild templates/.VERSION

* Delete .VERSION

* Update Makefile
8 years ago
Kim "BKC" Carlbäcker 1b5b297c39 Actually fix 'make build' (#353)
* Actually fix bloddy 'make build'
8 years ago
Kim "BKC" Carlbäcker cd0ce9f3d8 Awlays build, even when it thinks it's up to date (#351) 8 years ago
Thomas Boerger e52b24ad5d
Properly move releases within drone builds 8 years ago
Thomas Boerger 2932042a6d Get rid of bin folder within makefile, enabled TiDB (#319)
* Get rid of the bin folder within the build process

Signed-off-by: Thomas Boerger <thomas@webhippie.de>

* Dropped latest make task, it is unused

Signed-off-by: Thomas Boerger <thomas@webhippie.de>

* Added tidb tag to drone config

Signed-off-by: Thomas Boerger <thomas@webhippie.de>

* Dropped the cert build tag

Signed-off-by: Thomas Boerger <thomas@webhippie.de>

* Dropped useless minwinsvc build tag

Signed-off-by: Thomas Boerger <thomas@webhippie.de>

* Dropped the useless build tags from drone config

Signed-off-by: Thomas Boerger <thomas@webhippie.de>
8 years ago
Sandro Santilli a3fb627350 Have "make" create the executable in root dir (#247)
Same as "go build".
Makes it functional by default as it'd then find template/ and public/
by default w/out setting GITEA_WORK_DIR
8 years ago
Thomas Boerger b6a95a8cb3 Integrate public as bindata optionally (#293)
* 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
8 years ago
Thomas Boerger e93d394620
Replace invaliud bindata variable names within make task 8 years ago
Thomas Boerger 900a21008c Added errcheck make task (#242) 8 years ago
Thomas Boerger 21e8deed89 Merge pull request #96 from metalmatze/feature/drone-config
Create a first draft for .drone.yml
8 years ago
Thomas Boerger fd13b71fb2
Added drone instead of travis detection to makefile 8 years ago
Thomas Boerger cd7e661870
Added dummy tasks for mysql and pgsql tests 8 years ago
Thomas Boerger cc8c57458f
Really use go install on make install 8 years ago
Sandro Santilli 5301a5db3a Have the deault 'all' rule just build
Clean and test are saner being seperate targets
8 years ago
Sandro Santilli 4247304f5a Update import paths from github.com/go-gitea to code.gitea.io (#135)
- 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
8 years ago
Sandro Santilli f430d26f7e Hush dangerous GNU comment, mark "check" rule as phony 8 years ago
Sandro Santilli 3f18111cbe Add "check" alias for testing
Follows GNU Coding Standards, see
https://www.gnu.org/prep/standards/html_node/Standard-Targets.html#Standard-Targets
8 years ago
Thomas Boerger ec054ba582
Totally refactored the makefile and adjusted travis config 8 years ago
Thomas Boerger cda6baf02c Merge branch 'master' into feature/main.go 8 years ago
Matthias Loibl f01d927efb Rename all occurrences of gogs.go
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
8 years ago
Joubert RedRat ff54e4d929 Set default less and css to new default name 8 years ago
Rémy Boulanouar 2d68bd1ef9 Change import reference to match gitea instead of gogs (#37) 8 years ago
Sandro Santilli 47a3243ff1 Add all, check and dist Makefile rules (#3549)
These are to follow the GNU Coding Standards Makefile Targets:
https://www.gnu.org/prep/standards/html_node/Standard-Targets.html
8 years ago
Unknwon f70343660d Little code refactoring 8 years ago
Unknwon 08c976f811 Only do go vet on this codebase 8 years ago
Unknwon cf6d321991 Ignore repository with issue disabled or use external tracker in dashboard issues 8 years ago
Unknwon 899e799459 #1601 support delete issue comment 8 years ago
Dan McGregor db3905c0a3 Make go's build flags a variable
This allows the user to specify build flags from the make command
line. For example to force a complete rebuild one could use:

make BUILD_FLAGS='-v -a' TAGS="sqlite"
8 years ago
Unknwon 58f0c68151 Some minor changes 8 years ago
Unknwon 58e004f7da Remove cache avatar support and add its tests 8 years ago
Unknwon a1d97e8f5c Minor fix for #2567 8 years ago
Andrey Nering b8d0367a6c Add command to run the test suite in Makefile. 8 years ago
Unknwon db719abff2 stop compile bindata for TRANSLATORS
- update required version of git-module for #2373
8 years ago
Unknwon a49af93faf #1692 APIs: Users Followers
- User profile un/follow
- List user's followers/following
9 years ago
Adam Strzelecki eb6c634475 Makefile: Do not fail build on missing lessc
This is achieved by adding public/css/gogs.css to special .IGNORE target, which
makes inability to generate/update gogs.css non-fatal and not stopping whole
build process. User is still notified about missing lessc command though, since
inability to update CSS may lead to potential problems:

    lessc public/less/gogs.less public/css/gogs.css
    make: lessc: No such file or directory
    make: [public/css/gogs.css] Error 1 (ignored)

More info at:

  https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
9 years ago
Adam Strzelecki 19e8ce0354 Makefile: Remove trailing whitespace & add last LF
This is pure cleanup commit.
9 years ago
Adam Strzelecki f907a5c98b Makefile: Auto-build CSS & bin-data when necessary
This will ensure that running `make` we will get all necessary files built and
we do not need manually remember to rebuild them.
9 years ago
Adam Strzelecki da607c611d Makefile: Copy installed binary instead 2nd build
This speeds up single build/rebuild rather than install & build which compiles
everything twice, we just copy installed binary back to the project root.
9 years ago
Unknwon b55499d039 go vet and fix #1890 9 years ago
Unknwon a374751eb8 add Makefile 9 years ago