Skip to content

Commit 50cfd70

Browse files
authored
Merge branch 'main' into add-default-user-is-restricted
2 parents 0c05404 + 27c1578 commit 50cfd70

File tree

598 files changed

+38489
-23223
lines changed

Some content is hidden

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

598 files changed

+38489
-23223
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ Kyle Dumont <[email protected]> (@kdumontnu)
4343
Patrick Schratz <[email protected]> (@pat-s)
4444
Janis Estelmann <[email protected]> (@KN4CK3R)
4545
Steven Kriegler <[email protected]> (@justusbunsi)
46+
Jimmy Praet <[email protected]> (@jpraet)

cmd/convert.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ func runConvert(ctx *cli.Context) error {
2727
return err
2828
}
2929

30-
log.Trace("AppPath: %s", setting.AppPath)
31-
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
32-
log.Trace("Custom path: %s", setting.CustomPath)
33-
log.Trace("Log path: %s", setting.LogRootPath)
30+
log.Info("AppPath: %s", setting.AppPath)
31+
log.Info("AppWorkPath: %s", setting.AppWorkPath)
32+
log.Info("Custom path: %s", setting.CustomPath)
33+
log.Info("Log path: %s", setting.LogRootPath)
3434
setting.InitDBConfig()
3535

3636
if !setting.Database.UseMySQL {

cmd/dump_repo.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var CmdDumpRepository = cli.Command{
6969
cli.StringFlag{
7070
Name: "units",
7171
Value: "",
72-
Usage: `Which items will be migrated, one or more units should be separated as comma.
72+
Usage: `Which items will be migrated, one or more units should be separated as comma.
7373
wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments are allowed. Empty means all units.`,
7474
},
7575
},
@@ -80,10 +80,10 @@ func runDumpRepository(ctx *cli.Context) error {
8080
return err
8181
}
8282

83-
log.Trace("AppPath: %s", setting.AppPath)
84-
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
85-
log.Trace("Custom path: %s", setting.CustomPath)
86-
log.Trace("Log path: %s", setting.LogRootPath)
83+
log.Info("AppPath: %s", setting.AppPath)
84+
log.Info("AppWorkPath: %s", setting.AppWorkPath)
85+
log.Info("Custom path: %s", setting.CustomPath)
86+
log.Info("Log path: %s", setting.LogRootPath)
8787
setting.InitDBConfig()
8888

8989
var (

cmd/migrate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ func runMigrate(ctx *cli.Context) error {
2828
return err
2929
}
3030

31-
log.Trace("AppPath: %s", setting.AppPath)
32-
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
33-
log.Trace("Custom path: %s", setting.CustomPath)
34-
log.Trace("Log path: %s", setting.LogRootPath)
31+
log.Info("AppPath: %s", setting.AppPath)
32+
log.Info("AppWorkPath: %s", setting.AppWorkPath)
33+
log.Info("Custom path: %s", setting.CustomPath)
34+
log.Info("Log path: %s", setting.LogRootPath)
3535
setting.InitDBConfig()
3636

3737
if err := models.NewEngine(context.Background(), migrations.Migrate); err != nil {

cmd/migrate_storage.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ func runMigrateStorage(ctx *cli.Context) error {
110110
return err
111111
}
112112

113-
log.Trace("AppPath: %s", setting.AppPath)
114-
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
115-
log.Trace("Custom path: %s", setting.CustomPath)
116-
log.Trace("Log path: %s", setting.LogRootPath)
113+
log.Info("AppPath: %s", setting.AppPath)
114+
log.Info("AppWorkPath: %s", setting.AppWorkPath)
115+
log.Info("Custom path: %s", setting.CustomPath)
116+
log.Info("Log path: %s", setting.LogRootPath)
117117
setting.InitDBConfig()
118118

119119
if err := models.NewEngine(context.Background(), migrations.Migrate); err != nil {

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

cmd/web.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ and it takes care of all the other things for you`,
4747
Value: setting.PIDFile,
4848
Usage: "Custom pid file path",
4949
},
50+
cli.BoolFlag{
51+
Name: "quiet, q",
52+
Usage: "Only display Fatal logging errors until logging is set-up",
53+
},
54+
cli.BoolFlag{
55+
Name: "verbose",
56+
Usage: "Set initial logging to TRACE level until logging is properly set-up",
57+
},
5058
},
5159
}
5260

