cherry-pick: 4846-migration-fix
Updates #4846. Squashed commit of the following: commit 22e2e89e5390c7b1486fb69064c55da40fc5c7e7 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Aug 18 16:25:07 2022 +0300 home: fix yaml object type
This commit is contained in:
committed by
Ainar Garipov
parent
c7a8883201
commit
39fa4b1f8e
@@ -20,16 +20,11 @@ and this project adheres to
|
|||||||
- Weaker cipher suites that use the CBC (cipher block chaining) mode of
|
- Weaker cipher suites that use the CBC (cipher block chaining) mode of
|
||||||
operation have been disabled ([#2993]).
|
operation have been disabled ([#2993]).
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Bilibili service blocking ([#4795]).
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
- Go 1.18 support. v0.109.0 will require at least Go 1.19 to build.
|
- Go 1.18 support. v0.109.0 will require at least Go 1.19 to build.
|
||||||
|
|
||||||
[#2993]: https://github.com/AdguardTeam/AdGuardHome/issues/2993
|
[#2993]: https://github.com/AdguardTeam/AdGuardHome/issues/2993
|
||||||
[#4795]: https://github.com/AdguardTeam/AdGuardHome/issues/4795
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const currentSchemaVersion = 14
|
|||||||
// These aliases are provided for convenience.
|
// These aliases are provided for convenience.
|
||||||
type (
|
type (
|
||||||
yarr = []any
|
yarr = []any
|
||||||
yobj = map[any]any
|
yobj = map[string]any
|
||||||
)
|
)
|
||||||
|
|
||||||
// Performs necessary upgrade operations if needed
|
// Performs necessary upgrade operations if needed
|
||||||
@@ -182,12 +182,12 @@ func upgradeSchema2to3(diskConf yobj) error {
|
|||||||
newDNSConfig := make(yobj)
|
newDNSConfig := make(yobj)
|
||||||
|
|
||||||
switch v := dnsConfig.(type) {
|
switch v := dnsConfig.(type) {
|
||||||
case map[any]any:
|
case yobj:
|
||||||
for k, v := range v {
|
for k, v := range v {
|
||||||
newDNSConfig[fmt.Sprint(k)] = v
|
newDNSConfig[fmt.Sprint(k)] = v
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("dns configuration is not a map")
|
return fmt.Errorf("unexpected type of dns: %T", dnsConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace bootstrap_dns value filed with new array contains old bootstrap_dns inside
|
// Replace bootstrap_dns value filed with new array contains old bootstrap_dns inside
|
||||||
|
|||||||
Reference in New Issue
Block a user