pmcf 6.8.2 → 6.8.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.8.2",
3
+ "version": "6.8.4",
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.7.0",
55
+ "ip-utilties": "^3.7.1",
56
56
  "npm-pkgbuild": "^20.8.2",
57
57
  "pacc": "^10.4.1",
58
58
  "package-directory": "^8.2.0",
package/src/dns-utils.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { decodeIPv4, decodeIPv6 } from "ip-utilties";
1
+ import { decodeIPv4, decodeIPv6, FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
2
2
  import { asIterator } from "./utils.mjs";
3
3
 
4
4
  const typeOrder = {
@@ -109,6 +109,10 @@ export class NetworkInterface extends SkeletonNetworkInterface {
109
109
  }
110
110
 
111
111
  get domainNames() {
112
+ if(!this.host) {
113
+ //console.log("NO HOST",this.fullName);
114
+ return new Set();
115
+ }
112
116
  return this.hostName
113
117
  ? this.host.directDomainNames.union(
114
118
  new Set([[this.hostName, this.host.domain].join(".")])
@@ -156,20 +156,12 @@ class bind_group extends Base {
156
156
  }
157
157
 
158
158
  async packageContent(outputControl) {
159
- let hasContent = false;
160
-
161
- if (this.access.length) {
162
- hasContent ||= await this.generateACLs(outputControl);
163
- }
164
-
165
- if (this.entries.length) {
166
- hasContent ||= await this.generateZoneDefs(outputControl, this.entries);
167
- }
168
-
169
- return hasContent;
159
+ return await this.generateACLs(outputControl) && await this.generateZoneDefs(outputControl, this.entries);
170
160
  }
171
161
 
172
162
  async generateACLs(outputControl) {
163
+ console.log("generateACLs", this.name);
164
+
173
165
  const acls = addressesStatement(
174
166
  `acl ${this.name}`,
175
167
  addresses(this.access, { aggregate: true })
@@ -181,12 +173,16 @@ class bind_group extends Base {
181
173
  `0-acl-${this.name}.conf`,
182
174
  acls
183
175
  );
176
+
177
+ return true;
184
178
  }
185
179
 
186
- return acls.length > 0;
180
+ return false;
187
181
  }
188
182
 
189
183
  async generateZoneDefs(outputControl, sources) {
184
+ console.log("generateZoneDefs", this.name);
185
+
190
186
  for (const source of sources) {
191
187
  console.log(
192
188
  "ZONE",
@@ -195,7 +191,7 @@ class bind_group extends Base {
195
191
  );
196
192
 
197
193
  for (const domain of source.localDomains) {
198
- const locationName = source.owner.name;
194
+ const locationName = source.name;
199
195
  const reverseZones = new Map();
200
196
 
201
197
  const config = {
@@ -504,18 +500,16 @@ export class bind extends ExtraSourceService {
504
500
  }
505
501
 
506
502
  async *preparePackages(dir) {
507
- const basePackageDir = dir;
508
503
  const packageData = this.packageData;
509
- packageData.sources.push(new FileContentProvider(basePackageDir));
504
+ packageData.sources.push(new FileContentProvider(dir));
510
505
 
511
- const outputControl = newOutputControl(packageData, basePackageDir);
506
+ const outputControl = newOutputControl(packageData, dir);
512
507
 
513
508
  let hasContent = false;
514
509
 
515
- console.log("BIND GROUPS", [...this.groups.keys()]);
516
-
517
510
  for (const group of this.groups.values()) {
518
- hasContent ||= await group.packageContent(outputControl);
511
+ const present = await group.packageContent(outputControl);
512
+ hasContent ||= present;
519
513
  }
520
514
 
521
515
  hasContent ||= await this.writeForwarders(outputControl);
@@ -40,7 +40,7 @@ export class chrony extends ExtraSourceService {
40
40
  const packageData = this.packageData;
41
41
  packageData.sources.push(new FileContentProvider(dir + "/"));
42
42
 
43
- const subnets = [...new Set([...this.subnets.values()])]; // TODO should be normal
43
+ const subnets = [...new Map(this.subnets).values()]; // TODO should be normal
44
44
  const host = this.host;
45
45
 
46
46
  const lines = [
@@ -147,13 +147,13 @@ export class kea extends CoreService {
147
147
  const source = host.owner;
148
148
  const name = host.name;
149
149
 
150
- const subnets = [
151
- ...new Set(
152
- [...this.subnets.values()].filter(
153
- s => s !== SUBNET_LOCALHOST_IPV4 && s !== SUBNET_LOCALHOST_IPV6
154
- )
155
- )
156
- ]; // TODO should be normal
150
+ const subnets = [...new Map(this.subnets).values()].filter(
151
+ s => s !== SUBNET_LOCALHOST_IPV4 && s !== SUBNET_LOCALHOST_IPV6
152
+ ); // TODO should be normal
153
+ /*console.log(
154
+ "SUBNETS",
155
+ subnets.map(s => s.fullName)
156
+ );*/
157
157
 
158
158
  //console.log(source.fullName, [...source.hosts.keys()]);
159
159
 
@@ -45,6 +45,7 @@ export class mosquitto extends CoreService {
45
45
  }
46
46
 
47
47
  async *preparePackages(dir) {
48
+ /*
48
49
  const pm = this.root.named("/services/primary-SW/mosquitto");
49
50
  const wd = [...this.walkDirections(["this", "extends"])];
50
51
 
@@ -55,7 +56,7 @@ export class mosquitto extends CoreService {
55
56
  pm.fullName,
56
57
  [...pm.extends].map(n => n.fullName),
57
58
  wd.map(n => [n.fullName, n.directory])
58
- );
59
+ );*/
59
60
 
60
61
  const permissions = this.packageContentPermissions;
61
62
  const packageData = this.packageData;