@factiii/stack 0.1.200 → 0.1.203

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 (48) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +403 -403
  3. package/bin/stack +334 -334
  4. package/dist/cli/dev-sync.js +16 -16
  5. package/dist/plugins/addons/auth/index.js +7 -7
  6. package/dist/plugins/addons/vercel/index.js +9 -9
  7. package/dist/plugins/addons/vercel/scanfix/config.js +10 -10
  8. package/dist/plugins/addons/vercel/scanfix/token.js +15 -15
  9. package/dist/plugins/approved.json +13 -13
  10. package/dist/plugins/pipelines/aws/index.js +12 -12
  11. package/dist/plugins/pipelines/aws/policies/bootstrap-policy.json +135 -135
  12. package/dist/plugins/pipelines/aws/prod.js +1 -1
  13. package/dist/plugins/pipelines/factiii/index.d.ts.map +1 -1
  14. package/dist/plugins/pipelines/factiii/index.js +2 -14
  15. package/dist/plugins/pipelines/factiii/index.js.map +1 -1
  16. package/dist/plugins/pipelines/factiii/prod.js +21 -21
  17. package/dist/plugins/pipelines/factiii/scanfix/port-convention.d.ts.map +1 -1
  18. package/dist/plugins/pipelines/factiii/scanfix/port-convention.js +2 -4
  19. package/dist/plugins/pipelines/factiii/scanfix/port-convention.js.map +1 -1
  20. package/dist/plugins/pipelines/factiii/staging.js +23 -23
  21. package/dist/plugins/pipelines/factiii/workflows/stack-ci.yml +75 -75
  22. package/dist/plugins/pipelines/factiii/workflows/stack-cicd-prod.yml +73 -73
  23. package/dist/plugins/servers/amazon-linux/index.js +16 -16
  24. package/dist/plugins/servers/mac/index.js +12 -12
  25. package/dist/plugins/servers/mac/staging.js +2 -2
  26. package/dist/plugins/servers/ubuntu/index.js +23 -23
  27. package/dist/plugins/servers/windows/index.js +15 -15
  28. package/dist/scanfix/commands/mac.d.ts.map +1 -1
  29. package/dist/scanfix/commands/mac.js +5 -4
  30. package/dist/scanfix/commands/mac.js.map +1 -1
  31. package/dist/scanfix/fixes/certbot.d.ts.map +1 -1
  32. package/dist/scanfix/fixes/certbot.js +4 -18
  33. package/dist/scanfix/fixes/certbot.js.map +1 -1
  34. package/dist/scanfix/fixes/docker.d.ts.map +1 -1
  35. package/dist/scanfix/fixes/docker.js +5 -14
  36. package/dist/scanfix/fixes/docker.js.map +1 -1
  37. package/dist/scanfix/ssl-cert-helper.d.ts.map +1 -1
  38. package/dist/scanfix/ssl-cert-helper.js +18 -4
  39. package/dist/scanfix/ssl-cert-helper.js.map +1 -1
  40. package/dist/scripts/generate-all.js +73 -73
  41. package/dist/utils/deployment-report.js +2 -2
  42. package/dist/utils/secret-prompts.js +34 -34
  43. package/dist/utils/template-generator.js +74 -74
  44. package/package.json +100 -114
  45. package/dist/plugins/pipelines/factiii/scanfix/docker.d.ts +0 -20
  46. package/dist/plugins/pipelines/factiii/scanfix/docker.d.ts.map +0 -1
  47. package/dist/plugins/pipelines/factiii/scanfix/docker.js +0 -131
  48. package/dist/plugins/pipelines/factiii/scanfix/docker.js.map +0 -1
