pmcf 3.21.0 → 3.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -19
- package/bin/pmcf-package +11 -3
- package/package.json +1 -1
- package/src/cluster.mjs +3 -3
- package/src/host.mjs +4 -7
- package/src/services/chrony.mjs +2 -5
- package/src/services/influxdb.mjs +2 -3
- package/src/services/kea.mjs +2 -5
- package/src/services/mosquitto.mjs +2 -3
- package/src/services/openldap.mjs +2 -12
package/README.md
CHANGED
|
@@ -42,57 +42,59 @@ generates config packages for:
|
|
|
42
42
|
|
|
43
43
|
* [Base](#base)
|
|
44
44
|
* [Parameters](#parameters)
|
|
45
|
+
* [getProperties](#getproperties)
|
|
46
|
+
* [Parameters](#parameters-1)
|
|
45
47
|
* [priority](#priority)
|
|
46
48
|
* [expression](#expression)
|
|
47
|
-
* [Parameters](#parameters-1)
|
|
48
|
-
* [findService](#findservice)
|
|
49
49
|
* [Parameters](#parameters-2)
|
|
50
|
-
* [
|
|
50
|
+
* [findService](#findservice)
|
|
51
51
|
* [Parameters](#parameters-3)
|
|
52
|
+
* [expand](#expand)
|
|
53
|
+
* [Parameters](#parameters-4)
|
|
52
54
|
* [PortEndpoint](#portendpoint)
|
|
53
|
-
* [Parameters](#parameters-
|
|
55
|
+
* [Parameters](#parameters-5)
|
|
54
56
|
* [port](#port)
|
|
55
57
|
* [socketAddress](#socketaddress)
|
|
56
58
|
* [HTTPEndpoint](#httpendpoint)
|
|
57
|
-
* [Parameters](#parameters-
|
|
59
|
+
* [Parameters](#parameters-6)
|
|
58
60
|
* [port](#port-1)
|
|
59
61
|
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
60
62
|
* [networkAddresses](#networkaddresses)
|
|
61
|
-
* [Parameters](#parameters-
|
|
63
|
+
* [Parameters](#parameters-7)
|
|
62
64
|
* [SystemdJournalRemoteService](#systemdjournalremoteservice)
|
|
63
65
|
* [Properties](#properties)
|
|
64
66
|
* [systemdConfigs](#systemdconfigs)
|
|
65
|
-
* [Parameters](#parameters-
|
|
67
|
+
* [Parameters](#parameters-8)
|
|
66
68
|
* [SystemdJournalUploadService](#systemdjournaluploadservice)
|
|
67
69
|
* [Properties](#properties-1)
|
|
68
70
|
* [systemdConfigs](#systemdconfigs-1)
|
|
69
|
-
* [Parameters](#parameters-
|
|
71
|
+
* [Parameters](#parameters-9)
|
|
70
72
|
* [NetworkAddress](#networkaddress)
|
|
71
|
-
* [Parameters](#parameters-
|
|
73
|
+
* [Parameters](#parameters-10)
|
|
72
74
|
* [subnet](#subnet)
|
|
73
75
|
* [networkInterface](#networkinterface)
|
|
74
76
|
* [address](#address)
|
|
75
77
|
* [addresses](#addresses)
|
|
76
|
-
* [Parameters](#parameters-10)
|
|
77
|
-
* [cidrAddresses](#cidraddresses)
|
|
78
78
|
* [Parameters](#parameters-11)
|
|
79
|
+
* [cidrAddresses](#cidraddresses)
|
|
80
|
+
* [Parameters](#parameters-12)
|
|
79
81
|
* [isTemplate](#istemplate)
|
|
80
82
|
* [services](#services)
|
|
81
|
-
* [Parameters](#parameters-12)
|
|
82
|
-
* [named](#named)
|
|
83
83
|
* [Parameters](#parameters-13)
|
|
84
|
-
* [
|
|
84
|
+
* [named](#named)
|
|
85
85
|
* [Parameters](#parameters-14)
|
|
86
|
-
* [
|
|
86
|
+
* [serviceEndpoints](#serviceendpoints)
|
|
87
87
|
* [Parameters](#parameters-15)
|
|
88
|
-
* [
|
|
88
|
+
* [domainName](#domainname)
|
|
89
89
|
* [Parameters](#parameters-16)
|
|
90
|
-
* [
|
|
90
|
+
* [domainFromDominName](#domainfromdominname)
|
|
91
91
|
* [Parameters](#parameters-17)
|
|
92
|
-
* [
|
|
92
|
+
* [sectionLines](#sectionlines)
|
|
93
93
|
* [Parameters](#parameters-18)
|
|
94
|
-
* [
|
|
94
|
+
* [asArray](#asarray)
|
|
95
95
|
* [Parameters](#parameters-19)
|
|
96
|
+
* [asIterator](#asiterator)
|
|
97
|
+
* [Parameters](#parameters-20)
|
|
96
98
|
|
|
97
99
|
## Base
|
|
98
100
|
|
|
@@ -101,6 +103,16 @@ generates config packages for:
|
|
|
101
103
|
* `owner` **[Base](#base)** 
|
|
102
104
|
* `data` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
103
105
|
|
|
106
|
+
### getProperties
|
|
107
|
+
|
|
108
|
+
Retrive attribute values from an object.
|
|
109
|
+
|
|
110
|
+
#### Parameters
|
|
111
|
+
|
|
112
|
+
* `filter` (optional, default `filterPublic`)
|
|
113
|
+
|
|
114
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** values
|
|
115
|
+
|
|
104
116
|
### priority
|
|
105
117
|
|
|
106
118
|
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
package/bin/pmcf-package
CHANGED
|
@@ -42,12 +42,20 @@ const publishingDetails = createPublishingDetails(
|
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
for (const object of root.find(args)) {
|
|
45
|
+
if (object.isTemplate) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
45
48
|
const stagingDir = join(options.output, object.fullName);
|
|
46
49
|
|
|
47
50
|
//console.log(`packages for ${object.fullName}`);
|
|
48
51
|
for await (const { sources, outputs, properties } of object.preparePackages(
|
|
49
52
|
stagingDir
|
|
50
53
|
)) {
|
|
54
|
+
console.log(
|
|
55
|
+
(object.fullName + " ").substring(0, 20),
|
|
56
|
+
properties.name
|
|
57
|
+
);
|
|
58
|
+
|
|
51
59
|
for (const outputFactory of outputs) {
|
|
52
60
|
properties.version = pkg.version;
|
|
53
61
|
properties.license = pkg.license;
|
|
@@ -66,9 +74,9 @@ for (const object of root.find(args)) {
|
|
|
66
74
|
options
|
|
67
75
|
);
|
|
68
76
|
|
|
69
|
-
if (properties.verbose) {
|
|
70
|
-
|
|
71
|
-
}
|
|
77
|
+
// if (properties.verbose) {
|
|
78
|
+
console.log(" -> " + artifact);
|
|
79
|
+
// }
|
|
72
80
|
|
|
73
81
|
if (!options.dry) {
|
|
74
82
|
await Promise.all(
|
package/package.json
CHANGED
package/src/cluster.mjs
CHANGED
|
@@ -80,8 +80,8 @@ export class Cluster extends Host {
|
|
|
80
80
|
new Set()
|
|
81
81
|
)) {
|
|
82
82
|
const host = ni.host;
|
|
83
|
-
|
|
84
|
-
const packageStagingDir = join(stagingDir, name);
|
|
83
|
+
|
|
84
|
+
const packageStagingDir = join(stagingDir, host.name);
|
|
85
85
|
const result = {
|
|
86
86
|
sources: [
|
|
87
87
|
new FileContentProvider(packageStagingDir + "/")[
|
|
@@ -90,7 +90,7 @@ export class Cluster extends Host {
|
|
|
90
90
|
],
|
|
91
91
|
outputs: host.outputs,
|
|
92
92
|
properties: {
|
|
93
|
-
name
|
|
93
|
+
name: `keepalived-${host.location.name}-${host.name}`,
|
|
94
94
|
description: `${this.typeName} definitions for ${this.fullName}`,
|
|
95
95
|
access: "private",
|
|
96
96
|
dependencies: ["keepalived>=2.3.4"]
|
package/src/host.mjs
CHANGED
|
@@ -119,15 +119,12 @@ export class Host extends ServiceOwner {
|
|
|
119
119
|
_applyExtends(host) {
|
|
120
120
|
super._applyExtends(host);
|
|
121
121
|
for (const [name, ni] of host.networkInterfaces) {
|
|
122
|
-
|
|
123
|
-
let present = this._networkInterfaces.get(name);
|
|
124
|
-
|
|
125
|
-
if (!present) {
|
|
126
|
-
present = ni.forOwner(this);
|
|
127
|
-
this._networkInterfaces.set(name, present);
|
|
128
|
-
}
|
|
122
|
+
const present = this._networkInterfaces.get(name);
|
|
129
123
|
|
|
124
|
+
if (present) {
|
|
130
125
|
present.extends.push(ni);
|
|
126
|
+
} else {
|
|
127
|
+
this._networkInterfaces.set(name, ni.forOwner(this));
|
|
131
128
|
}
|
|
132
129
|
}
|
|
133
130
|
}
|
package/src/services/chrony.mjs
CHANGED
|
@@ -63,19 +63,16 @@ export class ChronyService extends ExtraSourceService {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
async *preparePackages(dir) {
|
|
66
|
-
const network = this.network;
|
|
67
66
|
const host = this.host;
|
|
68
67
|
const name = host.name;
|
|
69
68
|
|
|
70
|
-
console.log("chrony", host.name, network.name);
|
|
71
|
-
|
|
72
69
|
const packageData = {
|
|
73
70
|
dir,
|
|
74
71
|
sources: [new FileContentProvider(dir + "/")],
|
|
75
72
|
outputs: this.outputs,
|
|
76
73
|
properties: {
|
|
77
|
-
name:
|
|
78
|
-
description:
|
|
74
|
+
name: `${this.typeName}-${this.location.name}-${host.name}`,
|
|
75
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
79
76
|
access: "private",
|
|
80
77
|
dependencies: ["chrony>=4.6.1"]
|
|
81
78
|
}
|
|
@@ -50,7 +50,6 @@ export class InfluxdbService extends Service {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
async *preparePackages(dir) {
|
|
53
|
-
const network = this.network;
|
|
54
53
|
const host = this.host;
|
|
55
54
|
const name = host.name;
|
|
56
55
|
|
|
@@ -59,8 +58,8 @@ export class InfluxdbService extends Service {
|
|
|
59
58
|
sources: [new FileContentProvider(dir + "/")],
|
|
60
59
|
outputs: this.outputs,
|
|
61
60
|
properties: {
|
|
62
|
-
name:
|
|
63
|
-
description:
|
|
61
|
+
name: `${this.typeName}-${this.location.name}-${host.name}`,
|
|
62
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
64
63
|
access: "private",
|
|
65
64
|
dependencies: ["influxdb>=2.7.0"]
|
|
66
65
|
}
|
package/src/services/kea.mjs
CHANGED
|
@@ -152,9 +152,6 @@ export class KeaService extends Service {
|
|
|
152
152
|
const network = this.network;
|
|
153
153
|
const host = this.host;
|
|
154
154
|
const name = host.name;
|
|
155
|
-
const pkgName = `kea-${this.location.name}-${name}`;
|
|
156
|
-
|
|
157
|
-
console.log(pkgName, this.fullName, network.name);
|
|
158
155
|
|
|
159
156
|
const dnsServerEndpoints = serviceEndpoints(network, {
|
|
160
157
|
services: 'in("dns",types) && priority>=300',
|
|
@@ -166,8 +163,8 @@ export class KeaService extends Service {
|
|
|
166
163
|
sources: [new FileContentProvider(dir + "/")],
|
|
167
164
|
outputs: this.outputs,
|
|
168
165
|
properties: {
|
|
169
|
-
name:
|
|
170
|
-
description:
|
|
166
|
+
name: `${this.typeName}-${this.location.name}-${name}`,
|
|
167
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
171
168
|
access: "private",
|
|
172
169
|
dependencies: [`kea>=${keaVersion}`]
|
|
173
170
|
}
|
|
@@ -41,7 +41,6 @@ export class MosquittoService extends Service {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
async *preparePackages(dir) {
|
|
44
|
-
const network = this.network;
|
|
45
44
|
const host = this.host;
|
|
46
45
|
const name = host.name;
|
|
47
46
|
|
|
@@ -50,8 +49,8 @@ export class MosquittoService extends Service {
|
|
|
50
49
|
sources: [new FileContentProvider(dir + "/")],
|
|
51
50
|
outputs: this.outputs,
|
|
52
51
|
properties: {
|
|
53
|
-
name:
|
|
54
|
-
description:
|
|
52
|
+
name: `${this.typeName}-${this.location.name}-${host.name}`,
|
|
53
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
55
54
|
access: "private",
|
|
56
55
|
dependencies: ["mosquitto>=2.0.22"]
|
|
57
56
|
}
|
|
@@ -79,21 +79,11 @@ export class OpenLDAPService extends Service {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
async *preparePackages(dir) {
|
|
82
|
-
const network = this.network;
|
|
83
82
|
const host = this.host;
|
|
84
83
|
const name = host.name;
|
|
85
|
-
const pkgName = `openldap-${this.location.name}-${name}`;
|
|
86
84
|
const owner = "ldap";
|
|
87
85
|
const group = "ldap";
|
|
88
86
|
|
|
89
|
-
console.log(
|
|
90
|
-
pkgName,
|
|
91
|
-
this.fullName,
|
|
92
|
-
this.alias,
|
|
93
|
-
network.name,
|
|
94
|
-
this.extends.map(o => o.fullName)
|
|
95
|
-
);
|
|
96
|
-
|
|
97
87
|
const packageData = {
|
|
98
88
|
dir,
|
|
99
89
|
sources: [
|
|
@@ -113,8 +103,8 @@ export class OpenLDAPService extends Service {
|
|
|
113
103
|
],
|
|
114
104
|
outputs: this.outputs,
|
|
115
105
|
properties: {
|
|
116
|
-
name:
|
|
117
|
-
description:
|
|
106
|
+
name: `${this.typeName}-${this.location.name}-${name}`,
|
|
107
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
118
108
|
access: "private",
|
|
119
109
|
dependencies: ["openldap>=2.6.10"],
|
|
120
110
|
hooks: {}
|