pmcf 6.3.10 → 6.4.0

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 CHANGED
@@ -77,26 +77,26 @@ generates config packages for:
77
77
  * [domainNames](#domainnames)
78
78
  * [InitializationContext](#initializationcontext)
79
79
  * [Parameters](#parameters-13)
80
- * [SkeletonNetworkInterface](#skeletonnetworkinterface)
81
- * [networkAddresses](#networkaddresses)
82
- * [Parameters](#parameters-14)
83
80
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
84
81
  * [Properties](#properties)
85
82
  * [systemdConfigs](#systemdconfigs)
86
- * [Parameters](#parameters-15)
83
+ * [Parameters](#parameters-14)
87
84
  * [SystemdJournalUploadService](#systemdjournaluploadservice)
88
85
  * [Properties](#properties-1)
89
86
  * [systemdConfigs](#systemdconfigs-1)
90
- * [Parameters](#parameters-16)
87
+ * [Parameters](#parameters-15)
91
88
  * [NetworkAddress](#networkaddress)
92
- * [Parameters](#parameters-17)
89
+ * [Parameters](#parameters-16)
93
90
  * [subnet](#subnet)
94
91
  * [networkInterface](#networkinterface)
95
92
  * [address](#address)
96
93
  * [addresses](#addresses)
97
- * [Parameters](#parameters-18)
94
+ * [Parameters](#parameters-17)
98
95
  * [cidrAddresses](#cidraddresses)
99
- * [Parameters](#parameters-19)
96
+ * [Parameters](#parameters-18)
97
+ * [SkeletonNetworkInterface](#skeletonnetworkinterface)
98
+ * [networkAddresses](#networkaddresses)
99
+ * [Parameters](#parameters-19)
100
100
  * [families](#families)
101
101
  * [secretName](#secretname)
102
102
  * [directHosts](#directhosts)
@@ -286,18 +286,6 @@ Keeps track of all in flight object creations and loose ends during config initi
286
286
 
287
287
  * `directory` (optional, default `"/"`)
288
288
 
289
- ## SkeletonNetworkInterface
290
-
291
- **Extends ServiceOwner**
292
-
293
- ### networkAddresses
294
-
295
- #### Parameters
296
-
297
- * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
298
-
299
- Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
300
-
301
289
  ## SystemdJournalRemoteService
302
290
 
303
291
  **Extends CoreService**
@@ -373,6 +361,18 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
373
361
 
374
362
  Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
375
363
 
364
+ ## SkeletonNetworkInterface
365
+
366
+ **Extends ServiceOwner**
367
+
368
+ ### networkAddresses
369
+
370
+ #### Parameters
371
+
372
+ * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
373
+
374
+ Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
375
+
376
376
  ## families
377
377
 
378
378
  Returns **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.3.10",
3
+ "version": "6.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "aggregated-map": "^1.0.7",
54
54
  "content-entry-transform": "^1.6.9",
55
- "ip-utilties": "^3.4.0",
55
+ "ip-utilties": "^3.5.3",
56
56
  "npm-pkgbuild": "^20.8.1",
57
57
  "pacc": "^10.4.1",
58
58
  "package-directory": "^8.2.0",
@@ -63,7 +63,7 @@
63
63
  "ava": "^8.0.1",
64
64
  "c8": "^11.0.0",
65
65
  "documentation": "^14.0.3",
66
- "semantic-release": "^25.0.5"
66
+ "semantic-release": "^25.0.6"
67
67
  },
68
68
  "overrides": {
69
69
  "c8": {
@@ -1,7 +1,6 @@
1
1
  import { join } from "node:path";
2
- import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
2
+ import { FAMILY_IPV4, FAMILY_IPV6, isLinkLocal } from "ip-utilties";
3
3
  import { FileContentProvider } from "npm-pkgbuild";
4
- import { isLinkLocal } from "ip-utilties";
5
4
  import { serviceEndpoints, addType, ExtraSourceService, FAMILY_UNIX } from "pmcf";
6
5
  import { writeLines } from "../utils.mjs";
7
6
 
@@ -4,11 +4,7 @@ import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
4
4
  import { FileContentProvider } from "npm-pkgbuild";
5
5
  import { boolean_attribute_writable_true } from "pacc";
6
6
  import { CoreService, addType } from "pmcf";
7
- import {
8
- writeLines,
9
- setionLinesFromPropertyIterator,
10
- filterConfigurable
11
- } from "../utils.mjs";
7
+ import { writeLines, filterConfigurable } from "../utils.mjs";
12
8
 
13
9
  export class influxdb extends CoreService {
14
10
  static attributes = {
@@ -1,5 +1,12 @@
1
+ import { join } from "node:path";
2
+ import { FileContentProvider } from "npm-pkgbuild";
1
3
  import { port_attribute, string_attribute_writable } from "pacc";
2
4
  import { CoreService, addType } from "pmcf";
5
+ import {
6
+ writeLines,
7
+ setionLinesFromAttributeIterator,
8
+ filterConfigurable
9
+ } from "../utils.mjs";
3
10
 
4
11
  export class mosquitto extends CoreService {
5
12
  static attributes = {
@@ -57,6 +64,16 @@ export class mosquitto extends CoreService {
57
64
  )
58
65
  );
59
66
 
67
+ packageData.sources.push(new FileContentProvider(dir + "/"));
68
+
69
+ await writeLines(
70
+ join(dir, "etc", "mosquitto"),
71
+ "moquitto.conf",
72
+ setionLinesFromAttributeIterator(
73
+ this.attributeIterator(filterConfigurable), " "
74
+ )
75
+ );
76
+
60
77
  yield packageData;
61
78
  }
62
79
  }
@@ -11,7 +11,7 @@ import {
11
11
  filterConfigurable,
12
12
  yesno,
13
13
  sectionLines,
14
- setionLinesFromPropertyIterator
14
+ setionLinesFromAttributeIterator
15
15
  } from "../utils.mjs";
16
16
 
17
17
  export class SystemdResolvedService extends ExtraSourceService {
@@ -110,7 +110,7 @@ export class SystemdResolvedService extends ExtraSourceService {
110
110
  return {
111
111
  serviceName: this.systemdService,
112
112
  configFileName: `etc/systemd/resolved.conf.d/${name}.conf`,
113
- //content: [...setionLinesFromPropertyIterator(this.attributeIterator( filterConfigurable)), "A=1"]
113
+ //content: [...setionLinesFromAttributeIterator(this.attributeIterator( filterConfigurable)), "A=1"]
114
114
  content: sectionLines("Resolve", {
115
115
  DNS: serviceEndpoints(this, options(300, 399, 4)),
116
116
  FallbackDNS: serviceEndpoints(this, options(100, 199, 4)),
package/src/utils.mjs CHANGED
@@ -77,12 +77,12 @@ export function sectionLines(sectionName, values) {
77
77
  return lines;
78
78
  }
79
79
 
80
- export function* setionLinesFromPropertyIterator(properties) {
80
+ export function* setionLinesFromAttributeIterator(properties, separator="=") {
81
81
  for (const [name, value, path, attribute] of properties) {
82
82
  if (attribute.attributes) {
83
83
  yield `[${name}]`;
84
84
  } else {
85
- yield `${name}=${value}`;
85
+ yield `${name}${separator}${value}`;
86
86
  }
87
87
  }
88
88
  }