Skip to content

Commit

Permalink
Merge branch 'main' into fix-9691-configure-ssl-cipher-suites
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Nov 20, 2021
2 parents 7cb3835 + 52869ef commit 01f13e5
Show file tree
Hide file tree
Showing 837 changed files with 14,725 additions and 13,442 deletions.
48 changes: 34 additions & 14 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
kind: pipeline
type: docker
name: compliance

platform:
Expand Down Expand Up @@ -130,6 +131,7 @@ steps:

---
kind: pipeline
type: docker
name: testing-amd64

platform:
Expand Down Expand Up @@ -191,26 +193,30 @@ steps:
exclude:
- pull_request

- name: build
pull: always
image: golang:1.17
commands:
- make backend
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org
TAGS: bindata sqlite sqlite_unlock_notify

- name: tag-pre-condition
pull: always
image: drone/git
commands:
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}

- name: fix-permissions
- name: prepare-test-env
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
commands:
- chown -R gitea:gitea .
- ./build/test-env-prepare.sh

- name: build
pull: always
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- ./build/test-env-check.sh
- make backend
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org
TAGS: bindata sqlite sqlite_unlock_notify
depends_on:
- prepare-test-env

- name: unit-test
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
Expand Down Expand Up @@ -353,21 +359,24 @@ steps:
exclude:
- pull_request

- name: fix-permissions
- name: prepare-test-env
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
commands:
- chown -R gitea:gitea .
- ./build/test-env-prepare.sh

- name: build
pull: always
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- ./build/test-env-check.sh
- make backend
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org
TAGS: bindata gogit sqlite sqlite_unlock_notify
depends_on:
- prepare-test-env

- name: test-sqlite
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
Expand Down Expand Up @@ -461,6 +470,7 @@ steps:

---
kind: pipeline
type: docker
name: update_gitignore_and_licenses

platform:
Expand Down Expand Up @@ -497,6 +507,7 @@ steps:

---
kind: pipeline
type: docker
name: release-latest

platform:
Expand Down Expand Up @@ -675,6 +686,7 @@ steps:

---
kind: pipeline
type: docker
name: docs

platform:
Expand Down Expand Up @@ -716,6 +728,7 @@ steps:

---
kind: pipeline
type: docker
name: docker-linux-amd64-release-version

platform:
Expand Down Expand Up @@ -780,6 +793,7 @@ steps:

---
kind: pipeline
type: docker
name: docker-linux-amd64-release

platform:
Expand Down Expand Up @@ -844,6 +858,7 @@ steps:

---
kind: pipeline
type: docker
name: docker-linux-arm64-dry-run

platform:
Expand Down Expand Up @@ -876,6 +891,7 @@ steps:

---
kind: pipeline
type: docker
name: docker-linux-arm64-release-version

platform:
Expand Down Expand Up @@ -943,6 +959,7 @@ steps:

---
kind: pipeline
type: docker
name: docker-linux-arm64-release

platform:
Expand Down Expand Up @@ -1009,6 +1026,7 @@ steps:
- pull_request
---
kind: pipeline
type: docker
name: docker-manifest-version

platform:
Expand Down Expand Up @@ -1052,6 +1070,7 @@ depends_on:

---
kind: pipeline
type: docker
name: docker-manifest

platform:
Expand Down Expand Up @@ -1095,6 +1114,7 @@ depends_on:

---
kind: pipeline
type: docker
name: notifications

