Skip to content

Commit 6ca8f13

Browse files
authored
Merge branch 'main' into apply-patch
2 parents 2ca39bb + 1ab44cb commit 6ca8f13

File tree

12 files changed

+296
-61
lines changed

12 files changed

+296
-61
lines changed

.drone.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,67 @@ steps:
854854
exclude:
855855
- pull_request
856856

857+
---
858+
kind: pipeline
859+
name: docker-linux-amd64-release-branch
860+
861+
platform:
862+
os: linux
863+
arch: amd64
864+
865+
depends_on:
866+
- testing-amd64
867+
- testing-arm64
868+
869+
trigger:
870+
ref:
871+
- "refs/heads/release/v*"
872+
event:
873+
exclude:
874+
- cron
875+
876+
steps:
877+
- name: fetch-tags
878+
image: docker:git
879+
commands:
880+
- git fetch --tags --force
881+
882+
- name: publish
883+
pull: always
884+
image: techknowlogick/drone-docker:latest
885+
settings:
886+
auto_tag: false
887+
tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64
888+
repo: gitea/gitea
889+
build_args:
890+
- GOPROXY=https://goproxy.cn
891+
password:
892+
from_secret: docker_password
893+
username:
894+
from_secret: docker_username
895+
when:
896+
event:
897+
exclude:
898+
- pull_request
899+
900+
- name: publish-rootless
901+
image: techknowlogick/drone-docker:latest
902+
settings:
903+
dockerfile: Dockerfile.rootless
904+
auto_tag: false
905+
tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64-rootless
906+
repo: gitea/gitea
907+
build_args:
908+
- GOPROXY=https://goproxy.cn
909+
password:
910+
from_secret: docker_password
911+
username:
912+
from_secret: docker_username
913+
when:
914+
event:
915+
exclude:
916+
- pull_request
917+
857918
---
858919
kind: pipeline
859920
type: docker
@@ -1010,6 +1071,68 @@ steps:
10101071
event:
10111072
exclude:
10121073
- pull_request
1074+
1075+
---
1076+
kind: pipeline
1077+
name: docker-linux-arm64-release-branch
1078+
1079+
platform:
1080+
os: linux
1081+
arch: arm64
1082+
1083+
depends_on:
1084+
- testing-amd64
1085+
- testing-arm64
1086+
1087+
trigger:
1088+
ref:
1089+
- "refs/heads/release/v*"
1090+
event:
1091+
exclude:
1092+
- cron
1093+
1094+
steps:
1095+
- name: fetch-tags
1096+
image: docker:git
1097+
commands:
1098+
- git fetch --tags --force
1099+
1100+
- name: publish
1101+
pull: always
1102+
image: techknowlogick/drone-docker:latest
1103+
settings:
1104+
auto_tag: false
1105+
tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64
1106+
repo: gitea/gitea
1107+
build_args:
1108+
- GOPROXY=https://goproxy.cn
1109+
password:
1110+
from_secret: docker_password
1111+
username:
1112+
from_secret: docker_username
1113+
when:
1114+
event:
1115+
exclude:
1116+
- pull_request
1117+
1118+
- name: publish-rootless
1119+
image: techknowlogick/drone-docker:latest
1120+
settings:
1121+
dockerfile: Dockerfile.rootless
1122+
auto_tag: false
1123+
tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64-rootless
1124+
repo: gitea/gitea
1125+
build_args:
1126+
- GOPROXY=https://goproxy.cn
1127+
password:
1128+
from_secret: docker_password
1129+
username:
1130+
from_secret: docker_username
1131+
when:
1132+
event:
1133+
exclude:
1134+
- pull_request
1135+
10131136
---
10141137
kind: pipeline
10151138
type: docker
@@ -1090,13 +1213,16 @@ steps:
10901213
trigger:
10911214
ref:
10921215
- refs/heads/main
1216+
- "refs/heads/release/v*"
10931217
event:
10941218
exclude:
10951219
- cron
10961220

10971221
depends_on:
10981222
- docker-linux-amd64-release
10991223
- docker-linux-arm64-release
1224+
- docker-linux-amd64-release-branch
1225+
- docker-linux-arm64-release-branch
11001226

11011227
---
11021228
kind: pipeline
@@ -1130,6 +1256,8 @@ depends_on:
11301256
- docker-linux-arm64-release
11311257
- docker-linux-amd64-release-version
11321258
- docker-linux-arm64-release-version
1259+
- docker-linux-amd64-release-branch
1260+
- docker-linux-arm64-release-branch
11331261
- docker-manifest
11341262
- docker-manifest-version
11351263
- docs

