pmcf 6.26.0 → 6.26.1

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
@@ -79,30 +79,30 @@ generates config packages for:
79
79
  * [domainNames](#domainnames)
80
80
  * [InitializationContext](#initializationcontext)
81
81
  * [Parameters](#parameters-14)
82
- * [SkeletonNetworkInterface](#skeletonnetworkinterface)
83
- * [networkAddresses](#networkaddresses)
84
- * [Parameters](#parameters-15)
85
82
  * [zones](#zones)
86
83
  * [type](#type)
87
84
  * [addressesStatement](#addressesstatement)
88
- * [Parameters](#parameters-16)
85
+ * [Parameters](#parameters-15)
89
86
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
90
87
  * [Properties](#properties)
91
88
  * [systemdConfigs](#systemdconfigs)
92
- * [Parameters](#parameters-17)
89
+ * [Parameters](#parameters-16)
93
90
  * [SystemdJournalUploadService](#systemdjournaluploadservice)
94
91
  * [Properties](#properties-1)
95
92
  * [systemdConfigs](#systemdconfigs-1)
96
- * [Parameters](#parameters-18)
93
+ * [Parameters](#parameters-17)
97
94
  * [NetworkAddress](#networkaddress)
98
- * [Parameters](#parameters-19)
95
+ * [Parameters](#parameters-18)
99
96
  * [subnet](#subnet)
100
97
  * [networkInterface](#networkinterface)
101
98
  * [address](#address)
102
99
  * [addresses](#addresses)
103
- * [Parameters](#parameters-20)
100
+ * [Parameters](#parameters-19)
104
101
  * [cidrAddresses](#cidraddresses)
105
- * [Parameters](#parameters-21)
102
+ * [Parameters](#parameters-20)
103
+ * [SkeletonNetworkInterface](#skeletonnetworkinterface)
104
+ * [networkAddresses](#networkaddresses)
105
+ * [Parameters](#parameters-21)
106
106
  * [families](#families)
107
107
  * [secretName](#secretname)
108
108
  * [directHosts](#directhosts)
@@ -301,18 +301,6 @@ Keeps track of all in flight object creations and loose ends during config initi
301
301
 
302
302
  * `directory` (optional, default `"/"`)
303
303
 
304
- ## SkeletonNetworkInterface
305
-
306
- **Extends ServiceOwner**
307
-
308
- ### networkAddresses
309
-
310
- #### Parameters
311
-
312
- * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
313
-
314
- Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
315
-
316
304
  ## zones
317
305
 
318
306
  Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<bind\_zone>
@@ -409,6 +397,18 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
409
397
 
410
398
  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;
411
399
 
400
+ ## SkeletonNetworkInterface
401
+
402
+ **Extends ServiceOwner**
403
+
404
+ ### networkAddresses
405
+
406
+ #### Parameters
407
+
408
+ * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
409
+
410
+ Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
411
+
412
412
  ## families
413
413
 
414
414
  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.26.0",
3
+ "version": "6.26.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  filterPublic,
18
18
  extendingAttributeIterator,
19
19
  name_attribute_writable,
20
- type_attribute,
20
+ type_attribute_writable,
21
21
  string_attribute_writable,
22
22
  string_set_attribute_writable,
23
23
  description_attribute_writable,
@@ -41,7 +41,7 @@ export class Base {
41
41
  name: name_attribute_writable,
42
42
  aliases: aliases_attribute,
43
43
  description: description_attribute_writable,
44
- type: type_attribute,
44
+ type: type_attribute_writable,
45
45
  directory: { ...string_attribute_writable, name: "directory" },
46
46
  packaging: { ...string_set_attribute_writable, name: "packaging" },
47
47
  disabled: { ...boolean_attribute_writable, name: "disabled" },
@@ -2,7 +2,7 @@ import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
2
2
  import {
3
3
  string_attribute_writable,
4
4
  number_attribute_writable,
5
- string_set_attribute,
5
+ string_set_attribute_writable,
6
6
  boolean_attribute_false,
7
7
  port_attribute_writable,
8
8
  priority_attribute
@@ -43,7 +43,7 @@ export const endpointAttributes = {
43
43
  name: "protocol",
44
44
  values: new Set(["tcp", "udp", "quic"])
45
45
  },
46
- types: { ...string_set_attribute, name: "types" },
46
+ types: { ...string_set_attribute_writable, name: "types" },
47
47
  tls: { ...boolean_attribute_false, name: "tls" }
48
48
  };
49
49
 
@@ -186,6 +186,13 @@ export const ServiceTypes = {
186
186
  ],
187
187
  dnsRecord: { type: "MX" }
188
188
  },
189
+ smtps: {
190
+ endpoints: [
191
+ { family: FAMILY_IPV4, protocol: "tcp", port: 465, tls: true },
192
+ { family: FAMILY_IPV6, protocol: "tcp", port: 465, tls: true }
193
+ ],
194
+ dnsRecord: { type: "MX" }
195
+ },
189
196
  submission: {
190
197
  endpoints: [
191
198
  { family: FAMILY_IPV4, protocol: "tcp", port: 587, tls: false },
package/src/service.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { setBaseService, CoreService, addType } from "pmcf";
2
+ import { serviceTypes, ServiceTypes } from "./service-types.mjs";
2
3
 
3
4
  export class Service extends CoreService {
4
5
  static name = "service";
@@ -8,6 +9,29 @@ export class Service extends CoreService {
8
9
  }
9
10
 
10
11
  _type;
12
+ _types;
13
+
14
+ set types(value) {
15
+ this._types = value;
16
+ }
17
+
18
+ get types() {
19
+ if (this._types) {
20
+ this._types.add(this.type);
21
+ return this._types;
22
+ }
23
+ if (this._type) {
24
+ return new Set([this._type]);
25
+ }
26
+
27
+ const types = serviceTypes(ServiceTypes[this.type]);
28
+
29
+ if(types.size) {
30
+ return types;
31
+ }
32
+
33
+ return new Set([this.name]);
34
+ }
11
35
 
12
36
  set type(value) {
13
37
  this._type = value;
@@ -321,7 +321,7 @@ class bind_group extends Base {
321
321
  }
322
322
 
323
323
  get domains() {
324
- return this.entries.reduce(
324
+ return this.entries?.reduce(
325
325
  (all, address) => all.union(address.domains),
326
326
  new Set()
327
327
  );
@@ -3,7 +3,9 @@ import { CoreService, addType } from "pmcf";
3
3
  export class postfix extends CoreService {
4
4
  static service = {
5
5
  systemdService: "postfix.service",
6
- extends: ["smtp", "lmtp", "submission"]
6
+ systemUserName: "root",
7
+ systemGroupName: "root",
8
+ extends: ["smtp", "smtps", "lmtp", "submission"]
7
9
  };
8
10
 
9
11
  static {