@@ -71,6 +79,14 @@ func runHTTPRedirector() {
7179
}
7280

7381
func runWeb(ctx *cli.Context) error {
82+
if ctx.Bool("verbose") {
83+
_ = log.DelLogger("console")
84+
log.NewLogger(0, "console", "console", fmt.Sprintf(`{"level": "trace", "colorize": %t, "stacktraceLevel": "none"}`, log.CanColorStdout))
85+
} else if ctx.Bool("quiet") {
86+
_ = log.DelLogger("console")
87+
log.NewLogger(0, "console", "console", fmt.Sprintf(`{"level": "fatal", "colorize": %t, "stacktraceLevel": "none"}`, log.CanColorStdout))
88+
}
89+
7490
managerCtx, cancel := context.WithCancel(context.Background())
7591
graceful.InitManager(managerCtx)
7692
defer cancel()

contrib/pr/checkout.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"time"
2727

2828
"code.gitea.io/gitea/models"
29+
gitea_git "code.gitea.io/gitea/modules/git"
2930
"code.gitea.io/gitea/modules/markup"
3031
"code.gitea.io/gitea/modules/markup/external"
3132
"code.gitea.io/gitea/modules/setting"
@@ -79,7 +80,7 @@ func runPR() {
7980
setting.RunUser = curUser.Username
8081

8182
log.Printf("[PR] Loading fixtures data ...\n")
82-
setting.CheckLFSVersion()
83+
gitea_git.CheckLFSVersion()
8384
//models.LoadConfigs()
8485
/*
8586
setting.Database.Type = "sqlite3"

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: 25 additions & 6 deletions
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -654,9 +657,18 @@ PATH =
654657
;DEFAULT_USER_IS_RESTRICTED = false
655658
;;
656659
;; Either "public", "limited" or "private", default is "public"
657-
;; Limited is for signed user only
658-
;; Private is only for member of the organization
659-
;; Public is for everyone
660+
;; Limited is for users visible only to signed users
661+
;; Private is for users visible only to members of their organizations
662+
;; Public is for users visible for everyone
663+
;DEFAULT_USER_VISIBILITY = public
664+
;;
665+
;; Set whitch visibibilty modes a user can have
666+
;ALLOWED_USER_VISIBILITY_MODES = public,limited,private
667+
;;
668+
;; Either "public", "limited" or "private", default is "public"
669+
;; Limited is for organizations visible only to signed users
670+
;; Private is for organizations visible only to members of the organization
671+
;; Public is for organizations visible to everyone
660672
;DEFAULT_ORG_VISIBILITY = public
661673
;;
662674
;; Default value for DefaultOrgMemberVisible
@@ -708,6 +720,8 @@ PATH =
708720
;;
709721
;; Minimum amount of time a user must exist before comments are kept when the user is deleted.
710722
;USER_DELETE_WITH_COMMENTS_MAX_TIME = 0
723+
;; Valid site url schemes for user profiles
724+
;VALID_SITE_URL_SCHEMES=http,https
711725

712726

713727
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1021,11 +1035,16 @@ PATH =
10211035
;; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`.
10221036
;THEMES = gitea,arc-green
10231037
;;
1024-
;;All available reactions users can choose on issues/prs and comments.
1025-
;;Values can be emoji alias (:smile:) or a unicode emoji.
1026-
;;For custom reactions, add a tightly cropped square image to public/emoji/img/reaction_name.png
1038+
;; All available reactions users can choose on issues/prs and comments.
1039+
;; Values can be emoji alias (:smile:) or a unicode emoji.
1040+
;; For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png
10271041
;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
10281042
;;
1043+
;; Additional Emojis not defined in the utf8 standard
1044+
;; By default we support gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and add it to this config.
1045+
;; Dont mistake it for Reactions.
1046+
;CUSTOM_EMOJIS = gitea, codeberg, gitlab, git, github, gogs
1047+
;;
10291048
;; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
10301049
;DEFAULT_SHOW_FULL_NAME = false
10311050
;;

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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ The following configuration set `Content-Type: application/vnd.android.package-a
180180
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
181181
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
182182
Values can be emoji alias (:smile:) or a unicode emoji.
183-
For custom reactions, add a tightly cropped square image to public/emoji/img/reaction_name.png
183+
For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png
184+
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard.
185+
By default we support gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and
186+
add it to this config.
184187
- `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.
185188
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
186189
- `USE_SERVICE_WORKER`: **true**: Whether to enable a Service Worker to cache frontend assets.
@@ -389,7 +392,7 @@ relation to port exhaustion.
389392
- `MAX_ATTEMPTS`: **10**: Maximum number of attempts to create the wrapped queue
390393
- `TIMEOUT`: **GRACEFUL_HAMMER_TIME + 30s**: Timeout the creation of the wrapped queue if it takes longer than this to create.
391394
- Queues by default come with a dynamically scaling worker pool. The following settings configure this:
392-
- `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.
393396
- `MAX_WORKERS`: **10**: Maximum number of worker go-routines for the queue.
394397
- `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.
395398
- `BOOST_TIMEOUT`: **5m**: Boost workers will timeout after this long.
@@ -513,13 +516,16 @@ relation to port exhaustion.
513516
- `SHOW_MILESTONES_DASHBOARD_PAGE`: **true** Enable this to show the milestones dashboard page - a view of all the user's milestones
514517
- `AUTO_WATCH_NEW_REPOS`: **true**: Enable this to let all organisation users watch new repos when they are created
515518
- `AUTO_WATCH_ON_CHANGES`: **false**: Enable this to make users watch a repository after their first commit to it
519+
- `DEFAULT_USER_VISIBILITY`: **public**: Set default visibility mode for users, either "public", "limited" or "private".
520+
- `ALLOWED_USER_VISIBILITY_MODES`: **public,limited,private**: Set whitch visibibilty modes a user can have
516521
- `DEFAULT_ORG_VISIBILITY`: **public**: Set default visibility mode for organisations, either "public", "limited" or "private".
517522
- `DEFAULT_ORG_MEMBER_VISIBLE`: **false** True will make the membership of the users visible when added to the organisation.
518523
- `ALLOW_ONLY_INTERNAL_REGISTRATION`: **false** Set to true to force registration only via gitea.
519524
- `ALLOW_ONLY_EXTERNAL_REGISTRATION`: **false** Set to true to force registration only using third-party services.
520525
- `NO_REPLY_ADDRESS`: **noreply.DOMAIN** Value for the domain part of the user's email address in the git log if user has set KeepEmailPrivate to true. DOMAIN resolves to the value in server.DOMAIN.
521526
The user's email will be replaced with a concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS.
522527
- `USER_DELETE_WITH_COMMENTS_MAX_TIME`: **0** Minimum amount of time a user must exist before comments are kept when the user is deleted.
528+
- `VALID_SITE_URL_SCHEMES`: **http, https**: Valid site url schemes for user profiles
523529

524530
### Service - Expore (`service.explore`)
525531

@@ -832,7 +838,7 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
832838
- `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)
833839
- `VERBOSE_PUSH`: **true**: Print status information about pushes as they are being processed.
834840
- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay.
835-
841+
- `LARGE_OBJECT_THRESHOLD`: **1048576**: (Go-Git only), don't cache objects greater than this in memory. (Set to 0 to disable.)
836842
## Git - Timeout settings (`git.timeout`)
837843
- `DEFAUlT`: **360**: Git operations default timeout seconds.
838844
- `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 <[email protected]>"` 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!

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2016-12-01T16:00:00+02:00"
33
title: "Installation from package"
44
slug: "install-from-package"
5-
weight: 10
5+
weight: 20
66
toc: false
77
draft: false
88
menu:
@@ -92,18 +92,6 @@ is in `/usr/local/etc/rc.d/gitea`.
9292

9393
To enable Gitea to run as a service, run `sysrc gitea_enable=YES` and start it with `service gitea start`.
9494

95-
## Cloudron
96-
97-
Gitea is available as a 1-click install on [Cloudron](https://cloudron.io).
98-
Cloudron makes it easy to run apps like Gitea on your server and keep them up-to-date and secure.
99-
100-
[![Install](/cloudron.svg)](https://cloudron.io/button.html?app=io.gitea.cloudronapp)
101-
102-
The Gitea package is maintained [here](https://git.cloudron.io/cloudron/gitea-app).
103-
104-
There is a [demo instance](https://my.demo.cloudron.io) (username: cloudron password: cloudron) where
105-
you can experiment with running Gitea.
106-
10795
## Third-party
10896

10997
Various other third-party packages of Gitea exist.

0 commit comments

Comments
 (0)