From c89a9a1633b6503efcc960685e57bdec041566a4 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 27 Feb 2023 14:15:03 +0000 Subject: [PATCH] wait #5757 @1.5 --- .docker/images/php/Dockerfile | 1 + composer.json | 3 ++- .../class.ws.packager.win.exe.html.php | 19 +++++++++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.docker/images/php/Dockerfile b/.docker/images/php/Dockerfile index 1de25a144..6fe9437d8 100644 --- a/.docker/images/php/Dockerfile +++ b/.docker/images/php/Dockerfile @@ -70,6 +70,7 @@ RUN apt -y --no-install-recommends install libreoffice RUN apt -y --no-install-recommends install sshfs lftp RUN apt -y --no-install-recommends install sshfs python3 python3-pip RUN apt -y --no-install-recommends install openssh-server rsyslog +RUN apt update RUN apt -y --no-install-recommends install mariadb-client RUN apt -y --no-install-recommends install pdfposter rename diff --git a/composer.json b/composer.json index 83616219f..3a0cc0813 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,7 @@ "hollodotme/fast-cgi-client": "^3.1", "cubist/azuretts": "dev-master", "ext-zip": "*", - "cubist/matomo": "dev-master" + "cubist/matomo": "dev-master", + "ext-ssh2": "*" } } diff --git a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php index 6ea58d1de..99ee1f205 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php +++ b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php @@ -41,7 +41,7 @@ class wsPackagerWinEXEHTML extends wsPackager $this->copyFluidbookFiles(); $this->makeJSON(); - $this->buildPath = wsBook::getPackagerDir($this->book_id,true) . '/nwbuild/' . $this->version . '/' . $this->book_id; + $this->buildPath = wsBook::getPackagerDir($this->book_id, true) . '/nwbuild/' . $this->version . '/' . $this->book_id; `umask 0000;rm -rf $this->buildPath;mkdir -p 0777 $this->buildPath;chmod -R 777 $this->vdir;mkdir -p 0777 /application/tmp;chmod -R 777 /application/tmp`; @@ -89,15 +89,22 @@ class wsPackagerWinEXEHTML extends wsPackager function _sign($exe) { + $ssh = new CubeIT_Networking_SSH2('paris.cubedesigners.com', 'vince', 'Y@mUC9mY2DOYWXkN', '22422'); $rand = 'sign-' . rand(1000000, 9999999) . '.exe'; - copy($exe, '/mnt/sshfs/codesign/' . $rand); + $remote = 'C:/Sign/' . $rand; + $ssh->send($exe, $remote); + unlink($exe); $cli = new CubeIT_CommandLine('C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/signtool.exe'); - $cli->setManualArg("sign /f C:/Users/vince/Documents/Cubedesigners.cer /csp \"eToken Base Cryptographic Provider\" /k \"[SafeNet Token JC 0{{TYWjZacq%hAH98}}]=54C3F1B91759268A\" /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a C:/Sign/$rand"); - $cli->execute(new CubeIT_Networking_SSH2('paris.cubedesigners.com', 'vince', 'Y@mUC9mY2DOYWXkN', '22422')); + $cli->setManualArg("sign /f C:/Users/vince/Documents/Cubedesigners.cer /csp \"eToken Base Cryptographic Provider\" /k \"[SafeNet Token JC 0{{TYWjZacq%hAH98}}]=54C3F1B91759268A\" /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a $remote"); + $cli->execute($ssh); $cli->debug(); + if (!stristr($cli->output, 'Successfully signed')) { + $ssh->unlink($remote); + throw new \Exception('Error while signing exe ' . $rand . ' : ' . $cli->command . ' /// ' . $cli->output); + } + $ssh->recv($remote, $exe); + $ssh->unlink($remote); sleep(2); - copy('/mnt/sshfs/codesign/' . $rand, $exe); - unlink('/mnt/sshfs/codesign/' . $rand); } function replaceFFMpeg() -- 2.39.5