]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5851
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Sat, 6 May 2023 13:21:35 +0000 (15:21 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Sat, 6 May 2023 13:21:35 +0000 (15:21 +0200)
30 files changed:
.docker/build [deleted file]
.docker/build.sh [new file with mode: 0644]
.docker/dev/build [deleted file]
.docker/dev/build.sh [new file with mode: 0644]
.docker/dev/docker-compose.yml
.docker/dev/update [deleted file]
.docker/dev/update.sh [new file with mode: 0644]
.docker/docker-compose.yml
.docker/images/php-dev/Dockerfile
.docker/images/php/Dockerfile
.docker/syncprodtodev [deleted file]
.docker/syncprodtodev.sh [new file with mode: 0644]
.docker/update [deleted file]
.docker/update.sh [new file with mode: 0644]
.gitattributes
app/Console/Commands/UpdatePDFJSLibrary.php
bin/startup [deleted file]
bin/startup.sh [new file with mode: 0644]
scripts/fixrights [deleted file]
scripts/fixrights.sh [new file with mode: 0644]
scripts/restartworkers [deleted file]
scripts/restartworkers.sh [new file with mode: 0644]
scripts/terser_path [deleted file]
scripts/terser_path.sh [new file with mode: 0644]
scripts/update [deleted file]
scripts/update.sh [new file with mode: 0644]
scripts/updatenpm [deleted file]
scripts/updatenpm.sh [new file with mode: 0644]
scripts/webvideo [deleted file]
scripts/webvideo.sh [new file with mode: 0644]

diff --git a/.docker/build b/.docker/build
deleted file mode 100644 (file)
index 1ff82a2..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-cd /docker/fluidbook-toolbox
-COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose pull
-COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build
diff --git a/.docker/build.sh b/.docker/build.sh
new file mode 100644 (file)
index 0000000..1ff82a2
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+cd /docker/fluidbook-toolbox
+COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose pull
+COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build
diff --git a/.docker/dev/build b/.docker/dev/build
deleted file mode 100644 (file)
index 3f1e476..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-cd /docker/fluidbook-toolbox-dev
-COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose pull
-COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build
diff --git a/.docker/dev/build.sh b/.docker/dev/build.sh
new file mode 100644 (file)
index 0000000..3f1e476
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+cd /docker/fluidbook-toolbox-dev
+COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose pull
+COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build
index d4bcd73f4278a3c32253a9c33102a9e62050dc2a..e159931584740e9223c2aef2ea4535d2c496b431 100644 (file)
@@ -25,7 +25,7 @@ services:
       - '/home/extranet/www/fluidbook/cache/unzip/:/application/storage/fluidbook/cache/unzip/'
       - '/data/toolbox/protected/fluidbookpublication/cache/:/application/protected/fluidbookpublication/cache/'
       # Startup
-      - '/home/toolbox/dev/bin/startup:/usr/bin/startup'
+      - '/home/toolbox/dev/bin/startup.sh:/usr/bin/startup.sh'
       # SSH
       - '/home/toolbox/dev/.docker/config/ssh/root/:/root/.ssh/'
       - '/home/toolbox/dev/.docker/config/ssh/user/:/application/.ssh/'
diff --git a/.docker/dev/update b/.docker/dev/update
deleted file mode 100644 (file)
index 00f61fc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-cd /docker/fluidbook-toolbox-dev
-/home/toolbox/dev/scripts/fixrights
-chown root:root /home/toolbox/dev/.docker/config/cron/host;ln -sf /home/toolbox/dev/.docker/config/cron/host /etc/cron.d/toolbox
-docker network create fluidbook-toolbox-dev
-docker compose down
-docker compose up -d
-/home/toolbox/dev/scripts/fixrights
-docker exec -it fluidbook-toolbox /application/scripts/update
-
diff --git a/.docker/dev/update.sh b/.docker/dev/update.sh
new file mode 100644 (file)
index 0000000..724bf39
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+cd /docker/fluidbook-toolbox-dev
+/home/toolbox/dev/scripts/fixrights.sh
+chown root:root /home/toolbox/dev/.docker/config/cron/host;ln -sf /home/toolbox/dev/.docker/config/cron/host /etc/cron.d/toolbox
+docker network create fluidbook-toolbox-dev
+docker compose down
+docker compose up -d
+/home/toolbox/dev/scripts/fixrights.sh
+docker exec -it fluidbook-toolbox /application/scripts/update.sh
+
index 2bc802d7a87bf07310c701a565a21d117599f93b..e1edce81acac8b617de5864428082337c92be696 100644 (file)
@@ -25,7 +25,7 @@ services:
       - '/home/extranet/www/fluidbook/cache/unzip/:/application/storage/fluidbook/cache/unzip/'
       - '/data/toolbox/protected/fluidbookpublication/cache/:/application/protected/fluidbookpublication/cache/'
       # Startup
-      - '/home/toolbox/www/bin/startup:/usr/bin/startup'
+      - '/home/toolbox/www/bin/startup.sh:/usr/bin/startup.sh'
       # SSH
       - '/home/toolbox/www/.docker/config/ssh/root/:/root/.ssh/'
       - '/home/toolbox/www/.docker/config/ssh/user/:/application/.ssh/'
index d7b69bd4faf8664b83d03db1a31a5cb555725508..9af96ec918da84299777e83c58e6d8a57c70a7a8 100644 (file)
@@ -92,8 +92,7 @@ RUN pip3 install font-line
 
 RUN groupadd sudo;useradd -d /application -g 33 -G sudo -s /bin/bash -u 1001 toolbox
 
-COPY --chmod=0755 startup /usr/bin/startup
-CMD exec /usr/bin/startup
+CMD exec /usr/bin/startup.sh
 
 # Open up fcgi port
 EXPOSE 9000
index 3ef19bf502712e543fe52e1b007fd9fc099fdd14..b2c74b1de2d8d08c087f08edb6aa72b6e8344738 100644 (file)
@@ -90,7 +90,7 @@ RUN pip3 install font-line
 
 RUN groupadd sudo;useradd -d /application -g 33 -G sudo -s /bin/bash -u 1001 toolbox
 
-CMD exec /usr/bin/startup
+CMD exec /usr/bin/startup.sh
 
 # Open up fcgi port
 EXPOSE 9000
diff --git a/.docker/syncprodtodev b/.docker/syncprodtodev
deleted file mode 100644 (file)
index c647e85..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# Sync assets & files
-rsync -avz --delete --exclude-from /home/toolbox/dev/.docker/syncprodtodev.exclude --delete-excluded /home/toolbox/www/protected/ /home/toolbox/dev/protected/
-rsync -avz --delete --exclude-from /home/toolbox/dev/.docker/syncprodtodev.exclude --delete-excluded /data/toolbox/storage/ /data/toolbox/dev/storage/
-# Sync database
-docker stop fluidbook-toolbox-dev-mariadb
-rsync -avz /docker/fluidbook-toolbox/database/data/ /docker/fluidbook-toolbox-dev/database/data/
-docker stop fluidbook-toolbox-mariadb
-rsync -avz /docker/fluidbook-toolbox/database/data/ /docker/fluidbook-toolbox-dev/database/data/
-docker start fluidbook-toolbox-mariadb
-# Update and restart dev containers
-/docker/fluidbook-toolbox-dev/update
diff --git a/.docker/syncprodtodev.sh b/.docker/syncprodtodev.sh
new file mode 100644 (file)
index 0000000..c647e85
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Sync assets & files
+rsync -avz --delete --exclude-from /home/toolbox/dev/.docker/syncprodtodev.exclude --delete-excluded /home/toolbox/www/protected/ /home/toolbox/dev/protected/
+rsync -avz --delete --exclude-from /home/toolbox/dev/.docker/syncprodtodev.exclude --delete-excluded /data/toolbox/storage/ /data/toolbox/dev/storage/
+# Sync database
+docker stop fluidbook-toolbox-dev-mariadb
+rsync -avz /docker/fluidbook-toolbox/database/data/ /docker/fluidbook-toolbox-dev/database/data/
+docker stop fluidbook-toolbox-mariadb
+rsync -avz /docker/fluidbook-toolbox/database/data/ /docker/fluidbook-toolbox-dev/database/data/
+docker start fluidbook-toolbox-mariadb
+# Update and restart dev containers
+/docker/fluidbook-toolbox-dev/update
diff --git a/.docker/update b/.docker/update
deleted file mode 100644 (file)
index b55e015..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-cd /docker/fluidbook-toolbox
-/home/toolbox/www/scripts/fixrights
-chown root:root /home/toolbox/www/.docker/config/cron/host;ln -sf /home/toolbox/www/.docker/config/cron/host /etc/cron.d/toolbox
-docker network create fluidbook-toolbox
-docker compose down
-docker compose  up -d
-/home/toolbox/www/scripts/fixrights
-docker exec -it fluidbook-toolbox /application/scripts/update
diff --git a/.docker/update.sh b/.docker/update.sh
new file mode 100644 (file)
index 0000000..378ae0d
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+cd /docker/fluidbook-toolbox
+/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
+docker network create fluidbook-toolbox
+docker compose down
+docker compose  up -d
+/home/toolbox/www/scripts/fixrights.sh
+docker exec -it fluidbook-toolbox /application/scripts/update.sh
index 967315dd3d16d50942fa7abd383dfb95ec685491..6051ca4ef54170a88989f791a3da907c7297d4ce 100644 (file)
@@ -2,4 +2,6 @@
 *.css linguist-vendored
 *.scss linguist-vendored
 *.js linguist-vendored
+.sh text eol=lf
+.bat text eol=crlf
 CHANGELOG.md export-ignore
index 3036ac36eb1105873f2a64fb8d00b584dd26089f..3d0d43cfc7ec8b1783e2c7a1f4aef127d4c506f4 100644 (file)
@@ -45,6 +45,6 @@ class UpdatePDFJSLibrary extends CubistCommand
         Files::str_replace('function _isValidProtocol(url) {', 'function _isValidProtocol(url) {return true;', [$path . '/build/pdf.js', $path . '/build/pdf.worker.js']);
 
         `cp -r $path $minpath`;
-        `/application/scripts/terser_path $minpath`;
+        `/application/scripts/terser_path.sh $minpath`;
     }
 }
