pmcf 4.5.1 → 4.5.3
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 +3 -3
- package/src/base.mjs +10 -3
- package/src/services/openldap.mjs +18 -42
- package/types/base.d.mts +1 -0
- package/types/services/openldap.d.mts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"content-entry-transform": "^1.5.
|
|
56
|
+
"content-entry-transform": "^1.5.18",
|
|
57
57
|
"ip-utilties": "^2.0.2",
|
|
58
|
-
"npm-pkgbuild": "^
|
|
58
|
+
"npm-pkgbuild": "^20.0.1",
|
|
59
59
|
"pacc": "^8.0.2",
|
|
60
60
|
"package-directory": "^8.1.0"
|
|
61
61
|
},
|
package/src/base.mjs
CHANGED
|
@@ -306,13 +306,20 @@ export class Base {
|
|
|
306
306
|
return this.owner.addObject(object);
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
*
|
|
309
|
+
*_allExtends(all) {
|
|
310
310
|
for (const e of this.extends) {
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
if (!all.has(e)) {
|
|
312
|
+
all.add(e);
|
|
313
|
+
yield e;
|
|
314
|
+
yield* e._allExtends(all);
|
|
315
|
+
}
|
|
313
316
|
}
|
|
314
317
|
}
|
|
315
318
|
|
|
319
|
+
*allExtends() {
|
|
320
|
+
yield* this._allExtends(new Set());
|
|
321
|
+
}
|
|
322
|
+
|
|
316
323
|
*owners() {
|
|
317
324
|
if (this.owner) {
|
|
318
325
|
yield* this.owner.thisAndOwners();
|
|
@@ -8,9 +8,11 @@ import {
|
|
|
8
8
|
} from "pacc";
|
|
9
9
|
import { addServiceType } from "pmcf";
|
|
10
10
|
import { ServiceTypeDefinition, Service } from "../service.mjs";
|
|
11
|
-
import { writeLines, filterConfigurable } from "../utils.mjs";
|
|
12
11
|
import { addHook } from "../hooks.mjs";
|
|
13
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
createExpressionTransformer,
|
|
14
|
+
transform
|
|
15
|
+
} from "content-entry-transform";
|
|
14
16
|
|
|
15
17
|
const OpenLDAPServiceTypeDefinition = {
|
|
16
18
|
name: "openldap",
|
|
@@ -65,7 +67,6 @@ export class OpenLDAPService extends Service {
|
|
|
65
67
|
return OpenLDAPServiceTypeDefinition;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
DB_CONFIG = {};
|
|
69
70
|
_baseDN;
|
|
70
71
|
_rootDN;
|
|
71
72
|
|
|
@@ -114,18 +115,25 @@ export class OpenLDAPService extends Service {
|
|
|
114
115
|
group
|
|
115
116
|
};
|
|
116
117
|
const transformers = [
|
|
117
|
-
createExpressionTransformer(e => true, {
|
|
118
|
+
createExpressionTransformer(e => true, {
|
|
119
|
+
base: this.baseDN,
|
|
120
|
+
uri: this.uri
|
|
121
|
+
})
|
|
118
122
|
];
|
|
119
123
|
|
|
120
124
|
const templateDirs = [];
|
|
121
125
|
for (const e of [...this.allExtends(), this]) {
|
|
122
|
-
const
|
|
126
|
+
const dir = join(e.directory, "content") + "/";
|
|
127
|
+
console.log("DIR", dir);
|
|
123
128
|
templateDirs.push(
|
|
124
|
-
transform(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
transform(
|
|
130
|
+
new FileContentProvider(
|
|
131
|
+
{ transformers, dir },
|
|
132
|
+
entryProperties,
|
|
133
|
+
directoryProperties
|
|
134
|
+
),
|
|
135
|
+
transformers
|
|
136
|
+
)
|
|
129
137
|
);
|
|
130
138
|
}
|
|
131
139
|
|
|
@@ -157,38 +165,6 @@ export class OpenLDAPService extends Service {
|
|
|
157
165
|
`setfacl -m u:${owner}:r /etc/letsencrypt/archive/*/privkey*.pem`
|
|
158
166
|
);
|
|
159
167
|
|
|
160
|
-
await writeLines(
|
|
161
|
-
join(packageData.dir, "etc/conf.d"),
|
|
162
|
-
"slapd",
|
|
163
|
-
this.expand([
|
|
164
|
-
"SLAPD_OPTIONS=",
|
|
165
|
-
"SLAPD_URLS=ldap:/// ldaps:/// ldapi://%2Frun%2Fldapi"
|
|
166
|
-
])
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
await writeLines(
|
|
170
|
-
join(packageData.dir, "/var/lib/openldap/openldap-data"),
|
|
171
|
-
"DB_CONFIG",
|
|
172
|
-
|
|
173
|
-
/*
|
|
174
|
-
...[...this.propertyIterator(filterConfigurable)].map(
|
|
175
|
-
([name, value]) => `${name} ${value}`
|
|
176
|
-
)
|
|
177
|
-
*/
|
|
178
|
-
|
|
179
|
-
this.expand([
|
|
180
|
-
"set_cachesize 0 16777216 1",
|
|
181
|
-
"set_lg_regionmax 65536",
|
|
182
|
-
"set_lg_bsize 524288"
|
|
183
|
-
])
|
|
184
|
-
);
|
|
185
|
-
|
|
186
|
-
await writeLines(
|
|
187
|
-
join(packageData.dir, "etc/openldap"),
|
|
188
|
-
"ldap.conf",
|
|
189
|
-
this.expand([`BASE ${this.baseDN}`, `URI ${this.uri}`])
|
|
190
|
-
);
|
|
191
|
-
|
|
192
168
|
yield packageData;
|
|
193
169
|
}
|
|
194
170
|
}
|
package/types/base.d.mts
CHANGED
|
@@ -60,6 +60,7 @@ export class Base {
|
|
|
60
60
|
named(name: any): void;
|
|
61
61
|
typeNamed(typeName: any, name: any): any;
|
|
62
62
|
addObject(object: any): any;
|
|
63
|
+
_allExtends(all: any): Generator<any, void, any>;
|
|
63
64
|
allExtends(): Generator<any, void, any>;
|
|
64
65
|
owners(): any;
|
|
65
66
|
thisAndOwners(): any;
|