Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  Use random bytes to generate access token (go-gitea#21959)
  Replace fmt.Sprintf with hex.EncodeToString (go-gitea#21960)
  Implement FSFE REUSE for golang files (go-gitea#21840)
  Correct the fallbacks for mailer configuration (go-gitea#21945)
  [skip ci] Updated licenses and gitignores
  Fix typos (go-gitea#21947)
  Fix markdown anchor re-clicking (go-gitea#21931)
  Prevent NPE if trying to restore an already restored deleted branch (go-gitea#21940)
  add rel="me" to org.website link (go-gitea#21941)
  • Loading branch information
zjjhot committed Nov 29, 2022
2 parents c7939bb + f047ee0 commit 0261a67
Show file tree
Hide file tree
Showing 1,879 changed files with 2,064 additions and 3,886 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ Code that you contribute should use the standard copyright header:

```
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT
```

Files in the repository contain copyright from the year they are added
Expand Down
4 changes: 2 additions & 2 deletions build.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT


//go:build vendor

Expand Down
3 changes: 1 addition & 2 deletions build/code-batch-process.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

//go:build ignore

Expand Down
3 changes: 1 addition & 2 deletions build/codeformat/formatimports.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package codeformat

Expand Down
3 changes: 1 addition & 2 deletions build/codeformat/formatimports_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package codeformat

Expand Down
3 changes: 1 addition & 2 deletions build/generate-bindata.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

//go:build ignore

Expand Down
7 changes: 3 additions & 4 deletions build/generate-emoji.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2015 Kenneth Shaw
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

//go:build ignore

Expand Down Expand Up @@ -209,8 +208,8 @@ func generate() ([]byte, error) {

const hdr = `
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT
package emoji
Expand Down
3 changes: 1 addition & 2 deletions build/generate-go-licenses.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

//go:build ignore

Expand Down
3 changes: 1 addition & 2 deletions build/gocovmerge.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright (c) 2015, Wade Simmons
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

// gocovmerge takes the results from multiple `go test -coverprofile` runs and
// merges them into one profile
Expand Down
3 changes: 1 addition & 2 deletions cmd/admin.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/admin_auth_ldap.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/admin_auth_ldap_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/cert.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

// Package cmd provides subcommands to the gitea binary - such as "web" or
// "admin".
Expand Down
3 changes: 1 addition & 2 deletions cmd/convert.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/docs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/doctor.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/dump.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/dump_repo.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/embedded.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

//go:build bindata

Expand Down
3 changes: 1 addition & 2 deletions cmd/embedded_stub.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

//go:build !bindata

Expand Down
3 changes: 1 addition & 2 deletions cmd/generate.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
11 changes: 5 additions & 6 deletions cmd/hook.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2017 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down Expand Up @@ -218,9 +217,9 @@ Gitea or set your environment appropriately.`, "")
}
}

supportProcRecive := false
supportProcReceive := false
if git.CheckGitVersionAtLeast("2.29") == nil {
supportProcRecive = true
supportProcReceive = true
}

for scanner.Scan() {
Expand All @@ -241,9 +240,9 @@ Gitea or set your environment appropriately.`, "")
lastline++

// If the ref is a branch or tag, check if it's protected
// if supportProcRecive all ref should be checked because
// if supportProcReceive all ref should be checked because
// permission check was delayed
if supportProcRecive || strings.HasPrefix(refFullName, git.BranchPrefix) || strings.HasPrefix(refFullName, git.TagPrefix) {
if supportProcReceive || strings.HasPrefix(refFullName, git.BranchPrefix) || strings.HasPrefix(refFullName, git.TagPrefix) {
oldCommitIDs[count] = oldCommitID
newCommitIDs[count] = newCommitID
refFullNames[count] = refFullName
Expand Down
3 changes: 1 addition & 2 deletions cmd/hook_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/keys.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/mailer.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/main_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/manager.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/manager_logging.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/migrate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/migrate_storage.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/migrate_storage_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/restore_repo.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/serv.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/web.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/web_acme.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/web_graceful.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions cmd/web_https.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package cmd

Expand Down
3 changes: 1 addition & 2 deletions contrib/environment-to-ini/environment-to-ini.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package main

Expand Down
3 changes: 1 addition & 2 deletions contrib/fixtures/fixture_generation.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package main

Expand Down
3 changes: 1 addition & 2 deletions contrib/pr/checkout.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package main

Expand Down
2 changes: 1 addition & 1 deletion custom/conf/app.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ ROUTER = console
;; Prefix displayed before subject in mail
;SUBJECT_PREFIX =
;;
;; Mail server protocol. One of "smtp", "smtps", "smtp+startls", "smtp+unix", "sendmail", "dummy".
;; Mail server protocol. One of "smtp", "smtps", "smtp+starttls", "smtp+unix", "sendmail", "dummy".
;; - sendmail: use the operating system's `sendmail` command instead of SMTP. This is common on Linux systems.
;; - dummy: send email messages to the log as a testing phase.
;; If your provider does not explicitly say which protocol it uses but does provide a port,
Expand Down
2 changes: 1 addition & 1 deletion docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ and
[Gitea 1.17 configuration document](https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md)

- `ENABLED`: **false**: Enable to use a mail service.
- `PROTOCOL`: **\<empty\>**: Mail server protocol. One of "smtp", "smtps", "smtp+startls", "smtp+unix", "sendmail", "dummy". _Before 1.18, this was inferred from a combination of `MAILER_TYPE` and `IS_TLS_ENABLED`._
- `PROTOCOL`: **\<empty\>**: Mail server protocol. One of "smtp", "smtps", "smtp+starttls", "smtp+unix", "sendmail", "dummy". _Before 1.18, this was inferred from a combination of `MAILER_TYPE` and `IS_TLS_ENABLED`._
- SMTP family, if your provider does not explicitly say which protocol it uses but does provide a port, you can set SMTP_PORT instead and this will be inferred.
- **sendmail** Use the operating system's `sendmail` command instead of SMTP. This is common on Linux systems.
- **dummy** Send email messages to the log as a testing phase.
Expand Down
Loading

0 comments on commit 0261a67

Please sign in to comment.