1
0
Fork 0

Create backup file during migration from ACME V1 to ACME V2

This commit is contained in:
NicoMen 2018-04-16 19:34:04 +02:00 committed by Traefiker Bot
parent f0589b310f
commit a2e03e3bd0
5 changed files with 96 additions and 22 deletions

View file

@ -134,10 +134,16 @@ func migrateACMEData(fileName string) (*acme.Account, error) {
if accountFromNewFormat == nil {
// convert ACME json file to KV store (used for backward compatibility)
localStore := acme.NewLocalStore(fileName)
account, err = localStore.Get()
if err != nil {
return nil, err
}
err = acme.RemoveAccountV1Values(account)
if err != nil {
return nil, err
}
} else {
account = accountFromNewFormat
}