Skip to content

Commit c788d51

Browse files
committed
Merge branch 'master' into lunny/fix_archive
2 parents 98b84d7 + 46a4c68 commit c788d51

File tree

10 files changed

+36
-26
lines changed

10 files changed

+36
-26
lines changed

.drone.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ steps:
717717

718718
- name: publish
719719
pull: always
720-
image: plugins/docker:linux-amd64
720+
image: techknowlogick/drone-docker:latest
721721
settings:
722722
auto_tag: true
723723
auto_tag_suffix: linux-amd64
@@ -734,7 +734,7 @@ steps:
734734
- pull_request
735735

736736
- name: publish-rootless
737-
image: plugins/docker:linux-amd64
737+
image: techknowlogick/drone-docker:latest
738738
settings:
739739
dockerfile: Dockerfile.rootless
740740
auto_tag: true
@@ -772,7 +772,7 @@ trigger:
772772
steps:
773773
- name: dryrun
774774
pull: always
775-
image: plugins/docker:linux-arm64
775+
image: techknowlogick/drone-docker:latest
776776
settings:
777777
dry_run: true
778778
repo: gitea/gitea
@@ -814,7 +814,7 @@ steps:
814814

815815
- name: publish
816816
pull: always
817-
image: plugins/docker:linux-arm64
817+
image: techknowlogick/drone-docker:latest
818818
settings:
819819
auto_tag: true
820820
auto_tag_suffix: linux-arm64
@@ -834,7 +834,7 @@ steps:
834834
- pull_request
835835

836836
- name: publish-rootless
837-
image: plugins/docker:linux-arm64
837+
image: techknowlogick/drone-docker:latest
838838
settings:
839839
dockerfile: Dockerfile.rootless
840840
auto_tag: true

docs/content/doc/usage/email-setup.en-us.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ menu:
1919

2020
{{< toc >}}
2121

22-
To use Gitea's built-in Email support, update the `app.ini` config file [mailer] section:
22+
Gitea has mailer functionality for sending transactional emails (such as registration confirmation). It can be configured to either use Sendmail (or compatible MTAs like Postfix and msmtp) or directly use SMTP server.
2323

24-
## Sendmail version
24+
## Using Sendmail
2525

26-
Use the operating system’s sendmail command instead of SMTP. This is common on Linux servers.
27-
Note: For use in the official Gitea Docker image, please configure with the SMTP version.
26+
Use `sendmail` command as mailer.
27+
28+
Note: For use in the official Gitea Docker image, please configure with the SMTP version (see the following section).
29+
30+
Note: For Internet-facing sites consult documentation of your MTA for instructions to send emails over TLS. Also set up SPF, DMARC, and DKIM DNS records to make emails sent be accepted as legitimate by various email providers.
2831

2932
```ini
3033
[mailer]
@@ -34,7 +37,9 @@ MAILER_TYPE = sendmail
3437
SENDMAIL_PATH = /usr/sbin/sendmail
3538
```
3639

37-
## SMTP version
40+
## Using SMTP
41+
42+
Directly use SMTP server as relay. This option is useful if you don't want to set up MTA on your instance but you have an account at email provider.
3843

3944
```ini
4045
[mailer]
@@ -47,17 +52,19 @@ USER = [email protected]
4752
PASSWD = `password`
4853
```
4954

50-
- Restart Gitea for the configuration changes to take effect.
55+
Restart Gitea for the configuration changes to take effect.
5156

52-
- To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration.
57+
To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration.
5358

5459
For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}})
5560

