Skip to content

Commit 61944ed

Browse files
committed
Updating version - Fixing bug where SSH data was not storing properly for ZFSReplication (Creating/Editing Tasks)
1 parent 1d80ae9 commit 61944ed

File tree

7 files changed

+111
-10
lines changed

7 files changed

+111
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
## task scheduler 1.1.0-1
1+
## task scheduler 1.2.0-1
22

3-
* Updating Release Version
3+
* Major update, may require tasks to be destroyed + remade. Changes how task files are generated + read by system. Fixes major bug with SSH data not saving properly for ZFS Replication Tasks, also lays groundwork for CloudSync authentication to come in next update. Numerous other QoL updates and small bugfixes.
4+
* Updating version - Fixing bug where SSH data was not storing properly for ZFSReplication (Creating/Editing Tasks)

manifest.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "cockpit-scheduler",
44
"title": "task scheduler",
55
"prerelease": true,
6-
"version": "1.1.0",
6+
"version": "1.2.0",
77
"buildVersion": "1",
88
"author": "Jordan Keough <[email protected]>",
99
"url": "https://github.com/45Drives/cockpit-scheduler",
@@ -55,13 +55,11 @@
5555
],
5656
"changelog": {
5757
"urgency": "medium",
58-
"version": "1.1.0",
58+
"version": "1.2.0",
5959
"buildVersion": "1",
6060
"ignore": [],
61-
"date": "2024-08-02T15:27:03.043096",
61+
"date": null,
6262
"packager": "Jordan Keough <[email protected]>",
63-
"changes": [
64-
"Major update, may require tasks to be destroyed + remade. Changes how task files are generated + read by system. Fixes major bug with SSH data not saving properly for ZFS Replication Tasks, also lays groundwork for CloudSync authentication to come in next update. Numerous other QoL updates and small bugfixes."
65-
]
63+
"changes": []
6664
}
6765
}