.gitattributes

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
* text=auto eol=lf
2-
/vendor/** -text -eol linguist-vendored
3-
/public/vendor/** -text -eol linguist-vendored
4-
/web_src/js/vendor/** -text -eol linguist-vendored
5-
/templates/**/*.tmpl linguist-language=Handlebars
2+
*.tmpl linguist-language=Handlebars
63
/.eslintrc linguist-language=YAML
74
/.stylelintrc linguist-language=YAML
5+
/public/vendor/** -text -eol linguist-vendored
6+
/vendor/** -text -eol linguist-vendored
87
/web_src/fomantic/build/** linguist-generated
8+
/web_src/js/vendor/** -text -eol linguist-vendored
99
Dockerfile.* linguist-language=Dockerfile

docker/manifest.rootless.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-rootless
1+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-rootless
22
{{#if build.tags}}
33
tags:
44
{{#each build.tags}}
@@ -8,12 +8,12 @@ tags:
88
{{/if}}
99
manifests:
1010
-
11-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-linux-amd64-rootless
11+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-amd64-rootless
1212
platform:
1313
architecture: amd64
1414
os: linux
1515
-
16-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-linux-arm64-rootless
16+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-arm64-rootless
1717
platform:
1818
architecture: arm64
1919
os: linux

docker/manifest.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}
1+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}
22
{{#if build.tags}}
33
tags:
44
{{#each build.tags}}
@@ -8,13 +8,13 @@ tags:
88
{{/if}}
99
manifests:
1010
-
11-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{else}}dev-{{/if}}linux-amd64
11+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-amd64
1212
platform:
1313
architecture: amd64
1414
os: linux
1515
-
16-
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{else}}dev-{{/if}}linux-arm64
16+
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-arm64
1717
platform:
1818
architecture: arm64
1919
os: linux
20-
variant: v8
20+
variant: v8

docs/content/doc/installation/with-docker-rootless.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ image as a service. Since there is no database available, one can be initialized
3232
Create a directory for `data` and `config` then paste the following content into a file named `docker-compose.yml`.
3333
Note that the volume should be owned by the user/group with the UID/GID specified in the config file. By default Gitea in docker will use uid:1000 gid:1000. If needed you can set ownership on those folders with the command: `sudo chown 1000:1000 config/ data/`
3434
If you don't give the volume correct permissions, the container may not start.
35-
For a stable release you could use `:latest-rootless`, `:1-rootless` or specify a certain release like `:{{< version >}}-rootless`, but if you'd like to use the latest development version then `:dev-rootless` would be an appropriate tag.
35+
For a stable release you could use `:latest-rootless`, `:1-rootless` or specify a certain release like `:{{< version >}}-rootless`, but if you'd like to use the latest development version then `:dev-rootless` would be an appropriate tag. If you'd like to run the latest commit from a release branch you can use the `:1.x-dev-rootless` tag, where x is the minor version of Gitea. (e.g. `:1.16-dev-rootless`)
3636

3737
```yaml
3838
version: "2"

docs/content/doc/installation/with-docker.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ image as a service. Since there is no database available, one can be initialized
3434
Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`.
3535
Note that the volume should be owned by the user/group with the UID/GID specified in the config file.
3636
If you don't give the volume correct permissions, the container may not start.
37-
For a stable release you can use `:latest`, `:1` or specify a certain release like `:{{< version >}}`, but if you'd like to use the latest development version of Gitea then you could use the `:dev` tag.
37+
For a stable release you can use `:latest`, `:1` or specify a certain release like `:{{< version >}}`, but if you'd like to use the latest development version of Gitea then you could use the `:dev` tag. If you'd like to run the latest commit from a release branch you can use the `:1.x-dev` tag, where x is the minor version of Gitea. (e.g. `:1.16-dev`)
3838

3939
```yaml
4040
version: "3"

docs/content/doc/usage/command-line.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Admin operations:
129129
- `--custom-profile-url`: Use a custom Profile URL (option for GitLab/GitHub).
130130
- `--custom-email-url`: Use a custom Email URL (option for GitHub).
131131
- `--icon-url`: Custom icon URL for OAuth2 login source.
132-
- `--override-local-2fa`: Allow source to override local 2FA. (Optional)
132+
- `--skip-local-2fa`: Allow source to override local 2FA. (Optional)
133133
- `--scopes`: Additional scopes to request for this OAuth2 source. (Optional)
134134
- `--required-claim-name`: Claim name that has to be set to allow users to login with this source. (Optional)
135135
- `--required-claim-value`: Claim value that has to be set to allow users to login with this source. (Optional)
@@ -152,7 +152,7 @@ Admin operations:
152152
- `--custom-profile-url`: Use a custom Profile URL (option for GitLab/GitHub).
153153
- `--custom-email-url`: Use a custom Email URL (option for GitHub).
154154
- `--icon-url`: Custom icon URL for OAuth2 login source.
155-
- `--override-local-2fa`: Allow source to override local 2FA. (Optional)
155+
- `--skip-local-2fa`: Allow source to override local 2FA. (Optional)
156156
- `--scopes`: Additional scopes to request for this OAuth2 source.
157157
- `--required-claim-name`: Claim name that has to be set to allow users to login with this source. (Optional)
158158
- `--required-claim-value`: Claim value that has to be set to allow users to login with this source. (Optional)

routers/web/auth/oauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ func SignInOAuthCallback(ctx *context.Context) {
822822
u, gothUser, err := oAuth2UserLoginCallback(authSource, ctx.Req, ctx.Resp)
823823
if err != nil {
824824
if user_model.IsErrUserProhibitLogin(err) {
825-
uplerr := err.(*user_model.ErrUserProhibitLogin)
825+
uplerr := err.(user_model.ErrUserProhibitLogin)
826826
log.Info("Failed authentication attempt for %s from %s: %v", uplerr.Name, ctx.RemoteAddr(), err)
827827
ctx.Data["Title"] = ctx.Tr("auth.prohibit_login")
828828
ctx.HTML(http.StatusOK, "user/auth/prohibit_login")

services/mailer/mail.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"strconv"
1515
"strings"
1616
texttmpl "text/template"
17+
"time"
1718

1819
"code.gitea.io/gitea/models"
1920
repo_model "code.gitea.io/gitea/models/repo"
@@ -298,13 +299,15 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient
298299
}
299300

300301
// Make sure to compose independent messages to avoid leaking user emails
302+
msgID := createReference(ctx.Issue, ctx.Comment, ctx.ActionType)
303+
reference := createReference(ctx.Issue, nil, models.ActionType(0))
304+
301305
msgs := make([]*Message, 0, len(recipients))
302306
for _, recipient := range recipients {
303307
msg := NewMessageFrom([]string{recipient.Email}, ctx.Doer.DisplayName(), setting.MailService.FromEmail, subject, mailBody.String())
304308
msg.Info = fmt.Sprintf("Subject: %s, %s", subject, info)
305309

306-
msg.SetHeader("Message-ID", "<"+createReference(ctx.Issue, ctx.Comment)+">")
307-
reference := createReference(ctx.Issue, nil)
310+
msg.SetHeader("Message-ID", "<"+msgID+">")
308311
msg.SetHeader("In-Reply-To", "<"+reference+">")
309312
msg.SetHeader("References", "<"+reference+">")
310313

@@ -318,7 +321,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient
318321
return msgs, nil
319322
}
320323

321-
func createReference(issue *models.Issue, comment *models.Comment) string {
324+
func createReference(issue *models.Issue, comment *models.Comment, actionType models.ActionType) string {
322325
var path string
323326
if issue.IsPull {
324327
path = "pulls"
@@ -329,6 +332,17 @@ func createReference(issue *models.Issue, comment *models.Comment) string {
329332
var extra string
330333
if comment != nil {
331334
extra = fmt.Sprintf("/comment/%d", comment.ID)
335+
} else {
336+
switch actionType {
337+
case models.ActionCloseIssue, models.ActionClosePullRequest:
338+
extra = fmt.Sprintf("/close/%d", time.Now().UnixNano()/1e6)
339+
case models.ActionReopenIssue, models.ActionReopenPullRequest:
340+
extra = fmt.Sprintf("/reopen/%d", time.Now().UnixNano()/1e6)
341+
case models.ActionMergePullRequest:
342+
extra = fmt.Sprintf("/merge/%d", time.Now().UnixNano()/1e6)
343+
case models.ActionPullRequestReadyForReview:
344+
extra = fmt.Sprintf("/ready/%d", time.Now().UnixNano()/1e6)
345+
}
332346
}
333347

334348
return fmt.Sprintf("%s/%s/%d%s@%s", issue.Repo.FullName(), path, issue.Index, extra, setting.Domain)

0 commit comments

Comments
 (0)