]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7864 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 1 Dec 2025 14:57:37 +0000 (15:57 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 1 Dec 2025 14:57:37 +0000 (15:57 +0100)
app/Jobs/HostingUpdate.php
app/Models/Traits/PublicationSettings.php
resources/hosting/server/docker-compose.yml
resources/hosting/server/update

index 74382cf07878cc5bae402fe417866f6e61a25def..b420b8cec855a23315ed309933d524edb3d86d68 100644 (file)
@@ -38,33 +38,35 @@ class HostingUpdate extends Base
 
         copy($r . 'updateall', $d . 'update');
 
-
-
         foreach ($servers as $server) {
-            $basePath = trim($server->base_path, '/');
-            if ($basePath != '') {
-                $basePath = '/' . $basePath;
-            }
+            try {
+                $basePath = trim($server->base_path, '/');
+                if ($basePath != '') {
+                    $basePath = '/' . $basePath;
+                }
+
+                $phpversion = floatval($server->php);
+                $image = 'php:apache';
+                if ($phpversion > 1) {
+                    $image = 'php:' . $phpversion . '-apache';
+                }
+
+                /** @var FluidbookExternalInstallServer $server */
+                $server->updateHtaccess();
+                $s = $d . 'server-' . $server->id;
+                Files::copy($r . 'server', $s);
+                Files::recursiveReplaceStringInDir($s, [
+                    '$sid' => $server->id,
+                    '$image' => $image,
+                    '$dockerpath' => ($image !== 'httpd') ? '/var/www/html' : '/usr/local/apache2/htdocs',
+                    '$domains' => implode(',', Text::explodeNewLines($server->subdomains)),
+                    '$hosting' => $name,
+                    '$path' => $data['basepath'] . $basePath,
+                ]);
+                $updateAll[] = '/docker/fluidbook-' . $name . '/server-' . $server->id . '/update';
+            } catch (\Exception $e) {
 
-            $phpversion=floatval($server->php);
-            $image = 'php:apache';
-            if ($phpversion > 1) {
-                $image = 'php:' . $phpversion . '-apache';
             }
-
-            /** @var FluidbookExternalInstallServer $server */
-            $server->updateHtaccess();
-            $s = $d . 'server-' . $server->id;
-            Files::copy($r . 'server', $s);
-            Files::recursiveReplaceStringInDir($s, [
-                '$sid' => $server->id,
-                '$image' => $image,
-                '$dockerpath' => ($image !== 'httpd') ? '/var/www/html' : '/usr/local/apache2/htdocs',
-                '$domains' => implode(',', Text::explodeNewLines($server->subdomains)),
-                '$hosting' => $name,
-                '$path' => $data['basepath'] . $basePath,
-            ]);
-            $updateAll[] = '/docker/fluidbook-' . $name . '/server-' . $server->id . '/update';
         }
 
         Files::recursiveReplaceStringInDir($d, [
index 1fc083043b5ff9689424243753ac238cd29298ef..95103f443f0128804239d9a0390d342f05f92f29 100644 (file)
@@ -1304,11 +1304,14 @@ trait PublicationSettings
     protected function _accessibility()
     {
         $this->_addSettingField('section_accessibility', FormBigSection::class, $this->__('Accessibilité'));
-        $this->_addSettingField('audiodescriptionTexts', FilesOrURL::class, $this->__('Contenus textuels pour l\'audiodescription ou les lecteurs d\'écran'), [
+        $this->_addSettingField('accessible_contents', SelectFromArray::class, $this->__('Contenus alternatifs accessibles'), ['default' => 'disabled', 'options' => ['disabled' => __('Désactivés'), 'docling' => __('Contenus accessibles extraits automatiquement et édités'), 'excel' => __('Fichier excel ou liens "audiodescription"')]]);
+        $this->_addSettingField('audiodescriptionTexts', FilesOrURL::class, $this->__('Contenus textuels'), [
             'accept' => self::$acceptXLSX,
-            'hint' => '<a href="/fluidbook-publication/$id/pdftextsforaudiodescription">' . __('Télécharger les contenus extraits du PDF au format audiodescription') . '</a>',
+            'hint' => '<a href="/fluidbook-publication/$id/pdftextsforaudiodescription">' . $this->__('Télécharger les contenus extraits du PDF au format audiodescription') . '</a>',
+            'when' => ['accessible_contents' => ['excel']],
         ]);
-        $this->_addSettingField('audiodescriptionVoice', FluidbookTTSVoice::class, $this->__('Voix pour l\'audiodescription'));
+        $this->_addSettingField('audiodescription', Checkbox::class, $this->__('Activer l\'audiodescription'), ['default' => false, 'when' => ['accessible_contents' => ['docling', 'excel']]]);
+        $this->_addSettingField('audiodescriptionVoice', FluidbookTTSVoice::class, $this->__('Voix pour l\'audiodescription'), ['when' => ['audiodescription' => 1]]);
 
     }
 
index 56a8d98d8000317231be45ae800491e9bda38333..0ff3940068c721633f02e191865c5092fc74d494 100644 (file)
@@ -1,4 +1,3 @@
-version: '3.1'
 services:
     webserver:
         container_name: fluidbook-$hosting-server-$sid
@@ -11,9 +10,13 @@ services:
             LETSENCRYPT_HOST: $domains
         networks:
             - fluidbook-$hosting
+            - nginxproxy
         restart: unless-stopped
 
 networks:
   fluidbook-$hosting:
-    external:
-      name: fluidbook-$hosting
+    name: fluidbook-$hosting
+    external: true
+  nginxproxy:
+    name: nginxproxy
+    external: true
index 030d0b6a0413fb15d742284915dbb119aeed8224..133244351b3cb0baaaa7143779143c0eadf843b8 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
 cd /docker/fluidbook-$hosting/server-$sid/
 docker compose pull
-docker compose down
+docker compose down -v
 docker compose up -d