Skip to content

Commit

Permalink
REMOVE THIS COMMIT
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Mar 14, 2024
1 parent a3cd8ed commit 4444b69
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,7 @@ jobs:
run: |
export BEHAT_RUN_AS=$(ls -ld behat.yml | awk '{print $3}')
export BEHAT_VERBOSE="$RUNNER_DEBUG"
vendor/bin/behat -f junit -f pretty --colors
whoami
env
ls -la $BEHAT_ROOT_DIR
vendor/bin/behat -f junit -f pretty --colors features/account/signature.feature:28
17 changes: 17 additions & 0 deletions lib/Service/InstallService.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ public function setOutput(OutputInterface $output): void {
}

private function getFolder(string $path = ''): ISimpleFolder {
$this->appConfig->setAppValue('getting folder', $path);
$ls = shell_exec('ls -la data');
$this->appConfig->setAppValue('ls -la data', $ls);
$appdata = shell_exec('ls -la data/appdata_*');
$this->appConfig->setAppValue('ls -la data/appdata_*', $appdata);
$whoami = shell_exec('whoami');
$this->appConfig->setAppValue('whoami', $whoami);
$folder = $this->appData->getFolder('/');
$this->appConfig->setAppValue('folder found', 'yay');
if ($path) {
try {
$folder = $folder->getFolder($path);
Expand Down Expand Up @@ -485,6 +493,7 @@ public function uninstallPdftk(): void {
}

public function installCfssl(?bool $async = false): void {
$this->appConfig->setAppValue('start install as async', $async ? 'yes': 'no');
if ($this->certificateEngineHandler->getEngine()->getName() !== 'cfssl') {
if (!$async) {
throw new InvalidArgumentException('Set the engine to cfssl with: config:app:set libresign certificate_engine --value cfssl');
Expand All @@ -496,20 +505,26 @@ public function installCfssl(?bool $async = false): void {
$this->runAsync();
return;
}
$this->appConfig->setAppValue('OS Family', PHP_OS_FAMILY);
if (PHP_OS_FAMILY !== 'Linux') {
throw new RuntimeException(sprintf('OS_FAMILY %s is incompatible with LibreSign.', PHP_OS_FAMILY));
}
$architecture = php_uname('m');
$this->appConfig->setAppValue('Architecture', $architecture);
if ($architecture === 'x86_64') {
$this->installCfssl64();
} elseif ($architecture === 'aarch64') {
$this->installCfsslArm();
} else {
$this->appConfig->setAppValue('Invalid architecture', $architecture);
throw new RuntimeException(sprintf('Architecture %s is incompatible with LibreSign.', $architecture));
}
$this->removeDownloadProgress();
}

private function installCfssl64(): void {
$folder = $this->getFolder();
$this->appConfig->setAppValue('01. app defined', '');

$downloads = [
[
Expand All @@ -525,9 +540,11 @@ private function installCfssl64(): void {
$checksumUrl = 'https://github.com/cloudflare/cfssl/releases/download/v' . self::CFSSL_VERSION . '/cfssl_' . self::CFSSL_VERSION . '_checksums.txt';
foreach ($downloads as $download) {
$hash = $this->getHash($folder, 'cfssl', $download['file'], self::CFSSL_VERSION, $checksumUrl);
$this->appConfig->setAppValue('02. hash', $hash);

$file = $folder->newFile($download['destination']);
$fullPath = $this->getDataDir() . DIRECTORY_SEPARATOR . $this->getInternalPathOfFile($file);
$this->appConfig->setAppValue('03. full path', $fullPath);

$this->download($baseUrl . $download['file'], $download['destination'], $fullPath, $hash, 'sha256');

Expand Down
1 change: 1 addition & 0 deletions tests/integration/features/account/signature.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Feature: account/signature
And as user "signer1"
And run the command "config:app:set libresign certificate_engine --value cfssl"
And run the command "libresign:install --cfssl"
And run the command "config:list libresign"
And run the command "libresign:configure:cfssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company"
And sending "post" to ocs "/apps/libresign/api/v1/account/signature"
| signPassword | password |
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public static function runCommand($command): void {
if (posix_getuid() !== $owner['uid']) {
$fullCommand = 'runuser -u ' . $owner['name'] . ' -- ' . $fullCommand;
}
$fullCommand .= ' 2>&1';
exec($fullCommand, $output);
print_r($output);
}

public function setOpenedEmailStorage(OpenedEmailStorage $storage): void {
Expand Down

0 comments on commit 4444b69

Please sign in to comment.