pmcf 4.19.2 → 4.20.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.
Files changed (81) hide show
  1. package/README.md +93 -72
  2. package/package.json +19 -19
  3. package/src/base.mjs +23 -241
  4. package/src/cli.mjs +4 -4
  5. package/src/cluster.mjs +13 -11
  6. package/src/extra-source-service.mjs +7 -10
  7. package/src/host.mjs +30 -44
  8. package/src/initialization-context.mjs +324 -0
  9. package/src/location.mjs +4 -14
  10. package/src/module.mjs +1 -0
  11. package/src/network-interfaces/ethernet.mjs +3 -5
  12. package/src/network-interfaces/loopback.mjs +2 -4
  13. package/src/network-interfaces/network-interface.mjs +3 -5
  14. package/src/network-interfaces/skeleton.mjs +9 -3
  15. package/src/network-interfaces/tun.mjs +2 -4
  16. package/src/network-interfaces/wireguard.mjs +3 -5
  17. package/src/network-interfaces/wlan.mjs +4 -7
  18. package/src/network.mjs +10 -8
  19. package/src/owner.mjs +7 -31
  20. package/src/root.mjs +4 -73
  21. package/src/service-owner.mjs +19 -18
  22. package/src/service.mjs +13 -18
  23. package/src/services/alpm.mjs +4 -9
  24. package/src/services/bind.mjs +424 -388
  25. package/src/services/chrony.mjs +3 -5
  26. package/src/services/headscale.mjs +2 -4
  27. package/src/services/influxdb.mjs +2 -4
  28. package/src/services/kea.mjs +6 -10
  29. package/src/services/mosquitto.mjs +2 -4
  30. package/src/services/openldap.mjs +2 -4
  31. package/src/services/postfix.mjs +2 -4
  32. package/src/services/systemd-journal-remote.mjs +2 -4
  33. package/src/services/systemd-journal-upload.mjs +9 -10
  34. package/src/services/systemd-journald.mjs +2 -4
  35. package/src/services/systemd-resolved.mjs +42 -42
  36. package/src/services/systemd-timesyncd.mjs +9 -13
  37. package/src/services/tailscale.mjs +5 -2
  38. package/src/subnet.mjs +9 -5
  39. package/types/base.d.mts +0 -180
  40. package/types/cli.d.mts +0 -10
  41. package/types/cluster.d.mts +0 -507
  42. package/types/dns-utils.d.mts +0 -14
  43. package/types/endpoint.d.mts +0 -79
  44. package/types/extra-source-service.d.mts +0 -1033
  45. package/types/hooks.d.mts +0 -2
  46. package/types/host-utils.d.mts +0 -1
  47. package/types/host.d.mts +0 -285
  48. package/types/location.d.mts +0 -379
  49. package/types/module.d.mts +0 -36
  50. package/types/network-address.d.mts +0 -41
  51. package/types/network-interfaces/ethernet.d.mts +0 -1189
  52. package/types/network-interfaces/loopback.d.mts +0 -1140
  53. package/types/network-interfaces/network-interface.d.mts +0 -1158
  54. package/types/network-interfaces/skeleton.d.mts +0 -30
  55. package/types/network-interfaces/tun.d.mts +0 -1131
  56. package/types/network-interfaces/wireguard.d.mts +0 -1131
  57. package/types/network-interfaces/wlan.d.mts +0 -1734
  58. package/types/network-support.d.mts +0 -193
  59. package/types/network.d.mts +0 -702
  60. package/types/owner.d.mts +0 -235
  61. package/types/root.d.mts +0 -10
  62. package/types/service-owner.d.mts +0 -14
  63. package/types/service-types.d.mts +0 -246
  64. package/types/service.d.mts +0 -689
  65. package/types/services/alpm.d.mts +0 -805
  66. package/types/services/bind.d.mts +0 -1574
  67. package/types/services/chrony.d.mts +0 -1310
  68. package/types/services/headscale.d.mts +0 -801
  69. package/types/services/influxdb.d.mts +0 -812
  70. package/types/services/kea.d.mts +0 -945
  71. package/types/services/mosquitto.d.mts +0 -876
  72. package/types/services/openldap.d.mts +0 -793
  73. package/types/services/postfix.d.mts +0 -784
  74. package/types/services/systemd-journal-remote.d.mts +0 -1030
  75. package/types/services/systemd-journal-upload.d.mts +0 -932
  76. package/types/services/systemd-journald.d.mts +0 -1317
  77. package/types/services/systemd-resolved.d.mts +0 -1644
  78. package/types/services/systemd-timesyncd.d.mts +0 -1459
  79. package/types/services/tailscale.d.mts +0 -781
  80. package/types/subnet.d.mts +0 -57
  81. package/types/utils.d.mts +0 -37