package/package.json CHANGED
@@ -1,114 +1,100 @@
1
- {
2
- "name": "@factiii/stack",
3
- "version": "0.1.200",
4
- "description": "Infrastructure management package for deploying services to servers",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "bin": {
8
- "stack": "./bin/stack"
9
- },
10
- "files": [
11
- "bin/",
12
- "dist/"
13
- ],
14
- "scripts": {
15
- "build": "tsc && npm run copy-assets",
16
- "build:watch": "tsc --watch",
17
- "clean": "node -e \"const fs=require('fs');if(fs.existsSync('dist'))fs.rmSync('dist',{recursive:true,force:true})\"",
18
- "copy-assets": "node -e \"const fs=require('fs'),p=require('path');fs.cpSync('src/plugins/approved.json','dist/plugins/approved.json');const d='dist/plugins/pipelines/factiii/workflows';fs.mkdirSync(d,{recursive:true});for(const f of fs.readdirSync('src/plugins/pipelines/factiii/workflows').filter(f=>f.endsWith('.yml')))fs.cpSync(p.join('src/plugins/pipelines/factiii/workflows',f),p.join(d,f));const pd='dist/plugins/pipelines/aws/policies';fs.mkdirSync(pd,{recursive:true});for(const f of fs.readdirSync('src/plugins/pipelines/aws/policies').filter(f=>f.endsWith('.json')))fs.cpSync(p.join('src/plugins/pipelines/aws/policies',f),p.join(pd,f))\"",
19
- "prebuild": "npm run clean",
20
- "prepublish-check": "node -e \"const v=require('./package.json').version; if(v.includes('-d')){console.error('❌ Cannot publish dev version:',v); process.exit(1)}\"",
21
- "prepublishOnly": "npm run prepublish-check && npm run build",
22
- "test": "jest",
23
- "test:watch": "jest --watch",
24
- "test:coverage": "jest --coverage",
25
- "typecheck": "tsc --noEmit",
26
- "build:auth": "pnpm --filter @factiii/auth build",
27
- "build:all": "pnpm --filter @factiii/auth build && pnpm run build",
28
- "test:auth": "pnpm --filter @factiii/auth test",
29
- "test:all": "pnpm test && pnpm --filter @factiii/auth test",
30
- "changeset": "changeset",
31
- "version-packages": "changeset version",
32
- "release": "pnpm build:all && changeset publish"
33
- },
34
- "keywords": [
35
- "infrastructure",
36
- "deployment",
37
- "docker",
38
- "nginx"
39
- ],
40
- "author": "",
41
- "license": "MIT",
42
- "repository": {
43
- "type": "git",
44
- "url": "https://github.com/factiii/stack.git"
45
- },
46
- "publishConfig": {
47
- "registry": "https://registry.npmjs.org"
48
- },
49
- "dependencies": {
50
- "@aws-sdk/client-ec2": "^3.750.0",
51
- "@aws-sdk/client-ec2-instance-connect": "^3.1001.0",
52
- "@aws-sdk/client-ecr": "^3.750.0",
53
- "@aws-sdk/client-iam": "^3.750.0",
54
- "@aws-sdk/client-rds": "^3.750.0",
55
- "@aws-sdk/client-route-53": "^3.1001.0",
56
- "@aws-sdk/client-s3": "^3.750.0",
57
- "@aws-sdk/client-ses": "^3.750.0",
58
- "@aws-sdk/client-sts": "^3.750.0",
59
- "@factiii/auth": "^0.6.1",
60
- "@octokit/rest": "^20.0.2",
61
- "ansible-vault": "^1.3.0",
62
- "commander": "^11.1.0",
63
- "js-yaml": "^4.1.1",
64
- "libsodium-wrappers": "^0.7.11"
65
- },
66
- "devDependencies": {
67
- "@changesets/cli": "^2.30.0",
68
- "@types/jest": "^30.0.0",
69
- "@types/js-yaml": "^4.0.9",
70
- "@types/node": "^25.0.3",
71
- "jest": "^29.7.0",
72
- "ts-jest": "^29.4.6",
73
- "ts-node": "^10.9.2",
74
- "typescript": "^5.9.3"
75
- },
76
- "jest": {
77
- "preset": "ts-jest",
78
- "testEnvironment": "node",
79
- "testMatch": [
80
- "**/test/**/*.test.ts"
81
- ],
82
- "moduleNameMapper": {
83
- "^(\\.{1,2}/.*)\\.js$": "$1"
84
- },
85
- "collectCoverageFrom": [
86
- "src/**/*.ts",
87
- "!**/node_modules/**"
88
- ],
89
- "coverageThreshold": {
90
- "global": {
91
- "branches": 70,
92
- "functions": 70,
93
- "lines": 70,
94
- "statements": 70
95
- }
96
- }
97
- },
98
- "packageManager": "pnpm@10.32.1",
99
- "engines": {
100
- "node": ">=18.0.0"
101
- },
102
- "pnpm": {
103
- "overrides": {
104
- "minimatch": ">=10.2.1",
105
- "diff": ">=4.0.4",
106
- "hono": ">=4.12.7",
107
- "@hono/node-server": ">=1.19.10",
108
- "lodash": ">=4.17.23",
109
- "flatted": ">=3.4.0",
110
- "rollup": ">=4.59.0",
111
- "ajv": ">=6.14.0"
112
- }
113
- }
114
- }
1
+ {
2
+ "name": "@factiii/stack",
3
+ "version": "0.1.203",
4
+ "description": "Infrastructure management package for deploying services to servers",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "stack": "./bin/stack"
9
+ },
10
+ "files": [
11
+ "bin/",
12
+ "dist/"
13
+ ],
14
+ "keywords": [
15
+ "infrastructure",
16
+ "deployment",
17
+ "docker",
18
+ "nginx"
19
+ ],
20
+ "author": "",
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/factiii/stack.git"
25
+ },
26
+ "publishConfig": {
27
+ "registry": "https://registry.npmjs.org"
28
+ },
29
+ "dependencies": {
30
+ "@aws-sdk/client-ec2": "^3.750.0",
31
+ "@aws-sdk/client-ec2-instance-connect": "^3.1001.0",
32
+ "@aws-sdk/client-ecr": "^3.750.0",
33
+ "@aws-sdk/client-iam": "^3.750.0",
34
+ "@aws-sdk/client-rds": "^3.750.0",
35
+ "@aws-sdk/client-route-53": "^3.1001.0",
36
+ "@aws-sdk/client-s3": "^3.750.0",
37
+ "@aws-sdk/client-ses": "^3.750.0",
38
+ "@aws-sdk/client-sts": "^3.750.0",
39
+ "@octokit/rest": "^20.0.2",
40
+ "ansible-vault": "^1.3.0",
41
+ "commander": "^11.1.0",
42
+ "js-yaml": "^4.1.1",
43
+ "libsodium-wrappers": "^0.7.11",
44
+ "@factiii/auth": "0.6.3"
45
+ },
46
+ "devDependencies": {
47
+ "@changesets/cli": "^2.30.0",
48
+ "@types/jest": "^30.0.0",
49
+ "@types/js-yaml": "^4.0.9",
50
+ "@types/node": "^25.0.3",
51
+ "jest": "^29.7.0",
52
+ "ts-jest": "^29.4.6",
53
+ "ts-node": "^10.9.2",
54
+ "typescript": "^5.9.3"
55
+ },
56
+ "jest": {
57
+ "preset": "ts-jest",
58
+ "testEnvironment": "node",
59
+ "testMatch": [
60
+ "**/test/**/*.test.ts"
61
+ ],
62
+ "moduleNameMapper": {
63
+ "^(\\.{1,2}/.*)\\.js$": "$1"
64
+ },
65
+ "collectCoverageFrom": [
66
+ "src/**/*.ts",
67
+ "!**/node_modules/**"
68
+ ],
69
+ "coverageThreshold": {
70
+ "global": {
71
+ "branches": 70,
72
+ "functions": 70,
73
+ "lines": 70,
74
+ "statements": 70
75
+ }
76
+ }
77
+ },
78
+ "engines": {
79
+ "node": ">=18.0.0"
80
+ },
81
+ "scripts": {
82
+ "build": "tsc && npm run copy-assets",
83
+ "build:watch": "tsc --watch",
84
+ "clean": "node -e \"const fs=require('fs');if(fs.existsSync('dist'))fs.rmSync('dist',{recursive:true,force:true})\"",
85
+ "copy-assets": "node -e \"const fs=require('fs'),p=require('path');fs.cpSync('src/plugins/approved.json','dist/plugins/approved.json');const d='dist/plugins/pipelines/factiii/workflows';fs.mkdirSync(d,{recursive:true});for(const f of fs.readdirSync('src/plugins/pipelines/factiii/workflows').filter(f=>f.endsWith('.yml')))fs.cpSync(p.join('src/plugins/pipelines/factiii/workflows',f),p.join(d,f));const pd='dist/plugins/pipelines/aws/policies';fs.mkdirSync(pd,{recursive:true});for(const f of fs.readdirSync('src/plugins/pipelines/aws/policies').filter(f=>f.endsWith('.json')))fs.cpSync(p.join('src/plugins/pipelines/aws/policies',f),p.join(pd,f))\"",
86
+ "prebuild": "npm run clean",
87
+ "prepublish-check": "node -e \"const v=require('./package.json').version; if(v.includes('-d')){console.error('❌ Cannot publish dev version:',v); process.exit(1)}\"",
88
+ "test": "jest",
89
+ "test:watch": "jest --watch",
90
+ "test:coverage": "jest --coverage",
91
+ "typecheck": "tsc --noEmit",
92
+ "build:auth": "pnpm --filter @factiii/auth build",
93
+ "build:all": "pnpm --filter @factiii/auth build && pnpm run build",
94
+ "test:auth": "pnpm --filter @factiii/auth test",
95
+ "test:all": "pnpm test && pnpm --filter @factiii/auth test",
96
+ "changeset": "changeset",
97
+ "version-packages": "changeset version",
98
+ "release": "pnpm build:all && changeset publish"
99
+ }
100
+ }
@@ -1,20 +0,0 @@
1
- /**
2
- * Docker Pre-SSH Checks (Factiii Pipeline)
3
- *
4
- * Ensures Docker is installed and running on staging/prod servers via SSH
5
- * BEFORE the pipeline SSHes in to run `npx stack fix --staging/--prod`.
6
- *
7
- * Called from fixStage() and deployStage() — NOT via the scanfix array,
8
- * because remote stages bypass runLocalFixes() entirely.
9
- *
10
- * Handles both Mac (Docker Desktop / Colima) and Ubuntu (apt / get.docker.com).
11
- */
12
- import type { FactiiiConfig, Stage } from '../../../../types/index.js';
13
- /**
14
- * Pre-SSH Docker check: ensure Docker is installed and running on the remote server.
15
- *
16
- * Call this from fixStage() / deployStage() BEFORE SSHing to run the full fix/deploy.
17
- * Returns true if Docker is ready, false if it couldn't be fixed.
18
- */
19
- export declare function ensureRemoteDocker(stage: Stage, config: FactiiiConfig): Promise<boolean>;
20
- //# sourceMappingURL=docker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/pipelines/factiii/scanfix/docker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAqB,MAAM,4BAA4B,CAAC;AA8H1F;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,OAAO,CAAC,CAsBlB"}
@@ -1,131 +0,0 @@
1
- "use strict";
2
- /**
3
- * Docker Pre-SSH Checks (Factiii Pipeline)
4
- *
5
- * Ensures Docker is installed and running on staging/prod servers via SSH
6
- * BEFORE the pipeline SSHes in to run `npx stack fix --staging/--prod`.
7
- *
8
- * Called from fixStage() and deployStage() — NOT via the scanfix array,
9
- * because remote stages bypass runLocalFixes() entirely.
10
- *
11
- * Handles both Mac (Docker Desktop / Colima) and Ubuntu (apt / get.docker.com).
12
- */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.ensureRemoteDocker = ensureRemoteDocker;
15
- const config_helpers_js_1 = require("../../../../utils/config-helpers.js");
16
- const ssh_helper_js_1 = require("../../../../utils/ssh-helper.js");
17
- /**
18
- * Get the server type from the environment config, default to 'ubuntu'
19
- */
20
- function getServerType(envConfig) {
21
- return envConfig.server ?? 'ubuntu';
22
- }
23
- /**
24
- * Ensure Docker is installed on a remote server via SSH.
25
- * Returns true if Docker is now installed, false if it failed.
26
- */
27
- async function ensureDockerInstalled(envConfig, stage, config) {
28
- // Check if Docker is already installed
29
- try {
30
- await (0, ssh_helper_js_1.sshExec)(envConfig, 'export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" && docker --version', stage, config);
31
- return true; // Already installed
32
- }
33
- catch {
34
- // Not installed — proceed to install
35
- }
36
- const server = getServerType(envConfig);
37
- console.log(' Docker not found on ' + stage + ' server — installing...');
38
- try {
39
- if (server === 'mac') {
40
- await (0, ssh_helper_js_1.sshExec)(envConfig, 'export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" && ' +
41
- 'which docker >/dev/null 2>&1 || (' +
42
- 'brew install docker docker-compose colima 2>/dev/null && ' +
43
- 'colima start --memory 4 --cpu 2' +
44
- ')', stage, config);
45
- }
46
- else {
47
- await (0, ssh_helper_js_1.sshExec)(envConfig, 'sudo DEBIAN_FRONTEND=noninteractive apt-get update -qq && ' +
48
- 'curl -fsSL https://get.docker.com | sh && ' +
49
- 'sudo usermod -aG docker $USER && ' +
50
- 'sudo systemctl enable docker && sudo systemctl start docker', stage, config);
51
- }
52
- // Verify
53
- const version = await (0, ssh_helper_js_1.sshExec)(envConfig, 'export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" && docker --version', stage, config);
54
- console.log(' [OK] Docker installed: ' + version.trim());
55
- return true;
56
- }
57
- catch (e) {
58
- console.log(' [!] Failed to install Docker: ' + (e instanceof Error ? e.message : String(e)));
59
- return false;
60
- }
61
- }
62
- /**
63
- * Ensure Docker daemon is running on a remote server via SSH.
64
- * Returns true if Docker is now running, false if it failed.
65
- */
66
- async function ensureDockerRunning(envConfig, stage, config) {
67
- // Check if Docker is already running
68
- try {
69
- await (0, ssh_helper_js_1.sshExec)(envConfig, 'export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" && docker info >/dev/null 2>&1', stage, config);
70
- return true; // Already running
71
- }
72
- catch {
73
- // Not running — proceed to start
74
- }
75
- const server = getServerType(envConfig);
76
- console.log(' Docker not running on ' + stage + ' server — starting...');
77
- try {
78
- if (server === 'mac') {
79
- // Try Colima first, then Docker Desktop headless
80
- await (0, ssh_helper_js_1.sshExec)(envConfig, 'export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" && ' +
81
- 'if command -v colima >/dev/null 2>&1; then ' +
82
- ' colima start --memory 4 --cpu 2 2>/dev/null && echo "Colima started"; ' +
83
- 'elif [ -d "/Applications/Docker.app" ]; then ' +
84
- ' nohup /Applications/Docker.app/Contents/MacOS/Docker --unattended > /dev/null 2>&1 & ' +
85
- ' for i in $(seq 1 60); do sleep 1; if docker info >/dev/null 2>&1; then echo "Docker Desktop started"; exit 0; fi; done; ' +
86
- ' echo "Docker Desktop failed to start within 60s"; exit 1; ' +
87
- 'else ' +
88
- ' echo "No Docker runtime found"; exit 1; ' +
89
- 'fi', stage, config);
90
- }
91
- else {
92
- await (0, ssh_helper_js_1.sshExec)(envConfig, 'sudo systemctl start docker && sudo systemctl enable docker', stage, config);
93
- }
94
- // Verify
95
- await (0, ssh_helper_js_1.sshExec)(envConfig, 'export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" && docker info >/dev/null 2>&1', stage, config);
96
- console.log(' [OK] Docker is running on ' + stage + ' server');
97
- return true;
98
- }
99
- catch (e) {
100
- console.log(' [!] Failed to start Docker: ' + (e instanceof Error ? e.message : String(e)));
101
- return false;
102
- }
103
- }
104
- /**
105
- * Pre-SSH Docker check: ensure Docker is installed and running on the remote server.
106
- *
107
- * Call this from fixStage() / deployStage() BEFORE SSHing to run the full fix/deploy.
108
- * Returns true if Docker is ready, false if it couldn't be fixed.
109
- */
110
- async function ensureRemoteDocker(stage, config) {
111
- const environments = (0, config_helpers_js_1.extractEnvironments)(config);
112
- const envConfig = stage === 'prod'
113
- ? (environments.prod ?? environments.production)
114
- : environments[stage];
115
- if (!envConfig?.domain || envConfig.domain.toUpperCase().startsWith('EXAMPLE'))
116
- return true; // Skip — no real domain
117
- if (!(0, ssh_helper_js_1.findSshKeyForStage)(stage, config.name))
118
- return true; // Skip — no SSH key
119
- const installed = await ensureDockerInstalled(envConfig, stage, config);
120
- if (!installed) {
121
- console.log(' [!] Docker is not installed on ' + stage + ' — remote fix/deploy may fail');
122
- return false;
123
- }
124
- const running = await ensureDockerRunning(envConfig, stage, config);
125
- if (!running) {
126
- console.log(' [!] Docker is not running on ' + stage + ' — remote fix/deploy may fail');
127
- return false;
128
- }
129
- return true;
130
- }
131
- //# sourceMappingURL=docker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"docker.js","sourceRoot":"","sources":["../../../../../src/plugins/pipelines/factiii/scanfix/docker.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAsIH,gDAyBC;AA5JD,2EAA0E;AAC1E,mEAA8E;AAE9E;;GAEG;AACH,SAAS,aAAa,CAAC,SAA4B;IACjD,OAAQ,SAAgD,CAAC,MAAgB,IAAI,QAAQ,CAAC;AACxF,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,qBAAqB,CAClC,SAA4B,EAC5B,KAAY,EACZ,MAAqB;IAErB,uCAAuC;IACvC,IAAI,CAAC;QACH,MAAM,IAAA,uBAAO,EAAC,SAAS,EACrB,0EAA0E,EAC1E,KAAK,EAAE,MAAM,CACd,CAAC;QACF,OAAO,IAAI,CAAC,CAAC,oBAAoB;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,qCAAqC;IACvC,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,KAAK,GAAG,yBAAyB,CAAC,CAAC;IAE3E,IAAI,CAAC;QACH,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YACrB,MAAM,IAAA,uBAAO,EAAC,SAAS,EACrB,0DAA0D;gBAC1D,mCAAmC;gBACnC,2DAA2D;gBAC3D,iCAAiC;gBACjC,GAAG,EACH,KAAK,EAAE,MAAM,CACd,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,IAAA,uBAAO,EAAC,SAAS,EACrB,4DAA4D;gBAC5D,4CAA4C;gBAC5C,mCAAmC;gBACnC,6DAA6D,EAC7D,KAAK,EAAE,MAAM,CACd,CAAC;QACJ,CAAC;QAED,SAAS;QACT,MAAM,OAAO,GAAG,MAAM,IAAA,uBAAO,EAAC,SAAS,EACrC,0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