Skip to content

Commit 5c5acdb

Browse files
Merge pull request #62 from go-gitea/main
Fork updates from go-gitea/gitea main
2 parents 6e43bc5 + cc1f8cb commit 5c5acdb

File tree

84 files changed

+2359
-914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2359
-914
lines changed

.drone.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ services:
230230
MINIO_ACCESS_KEY: 123456
231231
MINIO_SECRET_KEY: 12345678
232232

233+
- name: smtpimap
234+
image: tabascoterrier/docker-imap-devel:latest
235+
pull: always
236+
233237
steps:
234238
- name: fetch-tags
235239
image: docker:git

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ linters-settings:
7676
extra-rules: true
7777
lang-version: "1.19"
7878
depguard:
79-
# TODO: use depguard to replace import checks in gitea-vet
8079
list-type: denylist
8180
# Check the list against standard lib.
8281
include-go-root: true
8382
packages-with-error-message:
8483
- encoding/json: "use gitea's modules/json instead of encoding/json"
8584
- github.com/unknwon/com: "use gitea's util and replacements"
85+
- io/ioutil: "use os or io instead"
86+
- golang.org/x/exp: "it's experimental and unreliable."
8687

8788
issues:
8889
max-issues-per-linter: 0

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ $(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
751751
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
752752

753753
.PHONY: release
754-
release: frontend generate release-windows release-linux release-darwin release-copy release-compress vendor release-sources release-docs release-check
754+
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-docs release-check
755755

756756
$(DIST_DIRS):
757757
mkdir -p $(DIST_DIRS)
@@ -780,6 +780,13 @@ ifeq ($(CI),true)
780780
cp /build/* $(DIST)/binaries
781781
endif
782782

783+
.PHONY: release-freebsd
784+
release-freebsd: | $(DIST_DIRS)
785+
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'freebsd/amd64' -out gitea-$(VERSION) .
786+
ifeq ($(CI),true)
787+
cp /build/* $(DIST)/binaries
788+
endif
789+
783790
.PHONY: release-copy
784791
release-copy: | $(DIST_DIRS)
785792
cd $(DIST); for file in `find . -type f -name "*"`; do cp $${file} ./release/; done;

assets/go-licenses.json

Lines changed: 53 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/admin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ func parseSMTPConfig(c *cli.Context, conf *smtp.Source) error {
950950
if c.IsSet("auth-type") {
951951
conf.Auth = c.String("auth-type")
952952
validAuthTypes := []string{"PLAIN", "LOGIN", "CRAM-MD5"}
953-
if !contains(validAuthTypes, strings.ToUpper(c.String("auth-type"))) {
953+
if !util.SliceContainsString(validAuthTypes, strings.ToUpper(c.String("auth-type"))) {
954954
return errors.New("Auth must be one of PLAIN/LOGIN/CRAM-MD5")
955955
}
956956
conf.Auth = c.String("auth-type")

cmd/dump.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -409,15 +409,6 @@ func runDump(ctx *cli.Context) error {
409409
return nil
410410
}
411411

412-
func contains(slice []string, s string) bool {
413-
for _, v := range slice {
414-
if v == s {
415-
return true
416-
}
417-
}
418-
return false
419-
}
420-
421412
// addRecursiveExclude zips absPath to specified insidePath inside writer excluding excludeAbsPath
422413
func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeAbsPath []string, verbose bool) error {
423414
absPath, err := filepath.Abs(absPath)
@@ -438,7 +429,7 @@ func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeA
438429
currentAbsPath := path.Join(absPath, file.Name())
439430
currentInsidePath := path.Join(insidePath, file.Name())
440431
if file.IsDir() {
441-
if !contains(excludeAbsPath, currentAbsPath) {
432+
if !util.SliceContainsString(excludeAbsPath, currentAbsPath) {
442433
if err := addFile(w, currentInsidePath, currentAbsPath, false); err != nil {
443434
return err
444435
}

custom/conf/app.example.ini

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,47 @@ ROUTER = console
16641664
;; convert \r\n to \n for Sendmail
16651665
;SENDMAIL_CONVERT_CRLF = true
16661666

1667+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1668+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1669+
;[email.incoming]
1670+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1671+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1672+
;;
1673+
;; Enable handling of incoming emails.
1674+
;ENABLED = false
1675+
;;
1676+
;; The email address including the %{token} placeholder that will be replaced per user/action.
1677+
;; Example: incoming+%{token}@example.com
1678+
;; The placeholder must appear in the user part of the address (before the @).
1679+
;REPLY_TO_ADDRESS =
1680+
;;
1681+
;; IMAP server host
1682+
;HOST =
1683+
;;
1684+
;; IMAP server port
1685+
;PORT =
1686+
;;
1687+
;; Username of the receiving account
1688+
;USERNAME =
1689+
;;
1690+
;; Password of the receiving account
1691+
;PASSWORD =
1692+
;;
1693+
;; Whether the IMAP server uses TLS.
1694+
;USE_TLS = false
1695+
;;
1696+
;; If set to true, completely ignores server certificate validation errors. This option is unsafe.
1697+
;SKIP_TLS_VERIFY = true
1698+
;;
1699+
;; The mailbox name where incoming mail will end up.
1700+
;MAILBOX = INBOX
1701+
;;
1702+
;; Whether handled messages should be deleted from the mailbox.
1703+
;DELETE_HANDLED_MESSAGE = true
1704+
;;
1705+
;; Maximum size of a message to handle. Bigger messages are ignored. Set to 0 to allow every size.
1706+
;MAXIMUM_MESSAGE_SIZE = 10485760
1707+
16671708
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16681709
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16691710
;[cache]

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,20 @@ and
750750
- `SEND_BUFFER_LEN`: **100**: Buffer length of mailing queue. **DEPRECATED** use `LENGTH` in `[queue.mailer]`
751751
- `SEND_AS_PLAIN_TEXT`: **false**: Send mails only in plain text, without HTML alternative.
752752

753+
## Incoming Email (`email.incoming`)
754+
755+
- `ENABLED`: **false**: Enable handling of incoming emails.
756+
- `REPLY_TO_ADDRESS`: **\<empty\>**: The email address including the `%{token}` placeholder that will be replaced per user/action. Example: `incoming+%{token}@example.com`. The placeholder must appear in the user part of the address (before the `@`).
757+
- `HOST`: **\<empty\>**: IMAP server host.
758+
- `PORT`: **\<empty\>**: IMAP server port.
759+
- `USERNAME`: **\<empty\>**: Username of the receiving account.
760+
- `PASSWORD`: **\<empty\>**: Password of the receiving account.
761+
- `USE_TLS`: **false**: Whether the IMAP server uses TLS.
762+
- `SKIP_TLS_VERIFY`: **false**: If set to `true`, completely ignores server certificate validation errors. This option is unsafe.
763+
- `MAILBOX`: **INBOX**: The mailbox name where incoming mail will end up.
764+
- `DELETE_HANDLED_MESSAGE`: **true**: Whether handled messages should be deleted from the mailbox.
765+
- `MAXIMUM_MESSAGE_SIZE`: **10485760**: Maximum size of a message to handle. Bigger messages are ignored. Set to 0 to allow every size.
766+
753767
## Cache (`cache`)
754768

755769
- `ENABLED`: **true**: Enable the cache.
@@ -1048,7 +1062,7 @@ Default templates for project boards:
10481062

10491063
## Git - Timeout settings (`git.timeout`)
10501064

1051-
- `DEFAUlT`: **360**: Git operations default timeout seconds.
1065+
- `DEFAULT`: **360**: Git operations default timeout seconds.
10521066
- `MIGRATE`: **600**: Migrate external repositories timeout seconds.
10531067
- `MIRROR`: **300**: Mirror external repositories timeout seconds.
10541068
- `CLONE`: **300**: Git clone from internal repositories timeout seconds.

docs/content/doc/advanced/external-renderers.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,5 @@ And so you could write some CSS:
192192
Add your stylesheet to your custom directory e.g `custom/public/css/my-style-XXXXX.css` and import it using a custom header file `custom/templates/custom/header.tmpl`:
193193

194194
```html
195-
<link type="text/css" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" />
195+
<link rel="stylesheet" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" />
196196
```

docs/content/doc/features/comparison.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ _Symbols used in table:_
106106
| Issue search ||||||||
107107
| Global issue search | [/](https://github.com/go-gitea/gitea/issues/2434) |||||||
108108
| Issue dependency ||||||||
109-
| Create issue via email | [](https://github.com/go-gitea/gitea/issues/6226) ||| ||||
109+
| Create issue via email | [](https://github.com/go-gitea/gitea/issues/6226) ||| ||||
110110
| Service Desk | [](https://github.com/go-gitea/gitea/issues/6219) |||||||
111111

112112
## Pull/Merge requests

0 commit comments

Comments
 (0)