@@ -12,6 +12,7 @@ import { writeLines } from "../utils.mjs";
12
12
 
13
13
  const ChronyServiceTypeDefinition = {
14
14
  name: "chrony",
15
+ priority: 1,
15
16
  extends: ExtraSourceServiceTypeDefinition,
16
17
  specializationOf: ServiceTypeDefinition,
17
18
  owners: ServiceTypeDefinition.owners,
@@ -45,15 +46,12 @@ const ChronyServiceTypeDefinition = {
45
46
  };
46
47
 
47
48
  export class ChronyService extends ExtraSourceService {
49
+ static typeDefinition = ChronyServiceTypeDefinition;
48
50
  static {
49
51
  addType(this);
50
52
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
51
53
  }
52
54
 
53
- static get typeDefinition() {
54
- return ChronyServiceTypeDefinition;
55
- }
56
-
57
55
  get type() {
58
56
  return ChronyServiceTypeDefinition.name;
59
57
  }
@@ -66,7 +64,7 @@ export class ChronyService extends ExtraSourceService {
66
64
 
67
65
  const lines = [
68
66
  ...serviceEndpoints(this, {
69
- services: 'in("ntp",types) && priority>=100',
67
+ services: "services[types[ntp] && priority>=100]",
70
68
  endpoints: e =>
71
69
  e.type === "ntp" &&
72
70
  !isLinkLocal(e.address) &&
@@ -4,6 +4,7 @@ import { ServiceTypeDefinition, Service } from "../service.mjs";
4
4
 
5
5
  const HeadscaleServiceTypeDefinition = {
6
6
  name: "headscale",
7
+ priority: 1,
7
8
  extends: ServiceTypeDefinition,
8
9
  specializationOf: ServiceTypeDefinition,
9
10
  owners: ServiceTypeDefinition.owners,
@@ -39,12 +40,9 @@ const HeadscaleServiceTypeDefinition = {
39
40
  };
40
41
 
41
42
  export class HeadscaleService extends Service {
43
+ static typeDefinition = HeadscaleServiceTypeDefinition;
42
44
  static {
43
45
  addType(this);
44
46
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
45
47
  }
46
-
47
- static get typeDefinition() {
48
- return HeadscaleServiceTypeDefinition;
49
- }
50
48
  }
@@ -11,6 +11,7 @@ import { Service, ServiceTypeDefinition } from "../service.mjs";
11
11
 
12
12
  const InfluxdbServiceTypeDefinition = {
13
13
  name: "influxdb",
14
+ priority: 1,
14
15
  extends: ServiceTypeDefinition,
15
16
  specializationOf: ServiceTypeDefinition,
16
17
  owners: ServiceTypeDefinition.owners,
@@ -43,15 +44,12 @@ const InfluxdbServiceTypeDefinition = {
43
44
  };
44
45
 
45
46
  export class InfluxdbService extends Service {
47
+ static typeDefinition = InfluxdbServiceTypeDefinition;
46
48
  static {
47
49
  addType(this);
48
50
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
49
51
  }
50
52
 
51
- static get typeDefinition() {
52
- return InfluxdbServiceTypeDefinition;
53
- }
54
-
55
53
  get type() {
56
54
  return InfluxdbServiceTypeDefinition.name;
57
55
  }
@@ -20,6 +20,7 @@ import { writeLines } from "../utils.mjs";
20
20
 
21
21
  const KeaServiceTypeDefinition = {
22
22
  name: "kea",
23
+ priority: 1,
23
24
  extends: ServiceTypeDefinition,
24
25
  specializationOf: ServiceTypeDefinition,
25
26
  owners: ServiceTypeDefinition.owners,
@@ -129,15 +130,12 @@ const KeaServiceTypeDefinition = {
129
130
  const keaVersion = "3.0.1";
130
131
 
131
132
  export class KeaService extends Service {
133
+ static typeDefinition = KeaServiceTypeDefinition;
132
134
  static {
133
135
  addType(this);
134
136
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
135
137
  }
136
138
 
137
- static get typeDefinition() {
138
- return KeaServiceTypeDefinition;
139
- }
140
-
141
139
  get type() {
142
140
  return KeaServiceTypeDefinition.name;
143
141
  }
@@ -154,7 +152,7 @@ export class KeaService extends Service {
154
152
  const name = host.name;
155
153
 
156
154
  const dnsServerEndpoints = serviceEndpoints(network, {
157
- services: 'in("dns",types) && priority>=300',
155
+ services: "services[types[dns] && priority>=300]",
158
156
  endpoints: endpoint => endpoint.networkInterface?.kind !== "loopback"
159
157
  });
160
158
 
@@ -163,11 +161,9 @@ export class KeaService extends Service {
163
161
  packageData.sources.push(new FileContentProvider(dir + "/"));
164
162
 
165
163
  const peers = async family =>
166
- (
167
- await Array.fromAsync(
168
- network.findServices(
169
- `type="kea" && priority>=${Math.min(this.priority, 100)}`
170
- )
164
+ Array.from(
165
+ network.expression(
166
+ `services[types[kea] && priority>=${Math.min(this.priority, 100)}]`
171
167
  )
172
168
  )
173
169
  .sort(sortDescendingByPriority)
@@ -4,6 +4,7 @@ import { Service, ServiceTypeDefinition } from "../service.mjs";
4
4
 
5
5
  const MosquittoServiceTypeDefinition = {
6
6
  name: "mosquitto",
7
+ priority: 1,
7
8
  extends: ServiceTypeDefinition,
8
9
  specializationOf: ServiceTypeDefinition,
9
10
  owners: ServiceTypeDefinition.owners,
@@ -33,15 +34,12 @@ const MosquittoServiceTypeDefinition = {
33
34
  };
34
35
 
35
36
  export class MosquittoService extends Service {
37
+ static typeDefinition = MosquittoServiceTypeDefinition;
36
38
  static {
37
39
  addType(this);
38
40
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
39
41
  }
40
42
 
41
- static get typeDefinition() {
42
- return MosquittoServiceTypeDefinition;
43
- }
44
-
45
43
  get type() {
46
44
  return MosquittoServiceTypeDefinition.name;
47
45
  }
@@ -10,6 +10,7 @@ import { ServiceTypeDefinition, Service } from "../service.mjs";
10
10
 
11
11
  const OpenLDAPServiceTypeDefinition = {
12
12
  name: "openldap",
13
+ priority: 1,
13
14
  extends: ServiceTypeDefinition,
14
15
  specializationOf: ServiceTypeDefinition,
15
16
  owners: ServiceTypeDefinition.owners,
@@ -26,15 +27,12 @@ const OpenLDAPServiceTypeDefinition = {
26
27
  };
27
28
 
28
29
  export class OpenLDAPService extends Service {
30
+ static typeDefinition = OpenLDAPServiceTypeDefinition;
29
31
  static {
30
32
  addType(this);
31
33
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
32
34
  }
33
35
 
34
- static get typeDefinition() {
35
- return OpenLDAPServiceTypeDefinition;
36
- }
37
-
38
36
  _base;
39
37
 
40
38
  get type() {
@@ -4,6 +4,7 @@ import { ServiceTypeDefinition, Service } from "../service.mjs";
4
4
 
5
5
  const PostfixServiceTypeDefinition = {
6
6
  name: "postfix",
7
+ priority: 1,
7
8
  extends: ServiceTypeDefinition,
8
9
  specializationOf: ServiceTypeDefinition,
9
10
  owners: ServiceTypeDefinition.owners,
@@ -17,15 +18,12 @@ const PostfixServiceTypeDefinition = {
17
18
  };
18
19
 
19
20
  export class PostfixService extends Service {
21
+ static typeDefinition = PostfixServiceTypeDefinition;
20
22
  static {
21
23
  addType(this);
22
24
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
23
25
  }
24
26
 
25
- static get typeDefinition() {
26
- return PostfixServiceTypeDefinition;
27
- }
28
-
29
27
  get type() {
30
28
  return PostfixServiceTypeDefinition.name;
31
29
  }
@@ -10,6 +10,7 @@ import { filterConfigurable, sectionLines } from "../utils.mjs";
10
10
 
11
11
  const SystemdJournalRemoteServiceTypeDefinition = {
12
12
  name: "systemd-journal-remote",
13
+ priority: 1,
13
14
  extends: ServiceTypeDefinition,
14
15
  specializationOf: ServiceTypeDefinition,
15
16
  owners: ServiceTypeDefinition.owners,
@@ -87,15 +88,12 @@ const SystemdJournalRemoteServiceTypeDefinition = {
87
88
  * @property {string} ServerKeyFile
88
89
  */
89
90
  export class SystemdJournalRemoteService extends Service {
91
+ static typeDefinition = SystemdJournalRemoteServiceTypeDefinition;
90
92
  static {
91
93
  addType(this);
92
94
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
93
95
  }
94
96
 
95
- static get typeDefinition() {
96
- return SystemdJournalRemoteServiceTypeDefinition;
97
- }
98
-
99
97
  get type() {
100
98
  return SystemdJournalRemoteServiceTypeDefinition.name;
101
99
  }
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  string_attribute_writable,
3
+ string_collection_attribute_writable,
3
4
  boolean_attribute_writable,
4
5
  addType
5
6
  } from "pacc";
@@ -8,6 +9,7 @@ import { filterConfigurable, sectionLines } from "../utils.mjs";
8
9
 
9
10
  const SystemdJournalUploadServiceTypeDefinition = {
10
11
  name: "systemd-journal-upload",
12
+ priority: 1,
11
13
  extends: ServiceTypeDefinition,
12
14
  specializationOf: ServiceTypeDefinition,
13
15
  owners: ServiceTypeDefinition.owners,
@@ -17,27 +19,27 @@ const SystemdJournalUploadServiceTypeDefinition = {
17
19
  ServerKeyFile: {
18
20
  ...string_attribute_writable,
19
21
  configurable: true
20
- // default: "/etc/ssl/private/journal-upload.pem"
22
+ // default: "/etc/ssl/private/journal-upload.pem"
21
23
  },
22
24
  ServerCertificateFile: {
23
25
  ...string_attribute_writable,
24
26
  configurable: true
25
- // default: "/etc/ssl/certs/journal-upload.pem"
27
+ // default: "/etc/ssl/certs/journal-upload.pem"
26
28
  },
27
29
  TrustedCertificateFile: {
28
30
  ...string_attribute_writable,
29
31
  configurable: true
30
- // default: "/etc/ssl/ca/trusted.pem"
32
+ // default: "/etc/ssl/ca/trusted.pem"
31
33
  },
32
34
  Compression: {
33
- ...string_attribute_writable,
35
+ ...string_collection_attribute_writable,
34
36
  configurable: true
35
- // default: "zstd lz4 xz"
37
+ // default: "zstd lz4 xz"
36
38
  },
37
39
  ForceCompression: {
38
40
  ...boolean_attribute_writable,
39
41
  configurable: true
40
- // default: false
42
+ // default: false
41
43
  }
42
44
  },
43
45
  service: {
@@ -51,15 +53,12 @@ const SystemdJournalUploadServiceTypeDefinition = {
51
53
  * @property {string} ServerKeyFile
52
54
  */
53
55
  export class SystemdJournalUploadService extends Service {
56
+ static typeDefinition = SystemdJournalUploadServiceTypeDefinition;
54
57
  static {
55
58
  addType(this);
56
59
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
57
60
  }
58
61
 
59
- static get typeDefinition() {
60
- return SystemdJournalUploadServiceTypeDefinition;
61
- }
62
-
63
62
  get type() {
64
63
  return SystemdJournalUploadServiceTypeDefinition.name;
65
64
  }
@@ -8,6 +8,7 @@ import { filterConfigurable, sectionLines } from "../utils.mjs";
8
8
 
9
9
  const SystemdJournalServiceTypeDefinition = {
10
10
  name: "systemd-journald",
11
+ priority: 1,
11
12
  extends: ServiceTypeDefinition,
12
13
  specializationOf: ServiceTypeDefinition,
13
14
  owners: ServiceTypeDefinition.owners,
@@ -112,15 +113,12 @@ const SystemdJournalServiceTypeDefinition = {
112
113
  };
113
114
 
114
115
  export class SystemdJournaldService extends Service {
116
+ static typeDefinition = SystemdJournalServiceTypeDefinition;
115
117
  static {
116
118
  addType(this);
117
119
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
118
120
  }
119
121
 
120
- static get typeDefinition() {
121
- return SystemdJournalServiceTypeDefinition;
122
- }
123
-
124
122
  get type() {
125
123
  return SystemdJournalServiceTypeDefinition.name;
126
124
  }
@@ -23,48 +23,53 @@ import {
23
23
 
24
24
  const SystemdResolvedServiceTypeDefinition = {
25
25
  name: "systemd-resolved",
26
+ priority: 1,
26
27
  extends: ExtraSourceServiceTypeDefinition,
27
28
  specializationOf: ServiceTypeDefinition,
28
29
  owners: ServiceTypeDefinition.owners,
29
30
  key: "name",
30
31
  attributes: {
31
- /* Resolve: {
32
+ /* Resolve: {
32
33
  ...object_attribute,
33
34
  attributes: {*/
34
- DNS: { ...string_attribute_writable, configurable: true },
35
- FallbackDNS: { ...string_attribute_writable, configurable: true },
36
-
37
- domains: { externalName: "Domains", ...string_collection_attribute_writable, configurable: true },
35
+ DNS: { ...string_attribute_writable, configurable: true },
36
+ FallbackDNS: { ...string_attribute_writable, configurable: true },
38
37
 
39
- MulticastDNS: { ...yesno_attribute_writable, configurable: true },
40
- Cache: { ...boolean_attribute_writable, configurable: true },
41
- CacheFromLocalhost: {
42
- ...boolean_attribute_writable,
43
- configurable: true
44
- },
45
- DNSStubListener: { ...boolean_attribute_writable, configurable: true },
46
- DNSStubListenerExtra: {
47
- ...string_attribute_writable,
48
- configurable: true
49
- },
50
- ReadEtcHosts: { ...boolean_attribute_writable, configurable: true },
51
- ResolveUnicastSingleLabel: {
52
- ...boolean_attribute_writable,
53
- configurable: true
54
- },
55
- StaleRetentionSec: {
56
- ...duration_attribute_writable,
57
- configurable: true
58
- },
59
- RefuseRecordTypes: { ...string_attribute_writable, configurable: true },
60
- DNSSEC: {
61
- ...yesno_attribute_writable,
62
- default: false,
63
- configurable: true
64
- },
65
- DNSOverTLS: { ...yesno_attribute_writable, configurable: true },
66
- LLMNR: { ...yesno_attribute_writable, configurable: true }
67
- /* }
38
+ domains: {
39
+ externalName: "Domains",
40
+ ...string_collection_attribute_writable,
41
+ configurable: true
42
+ },
43
+
44
+ MulticastDNS: { ...yesno_attribute_writable, configurable: true },
45
+ Cache: { ...boolean_attribute_writable, configurable: true },
46
+ CacheFromLocalhost: {
47
+ ...boolean_attribute_writable,
48
+ configurable: true
49
+ },
50
+ DNSStubListener: { ...boolean_attribute_writable, configurable: true },
51
+ DNSStubListenerExtra: {
52
+ ...string_attribute_writable,
53
+ configurable: true
54
+ },
55
+ ReadEtcHosts: { ...boolean_attribute_writable, configurable: true },
56
+ ResolveUnicastSingleLabel: {
57
+ ...boolean_attribute_writable,
58
+ configurable: true
59
+ },
60
+ StaleRetentionSec: {
61
+ ...duration_attribute_writable,
62
+ configurable: true
63
+ },
64
+ RefuseRecordTypes: { ...string_attribute_writable, configurable: true },
65
+ DNSSEC: {
66
+ ...yesno_attribute_writable,
67
+ default: false,
68
+ configurable: true
69
+ },
70
+ DNSOverTLS: { ...yesno_attribute_writable, configurable: true },
71
+ LLMNR: { ...yesno_attribute_writable, configurable: true }
72
+ /* }
68
73
  }*/
69
74
  },
70
75
  service: {
@@ -73,15 +78,12 @@ const SystemdResolvedServiceTypeDefinition = {
73
78
  };
74
79
 
75
80
  export class SystemdResolvedService extends ExtraSourceService {
81
+ static typeDefinition = SystemdResolvedServiceTypeDefinition;
76
82
  static {
77
83
  addType(this);
78
84
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
79
85
  }
80
86
 
81
- static get typeDefinition() {
82
- return SystemdResolvedServiceTypeDefinition;
83
- }
84
-
85
87
  get type() {
86
88
  return SystemdResolvedServiceTypeDefinition.name;
87
89
  }
@@ -89,20 +91,18 @@ export class SystemdResolvedService extends ExtraSourceService {
89
91
  systemdConfigs(name) {
90
92
  const options = (lower, upper, limit) => {
91
93
  return {
92
- services: `in("dns",types) && priority>=${lower} && priority<=${upper}`,
94
+ services: `services[types[dns] && priority>=${lower} && priority<=${upper}]`,
93
95
  endpoints: e =>
94
96
  e.family == "IPv4" &&
95
97
  e.networkInterface &&
96
98
  e.networkInterface.kind !== "loopback",
97
- //e.family !== "dns",
99
+ //e.family !== "dns",
98
100
  select: endpoint => endpoint.address,
99
101
  join: " ",
100
102
  limit
101
103
  };
102
104
  };
103
105
 
104
- //console.log([...this.owner.expression('services[in("dns",types) && priority>=300 && priority<=399].owner.name')]);
105
-
106
106
  return {
107
107
  serviceName: this.systemdService,
108
108
  configFileName: `etc/systemd/resolved.conf.d/${name}.conf`,
@@ -14,6 +14,7 @@ import { filterConfigurable, sectionLines } from "../utils.mjs";
14
14
 
15
15
  const SystemdTimesyncdServiceTypeDefinition = {
16
16
  name: "systemd-timesyncd",
17
+ priority: 1,
17
18
  extends: ExtraSourceServiceTypeDefinition,
18
19
  specializationOf: ServiceTypeDefinition,
19
20
  owners: ServiceTypeDefinition.owners,
@@ -33,15 +34,12 @@ const SystemdTimesyncdServiceTypeDefinition = {
33
34
  };
34
35
 
35
36
  export class SystemdTimesyncdService extends ExtraSourceService {
37
+ static typeDefinition = SystemdTimesyncdServiceTypeDefinition;
36
38
  static {
37
39
  addType(this);
38
40
  addServiceType(this.typeDefinition.service, this.typeDefinition.name);
39
41
  }
40
42
 
41
- static get typeDefinition() {
42
- return SystemdTimesyncdServiceTypeDefinition;
43
- }
44
-
45
43
  get type() {
46
44
  return SystemdTimesyncdServiceTypeDefinition.name;
47
45
  }
@@ -49,7 +47,8 @@ export class SystemdTimesyncdService extends ExtraSourceService {
49
47
  systemdConfigs(name) {
50
48
  const options = (lower, upper) => {
51
49
  return {
52
- services: `in("ntp",types) && priority >= ${lower} && priority <= ${upper}`,
50
+ // TODO types[ntp]
51
+ services: `services[in("ntp",types) && priority >= ${lower} && priority <= ${upper}]`,
53
52
  endpoints: e =>
54
53
  e.networkInterface && e.networkInterface.kind !== "loopback",
55
54
  select: endpoint => endpoint.address,
@@ -61,14 +60,11 @@ export class SystemdTimesyncdService extends ExtraSourceService {
61
60
  return {
62
61
  serviceName: this.systemdService,
63
62
  configFileName: `etc/systemd/timesyncd.conf.d/${name}.conf`,
64
- content: sectionLines(
65
- "Time",
66
- {
67
- NTP: serviceEndpoints(this, options(300, 399)),
68
- FallbackNTP: serviceEndpoints(this, options(100, 199)),
69
- ...this.getProperties(filterConfigurable)
70
- })
71
-
63
+ content: sectionLines("Time", {
64
+ NTP: serviceEndpoints(this, options(300, 399)),
65
+ FallbackNTP: serviceEndpoints(this, options(100, 199)),
66
+ ...this.getProperties(filterConfigurable)
67
+ })
72
68
  };
73
69
  }
74
70
  }
@@ -3,6 +3,7 @@ import { ServiceTypeDefinition, Service } from "../service.mjs";
3
3
 
4
4
  export class TailscaleService extends Service {
5
5
  static name = "tailscale";
6
+ static priority = 1;
6
7
  static extends = ServiceTypeDefinition;
7
8
  static specializationOf = ServiceTypeDefinition;
8
9
  static owners = ServiceTypeDefinition.owners;
@@ -18,7 +19,9 @@ export class TailscaleService extends Service {
18
19
  ]
19
20
  };
20
21
 
21
- /*static {
22
+ static typeDefinition = this;
23
+
24
+ static {
22
25
  addType(TailscaleService);
23
- }*/
26
+ }
24
27
  }
package/src/subnet.mjs CHANGED
@@ -6,12 +6,18 @@ import {
6
6
  familyIP,
7
7
  matchPrefixIP
8
8
  } from "ip-utilties";
9
- import { string_attribute, name_attribute, number_attribute, addType } from "pacc";
9
+ import {
10
+ string_attribute,
11
+ name_attribute,
12
+ number_attribute,
13
+ addType
14
+ } from "pacc";
10
15
  import { networks_attribute } from "./network-support.mjs";
11
16
  import { Base } from "./base.mjs";
12
17
 
13
18
  const SubnetTypeDefinition = {
14
19
  name: "subnet",
20
+ priority: 1,
15
21
  owners: ["location", "owner", "network", "root"],
16
22
  constructWithIdentifierOnly: true,
17
23
  key: "address",
@@ -24,15 +30,13 @@ const SubnetTypeDefinition = {
24
30
  };
25
31
 
26
32
  export class Subnet extends Base {
27
- networks = new Set();
33
+ static typeDefinition = SubnetTypeDefinition;
28
34
 
29
35
  static {
30
36
  addType(this);
31
37
  }
32
38
 
33
- static get typeDefinition() {
34
- return SubnetTypeDefinition;
35
- }
39
+ networks = new Set();
36
40
 
37
41
  constructor(owner, address) {
38
42
  const { longPrefix, prefix, prefixLength, cidr } = normalizeCIDR(address);