forked from forgejo/forgejo
Vendor Update (#16121)
* update github.com/PuerkitoBio/goquery * update github.com/alecthomas/chroma * update github.com/blevesearch/bleve/v2 * update github.com/caddyserver/certmagic * update github.com/go-enry/go-enry/v2 * update github.com/go-git/go-billy/v5 * update github.com/go-git/go-git/v5 * update github.com/go-redis/redis/v8 * update github.com/go-testfixtures/testfixtures/v3 * update github.com/jaytaylor/html2text * update github.com/json-iterator/go * update github.com/klauspost/compress * update github.com/markbates/goth * update github.com/mattn/go-isatty * update github.com/mholt/archiver/v3 * update github.com/microcosm-cc/bluemonday * update github.com/minio/minio-go/v7 * update github.com/prometheus/client_golang * update github.com/unrolled/render * update github.com/xanzy/go-gitlab * update github.com/yuin/goldmark * update github.com/yuin/goldmark-highlighting Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
f088dc4ea1
commit
86e2789960
819 changed files with 38072 additions and 34969 deletions
27
vendor/github.com/caddyserver/certmagic/account.go
generated
vendored
27
vendor/github.com/caddyserver/certmagic/account.go
generated
vendored
|
@ -28,6 +28,7 @@ import (
|
|||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/mholt/acmez/acme"
|
||||
)
|
||||
|
@ -185,9 +186,14 @@ func (am *ACMEManager) saveAccount(ca string, account acme.Account) error {
|
|||
func (am *ACMEManager) getEmail(allowPrompts bool) error {
|
||||
leEmail := am.Email
|
||||
|
||||
// First try package default email
|
||||
// First try package default email, or a discovered email address
|
||||
if leEmail == "" {
|
||||
leEmail = DefaultACME.Email // TODO: racey with line 122 (or whichever line assigns to DefaultACME.Email below)
|
||||
leEmail = DefaultACME.Email
|
||||
}
|
||||
if leEmail == "" {
|
||||
discoveredEmailMu.Lock()
|
||||
leEmail = discoveredEmail
|
||||
discoveredEmailMu.Unlock()
|
||||
}
|
||||
|
||||
// Then try to get most recent user email from storage
|
||||
|
@ -210,8 +216,13 @@ func (am *ACMEManager) getEmail(allowPrompts bool) error {
|
|||
|
||||
// save the email for later and ensure it is consistent
|
||||
// for repeated use; then update cfg with the email
|
||||
DefaultACME.Email = strings.TrimSpace(strings.ToLower(leEmail)) // TODO: this is racey with line 99
|
||||
am.Email = DefaultACME.Email
|
||||
leEmail = strings.TrimSpace(strings.ToLower(leEmail))
|
||||
discoveredEmailMu.Lock()
|
||||
if discoveredEmail == "" {
|
||||
discoveredEmail = leEmail
|
||||
}
|
||||
discoveredEmailMu.Unlock()
|
||||
am.Email = leEmail
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -386,6 +397,14 @@ func getPrimaryContact(account acme.Account) string {
|
|||
return primaryContact
|
||||
}
|
||||
|
||||
// When an email address is not explicitly specified, we can remember
|
||||
// the last one we discovered to avoid having to ask again later.
|
||||
// (We used to store this in DefaultACME.Email but it was racey; see #127)
|
||||
var (
|
||||
discoveredEmail string
|
||||
discoveredEmailMu sync.Mutex
|
||||
)
|
||||
|
||||
// agreementTestURL is set during tests to skip requiring
|
||||
// setting up an entire ACME CA endpoint.
|
||||
var agreementTestURL string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue