pmcf 4.1.3 → 4.1.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": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -2,7 +2,11 @@ import { join } from "node:path";
2
2
  import { FileContentProvider } from "npm-pkgbuild";
3
3
  import { boolean_attribute_writable_true, addType } from "pacc";
4
4
  import { addServiceType } from "pmcf";
5
- import { writeLines } from "../utils.mjs";
5
+ import {
6
+ writeLines,
7
+ setionLinesFromPropertyIterator,
8
+ filterConfigurable
9
+ } from "../utils.mjs";
6
10
  import { Service, ServiceTypeDefinition } from "../service.mjs";
7
11
 
8
12
  const InfluxdbServiceTypeDefinition = {
@@ -12,7 +16,8 @@ const InfluxdbServiceTypeDefinition = {
12
16
  owners: ServiceTypeDefinition.owners,
13
17
  key: "name",
14
18
  attributes: {
15
- "metrics-disabled": {
19
+ "metricsDisabled": {
20
+ externalName: "metrics-disabled",
16
21
  ...boolean_attribute_writable_true,
17
22
  configurable: true
18
23
  }
@@ -65,14 +70,11 @@ export class InfluxdbService extends Service {
65
70
  }
66
71
  };
67
72
 
68
- const lines = Object.entries(InfluxdbServiceTypeDefinition.attributes)
69
- .filter(
70
- ([key, attribute]) =>
71
- attribute.configurable && this[key] !== undefined
72
- )
73
- .map(([key]) => `${key}: ${this[key]}`);
74
-
75
- await writeLines(join(dir, "etc", "influxdb"), "config.yml", lines);
73
+ await writeLines(
74
+ join(dir, "etc", "influxdb"),
75
+ "config.yml",
76
+ setionLinesFromPropertyIterator(this.propertyIterator(filterConfigurable))
77
+ );
76
78
 
77
79
  yield packageData;
78
80
  }
@@ -7,7 +7,7 @@ import {
7
7
  addType
8
8
  } from "pacc";
9
9
  import { addServiceType } from "pmcf";
10
- import { writeLines, filterConfigurable } from "../utils.mjs";
10
+ import { writeLines, filterConfigurable, setionLinesFromPropertyIterator } from "../utils.mjs";
11
11
  import { Service, ServiceTypeDefinition } from "../service.mjs";
12
12
 
13
13
  const MosquittoServiceTypeDefinition = {
@@ -85,11 +85,9 @@ export class MosquittoService extends Service {
85
85
  await writeLines(
86
86
  join(dir, "etc", "mosquitto"),
87
87
  "mosquitto.conf",
88
- Object.entries(this.getProperties(filterConfigurable)).map(
89
- ([name, value]) => `${name} ${value}`
90
- )
88
+ setionLinesFromPropertyIterator(this.propertyIterator(filterConfigurable))
91
89
  );
92
-
90
+
93
91
  yield packageData;
94
92
  }
95
93
  }
@@ -1,9 +1,14 @@
1
1
  import { join } from "node:path";
2
2
  import { FileContentProvider } from "npm-pkgbuild";
3
- import { string_attribute_writable, addType } from "pacc";
3
+ import {
4
+ string_attribute_writable,
5
+ number_attribute_writable,
6
+ object_attribute,
7
+ addType
8
+ } from "pacc";
4
9
  import { addServiceType } from "pmcf";
5
10
  import { ServiceTypeDefinition, Service } from "../service.mjs";
6
- import { writeLines } from "../utils.mjs";
11
+ import { writeLines, filterConfigurable } from "../utils.mjs";
7
12
  import { addHook } from "../hooks.mjs";
8
13
 
9
14
  const OpenLDAPServiceTypeDefinition = {
@@ -15,7 +20,28 @@ const OpenLDAPServiceTypeDefinition = {
15
20
  attributes: {
16
21
  baseDN: string_attribute_writable,
17
22
  rootDN: string_attribute_writable,
18
- uri: string_attribute_writable
23
+ uri: string_attribute_writable,
24
+
25
+ DB_CONFIG: {
26
+ ...object_attribute,
27
+ attributes: {
28
+ set_cachesize: {
29
+ ...string_attribute_writable,
30
+ configurable: true,
31
+ default: "0 16777216 1"
32
+ },
33
+ set_lg_regionmax: {
34
+ ...number_attribute_writable,
35
+ configurable: true,
36
+ default: 65536
37
+ },
38
+ set_lg_bsize: {
39
+ ...number_attribute_writable,
40
+ configurable: true,
41
+ default: 524288
42
+ }
43
+ }
44
+ }
19
45
  },
20
46
  service: {
21
47
  systemdService: "slapd.service",
@@ -43,6 +69,7 @@ export class OpenLDAPService extends Service {
43
69
  return OpenLDAPServiceTypeDefinition;
44
70
  }
45
71
 
72
+ DB_CONFIG = {};
46
73
  _baseDN;
47
74
  _rootDN;
48
75
 
@@ -131,6 +158,13 @@ export class OpenLDAPService extends Service {
131
158
  await writeLines(
132
159
  join(packageData.dir, "/var/lib/openldap/openldap-data"),
133
160
  "DB_CONFIG",
161
+
162
+ /*
163
+ ...[...this.propertyIterator(filterConfigurable)].map(
164
+ ([name, value]) => `${name} ${value}`
165
+ )
166
+ */
167
+
134
168
  this.expand([
135
169
  "set_cachesize 0 16777216 1",
136
170
  "set_lg_regionmax 65536",
@@ -743,7 +743,7 @@ export class InfluxdbService extends Service {
743
743
  })[];
744
744
  key: string;
745
745
  attributes: {
746
- "metrics-disabled": {
746
+ metricsDisabled: {
747
747
  configurable: boolean;
748
748
  type: object;
749
749
  isKey: boolean;
@@ -761,7 +761,7 @@ export class InfluxdbService extends Service {
761
761
  toInternal?: Function;
762
762
  toExternal?: Function;
763
763
  values?: Set<any>;
764
- externalName?: string;
764
+ externalName: string;
765
765
  env?: string[] | string;
766
766
  additionalValues?: object;
767
767
  };
@@ -746,6 +746,95 @@ export class OpenLDAPService extends Service {
746
746
  baseDN: import("pacc").AttributeDefinition;
747
747
  rootDN: import("pacc").AttributeDefinition;
748
748
  uri: import("pacc").AttributeDefinition;
749
+ DB_CONFIG: {
750
+ attributes: {
751
+ set_cachesize: {
752
+ configurable: boolean;
753
+ default: string;
754
+ type: object;
755
+ isKey: boolean;
756
+ writable: boolean;
757
+ mandatory: boolean;
758
+ collection: boolean;
759
+ private?: boolean;
760
+ credential?: boolean;
761
+ persistent?: boolean;
762
+ depends?: string;
763
+ description?: string;
764
+ set?: Function;
765
+ get?: Function;
766
+ toInternal?: Function;
767
+ toExternal?: Function;
768
+ values?: Set<any>;
769
+ externalName?: string;
770
+ env?: string[] | string;
771
+ additionalValues?: object;
772
+ };
773
+ set_lg_regionmax: {
774
+ configurable: boolean;
775
+ default: number;
776
+ type: object;
777
+ isKey: boolean;
778
+ writable: boolean;
779
+ mandatory: boolean;
780
+ collection: boolean;
781
+ private?: boolean;
782
+ credential?: boolean;
783
+ persistent?: boolean;
784
+ depends?: string;
785
+ description?: string;
786
+ set?: Function;
787
+ get?: Function;
788
+ toInternal?: Function;
789
+ toExternal?: Function;
790
+ values?: Set<any>;
791
+ externalName?: string;
792
+ env?: string[] | string;
793
+ additionalValues?: object;
794
+ };
795
+ set_lg_bsize: {
796
+ configurable: boolean;
797
+ default: number;
798
+ type: object;
799
+ isKey: boolean;
800
+ writable: boolean;
801
+ mandatory: boolean;
802
+ collection: boolean;
803
+ private?: boolean;
804
+ credential?: boolean;
805
+ persistent?: boolean;
806
+ depends?: string;
807
+ description?: string;
808
+ set?: Function;
809
+ get?: Function;
810
+ toInternal?: Function;
811
+ toExternal?: Function;
812
+ values?: Set<any>;
813
+ externalName?: string;
814
+ env?: string[] | string;
815
+ additionalValues?: object;
816
+ };
817
+ };
818
+ type: object;
819
+ isKey: boolean;
820
+ writable: boolean;
821
+ mandatory: boolean;
822
+ collection: boolean;
823
+ private?: boolean;
824
+ credential?: boolean;
825
+ persistent?: boolean;
826
+ depends?: string;
827
+ description?: string;
828
+ default?: any;
829
+ set?: Function;
830
+ get?: Function;
831
+ toInternal?: Function;
832
+ toExternal?: Function;
833
+ values?: Set<any>;
834
+ externalName?: string;
835
+ env?: string[] | string;
836
+ additionalValues?: object;
837
+ };
749
838
  };
750
839
  service: {
751
840
  systemdService: string;
@@ -760,6 +849,7 @@ export class OpenLDAPService extends Service {
760
849
  };
761
850
  };
762
851
  };
852
+ DB_CONFIG: {};
763
853
  _baseDN: any;
764
854
  _rootDN: any;
765
855
  get type(): string;