platform:
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ rules:
unicorn/no-array-push-push: [2]
unicorn/no-console-spaces: [0]
unicorn/no-document-cookie: [2]
unicorn/no-empty-file: [2]
unicorn/no-fn-reference-in-iterator: [0]
unicorn/no-for-loop: [0]
unicorn/no-hex-escape: [0]
Expand Down Expand Up @@ -404,6 +405,7 @@ rules:
unicorn/prefer-date-now: [2]
unicorn/prefer-default-parameters: [0]
unicorn/prefer-event-key: [2]
unicorn/prefer-export-from: [2]
unicorn/prefer-includes: [2]
unicorn/prefer-math-trunc: [2]
unicorn/prefer-modern-dom-apis: [0]
Expand Down
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!--
Please check the following:
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for bug fixes.
2. Read contributing guidelines: https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md
3. Describe what your pull request does and which issue you're targeting (if any)
**You MUST delete the content above including this line before posting, otherwise your pull request will be invalid.**
-->
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ linters:
- unused
- structcheck
- varcheck
- golint
- dupl
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
- gofmt
- misspell
- gocritic
- bidichk
- ineffassign
enable-all: false
disable-all: true
fast: false
Expand Down Expand Up @@ -111,3 +112,6 @@ issues:
linters:
- staticcheck
text: "svc.IsAnInteractiveSession is deprecated: Use IsWindowsService instead."
- path: models/user/openid.go
linters:
- golint
1 change: 1 addition & 0 deletions .revive.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ warningCode = 1
[rule.unexported-return]
[rule.indent-error-flow]
[rule.errorf]
[rule.duplicated-imports]
17 changes: 16 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
extends: stylelint-config-standard

overrides:
- files: ["**/*.less"]
customSyntax: postcss-less

rules:
alpha-value-notation: null
at-rule-empty-line-before: null
block-closing-brace-empty-line-before: null
color-function-notation: null
color-hex-length: null
comment-empty-line-before: null
declaration-block-no-redundant-longhand-properties: null
declaration-block-single-line-max-declarations: null
declaration-empty-line-before: null
hue-degree-notation: null
indentation: 2
max-line-length: null
no-descending-specificity: null
no-invalid-position-at-import-rule: null
number-leading-zero: never
number-max-precision: null
property-no-vendor-prefix: null
rule-empty-line-before: null
selector-class-pattern: null
selector-id-pattern: null
selector-pseudo-element-colon-notation: double
shorthand-property-no-redundant-values: true
no-invalid-position-at-import-rule: null
string-quotes: null
value-no-vendor-prefix: null
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io).

## [1.15.6](https://github.com/go-gitea/gitea/releases/tag/v1.15.6) - 2021-10-28

