* [pve-devel] [PATCH common v3 1/1] PBSClient: add 'tar' parameter to file_restore_extract
2023-10-19 9:13 [pve-devel] [PATCH common/storage/widget-toolkit v3] add tar.zst download in pve Dominik Csapak
@ 2023-10-19 9:13 ` Dominik Csapak
2023-11-06 17:34 ` [pve-devel] applied: " Thomas Lamprecht
2023-10-19 9:13 ` [pve-devel] [PATCH storage v3 1/1] api/filerestore: add 'tar' parameter to 'download' api Dominik Csapak
2023-10-19 9:13 ` [pve-devel] [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default Dominik Csapak
2 siblings, 1 reply; 9+ messages in thread
From: Dominik Csapak @ 2023-10-19 9:13 UTC (permalink / raw)
To: pve-devel
so that we can get a 'tar.zst' from proxmox-file-restore by giving
'--format tar --zstd' to the file-restore binary
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/PVE/PBSClient.pm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm
index ec05a1c..e63af03 100644
--- a/src/PVE/PBSClient.pm
+++ b/src/PVE/PBSClient.pm
@@ -416,7 +416,7 @@ sub file_restore_extract_prepare {
# this blocks while data is transfered, call this from a background worker
sub file_restore_extract {
- my ($self, $output_file, $snapshot, $filepath, $base64) = @_;
+ my ($self, $output_file, $snapshot, $filepath, $base64, $tar) = @_;
(my $namespace, $snapshot) = split_namespaced_parameter($self, $snapshot);
@@ -430,10 +430,15 @@ sub file_restore_extract {
my $fn = fileno($fh);
my $errfunc = sub { print $_[0], "\n"; };
+ my $cmd = [ $snapshot, $filepath, "-", "--base64", $base64 ? 1 : 0];
+ if ($tar) {
+ push @$cmd, '--format', 'tar', '--zstd', 1;
+ }
+
return run_raw_client_cmd(
$self,
"extract",
- [ $snapshot, $filepath, "-", "--base64", $base64 ? 1 : 0 ],
+ $cmd,
binary => "proxmox-file-restore",
namespace => $namespace,
errfunc => $errfunc,
--
2.30.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pve-devel] [PATCH storage v3 1/1] api/filerestore: add 'tar' parameter to 'download' api
2023-10-19 9:13 [pve-devel] [PATCH common/storage/widget-toolkit v3] add tar.zst download in pve Dominik Csapak
2023-10-19 9:13 ` [pve-devel] [PATCH common v3 1/1] PBSClient: add 'tar' parameter to file_restore_extract Dominik Csapak
@ 2023-10-19 9:13 ` Dominik Csapak
2023-11-13 15:45 ` [pve-devel] applied: " Thomas Lamprecht
2023-10-19 9:13 ` [pve-devel] [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default Dominik Csapak
2 siblings, 1 reply; 9+ messages in thread
From: Dominik Csapak @ 2023-10-19 9:13 UTC (permalink / raw)
To: pve-devel
to be able to download 'tar.zst' archives
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/PVE/API2/Storage/FileRestore.pm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/PVE/API2/Storage/FileRestore.pm b/src/PVE/API2/Storage/FileRestore.pm
index 764ebfb..6c9cda6 100644
--- a/src/PVE/API2/Storage/FileRestore.pm
+++ b/src/PVE/API2/Storage/FileRestore.pm
@@ -167,6 +167,12 @@ __PACKAGE__->register_method ({
description => 'base64-path to the directory or file to download.',
type => 'string',
},
+ tar => {
+ description => "Download dirs as 'tar.zst' instead of 'zip'.",
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ },
},
},
returns => {
@@ -182,6 +188,7 @@ __PACKAGE__->register_method ({
my $path = extract_param($param, 'filepath');
my $storeid = extract_param($param, 'storage');
my $volid = $parse_volname_or_id->($storeid, $param->{volume});
+ my $tar = extract_param($param, 'tar') // 0;
my $cfg = PVE::Storage::config();
my $scfg = PVE::Storage::storage_config($cfg, $storeid);
@@ -199,7 +206,7 @@ __PACKAGE__->register_method ({
$rpcenv->fork_worker('pbs-download', undef, $user, sub {
my $name = decode_base64($path);
print "Starting download of file: $name\n";
- $client->file_restore_extract($fifo, $snap, $path, 1);
+ $client->file_restore_extract($fifo, $snap, $path, 1, $tar);
});
my $ret = {
--
2.30.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pve-devel] [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default
2023-10-19 9:13 [pve-devel] [PATCH common/storage/widget-toolkit v3] add tar.zst download in pve Dominik Csapak
2023-10-19 9:13 ` [pve-devel] [PATCH common v3 1/1] PBSClient: add 'tar' parameter to file_restore_extract Dominik Csapak
2023-10-19 9:13 ` [pve-devel] [PATCH storage v3 1/1] api/filerestore: add 'tar' parameter to 'download' api Dominik Csapak
@ 2023-10-19 9:13 ` Dominik Csapak
2023-11-13 15:46 ` [pve-devel] applied: " Thomas Lamprecht
2023-11-13 15:46 ` [pve-devel] " Thomas Lamprecht
2 siblings, 2 replies; 9+ messages in thread
From: Dominik Csapak @ 2023-10-19 9:13 UTC (permalink / raw)
To: pve-devel
all endpoints now can handle the 'tar' parameter, so add it for all
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/window/FileBrowser.js | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/window/FileBrowser.js b/src/window/FileBrowser.js
index 4e4c639..e036d9f 100644
--- a/src/window/FileBrowser.js
+++ b/src/window/FileBrowser.js
@@ -61,10 +61,6 @@ Ext.define("Proxmox.window.FileBrowser", {
'd': true, // directories
},
- // enable tar download, this will add a menu to the "Download" button when the selection
- // can be downloaded as `.tar` files
- enableTar: false,
-
// prefix to prepend to downloaded file names
downloadPrefix: '',
},
@@ -126,7 +122,7 @@ Ext.define("Proxmox.window.FileBrowser", {
view.lookup('selectText').setText(st);
let canDownload = view.downloadURL && view.downloadableFileTypes[data.type];
- let enableMenu = view.enableTar && data.type === 'd';
+ let enableMenu = data.type === 'd';
let downloadBtn = view.lookup('downloadBtn');
downloadBtn.setDisabled(!canDownload || enableMenu);
--
2.30.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pve-devel] applied: [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default
2023-10-19 9:13 ` [pve-devel] [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default Dominik Csapak
@ 2023-11-13 15:46 ` Thomas Lamprecht
2023-11-13 15:46 ` [pve-devel] " Thomas Lamprecht
1 sibling, 0 replies; 9+ messages in thread
From: Thomas Lamprecht @ 2023-11-13 15:46 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
Am 19/10/2023 um 11:13 schrieb Dominik Csapak:
> all endpoints now can handle the 'tar' parameter, so add it for all
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/window/FileBrowser.js | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [pve-devel] [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default
2023-10-19 9:13 ` [pve-devel] [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default Dominik Csapak
2023-11-13 15:46 ` [pve-devel] applied: " Thomas Lamprecht
@ 2023-11-13 15:46 ` Thomas Lamprecht
2023-11-13 15:48 ` Dominik Csapak
1 sibling, 1 reply; 9+ messages in thread
From: Thomas Lamprecht @ 2023-11-13 15:46 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
Am 19/10/2023 um 11:13 schrieb Dominik Csapak:
> diff --git a/src/window/FileBrowser.js b/src/window/FileBrowser.js
> index 4e4c639..e036d9f 100644
> --- a/src/window/FileBrowser.js
> +++ b/src/window/FileBrowser.js
> @@ -61,10 +61,6 @@ Ext.define("Proxmox.window.FileBrowser", {
> 'd': true, // directories
> },
>
> - // enable tar download, this will add a menu to the "Download" button when the selection
> - // can be downloaded as `.tar` files
> - enableTar: false,
> -
ps. isn't there a call-site where we had this set, i.e., that could be dropped now?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [pve-devel] [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default
2023-11-13 15:46 ` [pve-devel] " Thomas Lamprecht
@ 2023-11-13 15:48 ` Dominik Csapak
0 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2023-11-13 15:48 UTC (permalink / raw)
To: Thomas Lamprecht, Proxmox VE development discussion
On 11/13/23 16:46, Thomas Lamprecht wrote:
> Am 19/10/2023 um 11:13 schrieb Dominik Csapak:
>> diff --git a/src/window/FileBrowser.js b/src/window/FileBrowser.js
>> index 4e4c639..e036d9f 100644
>> --- a/src/window/FileBrowser.js
>> +++ b/src/window/FileBrowser.js
>> @@ -61,10 +61,6 @@ Ext.define("Proxmox.window.FileBrowser", {
>> 'd': true, // directories
>> },
>>
>> - // enable tar download, this will add a menu to the "Download" button when the selection
>> - // can be downloaded as `.tar` files
>> - enableTar: false,
>> -
>
> ps. isn't there a call-site where we had this set, i.e., that could be dropped now?
>
yes, but that's in proxmox-backup, should i already send that patch
or do we wait until we bump widget-toolkit?
^ permalink raw reply [flat|nested] 9+ messages in thread