Skip to content

Commit

Permalink
Merge branch 'main' into acme-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath committed Feb 3, 2022
2 parents 7ea21e9 + cafd19c commit 1ec10b8
Show file tree
Hide file tree
Showing 307 changed files with 5,544 additions and 1,680 deletions.
13 changes: 9 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ steps:

- name: coverage-codecov
pull: always
image: plugins/codecov
image: woodpeckerci/plugin-codecov:next-alpine
settings:
files:
- coverage.all
Expand Down Expand Up @@ -567,7 +567,7 @@ steps:
settings:
acl: public-read
bucket: gitea-artifacts
endpoint: https://storage.gitea.io
endpoint: https://ams3.digitaloceanspaces.com
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
Expand All @@ -588,7 +588,7 @@ steps:
settings:
acl: public-read
bucket: gitea-artifacts
endpoint: https://storage.gitea.io
endpoint: https://ams3.digitaloceanspaces.com
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
Expand Down Expand Up @@ -641,6 +641,7 @@ steps:
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
TAGS: bindata sqlite sqlite_unlock_notify
depends_on: [fetch-tags]

- name: gpg-sign
pull: always
Expand All @@ -656,14 +657,15 @@ steps:
from_secret: gpgsign_key
GPGSIGN_PASSPHRASE:
from_secret: gpgsign_passphrase
depends_on: [static]

- name: release-tag
pull: always
image: woodpeckerci/plugin-s3:latest
settings:
acl: public-read
bucket: gitea-artifacts
endpoint: https://storage.gitea.io
endpoint: https://ams3.digitaloceanspaces.com
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
Expand All @@ -673,6 +675,7 @@ steps:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
depends_on: [gpg-sign]

- name: github
pull: always
Expand All @@ -683,6 +686,7 @@ steps:
environment:
GITHUB_TOKEN:
from_secret: github_token
depends_on: [gpg-sign]

---
kind: pipeline
Expand Down Expand Up @@ -1086,6 +1090,7 @@ steps:
trigger:
ref:
- refs/heads/main
- "refs/heads/release/v*"
event:
exclude:
- cron
Expand Down
4 changes: 0 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ env:

globals:
__webpack_public_path__: true
CodeMirror: false
Dropzone: false
SimpleMDE: false