diff --git a/bin/startup b/bin/startup
deleted file mode 100644 (file)
index 3dc5848..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-# Set file rights
-umask 0000
-chmod -R 777 /tmp
-
-chown -R root:root /etc/sudoers.d
-chown -R toolbox:www-data /application/storage/framework
-chmod 755 /etc/ssh/*.d
-chmod 600 /etc/ssh/*_key
-chmod 750 /application
-chmod 600 /application/.ssh/id_rsa
-chmod 700 /application/.ssh/
-chmod 600 /application/.ssh/authorized_keys2
-chmod 600 /root/.ssh/id_rsa
-chmod 700 /root/.ssh/
-chmod 600 /root/.ssh/authorized_keys2
-
-# Rsyslog
-start-stop-daemon --start -b -x /usr/sbin/rsyslogd -- -n
-
-# SSH Server
-/usr/sbin/service ssh start
-
-# Supervisor
-/usr/sbin/service supervisor start
-
-# Cron
-chmod 0644 /etc/crontab && crontab -u root /etc/crontab && /usr/sbin/service cron start
-
-# Set user password
-chpasswd < /root/passwords
-
-# Launch monit
-chmod -R 700 /etc/monit;chown -R root:root /etc/monit;/usr/bin/monit
-chown -R root:root /etc/monit && /usr/bin/monit
-
-# Launch PHP
-/usr/sbin/php-fpm8.2 -O
diff --git a/bin/startup.sh b/bin/startup.sh
new file mode 100644 (file)
index 0000000..3dc5848
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Set file rights
+umask 0000
+chmod -R 777 /tmp
+
+chown -R root:root /etc/sudoers.d
+chown -R toolbox:www-data /application/storage/framework
+chmod 755 /etc/ssh/*.d
+chmod 600 /etc/ssh/*_key
+chmod 750 /application
+chmod 600 /application/.ssh/id_rsa
+chmod 700 /application/.ssh/
+chmod 600 /application/.ssh/authorized_keys2
+chmod 600 /root/.ssh/id_rsa
+chmod 700 /root/.ssh/
+chmod 600 /root/.ssh/authorized_keys2
+
+# Rsyslog
+start-stop-daemon --start -b -x /usr/sbin/rsyslogd -- -n
+
+# SSH Server
+/usr/sbin/service ssh start
+
+# Supervisor
+/usr/sbin/service supervisor start
+
+# Cron
+chmod 0644 /etc/crontab && crontab -u root /etc/crontab && /usr/sbin/service cron start
+
+# Set user password
+chpasswd < /root/passwords
+
+# Launch monit
+chmod -R 700 /etc/monit;chown -R root:root /etc/monit;/usr/bin/monit
+chown -R root:root /etc/monit && /usr/bin/monit
+
+# Launch PHP
+/usr/sbin/php-fpm8.2 -O
diff --git a/scripts/fixrights b/scripts/fixrights
deleted file mode 100644 (file)
index 7cc5212..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-chmod -R 755 /home/toolbox/www/scripts
-chmod -R 775 /home/toolbox/www/protected
-chmod -R 775 /home/toolbox/www/public
-chmod -R 775 /home/toolbox/www/bin
-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
diff --git a/scripts/fixrights.sh b/scripts/fixrights.sh
new file mode 100644 (file)
index 0000000..7cc5212
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+chmod -R 755 /home/toolbox/www/scripts
+chmod -R 775 /home/toolbox/www/protected
+chmod -R 775 /home/toolbox/www/public
+chmod -R 775 /home/toolbox/www/bin
+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
diff --git a/scripts/restartworkers b/scripts/restartworkers
deleted file mode 100644 (file)
index 5153c71..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-sudo /usr/sbin/service supervisor stop
-sudo pkill -9 -f queue:work
-sudo /usr/sbin/service supervisor start
-sleep 2
-sudo /usr/sbin/service supervisor restart
diff --git a/scripts/restartworkers.sh b/scripts/restartworkers.sh
new file mode 100644 (file)
index 0000000..5153c71
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+sudo /usr/sbin/service supervisor stop
+sudo pkill -9 -f queue:work
+sudo /usr/sbin/service supervisor start
+sleep 2
+sudo /usr/sbin/service supervisor restart
diff --git a/scripts/terser_path b/scripts/terser_path
deleted file mode 100644 (file)
index f842e9f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-####
-# Tiny shell script for terser any JavaScript project
-# usage:
-# ./terser_path <path_to_your_project>
-####
-
-path="$1"
-
-find $path -name '*.js' -type f | while read f
-do
-    folderpath=$(dirname "$f")
-    filename=$(basename "$f")
-    extension="${filename##*.}"
-    filename="${filename%.*}"
-    nf=$folderpath/$filename.$extension
-
-    terser "$f" --output "$f" --compress --mangle
-done
diff --git a/scripts/terser_path.sh b/scripts/terser_path.sh
new file mode 100644 (file)
index 0000000..f842e9f
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+####
+# Tiny shell script for terser any JavaScript project
+# usage:
+# ./terser_path <path_to_your_project>
+####
+
+path="$1"
+
+find $path -name '*.js' -type f | while read f
+do
+    folderpath=$(dirname "$f")
+    filename=$(basename "$f")
+    extension="${filename##*.}"
+    filename="${filename%.*}"
+    nf=$folderpath/$filename.$extension
+
+    terser "$f" --output "$f" --compress --mangle
+done
diff --git a/scripts/update b/scripts/update
deleted file mode 100644 (file)
index cebdac1..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-cd /application
-mkdir -p /application/storage/framework/cache/cache
-mkdir -p /application/storage/framework/views
-mkdir -p /application/storage/framework/sessions
-mkdir -p /application/storage/framework/testing
-sudo chown -R 1001:33 /application/storage/framework
-sudo chown -R 1001:33 /root/.npm
-composer update
-chmod 755 ./scripts/*
-php artisan lang:add fr en
-php artisan fluidbook:player:updatesources
-php artisan cubist:magic:migrate
-php artisan cubist:magic:generate
-composer dump-autoload
-sudo /application/scripts/restartworkers
-/application/scripts/updatenpm
-sudo chown -R 1001:33 /application/storage/framework
-sudo chown -R 1001:33 /application/storage/framework
-php artisan optimize:clear
-php artisan cubist:magic:precache
-php artisan toolbox:precache
-sudo chown -R 1001:33 /application/storage/framework
-sudo chown -R 1001:33 /application/vendor
-sudo chown -R 0:0 /etc/sudoers.d/toolbox
diff --git a/scripts/update.sh b/scripts/update.sh
new file mode 100644 (file)
index 0000000..980b824
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+cd /application
+mkdir -p /application/storage/framework/cache/cache
+mkdir -p /application/storage/framework/views
+mkdir -p /application/storage/framework/sessions
+mkdir -p /application/storage/framework/testing
+sudo chown -R 1001:33 /application/storage/framework
+sudo chown -R 1001:33 /root/.npm
+composer update
+chmod 755 ./scripts/*
+php artisan lang:add fr en
+php artisan fluidbook:player:updatesources
+php artisan cubist:magic:migrate
+php artisan cubist:magic:generate
+composer dump-autoload
+sudo /application/scripts/restartworkers.sh
+/application/scripts/updatenpm.sh
+sudo chown -R 1001:33 /application/storage/framework
+sudo chown -R 1001:33 /application/storage/framework
+php artisan optimize:clear
+php artisan cubist:magic:precache
+php artisan toolbox:precache
+sudo chown -R 1001:33 /application/storage/framework
+sudo chown -R 1001:33 /application/vendor
+sudo chown -R 0:0 /etc/sudoers.d/toolbox
diff --git a/scripts/updatenpm b/scripts/updatenpm
deleted file mode 100644 (file)
index 76cfd81..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-npm install --prefer-offline --no-audit --progress=false
-npm run all
diff --git a/scripts/updatenpm.sh b/scripts/updatenpm.sh
new file mode 100644 (file)
index 0000000..76cfd81
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+npm install --prefer-offline --no-audit --progress=false
+npm run all
diff --git a/scripts/webvideo b/scripts/webvideo
deleted file mode 100644 (file)
index e0a2c65..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-filename=$(basename $1)
-filename=${filename%.*}
-jpg=$2/$filename.jpg
-mp4=$2/$filename.mp4
-
-if [ ! -f $jpg ]
-then
-        ffmpeg -i $1 -y -r 1 -ss 00:00:04 -t 00:00:01 -f image2 $jpg
-fi
-
-if [ ! -f $jpg ]
-then
-        ffmpeg -i $1 -y -r 1 -ss 00:00:00 -t 00:00:01 -f image2 $jpg
-fi
-
-if [ ! -f $mp4 ] && [ extension != "mp4" ]
-then
-        ffmpeg -i $1 \
-        -y \
-        -acodec aac \
-        -vcodec libx264 \
-        -b 384k \
-        -ab 64k \
-        -mbd 2 \
-        -cmp 256 \
-        -subcmp 2 \
-        -subq 6 \
-        -strict experimental \
-        -vf scale="640:trunc(320/a)*2" \
-        -coder 0 \
-        -trellis 0 \
-        -bf 0 \
-        -refs 5 \
-        -flags +loop+mv4 \
-        -partitions +parti4x4+parti8x8+partp4x4+partp8x8 \
-        -me_range 16 \
-        -g 250 \
-        -keyint_min 25 \
-        -sc_threshold 40 \
-        -i_qfactor 0.71 \
-        -qmin 10 -qmax 51 \
-        -qdiff 4 \
-        -ac 2 \
-        -ar 44100 \
-        -r 13 \
-        $mp4
-fi
diff --git a/scripts/webvideo.sh b/scripts/webvideo.sh
new file mode 100644 (file)
index 0000000..e0a2c65
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+filename=$(basename $1)
+filename=${filename%.*}
+jpg=$2/$filename.jpg
+mp4=$2/$filename.mp4
+
+if [ ! -f $jpg ]
+then
+        ffmpeg -i $1 -y -r 1 -ss 00:00:04 -t 00:00:01 -f image2 $jpg
+fi
+
+if [ ! -f $jpg ]
+then
+        ffmpeg -i $1 -y -r 1 -ss 00:00:00 -t 00:00:01 -f image2 $jpg
+fi
+
+if [ ! -f $mp4 ] && [ extension != "mp4" ]
+then
+        ffmpeg -i $1 \
+        -y \
+        -acodec aac \
+        -vcodec libx264 \
+        -b 384k \
+        -ab 64k \
+        -mbd 2 \
+        -cmp 256 \
+        -subcmp 2 \
+        -subq 6 \
+        -strict experimental \
+        -vf scale="640:trunc(320/a)*2" \
+        -coder 0 \
+        -trellis 0 \
+        -bf 0 \
+        -refs 5 \
+        -flags +loop+mv4 \
+        -partitions +parti4x4+parti8x8+partp4x4+partp8x8 \
+        -me_range 16 \
+        -g 250 \
+        -keyint_min 25 \
+        -sc_threshold 40 \
+        -i_qfactor 0.71 \
+        -qmin 10 -qmax 51 \
+        -qdiff 4 \
+        -ac 2 \
+        -ar 44100 \
+        -r 13 \
+        $mp4
+fi