packaging/el8/main.spec

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ make DESTDIR=%{buildroot} install
2828
/opt/45drives/houston/scheduler/*
2929

3030
%changelog
31+
* Mon Aug 05 2024 Jordan Keough <[email protected]> 1.2.0-1
32+
- Major update, may require tasks to be destroyed + remade. Changes how task files
33+
are generated + read by system. Fixes major bug with SSH data not saving properly
34+
for ZFS Replication Tasks, also lays groundwork for CloudSync authentication to
35+
come in next update. Numerous other QoL updates and small bugfixes.
36+
- Updating version - Fixing bug where SSH data was not storing properly for ZFSReplication
37+
(Creating/Editing Tasks)
3138
* Fri Jun 14 2024 Jordan Keough <[email protected]> 1.1.0-1
3239
- Updating Release Version
3340
* Fri Jun 14 2024 Jordan Keough <[email protected]> 1.0.3-1

packaging/focal/changelog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
cockpit-scheduler (1.2.0-1focal) focal; urgency=medium
2+
3+
* Major update, may require tasks to be destroyed + remade. Changes how task files
4+
are generated + read by system. Fixes major bug with SSH data not saving properly
5+
for ZFS Replication Tasks, also lays groundwork for CloudSync authentication
6+
to come in next update. Numerous other QoL updates and small bugfixes.
7+
* Updating version - Fixing bug where SSH data was not storing properly for ZFSReplication
8+
(Creating/Editing Tasks)
9+
10+
-- Jordan Keough <[email protected]> Mon, 05 Aug 2024 09:33:04 -0300
11+
112
cockpit-scheduler (1.1.0-1focal) focal; urgency=medium
213

314
* Updating Release Version

scheduler/src/components/parameters/task-parameters/ZfsRepTaskParams.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ function validateParams() {
738738
function setParams() {
739739
const newParams = new ParameterNode("ZFS Replication Task Config", "zfsRepConfig")
740740
.addChild(new ZfsDatasetParameter('Source Dataset', 'sourceDataset', '', 0, '', sourcePool.value, sourceDataset.value))
741-
.addChild(new ZfsDatasetParameter('Destination Dataset', 'destDataset', '', 22, '', destPool.value, destDataset.value))
741+
.addChild(new ZfsDatasetParameter('Destination Dataset', 'destDataset', destHost.value, destPort.value, destUser.value, destPool.value, destDataset.value))
742742
.addChild(new ParameterNode('Send Options', 'sendOptions')
743743
.addChild(new BoolParameter('Compressed', 'compressed_flag', sendCompressed.value))
744744
.addChild(new BoolParameter('Raw', 'raw_flag', sendRaw.value))

scheduler/src/models/Scheduler.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ export class Scheduler implements SchedulerType {
297297

298298
const envKeyValuesString = envKeyValues.join('\n')
299299

300+
// Convert envKeyValues to an object for easier manipulation
301+
let envObject = envKeyValues.reduce((acc, curr) => {
302+
const [key, value] = curr.split('=');
303+
acc[key] = value;
304+
return acc;
305+
}, {});
306+
300307
const templateName = formatTemplateName(taskInstance.template.name);
301308

302309
let scriptFileName = '';
@@ -305,12 +312,88 @@ export class Scheduler implements SchedulerType {
305312
switch (templateName) {
306313
case 'ZfsReplicationTask':
307314
scriptFileName = 'replication-script';
315+
if (envObject['zfsRepConfig_sendOptions_raw_flag'] === 'true') {
316+
envObject['zfsRepConfig_sendOptions_compressed_flag'] = '';
317+
} else if (envObject['zfsRepConfig_sendOptions_compressed_flag'] === 'true') {
318+
envObject['zfsRepConfig_sendOptions_raw_flag'] = '';
319+
}
320+
321+
['recursive', 'customName', 'raw', 'compressed'].forEach(flag => {
322+
const flagKey = `zfsRepConfig_sendOptions_${flag}_flag`;
323+
if (envObject[flagKey] === 'true') {
324+
envObject[flagKey] = `--${flag}`;
325+
} else {
326+
envObject[flagKey] = '';
327+
if (flag === 'customName') {
328+
envObject['zfsRepConfig_sendOptions_customName'] = '';
329+
}
330+
}
331+
});
308332
break;
309333
case 'AutomatedSnapshotTask':
310334
scriptFileName = 'autosnap-script';
335+
['recursive', 'customName'].forEach(flag => {
336+
const flagKey = `autoSnapConfig_${flag}_flag`;
337+
if (envObject[flagKey] === 'true') {
338+
envObject[flagKey] = `--${flag}`;
339+
} else {
340+
envObject[flagKey] = '';
341+
if (flag === 'customName') {
342+
envObject['autoSnapConfig_customName'] = '';
343+
}
344+
}
345+
});
311346
break;
312347
case 'RsyncTask':
313348
scriptFileName = 'rsync-script';
349+
['archive', 'recursive', 'compressed', 'delete', 'quiet', 'times', 'hardLinks', 'permissions', 'xattr', 'parallel'].forEach(flag => {
350+
const flagKey = `rsyncConfig_rsyncOptions_${flag}_flag`;
351+
if (envObject[flagKey] === 'true') {
352+
envObject[flagKey] = `--${flag}`;
353+
if (flag === 'parallel') {
354+
envObject['rsyncConfig_rsyncOptions_parallel_threads'] = `--threads=${envObject['rsyncConfig_rsyncOptions_parallel_threads'] || '1'}`;
355+
}
356+
} else {
357+
envObject[flagKey] = '';
358+
if (flag === 'parallel') {
359+
envObject['rsyncConfig_rsyncOptions_parallel_threads'] = '';
360+
}
361+
}
362+
});
363+
364+
if (!envObject['rsyncConfig_target_info_host']) {
365+
envObject['rsyncConfig_target_info_host'] = '';
366+
envObject['rsyncConfig_target_info_port'] = '';
367+
envObject['rsyncConfig_target_info_user'] = '';
368+
} else {
369+
envObject['rsyncConfig_target_info_host'] = `--host=${envObject['rsyncConfig_target_info_host']}`;
370+
envObject['rsyncConfig_target_info_port'] = `--port=${envObject['rsyncConfig_target_info_port']}`;
371+
envObject['rsyncConfig_target_info_user'] = `--user=${envObject['rsyncConfig_target_info_user']}`;
372+
}
373+
374+
if (envObject['rsyncConfig_rsyncOptions_bandwidth_limit_kbps'] !== '0') {
375+
envObject['rsyncConfig_rsyncOptions_bandwidth_limit_kbps'] = `--bandwidth=${envObject['rsyncConfig_rsyncOptions_bandwidth_limit_kbps']}`;
376+
} else {
377+
envObject['rsyncConfig_rsyncOptions_bandwidth_limit_kbps'] = '';
378+
}
379+
380+
if (envObject['rsyncConfig_rsyncOptions_include_pattern'] && envObject['rsyncConfig_rsyncOptions_include_pattern'] !== "''") {
381+
envObject['rsyncConfig_rsyncOptions_include_pattern'] = `--include=${envObject['rsyncConfig_rsyncOptions_include_pattern']}`;
382+
} else {
383+
envObject['rsyncConfig_rsyncOptions_include_pattern'] = '';
384+
}
385+
386+
if (envObject['rsyncConfig_rsyncOptions_exclude_pattern'] && envObject['rsyncConfig_rsyncOptions_exclude_pattern'] !== "''") {
387+
envObject['rsyncConfig_rsyncOptions_exclude_pattern'] = `--exclude=${envObject['rsyncConfig_rsyncOptions_exclude_pattern']}`;
388+
} else {
389+
envObject['rsyncConfig_rsyncOptions_exclude_pattern'] = '';
390+
}
391+
392+
if (envObject['rsyncConfig_rsyncOptions_custom_args'] && envObject['rsyncConfig_rsyncOptions_custom_args'] !== "''") {
393+
envObject['rsyncConfig_rsyncOptions_custom_args'] = `--customArgs=${envObject['rsyncConfig_rsyncOptions_custom_args']}`;
394+
} else {
395+
envObject['rsyncConfig_rsyncOptions_custom_args'] = '';
396+
}
314397
break;
315398
case 'SmartTest':
316399
scriptFileName = 'smart-test-script';
@@ -321,6 +404,7 @@ export class Scheduler implements SchedulerType {
321404
default:
322405
break;
323406
}
407+
324408

325409
const scriptPath = `/opt/45drives/houston/scheduler/scripts/${scriptFileName}.py`;
326410
// const templateServicePath = `/opt/45drives/houston/scheduler/templates/${templateName}.service`;

scheduler/src/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const pluginVersion = "1.0.2-1built_from_source";
1+
export const pluginVersion = "1.2.0built_from_source";

0 commit comments

Comments
 (0)