@entity-access/server-pages 1.0.31 → 1.0.33

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 (31) hide show
  1. package/dist/ServerPages.d.ts +4 -4
  2. package/dist/ServerPages.d.ts.map +1 -1
  3. package/dist/ServerPages.js +11 -6
  4. package/dist/ServerPages.js.map +1 -1
  5. package/dist/ssl/{ACME.d.ts → AcmeCertificateService.d.ts} +3 -2
  6. package/dist/ssl/AcmeCertificateService.d.ts.map +1 -0
  7. package/dist/ssl/{ACME.js → AcmeCertificateService.js} +17 -39
  8. package/dist/ssl/AcmeCertificateService.js.map +1 -0
  9. package/dist/ssl/{ChallengeStore.d.ts → AcmeChallengeStore.d.ts} +2 -3
  10. package/dist/ssl/AcmeChallengeStore.d.ts.map +1 -0
  11. package/dist/ssl/{ChallengeStore.js → AcmeChallengeStore.js} +2 -2
  12. package/dist/ssl/AcmeChallengeStore.js.map +1 -0
  13. package/dist/ssl/CertificateStore.d.ts +15 -0
  14. package/dist/ssl/CertificateStore.d.ts.map +1 -0
  15. package/dist/ssl/CertificateStore.js +65 -0
  16. package/dist/ssl/CertificateStore.js.map +1 -0
  17. package/dist/ssl/ChallengeServer.d.ts +5 -0
  18. package/dist/ssl/ChallengeServer.d.ts.map +1 -0
  19. package/dist/ssl/ChallengeServer.js +45 -0
  20. package/dist/ssl/ChallengeServer.js.map +1 -0
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +1 -1
  23. package/src/ServerPages.ts +15 -8
  24. package/src/ssl/{ACME.ts → AcmeCertificateService.ts} +225 -247
  25. package/src/ssl/{ChallengeStore.ts → AcmeChallengeStore.ts} +25 -25
  26. package/src/ssl/CertificateStore.ts +68 -0
  27. package/src/ssl/ChallengeServer.ts +34 -0
  28. package/dist/ssl/ACME.d.ts.map +0 -1
  29. package/dist/ssl/ACME.js.map +0 -1
  30. package/dist/ssl/ChallengeStore.d.ts.map +0 -1
  31. package/dist/ssl/ChallengeStore.js.map +0 -1
