]> BookStack Code Mirror - system-cli/commitdiff
Added general warning on all app usage about alpha status
authorDan Brown <redacted>
Wed, 3 May 2023 09:45:45 +0000 (10:45 +0100)
committerDan Brown <redacted>
Wed, 3 May 2023 09:45:45 +0000 (10:45 +0100)
- Also upped more timeouts.
- Added extra advisory text for restore regarding permissions.

run.php
src/Commands/InitCommand.php
src/Commands/RestoreCommand.php
src/Services/MySqlRunner.php

diff --git a/run.php b/run.php
index 56d19524f87c8beb083043bf45b4f52e30ece80b..6fb523c203c1d751a70b508ff554be54db3d76b6 100644 (file)
--- a/run.php
+++ b/run.php
@@ -1,5 +1,6 @@
 #!/usr/bin/env php
 <?php
+declare(strict_types=1);
 
 if (php_sapi_name() !== 'cli') {
     exit;
@@ -23,6 +24,10 @@ $formatter->setStyle('error', new OutputFormatterStyle('red'));
 
 // Run the command and handle errors
 try {
+    $output->writeln("<warn>WARNING: This CLI is in early alpha testing.</warn>");
+    $output->writeln("<warn>There's a high chance of running into bugs, and the CLI API is subject to change.</warn>");
+    $output->writeln("");
+
     $app->run(null, $output);
 } catch (Exception $error) {
     $output = (new ConsoleOutput())->getErrorOutput();
index a82b02d4908a12456062d4f0c678d1eb2732dd2e..4ebd267aa2336f1f833eabf34f4ee599b66f9e5c 100644 (file)
@@ -71,7 +71,7 @@ class InitCommand extends Command
     {
         $errors = (new ProgramRunner('php', '/usr/bin/php'))
             ->withTimeout(60)
-            ->withIdleTimeout(5)
+            ->withIdleTimeout(15)
             ->withEnvironment(EnvironmentLoader::load($installDir))
             ->runCapturingAllOutput([
                 Paths::join($installDir, 'artisan'),
index 4a5fad74ad635989c5b79e6f8aacdafe90c369a5..f46d571d23cb06aa9a50c43efa66dd02354d7fbe 100644 (file)
@@ -120,6 +120,8 @@ class RestoreCommand extends Command
         $this->deleteDirectoryAndContents($extractDir);
 
         $output->writeln("<success>\nRestore operation complete!</success>");
+        $output->writeln("<info>You may need to fix file/folder permissions so that the webserver has</info>");
+        $output->writeln("<info>the required read/write access to the necessary directories & files.</info>");
 
         return Command::SUCCESS;
     }
index 8a91aadbe629b6c62d229a04102c28519b8d3a56..f9110695a50371a81fa9f482f2b9d752ffa4a0dc 100644 (file)
@@ -50,8 +50,8 @@ class MySqlRunner
     {
         $output = (new ProgramRunner('mysql', '/usr/bin/mysql'))
             ->withEnvironment(['MYSQL_PWD' => $this->password])
-            ->withTimeout(240)
-            ->withIdleTimeout(5)
+            ->withTimeout(300)
+            ->withIdleTimeout(300)
             ->runCapturingStdErr([
                 '-h', $this->host,
                 '-P', $this->port,
@@ -94,8 +94,8 @@ HEREDOC;
 
         try {
             (new ProgramRunner('mysqldump', '/usr/bin/mysqldump'))
-                ->withTimeout(240)
-                ->withIdleTimeout(15)
+                ->withTimeout(300)
+                ->withIdleTimeout(300)
                 ->withEnvironment(['MYSQL_PWD' => $this->password])
                 ->runWithoutOutputCallbacks([
                     '-h', $this->host,