Skip to content

Commit 9bfae10

Browse files
authored
Merge branch 'main' into fix_16384
2 parents 9ad934f + 46a4c68 commit 9bfae10

File tree

5 files changed

+34
-16
lines changed

5 files changed

+34
-16
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

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)