mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-29 03:54:02 +00:00
Backport #20289 The code is as old as back to 2016, creating the directory automatically is not correct IMO. In other places for ssh key writing (RewriteAllPrincipalKeys / appendAuthorizedKeysToFile, etc), the directory will still be created when updating the keys. This PR will resolve the confusing and annoying problem: the dummy and empty ".ssh" directory in new git home
This commit is contained in:
parent
1d02a9c9fb
commit
317c565e77
|
@ -862,9 +862,7 @@ func loadFromConf(allowEmpty bool, extraConfig string) {
|
|||
SSH.AuthorizedPrincipalsAllow, SSH.AuthorizedPrincipalsEnabled = parseAuthorizedPrincipalsAllow(sec.Key("SSH_AUTHORIZED_PRINCIPALS_ALLOW").Strings(","))
|
||||
|
||||
if !SSH.Disabled && !SSH.StartBuiltinServer {
|
||||
if err := os.MkdirAll(SSH.RootPath, 0o700); err != nil {
|
||||
log.Fatal("Failed to create '%s': %v", SSH.RootPath, err)
|
||||
} else if err = os.MkdirAll(SSH.KeyTestPath, 0o644); err != nil {
|
||||
if err = os.MkdirAll(SSH.KeyTestPath, 0o644); err != nil {
|
||||
log.Fatal("Failed to create '%s': %v", SSH.KeyTestPath, err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue