Skip to content

Commit d25e1f3

Browse files
committed
Merge branch 'master' of https://github.com/go-gitea/gitea into milestones
# Conflicts: # routers/user/home.go
2 parents ffe6d80 + 0e56337 commit d25e1f3

File tree

542 files changed

+52371
-45351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

542 files changed

+52371
-45351
lines changed

.drone.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ steps:
5656

5757
- name: pre-build
5858
pull: always
59-
image: webhippie/nodejs:latest
59+
image: node:10 # this step is kept at the lowest version of node that we support
6060
commands:
6161
- make css
6262
- make js
63-
- bash -c '[ -z "$(git status --porcelain public/js public/css)" ] || (echo "Generated js/css files do not match" && git status --porcelain public/js public/css && exit 1)'
6463

6564
- name: build-without-gcc
6665
pull: always
@@ -69,6 +68,7 @@ steps:
6968
GO111MODULE: on
7069
GOPROXY: off
7170
commands:
71+
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
7272
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
7373

7474
- name: build-linux-386
@@ -80,12 +80,14 @@ steps:
8080
GOOS: linux
8181
GOARCH: 386
8282
commands:
83+
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
8384
- go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit
8485

8586
- name: build
8687
pull: always
8788
image: golang:1.13
8889
commands:
90+
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
8991
- make clean
9092
- make generate
9193
- make golangci-lint

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ root = true
55
charset = utf-8
66
insert_final_newline = true
77
trim_trailing_whitespace = true
8+
end_of_line = lf
89

