Skip to content

Commit 2bd49cf

Browse files
authored
Merge branch 'main' into delete-pull-branch-on-merge
2 parents 96e160d + 64122fe commit 2bd49cf

File tree

408 files changed

+35744
-22364
lines changed

Some content is hidden

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

408 files changed

+35744
-22364
lines changed

cmd/serv.go

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
package cmd
77

88
import (
9+
"context"
910
"fmt"
1011
"net/http"
1112
"net/url"
1213
"os"
1314
"os/exec"
15+
"os/signal"
1416
"regexp"
1517
"strconv"
1618
"strings"
19+
"syscall"
1720
"time"
1821

1922
"code.gitea.io/gitea/models"
@@ -273,12 +276,31 @@ func runServ(c *cli.Context) error {
273276
verb = strings.Replace(verb, "-", " ", 1)
274277
}
275278

279+
ctx, cancel := context.WithCancel(context.Background())
280+
defer cancel()
281+
go func() {
282+
// install notify
283+
signalChannel := make(chan os.Signal, 1)
284+
285+
signal.Notify(
286+
signalChannel,
287+
syscall.SIGINT,
288+
syscall.SIGTERM,
289+
)
290+
select {
291+
case <-signalChannel:
292+
case <-ctx.Done():
293+
}
294+
cancel()
295+
signal.Reset()
296+
}()
297+
276298
var gitcmd *exec.Cmd
277299
verbs := strings.Split(verb, " ")
278300
if len(verbs) == 2 {
279-
gitcmd = exec.Command(verbs[0], verbs[1], repoPath)
301+
gitcmd = exec.CommandContext(ctx, verbs[0], verbs[1], repoPath)
280302
} else {
281-
gitcmd = exec.Command(verb, repoPath)
303+
gitcmd = exec.CommandContext(ctx, verb, repoPath)
282304
}
283305

284306
gitcmd.Dir = setting.RepoRootPath

contrib/update_dependencies.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
grep 'git' go.mod | grep '\.com' | grep -v indirect | grep -v replace | cut -f 2 | cut -d ' ' -f 1 | while read line; do
4+
go get -u "$line"
5+
make vendor
6+
git add .
7+
git commit -S -m "update $line"
8+
done

custom/conf/app.example.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,9 @@ PATH =
573573
;;
574574
;; Respond to pushes to a non-default branch with a URL for creating a Pull Request (if the repository has them enabled)
575575
;PULL_REQUEST_PUSH_MESSAGE = true
576+
;;
577+
;; (Go-Git only) Don't cache objects greater than this in memory. (Set to 0 to disable.)
578+
;LARGE_OBJECT_THRESHOLD = 1048576
576579

577580
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
578581
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1037,7 +1040,7 @@ PATH =
10371040
;; Additional Emojis not defined in the utf8 standard
10381041
;; By default we support gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and add it to this config.
10391042
;; Dont mistake it for Reactions.
1040-
;CUSTOM_EMOJIS = gitea
1043+
;CUSTOM_EMOJIS = gitea, codeberg, gitlab, git, github, gogs
10411044
;;
10421045
;; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
10431046
;DEFAULT_SHOW_FULL_NAME = false

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.14.2
21+
version: 1.14.3
2222
minGoVersion: 1.14
2323
goVersion: 1.16
2424
minNodeVersion: 12.17

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
181181
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
182182
Values can be emoji alias (:smile:) or a unicode emoji.
183183
For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png
184-
- `CUSTOM_EMOJIS`: **gitea**: Additional Emojis not defined in the utf8 standard.
184+
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard.
185185
By default we support gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and
186186
add it to this config.
187187
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
@@ -392,7 +392,7 @@ relation to port exhaustion.
392392
- `MAX_ATTEMPTS`: **10**: Maximum number of attempts to create the wrapped queue
393393
- `TIMEOUT`: **GRACEFUL_HAMMER_TIME + 30s**: Timeout the creation of the wrapped queue if it takes longer than this to create.
394394
- Queues by default come with a dynamically scaling worker pool. The following settings configure this:
395-
- `WORKERS`: **0** (v1.14 and before: **1**): Number of initial workers for the queue.
395+
- `WORKERS`: **0** (v1.14 and before: **1**): Number of initial workers for the queue.
396396
- `MAX_WORKERS`: **10**: Maximum number of worker go-routines for the queue.
397397
- `BLOCK_TIMEOUT`: **1s**: If the queue blocks for this time, boost the number of workers - the `BLOCK_TIMEOUT` will then be doubled before boosting again whilst the boost is ongoing.
398398
- `BOOST_TIMEOUT`: **5m**: Boost workers will timeout after this long.
@@ -837,7 +837,7 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
837837
- `PULL_REQUEST_PUSH_MESSAGE`: **true**: Respond to pushes to a non-default branch with a URL for creating a Pull Request (if the repository has them enabled)
838838
- `VERBOSE_PUSH`: **true**: Print status information about pushes as they are being processed.
839839
- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay.
840-
840+
- `LARGE_OBJECT_THRESHOLD`: **1048576**: (Go-Git only), don't cache objects greater than this in memory. (Set to 0 to disable.)
841841
## Git - Timeout settings (`git.timeout`)
842842
- `DEFAUlT`: **360**: Git operations default timeout seconds.
843843
- `MIGRATE`: **600**: Migrate external repositories timeout seconds.

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ To make Gitea serve custom public files (like pages and images), use the folder
5656
`$GITEA_CUSTOM/public/` as the webroot. Symbolic links will be followed.
5757

5858
For example, a file `image.png` stored in `$GITEA_CUSTOM/public/`, can be accessed with
59-
the url `http://gitea.domain.tld/image.png`.
59+
the url `http://gitea.domain.tld/assets/image.png`.
6060

6161
## Changing the logo
6262

docs/content/doc/advanced/customizing-gitea.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板
4040

4141
将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。
4242

43-
举例说明:`image.png` 存放在 `custom/public/`中,那么它可以通过链接 http://gitea.domain.tld/image.png 访问。
43+
举例说明:`image.png` 存放在 `custom/public/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。
4444

4545
## 修改默认头像
4646

docs/content/doc/developers/integrations.en-us.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ projects.
2020

2121
We are curating a list over at [awesome-gitea](https://gitea.com/gitea/awesome-gitea) to track these!
2222

23-
If you are looking for [CI/CD](https://gitea.com/gitea/awesome-gitea#devops),
24-
an [SDK](https://gitea.com/gitea/awesome-gitea#sdk),
25-
or even some extra [themes](https://gitea.com/gitea/awesome-gitea#themes),
23+
If you are looking for [CI/CD](https://gitea.com/gitea/awesome-gitea#user-content-devops),
24+
an [SDK](https://gitea.com/gitea/awesome-gitea#user-content-sdk),
25+
or even some extra [themes](https://gitea.com/gitea/awesome-gitea#user-content-themes),
2626
you can find them listed in the [awesome-gitea](https://gitea.com/gitea/awesome-gitea) repository!

docs/content/doc/developers/integrations.zh-tw.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ Gitea 有著很棒的第三方整合社群, 以及其它有著一流支援的
1919

2020
我們持續的整理一份清單以追蹤他們!請到 [awesome-gitea](https://gitea.com/gitea/awesome-gitea) 查看。
2121

22-
如果您正在找尋有關 [CI/CD](https://gitea.com/gitea/awesome-gitea#devops)、[SDK](https://gitea.com/gitea/awesome-gitea#sdk) 或是其它佈景主題,您可以在存儲庫 [awesome-gitea](https://gitea.com/gitea/awesome-gitea) 找到他們。
22+
如果您正在找尋有關 [CI/CD](https://gitea.com/gitea/awesome-gitea#user-content-devops)、[SDK](https://gitea.com/gitea/awesome-gitea#user-content-sdk) 或是其它佈景主題,您可以在存儲庫 [awesome-gitea](https://gitea.com/gitea/awesome-gitea) 找到他們。

docs/content/doc/installation/from-binary.en-us.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ chmod +x gitea
3232
```
3333

3434
## Verify GPG signature
35-
Gitea signs all binaries with a [GPG key](https://keys.openpgp.org/search?q=teabot%40gitea.io) to prevent against unwanted modification of binaries. To validate the binary, download the signature file which ends in `.asc` for the binary you downloaded and use the gpg command line tool.
35+
Gitea signs all binaries with a [GPG key](https://keys.openpgp.org/search?q=teabot%40gitea.io) to prevent against unwanted modification of binaries.
36+
To validate the binary, download the signature file which ends in `.asc` for the binary you downloaded and use the gpg command line tool.
3637

3738
```sh
3839
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
3940
gpg --verify gitea-{{< version >}}-linux-amd64.asc gitea-{{< version >}}-linux-amd64
4041
```
4142

43+
Look for the text `Good signature from "Teabot <teabot@gitea.io>"` to assert a good binary,
44+
despite warnings like `This key is not certified with a trusted signature!`.
45+
4246
## Recommended server configuration
4347

4448
**NOTE:** Many of the following directories can be configured using [Environment Variables]({{< relref "doc/advanced/environment-variables.en-us.md" >}}) as well!

go.mod

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ require (
1414
github.com/Microsoft/go-winio v0.5.0 // indirect
1515
github.com/NYTimes/gziphandler v1.1.1
1616
github.com/ProtonMail/go-crypto v0.0.0-20210512092938-c05353c2d58c // indirect
17-
github.com/PuerkitoBio/goquery v1.6.1
18-
github.com/RoaringBitmap/roaring v0.7.3 // indirect
19-
github.com/alecthomas/chroma v0.9.1
17+
github.com/PuerkitoBio/goquery v1.7.0
18+
github.com/RoaringBitmap/roaring v0.8.0 // indirect
19+
github.com/alecthomas/chroma v0.9.2
2020
github.com/andybalholm/brotli v1.0.3 // indirect
2121
github.com/andybalholm/cascadia v1.2.0 // indirect
22-
github.com/blevesearch/bleve/v2 v2.0.5
22+
github.com/blevesearch/bleve/v2 v2.0.6
2323
github.com/boombuler/barcode v1.0.1 // indirect
2424
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
25-
github.com/caddyserver/certmagic v0.13.1
25+
github.com/caddyserver/certmagic v0.14.0
2626
github.com/chi-middleware/proxy v1.1.1
2727
github.com/couchbase/go-couchbase v0.0.0-20210224140812-5740cd35f448 // indirect
2828
github.com/couchbase/gomemcached v0.1.2 // indirect
@@ -39,18 +39,19 @@ require (
3939
github.com/go-asn1-ber/asn1-ber v1.5.3 // indirect
4040
github.com/go-chi/chi v1.5.4
4141
github.com/go-chi/cors v1.2.0
42-
github.com/go-enry/go-enry/v2 v2.7.0
42+
github.com/go-enry/go-enry/v2 v2.7.1
4343
github.com/go-git/go-billy/v5 v5.3.1
44-
github.com/go-git/go-git/v5 v5.4.2
44+
github.com/go-git/go-git/v5 v5.4.3-0.20210630082519-b4368b2a2ca4
4545
github.com/go-ldap/ldap/v3 v3.3.0
46-
github.com/go-redis/redis/v8 v8.10.0
46+
github.com/go-redis/redis/v8 v8.11.0
4747
github.com/go-sql-driver/mysql v1.6.0
4848
github.com/go-swagger/go-swagger v0.27.0
4949
github.com/go-testfixtures/testfixtures/v3 v3.6.1
5050
github.com/gobwas/glob v0.2.3
5151
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
5252
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
5353
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
54+
github.com/golang/snappy v0.0.4 // indirect
5455
github.com/google/go-github/v32 v32.1.0
5556
github.com/google/go-querystring v1.1.0 // indirect
5657
github.com/google/uuid v1.2.0
@@ -60,39 +61,39 @@ require (
6061
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
6162
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
6263
github.com/hashicorp/go-version v1.3.1
63-
github.com/hashicorp/golang-lru v0.5.1
64+
github.com/hashicorp/golang-lru v0.5.4
6465
github.com/huandu/xstrings v1.3.2
6566
github.com/issue9/identicon v1.2.0
6667
github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7
6768
github.com/json-iterator/go v1.1.11
6869
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
6970
github.com/kevinburke/ssh_config v1.1.0 // indirect
7071
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
71-
github.com/klauspost/compress v1.13.0
72+
github.com/klauspost/compress v1.13.1
73+
github.com/klauspost/cpuid/v2 v2.0.7 // indirect
7274
github.com/klauspost/pgzip v1.2.5 // indirect
7375
github.com/lafriks/xormstore v1.4.0
7476
github.com/lib/pq v1.10.2
75-
github.com/libdns/libdns v0.2.1 // indirect
7677
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
7778
github.com/markbates/goth v1.67.1
7879
github.com/mattn/go-isatty v0.0.13
7980
github.com/mattn/go-runewidth v0.0.13 // indirect
8081
github.com/mattn/go-sqlite3 v1.14.7
8182
github.com/mholt/archiver/v3 v3.5.0
82-
github.com/microcosm-cc/bluemonday v1.0.9
83-
github.com/miekg/dns v1.1.42 // indirect
83+
github.com/microcosm-cc/bluemonday v1.0.14
84+
github.com/miekg/dns v1.1.43 // indirect
8485
github.com/minio/md5-simd v1.1.2 // indirect
85-
github.com/minio/minio-go/v7 v7.0.10
86+
github.com/minio/minio-go/v7 v7.0.12
8687
github.com/minio/sha256-simd v1.0.0 // indirect
8788
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
8889
github.com/msteinert/pam v0.0.0-20201130170657-e61372126161
8990
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
9091
github.com/niklasfasching/go-org v1.5.0
9192
github.com/olekukonko/tablewriter v0.0.5 // indirect
9293
github.com/oliamb/cutter v0.2.2
93-
github.com/olivere/elastic/v7 v7.0.24
94+
github.com/olivere/elastic/v7 v7.0.25
9495
github.com/pelletier/go-toml v1.9.0 // indirect
95-
github.com/pierrec/lz4/v4 v4.1.7 // indirect
96+
github.com/pierrec/lz4/v4 v4.1.8 // indirect
9697
github.com/pkg/errors v0.9.1
9798
github.com/pquerna/otp v1.3.0
9899
github.com/prometheus/client_golang v1.11.0
@@ -112,31 +113,33 @@ require (
112113
github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae
113114
github.com/unrolled/render v1.4.0
114115
github.com/urfave/cli v1.22.5
115-
github.com/xanzy/go-gitlab v0.50.0
116+
github.com/xanzy/go-gitlab v0.50.1
116117
github.com/yohcop/openid-go v1.0.0
117-
github.com/yuin/goldmark v1.3.7
118+
github.com/yuin/goldmark v1.3.9
118119
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01
119120
github.com/yuin/goldmark-meta v1.0.0
120121
go.etcd.io/bbolt v1.3.6 // indirect
121122
go.jolheiser.com/hcaptcha v0.0.4
122123
go.jolheiser.com/pwn v0.0.3
124+
go.uber.org/atomic v1.8.0 // indirect
123125
go.uber.org/multierr v1.7.0 // indirect
124-
go.uber.org/zap v1.17.0 // indirect
126+
go.uber.org/zap v1.18.1 // indirect
125127
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
126-
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
127-
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
128-
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
128+
golang.org/x/net v0.0.0-20210614182718-04defd469f4e
129+
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
130+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
129131
golang.org/x/text v0.3.6
130-
golang.org/x/time v0.0.0-20210608053304-ed9ce3a009e4 // indirect
132+
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
131133
golang.org/x/tools v0.1.0
134+
google.golang.org/protobuf v1.27.1 // indirect
132135
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
133136
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
134137
gopkg.in/ini.v1 v1.62.0
135138
gopkg.in/yaml.v2 v2.4.0
136139
mvdan.cc/xurls/v2 v2.2.0
137140
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
138141
xorm.io/builder v0.3.9
139-
xorm.io/xorm v1.1.0
142+
xorm.io/xorm v1.1.1
140143
)
141144

142145
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1

0 commit comments

Comments
 (0)