]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7168 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Oct 2024 15:23:36 +0000 (16:23 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Oct 2024 15:23:36 +0000 (16:23 +0100)
app/Http/Controllers/Admin/Operations/Tools/DockerWebContainer.php
public/images/logo-small.svg [new file with mode: 0644]
resources/tools/dockerwebcontainer/s3 [new file with mode: 0644]
routes/api.php

index 35c5ec5403f5e4b601112874e478fac530c221dc..c6278b908d7c8b7d738c5be6eab7506b0b7a444c 100644 (file)
@@ -47,6 +47,7 @@ trait DockerWebContainer
         $form->addField('redis', Checkbox::class, __('Serveur Redis'), ['default' => true, 'when' => ['laravel' => '0']]);
         $form->addField('matomo', Checkbox::class, __('Serveur Matomo'), ['default' => false]);
         $form->addField('elasticsearch', Checkbox::class, __('Serveur ElasticSearch'), ['default' => false]);
+        $form->addField('s3', Checkbox::class, __('Serveur S3 (MinIO)'), ['default' => false]);
 
         return view('tools.form', ['form' => $form]);
     }
@@ -110,6 +111,7 @@ trait DockerWebContainer
         $phpversion = $request->get('phpversion', '8.3');
         $mysql = $request->get('mysql', true);
         $redis = $request->get('redis', true);
+        $s3 = $request->get('s3', false);
         if ($laravel > 0) {
             $phpversion = '8.3';
             $redis = $mysql = true;
@@ -128,6 +130,7 @@ trait DockerWebContainer
             '$sshpassword' => Str::random(16),
             '$public' => ($laravel || $request->get('public')) ? '/public' : '/',
             '$environment' => $env,
+            '$s3password' => Str::random(16),
         ];
 
         if (!$variables['$domain']) {
@@ -177,6 +180,9 @@ trait DockerWebContainer
             $compose[] = 'elasticsearch';
             $fixRights[] = 'chmod -R 777 ./esdata';
         }
+        if ($s3) {
+            $compose[] = 's3';
+        }
 
         if ($laravel) {
             $laravelSource = resource_path('tools/dockerwebcontainer/laravel');
diff --git a/public/images/logo-small.svg b/public/images/logo-small.svg
new file mode 100644 (file)
index 0000000..3914fe8
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50">
+  <defs>
+    <style>
+      .cls-1 {
+        fill: url(#Dégradé_sans_nom_3-2);
+        isolation: isolate;
+        opacity: .8;
+      }
+
+      .cls-2 {
+        fill: #fff;
+      }
+
+      .cls-3 {
+        fill: url(#Dégradé_sans_nom_2);
+      }
+
+      .cls-4 {
+        fill: url(#Dégradé_sans_nom_3);
+      }
+    </style>
+    <linearGradient id="Dégradé_sans_nom_3" data-name="Dégradé sans nom 3" x1="9.7" y1="25.7" x2="41.2" y2="25.7" gradientTransform="translate(0 50.1) scale(1 -1)" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#b2cd4c"/>
+      <stop offset="1" stop-color="#58782b"/>
+    </linearGradient>
+    <linearGradient id="Dégradé_sans_nom_2" data-name="Dégradé sans nom 2" x1="14" y1="18.5" x2="39.8" y2="18.5" gradientTransform="translate(0 50.1) scale(1 -1)" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#58782b"/>
+      <stop offset="1" stop-color="#b2cd4c"/>
+    </linearGradient>
+    <linearGradient id="Dégradé_sans_nom_3-2" data-name="Dégradé sans nom 3" x1="9.4" y1="11.4" x2="39.8" y2="11.4" xlink:href="#Dégradé_sans_nom_3"/>
+  </defs>
+  <!-- Generator: Adobe Illustrator 28.7.2, SVG Export Plug-In . SVG Version: 1.2.0 Build 154)  -->
+  <g>
+    <g id="Calque_1">
+      <path class="cls-2" d="M36.6,14.7C31.4,7.3,19.2,7.1,11.2,1.4c-2.4,13.3-2,22.9,1.7,29.3-1.2.2-2.4.2-3.5,0,4.4,12.8,9.6,18.5,18,17.1,8.4-1.2,12.4-.2,12.4-.2h0c2.4-18.2,2.2-25.6-3.2-33Z"/>
+      <g>
+        <path class="cls-4" d="M39.8,47.5c2.4-18,2.2-25.4-3.2-32.8C31.4,7.3,19.2,7.1,11.2,1.4c-3.7,20.7-1,32.4,11.6,37.2,12.4,4.5,17,8.9,17,8.9Z"/>
+        <path class="cls-3" d="M39.8,47.5c0-13.6-.8-19.2-5.4-24.2-4.7-5-13.6-4-20.2-7.6-.7,15.8,2.4,24.2,12.1,26.6,9.8,2.4,13.5,5.2,13.5,5.2Z"/>
+        <path class="cls-1" d="M39.8,47.7c-4.4-10.8-6.7-14.8-12.1-17.3-5.2-2.5-12.1,1-18.3.3,4.4,12.8,9.6,18.5,18,17.1,8.6-1.3,12.4-.2,12.4-.2Z"/>
+      </g>
+    </g>
+  </g>
+</svg>
\ No newline at end of file
diff --git a/resources/tools/dockerwebcontainer/s3 b/resources/tools/dockerwebcontainer/s3
new file mode 100644 (file)
index 0000000..2c3857c
--- /dev/null
@@ -0,0 +1,22 @@
+  minio:
+    image: 'minio/minio:latest'
+    container_name: $name-s3
+    environment:
+      VIRTUAL_HOST: s3.$domain
+      VIRTUAL_PORT: 9000
+      VIRTUAL_HOST_MULTIPORTS: |-
+        s3.$domain:
+          "/":
+            port: 9000
+        s3.$domain:
+          "/console":
+            port: 8900
+      LETSENCRYPT_HOST: s3.$domain
+      MINIO_ROOT_USER: root
+      MINIO_ROOT_PASSWORD: $s3password
+    volumes:
+      - './s3:/data/minio'
+    command: 'minio server /data/minio --console-address ":8900"'
+    networks:
+      - $name
+    restart: unless-stopped
index 2f535c910394758e01011d1946abf104652699cb..dfe0062902a18ae7a7f9a2f406d8f07cce84c807 100644 (file)
@@ -19,7 +19,7 @@ Route::group([
 ], function () {
     Route::get('fluidbook-publication/{id}/download/{version}', [\App\Http\Controllers\API\FluidbookPublicationAPIController::class, 'download']);
     Route::get('fluidbook-publication/{id}/metadata', [\App\Http\Controllers\API\FluidbookPublicationAPIController::class, 'metadata']);
-    Route::get('fluidbook-publication/create', [\App\Http\Controllers\API\FluidbookPublicationAPIController::class, 'create']);
+    Route::post('fluidbook-publication/create', [\App\Http\Controllers\API\FluidbookPublicationAPIController::class, 'create']);
     Route::post('cache/clear/{tag?}', [\App\Http\Controllers\API\CacheAPIController::class, 'clear']);
 });