settings:
html/html-extensions: [".tmpl"]
Expand All @@ -34,7 +31,6 @@ overrides:
- files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
env:
browser: true
jquery: true
node: false
- files: ["templates/**/*.tmpl"]
rules:
Expand Down
8 changes: 4 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
* text=auto eol=lf
/vendor/** -text -eol linguist-vendored
/public/vendor/** -text -eol linguist-vendored
/web_src/js/vendor/** -text -eol linguist-vendored
/templates/**/*.tmpl linguist-language=Handlebars
*.tmpl linguist-language=Handlebars
/.eslintrc linguist-language=YAML
/.stylelintrc linguist-language=YAML
/public/vendor/** -text -eol linguist-vendored
/vendor/** -text -eol linguist-vendored
/web_src/fomantic/build/** linguist-generated
/web_src/js/vendor/** -text -eol linguist-vendored
Dockerfile.* linguist-language=Dockerfile
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ _testmain.go
coverage.all
cpu.out

/modules/migration/bindata.go
/modules/migration/bindata.go.hash
/modules/options/bindata.go
/modules/options/bindata.go.hash
/modules/public/bindata.go
Expand Down
29 changes: 27 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ 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.16.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.16.0-rc1) - 2022-01-19
## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30

* BREAKING
* Remove golang vendored directory (#18277)
* Paginate releases page & set default page size to 10 (#16857)
* Use shadowing script for docker (#17846)
* Only allow webhook to send requests to allowed hosts (#17482)
* SECURITY
* Disable content sniffing on `PlainTextBytes` (#18359) (#18365)
* Only view milestones from current repo (#18414) (#18417)
* Sanitize user-input on file name (#17666)
* Use `hostmatcher` to replace `matchlist` to improve blocking of bad hosts in Webhooks (#17605)
* FEATURES
Expand Down Expand Up @@ -228,6 +231,16 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
* Add left padding for chunk header of split diff view (#13397)
* Allow U2F 2FA without TOTP (#11573)
* BUGFIXES
* GitLab reviews may not have the updated_at field set (#18450) (#18461)
* Fix detection of no commits when the default branch is not master (#18422) (#18423)
* Fix broken oauth2 authentication source edit page (#18412) (#18419)
* Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403) (#18404)
* Fix restore without topic failure (#18387) (#18400)
* Fix commit's time (#18375) (#18392)
* Fix partial cloning a repo (#18373) (#18377)
* Stop trimming preceding and suffixing spaces from editor filenames (#18334)
* Prevent showing webauthn error for every time visiting `/user/settings/security` (#18386)
* Fix mime-type detection for HTTP server (#18370) (#18371)
* Stop trimming preceding and suffixing spaces from editor filenames (#18334)
* Restore propagation of ErrDependenciesLeft (#18325)
* Fix PR comments UI (#18323)
Expand Down Expand Up @@ -295,10 +308,22 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
* BUILD
* Add lockfile-check (#18285)
* Don't store assets modified time into generated files (#18193)
* Use shadowing script for docker (#17846)
* MISC
* Update JS dependencies (#17611)

## [1.15.11](https://github.com/go-gitea/gitea/releases/tag/v1.15.11) - 2022-01-29

* SECURITY
* Only view milestones from current repo (#18414) (#18418)
* BUGFIXES
* Fix broken when no commits and default branch is not master (#18422) (#18424)
* Fix commit's time (#18375) (#18409)
* Fix restore without topic failure (#18387) (#18401)
* Fix mermaid import in 1.15 (it uses ESModule now) (#18382)
* Update to go/text 0.3.7 (#18336)
* MISC
* Upgrade EasyMDE to 2.16.1 (#18278) (#18279)

## [1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14

* BUGFIXES
Expand Down
80 changes: 75 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,24 @@ Some of the key points:
if that is not related to your PR, please make *another* PR for that.
* Split big pull requests into multiple small ones. An incremental change
will be faster to review than a huge PR.
* Use the first comment as a summary explainer of your PR and you should keep this up-to-date as the PR evolves.

If your PR could cause a breaking change you must add a BREAKING section to this comment e.g.:

```
## :warning: BREAKING :warning:
```

To explain how this could affect users and how to mitigate these changes.

## Styleguide

For imports you should use the following format (_without_ the comments)
```go
import (
// stdlib
"encoding/json"
"fmt"
"math"

// local packages
"code.gitea.io/gitea/models"
Expand Down Expand Up @@ -203,13 +212,74 @@ In general, HTTP methods are chosen as follows:
* **PUT** endpoints return status **No Content (204)**, used to **add/assign** existing Objects (e.g. User) to something (e.g. Org-Team)
* **PATCH** endpoints return changed object and status **OK (200)**, used to **edit/change** an existing object


An endpoint which changes/edits an object expects all fields to be optional (except ones to identify the object, which are required).

### Endpoints returning lists should
* support pagination (`page` & `limit` options in query)
* set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))

## Large Character Comments

Throughout the codebase there are large-text comments for sections of code, e.g.:

```go
// __________ .__
// \______ \ _______ _|__| ______ _ __
// | _// __ \ \/ / |/ __ \ \/ \/ /
// | | \ ___/\ /| \ ___/\ /
// |____|_ /\___ >\_/ |__|\___ >\/\_/
// \/ \/ \/
```

These were created using the `figlet` tool with the `graffiti` font.

A simple way of creating these is to use the following:

```bash
figlet -f graffiti Review | sed -e's+^+// +' - | xclip -sel clip -in
```

## Backports and Frontports

Occasionally backports of PRs are required.

The backported PR title should be:

```
Title of backported PR (#ORIGINAL_PR_NUMBER)
```

The first two lines of the summary of the backporting PR should be:

```
Backport #ORIGINAL_PR_NUMBER
```

with the rest of the summary matching the original PR. Similarly for frontports

---

The below is a script that may be helpful in creating backports. YMMV.

```bash
#!/bin/sh
PR="$1"
SHA="$2"
VERSION="$3"

if [ -z "$SHA" ]; then
SHA=$(gh api /repos/go-gitea/gitea/pulls/$PR -q '.merge_commit_sha')
fi

if [ -z "$VERSION" ]; then
VERSION="v1.16"
fi

echo git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
git cherry-pick $SHA && git commit --amend && git push zeripath backport-$PR-$VERSION && xdg-open https://github.com/go-gitea/gitea/compare/release/"$VERSION"...zeripath:backport-$PR-$VERSION

```

## Developer Certificate of Origin (DCO)

Expand Down Expand Up @@ -351,15 +421,15 @@ be reviewed by two maintainers and must pass the automatic tests.
* If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
* Add a tag as `git tag -s -F release.notes v$vmaj.$vmin.$`, release.notes file could be a temporary file to only include the changelog this version which you added to `CHANGELOG.md`.
* And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically create a release and upload all the compiled binary. (But currently it doesn't add the release notes automatically. Maybe we should fix that.)
* If needed send PR for changelog on branch `main`.
* If needed send a frontport PR for the changelog to branch `main` and update the version in `docs/config.yaml` to refer to the new version.
* Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.

## Copyright

Code that you contribute should use the standard copyright header:

```
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
```
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ COMMA := ,
XGO_VERSION := go-1.17.x
MIN_GO_VERSION := 001016000
MIN_NODE_VERSION := 012017000
MIN_GOLANGCI_LINT_VERSION := 001043000
MIN_GOLANGCI_LINT_VERSION := 001044000

DOCKER_IMAGE ?= gitea/gitea
DOCKER_TAG ?= latest
Expand Down Expand Up @@ -231,10 +231,13 @@ clean:

.PHONY: fmt
fmt:
@hash xgogofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
@echo "Running gitea-fmt(with gofmt)..."
@$(GO) run build/code-batch-process.go gitea-fmt -s -w '{file-list}'
@echo "Running gofumpt"
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) install mvdan.cc/gofumpt@latest; \
fi
gofumpt -w -l -extra -lang 1.16 .
@gofumpt -w -l -extra -lang 1.16 .

.PHONY: vet
vet:
Expand Down
5 changes: 5 additions & 0 deletions cmd/restore_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ var CmdRestoreRepository = cli.Command{
Usage: `Which items will be restored, one or more units should be separated as comma.
wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments are allowed. Empty means all units.`,
},
cli.BoolFlag{
Name: "validation",
Usage: "Sanity check the content of the files before trying to load them",
},
},
}

Expand All @@ -58,6 +62,7 @@ func runRestoreRepository(c *cli.Context) error {
c.String("owner_name"),
c.String("repo_name"),
c.StringSlice("units"),
c.Bool("validation"),
)
if statusCode == http.StatusOK {
return nil
Expand Down
12 changes: 6 additions & 6 deletions contrib/ide/vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"request": "launch",
"mode": "debug",
"buildFlags": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/main.go",
"env": {},
"env": {
"GITEA_WORK_DIR": "${workspaceRoot}",
},
"args": ["web"],
"showLog": true
},
Expand All @@ -20,10 +20,10 @@
"request": "launch",
"mode": "debug",
"buildFlags": "-tags='sqlite sqlite_unlock_notify'",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/main.go",
"env": {},
"env": {
"GITEA_WORK_DIR": "${workspaceRoot}",
},
"args": ["web"],
"showLog": true
}
Expand Down
5 changes: 3 additions & 2 deletions custom/conf/app.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ RUN_MODE = ; prod
;; Enables git-lfs support. true or false, default is false.
;LFS_START_SERVER = false
;;
;; Where your lfs files reside, default is data/lfs.
;LFS_CONTENT_PATH = data/lfs
;;
;; LFS authentication secret, change this yourself
LFS_JWT_SECRET =
Expand Down Expand Up @@ -2213,6 +2211,9 @@ PATH =
;;
;[lfs]
;STORAGE_TYPE = local
;;
;; Where your lfs files reside, default is data/lfs.
;PATH = data/lfs

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
Loading

0 comments on commit 1ec10b8

Please sign in to comment.