@@ -1,247 +1,225 @@
1
- import * as forge from "node-forge";
2
- import * as crypto from "crypto";
3
- import * as acme from "acme-client";
4
- import DateTime from "@entity-access/entity-access/dist/types/DateTime.js";
5
- import cluster from "cluster";
6
- import { existsSync, writeFileSync, readFileSync, unlinkSync, mkdirSync } from "fs";
7
- import { join } from "path"
8
- import ensureDir, { deleteIfExists } from "../core/FileApi.js";
9
- import Inject, { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
10
- import ChallengeStore from "./ChallengeStore.js";
11
- import * as tls from "node:tls";
12
-
13
- export interface IAcmeOptions {
14
- sslMode?: string,
15
- accountPrivateKeyPath?: string,
16
- emailAddress?: string,
17
- mode?: "production" | "self-signed" | "staging",
18
- endPoint?: string,
19
- eabKid?: string,
20
- eabHmac?: string
21
- }
22
-
23
- export interface ICertOptions extends IAcmeOptions {
24
- host: string,
25
- };
26
-
27
- @RegisterSingleton
28
- export default class ACME {
29
-
30
- @Inject
31
- private challengeStore: ChallengeStore;
32
-
33
- private map = new Map<string, tls.SecureContext>();
34
-
35
- public async getSecureContext(options: ICertOptions) {
36
- const { host } = options;
37
- let sc = this.map.get(host);
38
- if (sc) {
39
- return sc;
40
- }
41
-
42
- const { key , cert } = await this.setup(options)
43
- sc = tls.createSecureContext({ cert, key });
44
- this.map.set(host, sc);
45
- return sc;
46
- }
47
-
48
- public async setup({
49
- host,
50
- sslMode = "./",
51
- accountPrivateKeyPath = "./",
52
- emailAddress = "",
53
- mode = "production" as "production" | "self-signed" | "staging",
54
- endPoint = "",
55
- eabKid = "",
56
- eabHmac = ""
57
- }) {
58
-
59
- if (mode === "self-signed") {
60
- return this.setupSelfSigned(sslMode);
61
- }
62
-
63
- const hostRoot = join(sslMode, host);
64
-
65
- ensureDir(hostRoot);
66
-
67
- const keyPath = join(hostRoot, "cert.key");
68
- const certPath = join(hostRoot, "cert.crt");
69
-
70
- const logs = [];
71
-
72
- try {
73
-
74
- const maintainerEmail = emailAddress;
75
-
76
- let externalAccountBinding;
77
-
78
- if (eabKid) {
79
- externalAccountBinding = {
80
- kid: eabKid,
81
- hmacKey: eabHmac
82
- };
83
- }
84
-
85
- let cert:string;
86
- let key:string;
87
-
88
- if (!existsSync(keyPath)) {
89
- deleteIfExists(certPath);
90
- key = (await acme.crypto.createPrivateRsaKey()).toString();
91
- writeFileSync(keyPath, key);
92
- console.log(`Creating key at ${keyPath}`);
93
- } else {
94
- key = readFileSync(keyPath, "utf8");
95
- }
96
-
97
- // load cert...
98
- if (existsSync(certPath)) {
99
- cert = readFileSync(certPath, "utf8");
100
- const certificate = new crypto.X509Certificate(cert);
101
- const validTo = DateTime.parse(certificate.validTo).diff(DateTime.now);
102
- if (validTo.totalDays > 30) {
103
- console.log(`Reusing certificate, valid for ${validTo.totalDays}`);
104
- return { cert , key };
105
- }
106
- console.log(`Deleting old certificates`);
107
- unlinkSync(certPath);
108
- }
109
-
110
- if (!cluster.isPrimary) {
111
- console.log(`Generating Self Signed SSL Certificate for ${host} in cluster worker. Contact administrator.`);
112
- return this.setupSelfSigned();
113
- }
114
-
115
- let accountKey;
116
- if( existsSync(accountPrivateKeyPath) ) {
117
- console.log("Reusing the account private key.");
118
- accountKey = readFileSync(accountPrivateKeyPath);
119
- } else {
120
- console.log("Creating new private key.");
121
- accountKey = await acme.crypto.createPrivateKey();
122
- writeFileSync(accountPrivateKeyPath, accountKey);
123
- }
124
-
125
- acme.setLogger((message) => {
126
- // console.log(message);
127
- logs.push(message);
128
- });
129
-
130
- let altNames;
131
-
132
- // auto renew...
133
- const client = new acme.Client({
134
- directoryUrl: endPoint || acme.directory.letsencrypt[mode],
135
- accountKey,
136
- externalAccountBinding,
137
- });
138
-
139
- /* Create CSR */
140
- const [csrKey, csr] = await acme.crypto.createCsr({
141
- commonName: host,
142
- altNames
143
- }, key);
144
-
145
-
146
-
147
- /* Certificate */
148
- cert = await client.auto({
149
- csr,
150
- email: maintainerEmail,
151
- termsOfServiceAgreed: true,
152
- skipChallengeVerification: true,
153
- challengePriority: ["http-01"],
154
- challengeCreateFn: (authz, challenge, keyAuthorization) => {
155
- if (challenge.type !== "http-01") {
156
- return;
157
- }
158
- return this.challengeStore.save(challenge.token, keyAuthorization);
159
- },
160
- challengeRemoveFn: (authz, challenge, keyAuthorization) => {
161
- return this.challengeStore.remove(challenge.token);
162
- },
163
- });
164
-
165
- writeFileSync(certPath, cert);
166
-
167
- return { cert, key };
168
- } catch (error) {
169
- console.log(logs.join("\n"));
170
- console.error(error);
171
- throw error;
172
- }
173
- }
174
-
175
- public setupSelfSigned(sslMode = "./") {
176
-
177
- const selfSigned = `${sslMode}/self-signed/`;
178
-
179
- ensureDir(selfSigned);
180
-
181
- const certPath = `${selfSigned}/cert.crt`;
182
- const keyPath = `${selfSigned}/key.pem`;
183
-
184
- let key;
185
- let cert;
186
-
187
- if (existsSync(certPath) && existsSync(keyPath)) {
188
- key = readFileSync(keyPath);
189
- cert = readFileSync(certPath);
190
- return { key, cert };
191
- }
192
-
193
- const pki = forge.default.pki;
194
-
195
- // generate a key pair or use one you have already
196
- const keys = pki.rsa.generateKeyPair(2048);
197
-
198
- // create a new certificate
199
- const crt = pki.createCertificate();
200
-
201
- // fill the required fields
202
- crt.publicKey = keys.publicKey;
203
- crt.serialNumber = '01';
204
- crt.validity.notBefore = new Date();
205
- crt.validity.notAfter = new Date();
206
- crt.validity.notAfter.setFullYear(crt.validity.notBefore.getFullYear() + 40);
207
-
208
- // use your own attributes here, or supply a csr (check the docs)
209
- const attrs = [
210
- {
211
- name: 'commonName',
212
- value: 'dev.socialmail.in'
213
- }, {
214
- name: 'countryName',
215
- value: 'IN'
216
- }, {
217
- shortName: 'ST',
218
- value: 'Maharashtra'
219
- }, {
220
- name: 'localityName',
221
- value: 'Navi Mumbai'
222
- }, {
223
- name: 'organizationName',
224
- value: 'NeuroSpeech Technologies Pvt Ltd'
225
- }, {
226
- shortName: 'OU',
227
- value: 'Test'
228
- }
229
- ];
230
-
231
- // here we set subject and issuer as the same one
232
- crt.setSubject(attrs);
233
- crt.setIssuer(attrs);
234
-
235
- // the actual certificate signing
236
- crt.sign(keys.privateKey);
237
-
238
- // now convert the Forge certificate to PEM format
239
- cert = pki.certificateToPem(crt);
240
- key = pki.privateKeyToPem(keys.privateKey);
241
-
242
- writeFileSync(certPath, cert);
243
- writeFileSync(keyPath, key);
244
-
245
- return { key, cert };
246
- }
247
- }
1
+ import * as forge from "node-forge";
2
+ import * as crypto from "crypto";
3
+ import * as acme from "acme-client";
4
+ import DateTime from "@entity-access/entity-access/dist/types/DateTime.js";
5
+ import cluster from "cluster";
6
+ import { existsSync, writeFileSync, readFileSync, unlinkSync, mkdirSync } from "fs";
7
+ import { join } from "path"
8
+ import ensureDir, { deleteIfExists } from "../core/FileApi.js";
9
+ import Inject, { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
10
+ import ChallengeStore from "./AcmeChallengeStore.js";
11
+ import * as tls from "node:tls";
12
+ import CertificateStore from "./CertificateStore.js";
13
+
14
+ export interface IAcmeOptions {
15
+ sslMode?: string,
16
+ accountPrivateKeyPath?: string,
17
+ emailAddress?: string,
18
+ mode?: "production" | "self-signed" | "staging",
19
+ endPoint?: string,
20
+ eabKid?: string,
21
+ eabHmac?: string
22
+ }
23
+
24
+ export interface ICertOptions extends IAcmeOptions {
25
+ host: string,
26
+ };
27
+
28
+ @RegisterSingleton
29
+ export default class AcmeCertficateService {
30
+
31
+ @Inject
32
+ private challengeStore: ChallengeStore;
33
+
34
+ @Inject
35
+ private certificateStore: CertificateStore;
36
+
37
+ private map = new Map<string, tls.SecureContext>();
38
+
39
+ public async getSecureContext(options: ICertOptions) {
40
+ const { host } = options;
41
+ let sc = this.map.get(host);
42
+ if (sc) {
43
+ return sc;
44
+ }
45
+
46
+ const { key , cert } = await this.setup(options)
47
+ sc = tls.createSecureContext({ cert, key });
48
+ this.map.set(host, sc);
49
+ return sc;
50
+ }
51
+
52
+ public async setup({
53
+ host,
54
+ sslMode = "./",
55
+ accountPrivateKeyPath = "./",
56
+ emailAddress = "",
57
+ mode = "production" as "production" | "self-signed" | "staging",
58
+ endPoint = "",
59
+ eabKid = "",
60
+ eabHmac = ""
61
+ }) {
62
+
63
+ if (mode === "self-signed") {
64
+ return this.setupSelfSigned(sslMode);
65
+ }
66
+
67
+ const hostRoot = join(sslMode, host);
68
+
69
+ ensureDir(hostRoot);
70
+
71
+ const keyPath = join(hostRoot, "cert.key");
72
+ const certPath = join(hostRoot, "cert.crt");
73
+
74
+ const logs = [];
75
+
76
+ try {
77
+
78
+ const maintainerEmail = emailAddress;
79
+
80
+ let externalAccountBinding;
81
+
82
+ if (eabKid) {
83
+ externalAccountBinding = {
84
+ kid: eabKid,
85
+ hmacKey: eabHmac
86
+ };
87
+ }
88
+
89
+ let { cert, key } = await this.certificateStore.get({ host });
90
+
91
+ // load cert...
92
+ if (cert) {
93
+ const certificate = new crypto.X509Certificate(cert);
94
+ const validTo = DateTime.parse(certificate.validTo).diff(DateTime.now);
95
+ if (validTo.totalDays > 30) {
96
+ console.log(`Reusing certificate, valid for ${validTo.totalDays}`);
97
+ return { cert , key };
98
+ }
99
+ }
100
+
101
+ const accountKey = await this.certificateStore.getAccountKey();
102
+
103
+ acme.setLogger((message) => {
104
+ // console.log(message);
105
+ logs.push(message);
106
+ });
107
+
108
+ let altNames;
109
+
110
+ // auto renew...
111
+ const client = new acme.Client({
112
+ directoryUrl: endPoint || acme.directory.letsencrypt[mode],
113
+ accountKey,
114
+ externalAccountBinding,
115
+ });
116
+
117
+ /* Create CSR */
118
+ const [csrKey, csr] = await acme.crypto.createCsr({
119
+ commonName: host,
120
+ altNames
121
+ }, key);
122
+
123
+
124
+
125
+ /* Certificate */
126
+ cert = await client.auto({
127
+ csr,
128
+ email: maintainerEmail,
129
+ termsOfServiceAgreed: true,
130
+ skipChallengeVerification: true,
131
+ challengePriority: ["http-01"],
132
+ challengeCreateFn: (authz, challenge, keyAuthorization) => {
133
+ if (challenge.type !== "http-01") {
134
+ return;
135
+ }
136
+ return this.challengeStore.save(challenge.token, keyAuthorization);
137
+ },
138
+ challengeRemoveFn: (authz, challenge, keyAuthorization) => {
139
+ return this.challengeStore.remove(challenge.token);
140
+ },
141
+ });
142
+
143
+ writeFileSync(certPath, cert);
144
+
145
+ return { cert, key };
146
+ } catch (error) {
147
+ console.log(logs.join("\n"));
148
+ console.error(error);
149
+ throw error;
150
+ }
151
+ }
152
+
153
+ public setupSelfSigned(sslMode = "./") {
154
+
155
+ const selfSigned = `${sslMode}/self-signed/`;
156
+
157
+ ensureDir(selfSigned);
158
+
159
+ const certPath = `${selfSigned}/cert.crt`;
160
+ const keyPath = `${selfSigned}/key.pem`;
161
+
162
+ let key;
163
+ let cert;
164
+
165
+ if (existsSync(certPath) && existsSync(keyPath)) {
166
+ key = readFileSync(keyPath);
167
+ cert = readFileSync(certPath);
168
+ return { key, cert };
169
+ }
170
+
171
+ const pki = forge.default.pki;
172
+
173
+ // generate a key pair or use one you have already
174
+ const keys = pki.rsa.generateKeyPair(2048);
175
+
176
+ // create a new certificate
177
+ const crt = pki.createCertificate();
178
+
179
+ // fill the required fields
180
+ crt.publicKey = keys.publicKey;
181
+ crt.serialNumber = '01';
182
+ crt.validity.notBefore = new Date();
183
+ crt.validity.notAfter = new Date();
184
+ crt.validity.notAfter.setFullYear(crt.validity.notBefore.getFullYear() + 40);
185
+
186
+ // use your own attributes here, or supply a csr (check the docs)
187
+ const attrs = [
188
+ {
189
+ name: 'commonName',
190
+ value: 'dev.socialmail.in'
191
+ }, {
192
+ name: 'countryName',
193
+ value: 'IN'
194
+ }, {
195
+ shortName: 'ST',
196
+ value: 'Maharashtra'
197
+ }, {
198
+ name: 'localityName',
199
+ value: 'Navi Mumbai'
200
+ }, {
201
+ name: 'organizationName',
202
+ value: 'NeuroSpeech Technologies Pvt Ltd'
203
+ }, {
204
+ shortName: 'OU',
205
+ value: 'Test'
206
+ }
207
+ ];
208
+
209
+ // here we set subject and issuer as the same one
210
+ crt.setSubject(attrs);
211
+ crt.setIssuer(attrs);
212
+
213
+ // the actual certificate signing
214
+ crt.sign(keys.privateKey);
215
+
216
+ // now convert the Forge certificate to PEM format
217
+ cert = pki.certificateToPem(crt);
218
+ key = pki.privateKeyToPem(keys.privateKey);
219
+
220
+ writeFileSync(certPath, cert);
221
+ writeFileSync(keyPath, key);
222
+
223
+ return { key, cert };
224
+ }
225
+ }
@@ -1,26 +1,26 @@
1
- import { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
2
- import ensureDir from "../core/FileApi.js";
3
- import { readFileSync, unlinkSync, writeFileSync } from "fs";
4
- import { join } from "node:path";
5
-
6
- const path = "./challenges";
7
-
8
- @RegisterSingleton
9
- export default class ChallengeStore {
10
-
11
- constructor() {
12
- ensureDir(path);
13
- }
14
-
15
- async get(name: string) {
16
- return readFileSync(join(path, name));
17
- }
18
-
19
- async save(name: string, value: string) {
20
- writeFileSync(join(path, name), value, "utf8");
21
- }
22
-
23
- async remove(name: string) {
24
- unlinkSync(join(path, name));
25
- }
1
+ import { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
2
+ import ensureDir from "../core/FileApi.js";
3
+ import { readFileSync, unlinkSync, writeFileSync } from "fs";
4
+ import { join } from "node:path";
5
+
6
+ const path = "./challenges";
7
+
8
+ @RegisterSingleton
9
+ export default class ChallengeStore {
10
+
11
+ constructor() {
12
+ ensureDir(path);
13
+ }
14
+
15
+ async get(name: string) {
16
+ return readFileSync(join(path, name), "utf8");
17
+ }
18
+
19
+ async save(name: string, value: string) {
20
+ writeFileSync(join(path, name), value, "utf8");
21
+ }
22
+
23
+ async remove(name: string) {
24
+ unlinkSync(join(path, name));
25
+ }
26
26
  }
@@ -0,0 +1,68 @@
1
+ import { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
2
+ import { join } from "node:path";
3
+ import ensureDir from "../core/FileApi.js";
4
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
5
+ import * as acme from "acme-client";
6
+
7
+ export interface ICertificate {
8
+ host?: string;
9
+ key?: Buffer;
10
+ cert?: string;
11
+ }
12
+
13
+ let folder = "./certs";
14
+
15
+ @RegisterSingleton
16
+ export default class CertificateStore {
17
+
18
+ public get folder() {
19
+ return folder;
20
+ }
21
+
22
+ public set folder(v: string) {
23
+ folder = v;
24
+ }
25
+
26
+ public async getAccountKey() {
27
+ const keyPath = join(folder, "keys");
28
+ let key: Buffer;
29
+ ensureDir(keyPath);
30
+ if (!existsSync(keyPath)) {
31
+ key = await acme.crypto.createPrivateRsaKey();
32
+ writeFileSync(keyPath, key);
33
+ console.log(`Creating New Account key: ${keyPath}`);
34
+ } else {
35
+ key = readFileSync(keyPath);
36
+ }
37
+ return key;
38
+ }
39
+
40
+ public async get( { host }: ICertificate): Promise<ICertificate> {
41
+ const { certPath, keyPath } = this.getPaths(folder, host);
42
+ const cert = existsSync(certPath) ? readFileSync(certPath, "utf8") : "";
43
+ let key: Buffer;
44
+ if (!existsSync(keyPath)) {
45
+ key = await acme.crypto.createPrivateRsaKey();
46
+ writeFileSync(keyPath, key);
47
+ console.log(`Creating New key: ${keyPath}`);
48
+ } else {
49
+ key = readFileSync(keyPath);
50
+ }
51
+ return { host, cert, key };
52
+ }
53
+
54
+ public async save({ host, cert, key }: ICertificate) {
55
+ const { certPath, keyPath } = this.getPaths(folder, host);
56
+ writeFileSync(certPath, cert, "utf8");
57
+ writeFileSync(keyPath, key);
58
+ }
59
+
60
+ private getPaths(folder: string, host: string) {
61
+ const hostRoot = join(folder, host);
62
+ ensureDir(hostRoot);
63
+ const certPath = join(hostRoot, "cert.crt");
64
+ const keyPath = join(hostRoot, "key.pem");
65
+ return { certPath, keyPath }
66
+ }
67
+
68
+ }
@@ -0,0 +1,34 @@
1
+ import * as http from "node:http";
2
+ import Inject, { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
3
+ import ChallengeStore from "./AcmeChallengeStore.js";
4
+
5
+ @RegisterSingleton
6
+ export default class ChallengeServer {
7
+
8
+ @Inject
9
+ private challengeStore: ChallengeStore;
10
+
11
+ start() {
12
+ const server = http.createServer(async (req, res) => {
13
+ try {
14
+ const url = new URL(req.url, `https://${req.headers.host || "localhost"}`);
15
+ const path = url.pathname.split("/").filter((x) => x);
16
+ if(url.pathname.startsWith("/.well-known/acme-challenge/")) {
17
+ const token = path[2];
18
+ const value = await this.challengeStore.get(token);
19
+ res.writeHead(200, { "content-type": "text/plain" });
20
+ await new Promise<void>((resolve, reject) => res.write(Buffer.from(value), (error) => error ? reject(error) : resolve()));
21
+ } else {
22
+ res.writeHead(301, { location: url.toString() });
23
+ }
24
+ await new Promise<void>((resolve) => res.end(resolve));
25
+
26
+ } catch (error) {
27
+ console.error(error);
28
+ }
29
+ });
30
+
31
+ server.listen(80);
32
+ }
33
+
34
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"ACME.d.ts","sourceRoot":"","sources":["../../src/ssl/ACME.ts"],"names":[],"mappings":";AAUA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,YAAa,SAAQ,YAAY;IAC9C,IAAI,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,CAAC,OAAO,OAAO,IAAI;IAGrB,OAAO,CAAC,cAAc,CAAiB;IAEvC,OAAO,CAAC,GAAG,CAAwC;IAEtC,gBAAgB,CAAC,OAAO,EAAE,YAAY;IAatC,KAAK,CAAC,EACf,IAAI,EACJ,OAAc,EACd,qBAA4B,EAC5B,YAAiB,EACjB,IAA+D,EAC/D,QAAa,EACb,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