@zincapp/znvault-plugin-payara 1.0.0

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.
@@ -0,0 +1,312 @@
1
+ // Path: src/war-deployer.ts
2
+ // WAR file deployer with diff-based updates
3
+ import { createHash } from 'node:crypto';
4
+ import { readFile, writeFile, mkdir, rm, stat, readdir } from 'node:fs/promises';
5
+ import { join, dirname } from 'node:path';
6
+ import AdmZip from 'adm-zip';
7
+ /**
8
+ * WAR file deployer with diff-based updates
9
+ *
10
+ * Supports:
11
+ * - Full WAR deployment
12
+ * - Diff-based updates (only changed files)
13
+ * - Hash calculation for change detection
14
+ */
15
+ export class WarDeployer {
16
+ warPath;
17
+ appName;
18
+ contextRoot;
19
+ payara;
20
+ logger;
21
+ // Lock to prevent concurrent deployments
22
+ deployLock = false;
23
+ constructor(options) {
24
+ this.warPath = options.warPath;
25
+ this.appName = options.appName;
26
+ this.contextRoot = options.contextRoot;
27
+ this.payara = options.payara;
28
+ this.logger = options.logger;
29
+ }
30
+ /**
31
+ * Check if WAR file exists
32
+ */
33
+ async warExists() {
34
+ try {
35
+ await stat(this.warPath);
36
+ return true;
37
+ }
38
+ catch {
39
+ return false;
40
+ }
41
+ }
42
+ /**
43
+ * Get SHA-256 hashes of all files in the WAR
44
+ */
45
+ async getCurrentHashes() {
46
+ if (!(await this.warExists())) {
47
+ return {};
48
+ }
49
+ const hashes = {};
50
+ try {
51
+ const zip = new AdmZip(this.warPath);
52
+ for (const entry of zip.getEntries()) {
53
+ if (!entry.isDirectory) {
54
+ const content = entry.getData();
55
+ const hash = createHash('sha256').update(content).digest('hex');
56
+ hashes[entry.entryName] = hash;
57
+ }
58
+ }
59
+ }
60
+ catch (err) {
61
+ this.logger.error({ err, warPath: this.warPath }, 'Failed to read WAR file');
62
+ throw err;
63
+ }
64
+ return hashes;
65
+ }
66
+ /**
67
+ * Apply file changes to WAR and deploy
68
+ *
69
+ * This method:
70
+ * 1. Extracts the current WAR to a temp directory
71
+ * 2. Applies file changes and deletions
72
+ * 3. Repackages the WAR
73
+ * 4. Deploys to Payara
74
+ */
75
+ async applyChanges(changedFiles, deletedFiles) {
76
+ if (this.deployLock) {
77
+ throw new Error('Deployment already in progress');
78
+ }
79
+ this.deployLock = true;
80
+ const tempDir = `/tmp/war-deploy-${Date.now()}`;
81
+ try {
82
+ this.logger.info({
83
+ changed: changedFiles.length,
84
+ deleted: deletedFiles.length,
85
+ }, 'Applying WAR changes');
86
+ // Create temp directory
87
+ await mkdir(tempDir, { recursive: true });
88
+ // Extract current WAR if it exists
89
+ if (await this.warExists()) {
90
+ const zip = new AdmZip(this.warPath);
91
+ zip.extractAllTo(tempDir, true);
92
+ }
93
+ // Apply deletions
94
+ for (const file of deletedFiles) {
95
+ const fullPath = join(tempDir, file);
96
+ try {
97
+ await rm(fullPath, { force: true });
98
+ this.logger.debug({ file }, 'Deleted file');
99
+ }
100
+ catch (err) {
101
+ this.logger.warn({ err, file }, 'Failed to delete file');
102
+ }
103
+ }
104
+ // Apply changes
105
+ for (const { path, content } of changedFiles) {
106
+ const fullPath = join(tempDir, path);
107
+ const dir = dirname(fullPath);
108
+ // Ensure parent directory exists
109
+ await mkdir(dir, { recursive: true });
110
+ // Write file
111
+ await writeFile(fullPath, content);
112
+ this.logger.debug({ path, size: content.length }, 'Updated file');
113
+ }
114
+ // Repackage WAR
115
+ const newZip = new AdmZip();
116
+ await this.addDirectoryToZip(newZip, tempDir, '');
117
+ // Ensure WAR directory exists
118
+ const warDir = dirname(this.warPath);
119
+ await mkdir(warDir, { recursive: true });
120
+ // Write WAR file
121
+ newZip.writeZip(this.warPath);
122
+ this.logger.info({ warPath: this.warPath }, 'WAR file updated');
123
+ // Deploy to Payara
124
+ await this.deploy();
125
+ }
126
+ finally {
127
+ // Cleanup temp directory
128
+ try {
129
+ await rm(tempDir, { recursive: true, force: true });
130
+ }
131
+ catch (err) {
132
+ this.logger.warn({ err, tempDir }, 'Failed to cleanup temp directory');
133
+ }
134
+ this.deployLock = false;
135
+ }
136
+ }
137
+ /**
138
+ * Apply file changes to WAR without deploying to Payara
139
+ * (Useful for testing or when deployment is handled separately)
140
+ */
141
+ async applyChangesWithoutDeploy(changedFiles, deletedFiles) {
142
+ const tempDir = `/tmp/war-update-${Date.now()}`;
143
+ try {
144
+ this.logger.debug({
145
+ changed: changedFiles.length,
146
+ deleted: deletedFiles.length,
147
+ }, 'Applying WAR changes (no deploy)');
148
+ await mkdir(tempDir, { recursive: true });
149
+ // Extract current WAR if it exists
150
+ if (await this.warExists()) {
151
+ const zip = new AdmZip(this.warPath);
152
+ zip.extractAllTo(tempDir, true);
153
+ }
154
+ // Apply deletions
155
+ for (const file of deletedFiles) {
156
+ const fullPath = join(tempDir, file);
157
+ try {
158
+ await rm(fullPath, { force: true });
159
+ }
160
+ catch {
161
+ // Ignore deletion errors
162
+ }
163
+ }
164
+ // Apply changes
165
+ for (const { path, content } of changedFiles) {
166
+ const fullPath = join(tempDir, path);
167
+ await mkdir(dirname(fullPath), { recursive: true });
168
+ await writeFile(fullPath, content);
169
+ }
170
+ // Repackage WAR
171
+ const newZip = new AdmZip();
172
+ await this.addDirectoryToZip(newZip, tempDir, '');
173
+ const warDir = dirname(this.warPath);
174
+ await mkdir(warDir, { recursive: true });
175
+ newZip.writeZip(this.warPath);
176
+ }
177
+ finally {
178
+ try {
179
+ await rm(tempDir, { recursive: true, force: true });
180
+ }
181
+ catch {
182
+ // Ignore cleanup errors
183
+ }
184
+ }
185
+ }
186
+ /**
187
+ * Deploy WAR to Payara (full deployment)
188
+ */
189
+ async deploy() {
190
+ if (!(await this.warExists())) {
191
+ this.logger.info({ warPath: this.warPath }, 'No WAR file to deploy');
192
+ return;
193
+ }
194
+ this.logger.info({ warPath: this.warPath, appName: this.appName }, 'Deploying WAR');
195
+ // Check if Payara is running
196
+ const wasRunning = await this.payara.isRunning();
197
+ if (wasRunning) {
198
+ // Stop Payara for deployment
199
+ await this.payara.stop();
200
+ }
201
+ try {
202
+ // Deploy WAR
203
+ await this.payara.deploy(this.warPath, this.appName, this.contextRoot);
204
+ }
205
+ finally {
206
+ if (wasRunning) {
207
+ // Start Payara back up
208
+ await this.payara.start();
209
+ }
210
+ }
211
+ this.logger.info({ appName: this.appName }, 'WAR deployed successfully');
212
+ }
213
+ /**
214
+ * Deploy if WAR exists (for startup)
215
+ */
216
+ async deployIfExists() {
217
+ if (await this.warExists()) {
218
+ await this.deploy();
219
+ return true;
220
+ }
221
+ return false;
222
+ }
223
+ /**
224
+ * Check if deployment is in progress
225
+ */
226
+ isDeploying() {
227
+ return this.deployLock;
228
+ }
229
+ /**
230
+ * Get a specific file from the WAR
231
+ */
232
+ async getFile(path) {
233
+ if (!(await this.warExists())) {
234
+ return null;
235
+ }
236
+ try {
237
+ const zip = new AdmZip(this.warPath);
238
+ const entry = zip.getEntry(path);
239
+ if (!entry || entry.isDirectory) {
240
+ return null;
241
+ }
242
+ return entry.getData();
243
+ }
244
+ catch (err) {
245
+ this.logger.error({ err, path }, 'Failed to read file from WAR');
246
+ return null;
247
+ }
248
+ }
249
+ /**
250
+ * Recursively add directory contents to ZIP
251
+ */
252
+ async addDirectoryToZip(zip, dirPath, zipPath) {
253
+ const entries = await readdir(dirPath, { withFileTypes: true });
254
+ for (const entry of entries) {
255
+ const fullPath = join(dirPath, entry.name);
256
+ const entryZipPath = zipPath ? `${zipPath}/${entry.name}` : entry.name;
257
+ if (entry.isDirectory()) {
258
+ await this.addDirectoryToZip(zip, fullPath, entryZipPath);
259
+ }
260
+ else {
261
+ const content = await readFile(fullPath);
262
+ zip.addFile(entryZipPath, content);
263
+ }
264
+ }
265
+ }
266
+ }
267
+ /**
268
+ * Calculate diff between local and remote hashes
269
+ */
270
+ export function calculateDiff(localHashes, remoteHashes) {
271
+ const changed = [];
272
+ const deleted = [];
273
+ // Find changed/new files
274
+ for (const [path, hash] of Object.entries(localHashes)) {
275
+ if (!remoteHashes[path] || remoteHashes[path] !== hash) {
276
+ changed.push(path);
277
+ }
278
+ }
279
+ // Find deleted files
280
+ for (const path of Object.keys(remoteHashes)) {
281
+ if (!localHashes[path]) {
282
+ deleted.push(path);
283
+ }
284
+ }
285
+ return { changed, deleted };
286
+ }
287
+ /**
288
+ * Calculate hashes for a local WAR file
289
+ */
290
+ export async function calculateWarHashes(warPath) {
291
+ const hashes = {};
292
+ const zip = new AdmZip(warPath);
293
+ for (const entry of zip.getEntries()) {
294
+ if (!entry.isDirectory) {
295
+ const content = entry.getData();
296
+ const hash = createHash('sha256').update(content).digest('hex');
297
+ hashes[entry.entryName] = hash;
298
+ }
299
+ }
300
+ return hashes;
301
+ }
302
+ /**
303
+ * Get file content from a WAR file
304
+ */
305
+ export function getWarEntry(warPath, path) {
306
+ const zip = new AdmZip(warPath);
307
+ const entry = zip.getEntry(path);
308
+ if (!entry || entry.isDirectory) {
309
+ throw new Error(`Entry not found in WAR: ${path}`);
310
+ }
311
+ return entry.getData();
312
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"war-deployer.js","sourceRoot":"","sources":["../src/war-deployer.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,4CAA4C;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,MAAM,MAAM,SAAS,CAAC;AAK7B;;;;;;;GAOG;AACH,MAAM,OAAO,WAAW;IACL,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,WAAW,CAAU;IACrB,MAAM,CAAgB;IACtB,MAAM,CAAS;IAEhC,yCAAyC;IACjC,UAAU,GAAG,KAAK,CAAC;IAE3B,YAAY,OAA2B;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,C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AK,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEjC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;AACzB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@zincapp/znvault-plugin-payara",
3
+ "version": "1.0.0",
4
+ "description": "Payara application server plugin for zn-vault-agent with WAR diff deployment",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ },
16
+ "./cli": {
17
+ "import": "./dist/cli.js",
18
+ "types": "./dist/cli.d.ts"
19
+ }
20
+ },
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "build:prod": "tsc --sourceMap false",
24
+ "dev": "tsc --watch",
25
+ "clean": "rm -rf dist",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
+ "test:coverage": "vitest run --coverage",
29
+ "lint": "eslint src test --ext .ts",
30
+ "lint:fix": "eslint src test --ext .ts --fix",
31
+ "typecheck": "tsc --noEmit",
32
+ "prepublishOnly": "npm run build:prod"
33
+ },
34
+ "keywords": [
35
+ "znvault",
36
+ "payara",
37
+ "glassfish",
38
+ "war",
39
+ "deployment",
40
+ "plugin",
41
+ "secrets",
42
+ "vault"
43
+ ],
44
+ "author": "ZincApp",
45
+ "license": "MIT",
46
+ "homepage": "https://github.com/vidaldiego/znvault-plugin-payara#readme",
47
+ "bugs": {
48
+ "url": "https://github.com/vidaldiego/znvault-plugin-payara/issues"
49
+ },
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/vidaldiego/znvault-plugin-payara.git"
53
+ },
54
+ "peerDependencies": {
55
+ "@zincapp/zn-vault-agent": ">=1.6.0",
56
+ "@zincapp/znvault-cli": ">=2.11.0"
57
+ },
58
+ "peerDependenciesMeta": {
59
+ "@zincapp/zn-vault-agent": {
60
+ "optional": true
61
+ },
62
+ "@zincapp/znvault-cli": {
63
+ "optional": true
64
+ }
65
+ },
66
+ "dependencies": {
67
+ "adm-zip": "^0.5.16",
68
+ "pino": "^9.6.0"
69
+ },
70
+ "devDependencies": {
71
+ "@types/adm-zip": "^0.5.7",
72
+ "@types/node": "^22.10.2",
73
+ "@typescript-eslint/eslint-plugin": "^8.52.0",
74
+ "@typescript-eslint/parser": "^8.52.0",
75
+ "@vitest/coverage-v8": "^2.1.8",
76
+ "commander": "^12.1.0",
77
+ "eslint": "^8.57.1",
78
+ "fastify": "^5.2.1",
79
+ "typescript": "^5.7.2",
80
+ "vitest": "^2.1.8"
81
+ },
82
+ "engines": {
83
+ "node": ">=18.0.0"
84
+ },
85
+ "publishConfig": {
86
+ "access": "public"
87
+ }
88
+ }