docker plugin install ucphhpc/sshfs --grant-all-permissions
/home/toolbox/www/scripts/fixrights.sh
chown root:root /home/toolbox/www/.docker/config/cron/host;ln -sf /home/toolbox/www/.docker/config/cron/host /etc/cron.d/toolbox
+chown root:root /home/toolbox/www/.docker/config/sudoers
docker network create fluidbook-toolbox
docker compose down
docker volume rm fluidbook-toolbox_sshfsusstorage
namespace App\Fluidbook;
-use Cubist\PDF\PDFTools;
use Cubist\Util\Files\Files;
use Fluidbook\Tools\Jobs\ProcessFile;
use hollodotme\FastCGI\Client;
return trim($response->getBody());
}
+ /**
+ * @throws \Exception
+ */
public static function getFile($page, $format, $resolution, $quality, $withText, $withGraphics, $version, $resolutionRatio, $mobileFirstRatio, $path, $force = false)
{
$params = [
$time = round(microtime(true) - $start, 4);
$log = '[' . $farmer['name'] . ']' . "\t" . date('Y-m-d H:i:s') . "\t" . $time . "\t" . implode('|', $params) . "\t($res)\t>>" . $output . "\n";
+ $dir = isset($params['pdf']) ? dirname($params['pdf']) : $params['out'];
+ $logfile = $dir . '/farm.log';
+
+ if ($fp = fopen($logfile, 'ab')) {
+ fwrite($fp, $log);
+ fclose($fp);
+ }
+
if (!$res) {
if ($attempts > 0) {
Log::warning('Farm failure (' . $farmer['name'] . ') : ' . $output . ' // ' . $log);
namespace App\Jobs;
use App\Models\FluidbookDocument;
+use Illuminate\Support\Facades\Log;
class FluidbookDocumentFileProcess extends Base
{
try {
echo $this->document->getFile($this->page, $this->format, $this->resolution, $this->quality, $this->withText, $this->withGraphics, $this->version, $this->forceCheck, $this->forceProcess) . "\n";
} catch (\Exception $e) {
+ Log::warning($e->getMessage());
$this->log = $e->getMessage();
}
$this->finish = true;
return $this->path;
}
- public function getLog(){
+ public function getLog()
+ {
return $this->log;
}
}
use Cubist\Util\Gzip;
use Cubist\Util\Math;
use Illuminate\Support\Facades\Cache;
-use Illuminate\Support\Facades\Log;
// __('!!Paramètres des fluidbooks')
class FluidbookDocument extends ToolboxModel
}
+ /**
+ * @throws \Exception
+ */
public function _getFile($page, $format = 'jpg', $resolution = 150, $quality = 85, $withText = true, $withGraphics = true, $version = 'html', $forceCheck = true)
{
Farm::setRegion($this->getRegion());
chmod -R 775 /home/toolbox/www/bin
chown root:root /home/toolbox/dev/.docker/config/sudoers
+chown root:root /home/toolbox/dev/.docker/config/cron/host
chmod -R 775 /home/toolbox/dev/scripts
chmod -R 775 /home/toolbox/dev/protected
chmod -R 775 /home/toolbox/dev/public
chmod -R 775 /home/toolbox/dev/bin
+chown root:root /home/toolbox/alpha/.docker/config/sudoers
+chown root:root /home/toolbox/alpha/.docker/config/cron/host