Skip to content

Commit ef77ebe

Browse files
authored
Merge branch 'main' into fix-local-wiki-update
2 parents 2aa6f97 + 290f458 commit ef77ebe

File tree

225 files changed

+3035
-938
lines changed

Some content is hidden

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

225 files changed

+3035
-938
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"

custom/conf/app.example.ini

Lines changed: 23 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -651,9 +654,18 @@ PATH =
651654
;DEFAULT_ALLOW_CREATE_ORGANIZATION = true
652655
;;
653656
;; Either "public", "limited" or "private", default is "public"
654-
;; Limited is for signed user only
655-
;; Private is only for member of the organization
656-
;; Public is for everyone
657+
;; Limited is for users visible only to signed users
658+
;; Private is for users visible only to members of their organizations
659+
;; Public is for users visible for everyone
660+
;DEFAULT_USER_VISIBILITY = public
661+
;;
662+
;; Set whitch visibibilty modes a user can have
663+
;ALLOWED_USER_VISIBILITY_MODES = public,limited,private
664+
;;
665+
;; Either "public", "limited" or "private", default is "public"
666+
;; Limited is for organizations visible only to signed users
667+
;; Private is for organizations visible only to members of the organization
668+
;; Public is for organizations visible to everyone
657669
;DEFAULT_ORG_VISIBILITY = public
658670
;;
659671
;; Default value for DefaultOrgMemberVisible
@@ -1020,11 +1032,16 @@ PATH =
10201032
;; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`.
10211033
;THEMES = gitea,arc-green
10221034
;;
1023-
;;All available reactions users can choose on issues/prs and comments.
1024-
;;Values can be emoji alias (:smile:) or a unicode emoji.
1025-
;;For custom reactions, add a tightly cropped square image to public/emoji/img/reaction_name.png
1035+
;; All available reactions users can choose on issues/prs and comments.
1036+
;; Values can be emoji alias (:smile:) or a unicode emoji.
1037+
;; For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png
10261038
;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
10271039
;;
1040+
;; Additional Emojis not defined in the utf8 standard
1041+
;; By default we support gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and add it to this config.
1042+
;; Dont mistake it for Reactions.
1043+
;CUSTOM_EMOJIS = gitea
1044+
;;
10281045
;; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
10291046
;DEFAULT_SHOW_FULL_NAME = false
10301047
;;

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: 7 additions & 2 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**: 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.
@@ -512,6 +515,8 @@ relation to port exhaustion.
512515
- `SHOW_MILESTONES_DASHBOARD_PAGE`: **true** Enable this to show the milestones dashboard page - a view of all the user's milestones
513516
- `AUTO_WATCH_NEW_REPOS`: **true**: Enable this to let all organisation users watch new repos when they are created
514517
- `AUTO_WATCH_ON_CHANGES`: **false**: Enable this to make users watch a repository after their first commit to it
518+
- `DEFAULT_USER_VISIBILITY`: **public**: Set default visibility mode for users, either "public", "limited" or "private".
519+
- `ALLOWED_USER_VISIBILITY_MODES`: **public,limited,private**: Set whitch visibibilty modes a user can have
515520
- `DEFAULT_ORG_VISIBILITY`: **public**: Set default visibility mode for organisations, either "public", "limited" or "private".
516521
- `DEFAULT_ORG_MEMBER_VISIBLE`: **false** True will make the membership of the users visible when added to the organisation.
517522
- `ALLOW_ONLY_INTERNAL_REGISTRATION`: **false** Set to true to force registration only via gitea.
@@ -832,7 +837,7 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
832837
- `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)
833838
- `VERBOSE_PUSH`: **true**: Print status information about pushes as they are being processed.
834839
- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay.
835-
840+
- `LARGE_OBJECT_THRESHOLD`: **1048576**: (Go-Git only), don't cache objects greater than this in memory. (Set to 0 to disable.)
836841
## Git - Timeout settings (`git.timeout`)
837842
- `DEFAUlT`: **360**: Git operations default timeout seconds.
838843
- `MIGRATE`: **600**: Migrate external repositories timeout seconds.

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.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "Install on Cloud Provider"
4+
slug: "install-on-cloud-provider"
5+
weight: 20
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "installation"
11+
name: "On cloud provider"
12+
weight: 20
13+
identifier: "install-on-cloud-provider"
14+
---
15+
16+
# Installation on Cloud Provider
17+
18+
**Table of Contents**
19+
20+
{{< toc >}}
21+
22+
## Cloudron
23+
24+
Gitea is available as a 1-click install on [Cloudron](https://cloudron.io).
25+
Cloudron makes it easy to run apps like Gitea on your server and keep them up-to-date and secure.
26+
27+
[![Install](/cloudron.svg)](https://cloudron.io/button.html?app=io.gitea.cloudronapp)
28+
29+
The Gitea package is maintained [here](https://git.cloudron.io/cloudron/gitea-app).
30+
31+
There is a [demo instance](https://my.demo.cloudron.io) (username: cloudron password: cloudron) where
32+
you can experiment with running Gitea.
33+
34+
## Vultr
35+
36+
Gitea can found in [Vultr](https://www.vultr.com)'s marketplace.
37+
38+
To deploy it have a look at https://www.vultr.com/marketplace/apps/gitea.
39+
40+
## DigitalOcean
41+
42+
[DigitalOcean](https://www.digitalocean.com) has gitea as droplet in his marketplace.
43+
44+
Just create a new [Gitea Droplet](https://marketplace.digitalocean.com/apps/gitea).

docs/content/doc/usage/command-line.en-us.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Starts the server:
4646
- `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file.
4747
- `--install-port number`: Port number to run the install page on. Optional. (default: 3000). Overrides configuration file.
4848
- `--pid path`, `-P path`: Pidfile path. Optional.
49+
- `--quiet`, `-q`: Only emit Fatal logs on the console for logs emitted before logging set up.
50+
- `--verbose`: Emit tracing logs on the console for logs emitted before logging is set-up.
4951
- Examples:
5052
- `gitea web`
5153
- `gitea web --port 80`

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,32 @@ on a bad authentication from the web or CLI using SSH or HTTP respectively:
2929
```log
3030
2020/10/15 16:05:09 modules/ssh/ssh.go:143:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx
3131
```
32+
(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.)
3233

3334
```log
3435
2020/10/15 16:05:09 modules/ssh/ssh.go:155:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx
3536
```
37+
(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.)
3638

3739
```log
3840
2020/10/15 16:05:09 modules/ssh/ssh.go:198:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx
3941
```
42+
(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.)
4043

4144
```log
4245
2020/10/15 16:05:09 modules/ssh/ssh.go:213:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx
4346
```
47+
(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.)
4448

4549
```log
4650
2020/10/15 16:05:09 modules/ssh/ssh.go:227:publicKeyHandler() [W] Failed authentication attempt from xxx.xxx.xxx.xxx
4751
```
52+
(DEPRECATED: This may be a false positive as the user may still go on to correctly authenticate.)
53+
54+
```log
55+
2020/10/15 16:05:09 modules/ssh/ssh.go:249:sshConnectionFailed() [W] Failed authentication attempt from xxx.xxx.xxx.xxx
56+
```
57+
(From 1.15 this new message will available and doesn't have any of the false positive results that above messages from publicKeyHandler do. This will only be logged if the user has completely failed authentication.)
4858

4959
```log
5060
2020/10/15 16:08:44 ...s/context/context.go:204:HandleText() [E] invalid credentials from xxx.xxx.xxx.xxx

0 commit comments

Comments
 (0)