|
@@ -19,8 +19,7 @@ const MapHandler = require('./lib/map-handler')
|
19
|
19
|
const defaultConfig = (options = {}) => ({
|
20
|
20
|
options,
|
21
|
21
|
groups: { byKey: {}, byName: {} },
|
22
|
|
- replicators: { byKey: {}, byName: {} },
|
23
|
|
- identities: { byKey: {}, byName: {} }
|
|
22
|
+ replicators: { byKey: {}, byName: {} }
|
24
|
23
|
})
|
25
|
24
|
|
26
|
25
|
// filename-safe date (probably there is a better way to do this)
|
|
@@ -40,7 +39,6 @@ class CoBoxConfig {
|
40
|
39
|
fs.writeFileSync(this.storage, yaml.safeDump(defaultConfig(), { sortKeys: true }))
|
41
|
40
|
this._groups = config.groups
|
42
|
41
|
this._replicators = config.replicators
|
43
|
|
- this._identities = config.identities
|
44
|
42
|
this._options = config.options
|
45
|
43
|
} else {
|
46
|
44
|
this.load()
|
|
@@ -59,7 +57,6 @@ class CoBoxConfig {
|
59
|
57
|
this.log = this.logger('cobox-config')
|
60
|
58
|
this.groups = KeyHandler(this._groups)
|
61
|
59
|
this.replicators = KeyHandler(this._replicators)
|
62
|
|
- this.identities = KeyHandler(this._identities)
|
63
|
60
|
this.options = MapHandler(this._options)
|
64
|
61
|
}
|
65
|
62
|
|
|
@@ -68,7 +65,6 @@ class CoBoxConfig {
|
68
|
65
|
var config = defaultConfig()
|
69
|
66
|
config.groups = this._groups
|
70
|
67
|
config.replicators = this._replicators
|
71
|
|
- config.identities = this._identities
|
72
|
68
|
config.options = this._options
|
73
|
69
|
|
74
|
70
|
fs.writeFileSync(this.storage, yaml.safeDump(config, { sortKeys: true }))
|
|
@@ -83,7 +79,6 @@ class CoBoxConfig {
|
83
|
79
|
try {
|
84
|
80
|
const config = yaml.safeLoad(fs.readFileSync(this.storage, 'utf8'))
|
85
|
81
|
this._groups = config.groups
|
86
|
|
- this._identities = config.identities
|
87
|
82
|
this._replicators = config.replicators
|
88
|
83
|
this._options = config.options
|
89
|
84
|
return true
|