910
[*.go]
1011
indent_style = tab

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
* text=auto eol=lf
12
conf/* linguist-vendored
23
docker/* linguist-vendored
34
options/* linguist-vendored
45
public/* linguist-vendored
56
scripts/* linguist-vendored
6-
templates/* linguist-vendored
7+
templates/* linguist-vendored

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ coverage.all
6969
/modules/indexer/issues/indexers
7070
routers/repo/authorized_keys
7171
/yarn.lock
72+
/public/js
73+
/public/css
7274

7375
# Snapcraft
7476
snap/.snapcraft/
@@ -78,4 +80,4 @@ prime/
7880
*.snap
7981
*.snap-build
8082
*_source.tar.bz2
81-
.DS_Store
83+
.DS_Store

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.10.1](https://github.com/go-gitea/gitea/releases/tag/v1.10.1) - 2019-12-05
8+
* BUGFIXES
9+
* Fix max length check and limit in multiple repo forms (#9148) (#9204)
10+
* Properly fix displaying virtual session provider in admin panel (#9137) (#9203)
11+
* Upgrade levelqueue to 0.1.0 (#9192) (#9199)
12+
* Fix panic when diff (#9187) (#9193)
13+
* Smtp logger configuration sendTos should be an array (#9154) (#9157)
14+
* Always Show Password Field on Link Account Sign-in Page (#9150)
15+
* Create PR on Current Repository by Default (#8670) (#9141)
16+
* Fix race on indexer (#9136) (#9139)
17+
* Fix reCAPTCHA URL (#9119)
18+
* Hide migrated credentials (#9098)
19+
* Update golang.org/x/crypto vendor to use acme v2 (#9056) (#9085)
20+
* Fix password checks on admin create/edit user (#9076) (#9081)
21+
* Fix add search as a reserved username (#9063) (#9065)
22+
* Fix permission checks for close/reopen from commit (#8875) (#9033)
23+
* Ensure Written is set in GZIP ProxyResponseWriter (#9018) (#9025)
24+
* Fix broken link to branch from issue list (#9003) (#9021)
25+
* Fix wrong system notice when repository is empty (#9020)
26+
* Shadow password correctly for session config (#8984) (#9002)
27+
728
## [1.10.0](https://github.com/go-gitea/gitea/releases/tag/v1.10.0) - 2019-11-13
829
* BREAKING
930
* Fix deadline on update issue or PR via API (#8698)

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ ARG TAGS="sqlite sqlite_unlock_notify"
1111
ENV TAGS "bindata $TAGS"
1212

1313
#Build deps
14-
RUN apk --no-cache add build-base git
14+
RUN apk --no-cache add build-base git nodejs npm
1515

1616
#Setup repo
1717
COPY . ${GOPATH}/src/code.gitea.io/gitea
1818
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
1919

2020
#Checkout version if set
2121
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
22-
&& make clean generate build
22+
&& make clean build
2323

2424
FROM alpine:3.10
2525
LABEL maintainer="[email protected]"

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ Guillermo Prandi <[email protected]> (@guillep2k)
3535
Mura Li <[email protected]> (@typeless)
3636
6543 <[email protected]> (@6543)
3737
jaqra <[email protected]> (@jaqra)
38+
David Svantesson <[email protected]> (@davidsvantesson)

Makefile

Lines changed: 63 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ else
1818
endif
1919
endif
2020

21-
BINDATA := modules/{options,public,templates}/bindata.go
2221
GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go")
2322
GOFMT ?= gofmt -s
2423

@@ -42,7 +41,17 @@ endif
4241
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
4342

4443
PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell GO111MODULE=on $(GO) list -mod=vendor ./... | grep -v /vendor/)))
45-
SOURCES ?= $(shell find . -name "*.go" -type f)
44+
45+
GO_SOURCES ?= $(shell find . -name "*.go" -type f)
46+
JS_SOURCES ?= $(shell find web_src/js web_src/css -type f)
47+
CSS_SOURCES ?= $(shell find web_src/less -type f)
48+
49+
JS_DEST := public/js/index.js
50+
CSS_DEST := public/css/index.css
51+
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
52+
53+
JS_DEST_DIR := public/js
54+
CSS_DEST_DIR := public/css
4655

4756
TAGS ?=
4857

@@ -80,10 +89,31 @@ all: build
8089

8190
include docker/Makefile
8291

92+
.PHONY: go-check
93+
go-check:
94+
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?\s' | tr '.' ' ');))
95+
@if [ "$(GO_VERSION)" -lt "001011000" ]; then \
96+
echo "Gitea requires Go 1.11.0 or greater to build. You can get it at https://golang.org/dl/"; \
97+
exit 1; \
98+
fi
99+
100+
.PHONY: node-check
101+
node-check:
102+
$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?' | tr '.' ' ');))
103+
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
104+
@if [ "$(NODE_VERSION)" -lt "010000000" -o "$(NPM_MISSING)" = "1" ]; then \
105+
echo "Gitea requires Node.js 10.0.0 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
106+
exit 1; \
107+
fi
108+
109+
.PHONY: clean-all
110+
clean-all: clean
111+
rm -rf $(JS_DEST_DIR) $(CSS_DEST_DIR)
112+
83113
.PHONY: clean
84114
clean:
85115
$(GO) clean -i ./...
86-
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA) \
116+
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) \
87117
integrations*.test \
88118
integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-mysql8/ integrations/gitea-integration-sqlite/ \
89119
integrations/gitea-integration-mssql/ integrations/indexers-mysql/ integrations/indexers-mysql8/ integrations/indexers-pgsql integrations/indexers-sqlite \
@@ -309,42 +339,42 @@ bench-pgsql: integrations.pgsql.test generate-ini-pgsql
309339
integration-test-coverage: integrations.cover.test generate-ini-mysql
310340
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
311341

312-
integrations.mysql.test: $(SOURCES)
342+
integrations.mysql.test: $(GO_SOURCES)
313343
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test
314344

315-
integrations.mysql8.test: $(SOURCES)
345+
integrations.mysql8.test: $(GO_SOURCES)
316346
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test
317347

318-
integrations.pgsql.test: $(SOURCES)
348+
integrations.pgsql.test: $(GO_SOURCES)
319349
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
320350

321-
integrations.mssql.test: $(SOURCES)
351+
integrations.mssql.test: $(GO_SOURCES)
322352
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test
323353

324-
integrations.sqlite.test: $(SOURCES)
354+
integrations.sqlite.test: $(GO_SOURCES)
325355
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
326356

327-
integrations.cover.test: $(SOURCES)
357+
integrations.cover.test: $(GO_SOURCES)
328358
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test
329359

330360
.PHONY: migrations.mysql.test
331-
migrations.mysql.test: $(SOURCES)
361+
migrations.mysql.test: $(GO_SOURCES)
332362
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql.test
333363

334364
.PHONY: migrations.mysql8.test
335-
migrations.mysql8.test: $(SOURCES)
365+
migrations.mysql8.test: $(GO_SOURCES)
336366
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql8.test
337367

338368
.PHONY: migrations.pgsql.test
339-
migrations.pgsql.test: $(SOURCES)
369+
migrations.pgsql.test: $(GO_SOURCES)
340370
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.pgsql.test
341371

342372
.PHONY: migrations.mssql.test
343-
migrations.mssql.test: $(SOURCES)
373+
migrations.mssql.test: $(GO_SOURCES)
344374
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mssql.test
345375

346376
.PHONY: migrations.sqlite.test
347-
migrations.sqlite.test: $(SOURCES)
377+
migrations.sqlite.test: $(GO_SOURCES)
348378
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
349379

350380
.PHONY: check
@@ -354,10 +384,16 @@ check: test
354384
install: $(wildcard *.go)
355385
$(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
356386

387+
.PHONY: go
388+
go: go-check $(EXECUTABLE)
389+
390+
.PHONY: go-all
391+
go-all: go-check generate go
392+
357393
.PHONY: build
358-
build: $(EXECUTABLE)
394+
build: js css go-all
359395

360-
$(EXECUTABLE): $(SOURCES)
396+
$(EXECUTABLE): $(GO_SOURCES)
361397
GO111MODULE=on $(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
362398

363399
.PHONY: release
@@ -412,37 +448,30 @@ release-compress:
412448
fi
413449
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
414450

415-
npm-check:
416-
@hash npm > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
417-
echo "Please install Node.js 8.x or greater with npm"; \
418-
exit 1; \
419-
fi;
420-
@hash npx > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
421-
echo "Please install Node.js 8.x or greater with npm"; \
422-
exit 1; \
423-
fi;
424-
425-
.PHONY: npm
426-
npm: npm-check
451+
node_modules: package-lock.json
427452
npm install --no-save
428453

429454
.PHONY: npm-update
430-
npm-update: npm-check
455+
npm-update: node-check node_modules
431456
npx updates -cu
432457
rm -rf node_modules package-lock.json
433458
npm install --package-lock
434459

435460
.PHONY: js
436-
js: npm
461+
js: node-check $(JS_DEST)
462+
463+
$(JS_DEST): node_modules $(JS_SOURCES)
437464
npx eslint web_src/js webpack.config.js
438465
npx webpack
439466

440467
.PHONY: css
441-
css: npm
468+
css: node-check $(CSS_DEST)
469+
470+
$(CSS_DEST): node_modules $(CSS_SOURCES)
442471
npx stylelint web_src/less
443-
npx lessc --clean-css="--s0 -b" web_src/less/index.less public/css/index.css
444-
$(foreach file, $(filter-out web_src/less/themes/_base.less, $(wildcard web_src/less/themes/*)),npx lessc --clean-css="--s0 -b" web_src/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
445-
npx postcss --use autoprefixer --no-map --replace public/css/*
472+
npx lessc web_src/less/index.less public/css/index.css
473+
$(foreach file, $(filter-out web_src/less/themes/_base.less, $(wildcard web_src/less/themes/*)),npx lessc web_src/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
474+
npx postcss --use autoprefixer --use cssnano --no-map --replace public/css/*
446475

447476
.PHONY: javascripts
448477
javascripts:

0 commit comments

Comments
 (0)