Fix data dir creation permissions (#1503)

This commit is contained in:
Viktor Liu
2024-01-29 14:21:45 +01:00
committed by GitHub
parent c41504b571
commit 25b3641be8
2 changed files with 7 additions and 5 deletions

View File

@ -1,10 +1,11 @@
package encryption
import (
log "github.com/sirupsen/logrus"
"golang.org/x/crypto/acme/autocert"
"os"
"path/filepath"
log "github.com/sirupsen/logrus"
"golang.org/x/crypto/acme/autocert"
)
// CreateCertManager wraps common logic of generating Let's encrypt certificate.
@ -12,7 +13,7 @@ func CreateCertManager(datadir string, letsencryptDomain string) (*autocert.Mana
certDir := filepath.Join(datadir, "letsencrypt")
if _, err := os.Stat(certDir); os.IsNotExist(err) {
err = os.MkdirAll(certDir, os.ModeDir)
err = os.MkdirAll(certDir, 0755)
if err != nil {
return nil, err
}