RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
-RUN npm install --unsafe-perm --global uglify-js less sass puppeteer favicons nw-builder@^3
+RUN npm install --unsafe-perm --global uglify-js less sass puppeteer favicons crx3 nw-builder@^3
RUN pip3 install font-line
RUN groupadd sudo;useradd -d /application -g 33 -G sudo -s /bin/bash -u 1001 toolbox
class ChromeOS extends Online
{
- public $type='chormeos';
- public $cleanOnDestruct=true;
+ public $type = 'chormeos';
+ public $cleanOnDestruct = true;
- public $downloadExt='crx';
+ public $downloadExt = 'crx';
protected function preparePackage()
{
{
$this->preparePackage();
+ //
+
+ $final = $this->getPathBase('crx');
+
$chrome = new CommandLine('crx3');
- $chrome->setArg('o', WS_PACKAGER . '/download/' . $this->getBaseFile() . '.crx');
+ $chrome->setArg('o', $final);
$chrome->setArg(null, $this->vdir . '/m/');
$chrome->execute();
$chrome->debug();
+
+ $this->setFinalURL($this->getDownloadURL('crx'));
+ $this->setFinalPath($final);
}
}
use App\Jobs\DownloadBase;
use App\Services\ScormCloud;
use Cubist\Util\Files\Files;
+use Illuminate\Support\Facades\Log;
class Download extends DownloadBase
{
$url = $this->_compileandpackage();
$subject = __($this->_subject, ['title' => $this->_title(), 'nb' => $this->_id()]);
$text = '';
- $actions = ['Télécharger' => $url];
+ if ($this->action === 'download' || $this->action === 'scormcloud') {
+ $actions = ['Télécharger' => $url];
- if ($this->action === 'scormcloud') {
- try {
- $scormURL = ScormCloud::send($url, 'toolbox_' . $this->type . '_' . $this->_id());
- $actions[__('Tester sur SCORM Cloud')] = $scormURL;
- } catch (\Exception $e) {
+ if ($this->action === 'scormcloud') {
+ try {
+ $scormURL = ScormCloud::send($url, 'toolbox_' . $this->type . '_' . $this->_id());
+ $actions[__('Tester sur SCORM Cloud')] = $scormURL;
+ } catch (\Exception $e) {
+ }
+ $text = __('Une erreur s\'est produite lors de l\'envoi sur SCORM Cloud (App ID :appid) : :error', ['error' => $e->getMessage(), 'appid' => env('SCORM_CLOUD_APP_ID')]);
}
- $text = __('Une erreur s\'est produite lors de l\'envoi sur SCORM Cloud (App ID :appid) : :error', ['error' => $e->getMessage(), 'appid' => env('SCORM_CLOUD_APP_ID')]);
}
} catch (\Exception $e) {
$subject = __('Erreur lors de la compilation du :type :nb', ['nb' => $this->_id(), 'type' => $this->type]);
protected function _compileandpackage()
{
- if($this->action==='download' || $this->action===''){
- $zip=true;
+ if ($this->action === 'download' || $this->action === '') {
+ $zip = true;
}
- Packager::package($this->entry->id, $this->version);
+ $packager = Packager::package($this->entry->id, $this->version, $zip);
+ $packager->makePackage($zip);
+ Log::debug($this->action . '/' . $this->entry->id . '/' . $this->version . '/' . get_class($packager) . '///' . $packager->getFinalURL() . '//' . $packager->getFinalPath());
+ $url = $packager->getFinalURL();
+ if ($url) {
+ return $url;
+ }
+ return $packager->getFinalPath();
}
}
$res = $this->getFinalPackageDir();
}
$this->postPackage();
+ $this->setFinalURL(null);
+ $this->setFinalPath($res);
return $res;
}
{
protected $_allowNetworking = 'internal';
public $type = 'win_html';
-
-
- protected function copyFluidbookFiles()
- {
- parent::copyFluidbookFiles();
- unlink($this->vdir . '/index.swf');
- unlink($this->vdir . '/player.swf');
- copy(WS_COMPILE_ASSETS . '/offline.swf', $this->vdir . '/index.swf');
- }
}
if ($zip) {
return $this->zip();
}
+
+ $this->setFinalURL(null);
+ $this->setFinalPath($this->getFinalPackageDir());
return $this->getFinalPackageDir();
}
public $zipPackage = true;
- public $downloadExt='zip';
+ public $downloadExt = 'zip';
+
+ /**
+ * @var string
+ */
+ protected $_finalPath = '';
+
+ /**
+ * @var string
+ */
+ protected $_finalURL = '';
public static function package($book_id, $type, $zipPackage = true, $cleanOnDestruct = true, $options = [])
if ($rename) {
rename($zipfile, $final);
}
+
+ $this->setFinalPath($final);
+ $this->setFinalURL($this->getDownloadURL('zip'));
return $final;
}
`find $dest -type f -name "*.html" -exec rename 's/\.html$/.$e/' '{}' \;`;
}
}
+
+ /**
+ * @return string
+ */
+ public function getFinalPath(): string
+ {
+ return $this->_finalPath;
+ }
+
+ /**
+ * @param string $finalPath
+ */
+ public function setFinalPath(string $finalPath): void
+ {
+ $this->_finalPath = $finalPath;
+ }
+
+ /**
+ * @return string
+ */
+ public function getFinalURL(): string
+ {
+ return $this->_finalURL;
+ }
+
+
+ /**
+ * @param string $finalURL
+ */
+ public function setFinalURL(string $finalURL): void
+ {
+ $this->_finalURL = $finalURL;
+ }
}
$this->book->parametres->embedAllLibraries = true;
}
-
public function prepareHTML5()
{
$res = parent::prepareHTML5();
$this->replaceAutorun();
// Package mac app
- $win = ROOT . Packager::package($this->book_id, 'win_inss_html', false, false);
+ $win = Packager::package($this->book_id, 'win_inss_html', false, false);
$dest = $this->getFinalPackageDir() . "/" . $this->exeName . '.exe';
$cp = "cp $win $dest";
public function replaceAutorun()
{
- $inf = file_get_contents(WS_COMPILE_ASSETS . '/autorun-html.inf');
+ $inf = file_get_contents($this->resource_path('fluidbook/packager') . '/autorun-html.inf');
$toReplace = array('title' => $this->book->parametres->title, 'exe' => $this->exeName . '.exe', 'nwplatform' => $this->nwplatform);
$inf = $this->replaceContents($inf, $toReplace);
file_put_contents($this->getFinalPackageDir() . '/autorun.inf', utf8_decode($inf));
$makensis->setArg(null, '-V4');
$makensis->setArg(null, $tmp);
$makensis->execute();
- if (!file_exists($this->getPathBase('exe'))) {
+
+ $out=$this->getPathBase('exe');
+
+ if (!file_exists($out) ){
die('Error while building the installer : ' . $this->getPathBase('exe'));
}
$this->signInstaller();
- if (!file_exists($this->getPathBase('exe'))) {
+ if (!file_exists($out)) {
die('Error during the signing process : ' . $this->getPathBase('exe'));
}
+
+ $this->setFinalURL($this->getDownloadURL('exe'));
+ $this->setFinalPath($out);
}
public function signInstaller()
$actionsText = '';
$i = 0;
foreach ($actions as $label => $data) {
- if (is_null($data)) {
- $data = ['url' => '#nourl'];
+ if (!$data) {
+ $data = ['url' => ''];
}
if (is_string($data)) {
$data = ['url' => $data];
}
+ if (!$data['url']) {
+ $data['url'] = 'https://toolbox.fluidbook.com/404';
+ }
if ($i < 6) {
$a['elements'][] = array_merge([
'type' => 'button',
|
*/
- 'debug' => !isset($_SERVER['HTTP_X_REAL_IP']) || in_array($_SERVER['HTTP_X_REAL_IP'], ['130.180.213.67']),
+ 'debug' => !isset($_SERVER['HTTP_X_REAL_IP']) || in_array($_SERVER['HTTP_X_REAL_IP'], ['130.180.213.67']) ? env('APP_DEBUG') : false,
/*
|--------------------------------------------------------------------------
+++ /dev/null
-<?php
-
-return [
-
- /*
- |--------------------------------------------------------------------------
- | Login key
- |--------------------------------------------------------------------------
- |
- | This is your authorization key which you get from your profile.
- | Retrieve your key from https://www.larabug.com
- |
- */
-
- 'login_key' => env('LB_KEY', ''),
-
- /*
- |--------------------------------------------------------------------------
- | Project key
- |--------------------------------------------------------------------------
- |
- | This is your project key which you receive when creating a project
- | Retrieve your key from https://www.larabug.com
- |
- */
-
- 'project_key' => env('LB_PROJECT_KEY', ''),
-
- /*
- |--------------------------------------------------------------------------
- | Environment setting
- |--------------------------------------------------------------------------
- |
- | This setting determines if the exception should be send over or not.
- |
- */
-
- 'environments' => [
- 'production',
- 'staging',
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Project version
- |--------------------------------------------------------------------------
- |
- | Set the project version, default: null.
- | For git repository: shell_exec("git log -1 --pretty=format:'%h' --abbrev-commit")
- |
- */
- 'project_version' => null,
-
- /*
- |--------------------------------------------------------------------------
- | Lines near exception
- |--------------------------------------------------------------------------
- |
- | How many lines to show near exception line. The more you specify the bigger
- | the displayed code will be. Max value can be 50, will be defaulted to
- | 12 if higher than 50 automatically.
- |
- */
-
- 'lines_count' => 12,
-
- /*
- |--------------------------------------------------------------------------
- | Prevent duplicates
- |--------------------------------------------------------------------------
- |
- | Set the sleep time between duplicate exceptions. This value is in seconds, default: 60 seconds (1 minute)
- |
- */
-
- 'sleep' => 60,
-
- /*
- |--------------------------------------------------------------------------
- | Skip exceptions
- |--------------------------------------------------------------------------
- |
- | List of exceptions to skip sending.
- |
- */
-
- 'except' => [
- 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException',
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Key filtering
- |--------------------------------------------------------------------------
- |
- | Filter out these variables before sending them to LaraBug
- |
- */
-
- 'blacklist' => [
- '*authorization*',
- '*password*',
- '*token*',
- '*auth*',
- '*verification*',
- '*credit_card*',
- 'cardToken', // mollie card token
- '*cvv*',
- '*iban*',
- '*name*',
- '*email*'
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Release git hash
- |--------------------------------------------------------------------------
- |
- |
- */
-
- // 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')),
-
- /*
- |--------------------------------------------------------------------------
- | Server setting
- |--------------------------------------------------------------------------
- |
- | This setting allows you to change the server.
- |
- */
-
- 'server' => env('LB_SERVER', 'https://www.larabug.com/api/log'),
-
- /*
- |--------------------------------------------------------------------------
- | Verify SSL setting
- |--------------------------------------------------------------------------
- |
- | Enables / disables the SSL verification when sending exceptions to LaraBug
- | Never turn SSL verification off on production instances
- |
- */
- 'verify_ssl' => env('LB_VERIFY_SSL', true),
-
-];
'channels' => [
'stack' => [
'driver' => 'stack',
- 'channels' => ['daily', 'stderr', 'larabug'],
+ 'channels' => ['daily', 'stderr', 'slack'],
'ignore_exceptions' => false,
],
'larabug' => [
'driver' => 'larabug',
+ 'level' => 'debug',
],
],