* BUGFIXES
* Prevent panic in serv.go with Deploy Keys (#17434) (#17435)
* Fix CSV render error (#17406) (#17431)
* Read expected buffer size (#17409) (#17430)
* Ensure that restricted users can access repos for which they are members (#17460) (#17464)
* Make commit-statuses popup show correctly (#17447) (#17466)
* TESTING
* Add integration tests for private.NoServCommand and private.ServCommand (#17456) (#17463)

## [1.15.5](https://github.com/go-gitea/gitea/releases/tag/v1.15.5) - 2021-10-21

* SECURITY
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Alexey Makhov <amakhov@avito.ru> (@makhov)
Andrey Nering <andrey.nering@gmail.com> (@andreynering)
Bo-Yi Wu <appleboy.tw@gmail.com> (@appleboy)
Ethan Koenig <ethantkoenig@gmail.com> (@ethantkoenig)
Kees de Vries <bouwko@gmail.com> (@Bwko)
Expand Down Expand Up @@ -45,3 +44,4 @@ Janis Estelmann <admin@oldschoolhack.me> (@KN4CK3R)
Steven Kriegler <sk.bunsenbrenner@gmail.com> (@justusbunsi)
Jimmy Praet <jimmy.praet@telenet.be> (@jpraet)
Leon Hofmeister <dev.lh@web.de> (@delvh)
Gusted <williamzijl7@hotmail.com) (@Gusted)
31 changes: 19 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ COMMA := ,
XGO_VERSION := go-1.17.x
MIN_GO_VERSION := 001016000
MIN_NODE_VERSION := 012017000
MIN_GOLANGCI_LINT_VERSION := 001043000

DOCKER_IMAGE ?= gitea/gitea
DOCKER_TAG ?= latest
Expand Down Expand Up @@ -57,8 +58,6 @@ else
SED_INPLACE := sed -i ''
endif

GOFMT ?= gofmt -s

EXTRA_GOFLAGS ?=

MAKE_VERSION := $(shell $(MAKE) -v | head -n 1)
Expand Down Expand Up @@ -126,8 +125,6 @@ ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
GO_SOURCES += $(BINDATA_DEST)
endif

GO_SOURCES_OWN := $(filter-out vendor/% %/bindata.go, $(GO_SOURCES))

#To update swagger use: GO111MODULE=on go get -u github.com/go-swagger/go-swagger/cmd/swagger
SWAGGER := $(GO) run -mod=vendor github.com/go-swagger/go-swagger/cmd/swagger
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
Expand Down Expand Up @@ -237,7 +234,7 @@ clean:
.PHONY: fmt
fmt:
@echo "Running go fmt..."
@$(GOFMT) -w $(GO_SOURCES_OWN)
@$(GO) run build/code-batch-process.go gitea-fmt -s -w '{file-list}'

.PHONY: vet
vet:
Expand Down Expand Up @@ -297,20 +294,20 @@ misspell-check:
$(GO) install github.com/client9/misspell/cmd/misspell@v0.3.4; \
fi
@echo "Running misspell-check..."
@misspell -error -i unknwon $(GO_SOURCES_OWN)
@$(GO) run build/code-batch-process.go misspell -error -i unknwon '{file-list}'

.PHONY: misspell
misspell:
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) install github.com/client9/misspell/cmd/misspell@v0.3.4; \
fi
@echo "Running go misspell..."
@misspell -w -i unknwon $(GO_SOURCES_OWN)
@$(GO) run build/code-batch-process.go misspell -w -i unknwon '{file-list}'

.PHONY: fmt-check
fmt-check:
# get all go files and run go fmt on them
@diff=$$($(GOFMT) -d $(GO_SOURCES_OWN)); \
@diff=$$($(GO) run build/code-batch-process.go gitea-fmt -s -d '{file-list}'); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \
Expand Down Expand Up @@ -392,7 +389,7 @@ coverage:
.PHONY: unit-test-coverage
unit-test-coverage:
@echo "Running unit-test-coverage $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
@$(GO) test $(GOTESTFLAGS) -mod=vendor -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
@$(GO) test $(GOTESTFLAGS) -mod=vendor -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1

.PHONY: vendor
vendor:
Expand Down Expand Up @@ -765,12 +762,22 @@ pr\#%: clean-all
$(GO) run contrib/pr/checkout.go $*

.PHONY: golangci-lint
golangci-lint:
golangci-lint: golangci-lint-check
golangci-lint run --timeout 10m

.PHONY: golangci-lint-check
golangci-lint-check:
$(eval GOLANGCI_LINT_VERSION := $(shell printf "%03d%03d%03d" $(shell golangci-lint --version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
$(eval MIN_GOLANGCI_LINT_VER_FMT := $(shell printf "%g.%g.%g" $(shell echo $(MIN_GOLANGCI_LINT_VERSION) | grep -o ...)))
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
echo "Downloading golangci-lint v${MIN_GOLANGCI_LINT_VER_FMT}"; \
export BINARY="golangci-lint"; \
curl -sfL "https://github.com/raw/golangci/golangci-lint/v${MIN_GOLANGCI_LINT_VER_FMT}/install.sh" | sh -s -- -b $(GOPATH)/bin v$(MIN_GOLANGCI_LINT_VER_FMT); \
elif [ "$(GOLANGCI_LINT_VERSION)" -lt "$(MIN_GOLANGCI_LINT_VERSION)" ]; then \
echo "Downloading newer version of golangci-lint v${MIN_GOLANGCI_LINT_VER_FMT}"; \
export BINARY="golangci-lint"; \
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.37.0; \
curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${MIN_GOLANGCI_LINT_VER_FMT}/install.sh" | sh -s -- -b $(GOPATH)/bin v$(MIN_GOLANGCI_LINT_VER_FMT); \
fi
golangci-lint run --timeout 10m

.PHONY: docker
docker:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ or if sqlite support is required:
The `build` target is split into two sub-targets:

- `make backend` which requires [Go 1.16](https://golang.org/dl/) or greater.
- `make frontend` which requires [Node.js 12.17](https://nodejs.org/en/download/) or greater and Internet connectivity to download npm dependencies.
- `make frontend` which requires [Node.js LTS](https://nodejs.org/en/download/) or greater and Internet connectivity to download npm dependencies.

When building from the official source tarballs which include pre-built frontend files, the `frontend` target will not be triggered, making it possible to build without Node.js and Internet connectivity.

Expand Down
Loading

0 comments on commit 01f13e5

Please sign in to comment.