56-
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through:
57-
- Via the server supporting TLS through STARTTLS - usually provided on port 587. (Also known as Opportunistic TLS.)
58-
- SMTPS connection (SMTP over transport layer security) via the default port 465.
61+
Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through:
62+
- STARTTLS (also known as Opportunistic TLS) via port 587. Initial connection is done over cleartext, but then be upgraded over TLS if the server supports it.
63+
- SMTPS connection (SMTP over TLS) via the default port 465. Connection to the server use TLS from the beginning.
5964
- Forced SMTPS connection with `IS_TLS_ENABLED=true`. (These are both known as Implicit TLS.)
60-
- This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
65+
This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
66+
67+
Note that Implicit TLS is recommended by [RFC8314](https://tools.ietf.org/html/rfc8314#section-3) since 2018.
6168

6269
### Gmail
6370

@@ -74,3 +81,4 @@ MAILER_TYPE = smtp
7481
IS_TLS_ENABLED = true
7582
HELO_HOSTNAME = example.com
7683
```
84+

models/issue.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,9 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)
10181018

10191019
// GetIssueByIndex returns raw issue without loading attributes by index in a repository.
10201020
func GetIssueByIndex(repoID, index int64) (*Issue, error) {
1021+
if index < 1 {
1022+
return nil, ErrIssueNotExist{}
1023+
}
10211024
issue := &Issue{
10221025
RepoID: repoID,
10231026
Index: index,

modules/markup/external/external.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ func (p *Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.
9898
args = append(args, f.Name())
9999
}
100100

101+
if ctx == nil || ctx.Ctx == nil {
102+
return fmt.Errorf("RenderContext did not provide context")
103+
}
104+
101105
processCtx, cancel := context.WithCancel(ctx.Ctx)
102106
defer cancel()
103107

options/locale/locale_de-DE.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@ hi_user_x=Hallo <b>%s</b>,
326326

327327
activate_account=Bitte aktiviere dein Konto
328328
activate_account.title=%s, bitte aktiviere dein Konto
329-
activate_account.test_1=Hallo <b>%[1]s</b>, danke für deine Registrierung bei %[2]!
330-
activate_account.test_2=Bitte klicke innerhalb von <b>%s</b> auf folgenden Link, um dein Konto zu aktivieren:
331329

332330
activate_email=Bestätige deine E-Mail-Adresse
333331
activate_email.title=%s, bitte verifiziere deine E-Mail-Adresse

options/locale/locale_es-ES.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,6 @@ hi_user_x=Hola <b>%s</b>,
321321

322322
activate_account=Por favor, active su cuenta
323323
activate_account.title=%s, por favor activa tu cuenta
324-
activate_account.test_1=¡Hola <b>%[1]s</b>, gracias por registrarte en %[2]!
325-
activate_account.test_2=Haga clic en el siguiente enlace para activar su cuenta dentro de <b>%s</b>:
326324

327325
activate_email=Verifique su correo electrónico
328326
activate_email.title=%s, por favor verifica tu dirección de correo electrónico

options/locale/locale_ja-JP.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,6 @@ hi_user_x=こんにちは、<b>%s</b> さん。
324324

325325
activate_account=あなたのアカウントをアクティベートしてください。
326326
activate_account.title=%s さん、アカウントをアクティベートしてください
327-
activate_account.test_1=こんにちは、<b>%[1]s</b> さん。 %[2]s へのご登録ありがとうございます!
328-
activate_account.test_2=あなたのアカウントを有効化するため、<b>%s</b>以内に次のリンクをクリックしてください:
329327

330328
activate_email=メール アドレスを確認します
331329
activate_email.title=%s さん、メールアドレス確認をお願いします

options/locale/locale_pt-PT.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ hi_user_x=Olá <b>%s</b>,
323323

324324
activate_account=Por favor, ponha a sua conta em funcionamento
325325
activate_account.title=%s, por favor habilite a sua conta
326-
activate_account.test_1=Olá <b>%[1]s</b>, obrigado por se registar em %[2]s!
327-
activate_account.test_2=Por favor clique na seguinte ligação para habilitar a sua conta em <b>%s</b>:
326+
activate_account.text_1=Olá <b>%[1]s</b>, obrigado por se registar em %[2]s!
327+
activate_account.text_2=Clique, por favor, na ligação seguinte para activar a sua conta dentro de <b>%s</b>:
328328

329329
activate_email=Verifique o seu endereço de email
330330
activate_email.title=%s, por favor verifique o seu endereço de email

options/locale/locale_zh-TW.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,6 @@ hi_user_x=<b>%s</b> 您好,
324324

325325
activate_account=請啟用您的帳戶
326326
activate_account.title=%s,請啟用您的帳戶
327-
activate_account.test_1=<b>%[1]s</b> 您好,感謝您註冊 %[2]s!
328-
activate_account.test_2=請在 <b>%s</b>內點擊下列連結以啟用您的帳戶:
329327

330328
activate_email=請驗證您的電子信箱
331329
activate_email.title=%s,請驗證您的電子信箱

routers/web/repo/view.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ func renderDirectory(ctx *context.Context, treeLink string) {
336336
ctx.Data["MarkupType"] = string(markupType)
337337
var result strings.Builder
338338
err := markup.Render(&markup.RenderContext{
339+
Ctx: ctx,
339340
Filename: readmeFile.name,
340341
URLPrefix: readmeTreelink,
341342
Metas: ctx.Repo.Repository.ComposeDocumentMetas(),
@@ -511,6 +512,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
511512
ctx.Data["MarkupType"] = markupType
512513
var result strings.Builder
513514
err := markup.Render(&markup.RenderContext{
515+
Ctx: ctx,
514516
Filename: blob.Name(),
515517
URLPrefix: path.Dir(treeLink),
516518
Metas: ctx.Repo.Repository.ComposeDocumentMetas(),
@@ -570,6 +572,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
570572
ctx.Data["MarkupType"] = markupType
571573
var result strings.Builder
572574
err := markup.Render(&markup.RenderContext{
575+
Ctx: ctx,
573576
Filename: blob.Name(),
574577
URLPrefix: path.Dir(treeLink),
575578
Metas: ctx.Repo.Repository.ComposeDocumentMetas(),

0 commit comments

Comments
 (0)