]> _ Git - cubeextranet.git/commitdiff
wip #5590 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 21 Nov 2022 07:13:36 +0000 (07:13 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 21 Nov 2022 07:13:36 +0000 (07:13 +0000)
.docker/config/crontab
.docker/docker-compose.yml
.docker/images/php/Dockerfile
.htaccess
bin/cleantmp [new file with mode: 0644]
bin/compresslogs [new file with mode: 0644]
bin/fixpackagerrights [new file with mode: 0644]
bin/fixrights [new file with mode: 0644]
inc/ws/Controlleur/class.ws.maintenance.php

index e11d455ebc756697ef623ba54f56cec86c95ee27..7018b2194477e3bd884ab75f73089da45e9e1294 100644 (file)
@@ -2,5 +2,15 @@ MAILTO=sysadmin@cubedesigners.com
 SHELL=/bin/sh
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
-#* * * * *   runuser -l toolbox -c '/usr/bin/php /application/artisan schedule:run' > /proc/1/fd/1 2>/proc/1/fd/2
-#20 5 * * *  /application/scripts/restartworkers > /proc/1/fd/1 2>/proc/1/fd/2
+#10 * * * * stats /data1/stats/www/FWStats.sh /data1/stats/www 1000000
+
+20 * * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanDownload >/dev/null 2>/dev/null
+0 2 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/deleteOldFilesFromFTP >/dev/null 2>/dev/null
+0 5 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanCompiledBooks >/dev/null 2>/dev/null
+40 * * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanPackages >/dev/null 2>/dev/null
+0 1 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanConversionSessions >/dev/null 2>/dev/null
+
+24 4 * * * root /application/bin/fixrights  >/dev/null 2>/dev/null
+*/5 * * * * root /application/bin/fixpackagerrights  >/dev/null 2>/dev/null
+35 3 * * * root /application/bin/compresslogs >/dev/null 2>/dev/null
+10 * * * * root /application/bin/cleantmp >/dev/null 2>/dev/null
index 31cdc12bd40379bd78c0c0a04fd00de38d9b58cd..4e5a220a9c070b4d4e26a93fd0932e4ad2c486d1 100644 (file)
@@ -105,6 +105,7 @@ services:
       - '/home/extranet/www/.docker/config/sudoers:/etc/sudoers.d/extranet'\r
       # PHP\r
       - '/home/extranet/www/.docker/config/php.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini'\r
+      - '/home/extranet/sessions/:/var/lib/php/sessions/'\r
       # Crontab\r
       - '/home/extranet/www/.docker/config/crontab:/etc/crontab'\r
       # Files\r
index 35cf1d9f48d81c0f1b54f187510046396b57012b..2d6417d919f027d3ca186bb291e671e5d6f1bdb5 100644 (file)
@@ -61,24 +61,26 @@ RUN apt-get -y --no-install-recommends install supervisor ssh rsync
 RUN apt-get -y --no-install-recommends install default-jre pdftk poppler-utils inkscape mupdf-tools ghostscript imagemagick netpbm libjpeg-turbo8 libjpeg-turbo-progs
 RUN apt-get -y --no-install-recommends install zip unzip gzip 7zip
 RUN apt-get -y --no-install-recommends install icoutils fontforge icnsutils
-RUN apt-get -y --no-install-recommends install ffmpeg python3 lame x264 vorbis-tools
+RUN apt-get -y --no-install-recommends install ffmpeg lame x264 vorbis-tools
 RUN apt-get -y --no-install-recommends install inkscape mupdf-tools librsvg2-bin
 RUN apt-get -y --no-install-recommends install cron monit locate
 RUN apt-get -y --no-install-recommends install build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
 RUN apt-get -y --no-install-recommends install libreoffice
 RUN apt-get -y --no-install-recommends install sshfs lftp
+RUN apt-get -y --no-install-recommends install sshfs python3 python3-pip
 
 RUN cd /root;wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2;tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2;mv phantomjs-2.1.1-linux-x86_64 /usr/local/share;ln -sf /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
 RUN cd /root;wget https://github.com/nwutils/Web2Executable/releases/download/v0.7.1b/Web2ExeLinux-CMD.zip;unzip Web2ExeLinux-CMD.zip;mv Web2ExeLinux-CMD /usr/local/web2exe
 RUN cd /root;wget https://github.com/RazrFalcon/svgcleaner/releases/download/v0.9.5/svgcleaner_linux_x86_64_0.9.5.tar.gz; tar xvzf svgcleaner_linux_x86_64_0.9.5.tar.gz;mv svgcleaner /usr/local/bin
-
 RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
 
+ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
+RUN npm install --unsafe-perm --global uglify-js less sass puppeteer favicons nw-builder@3.5.7
+RUN pip3 install font-line
+
 RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
 
 RUN groupadd fluidbook;groupadd sudo;useradd -d /application -g 33 -G sudo -s /bin/bash -u 1002 extranet
-ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
-RUN npm install --unsafe-perm --global uglify-js less sass puppeteer favicons nw-builder@3.5.7
 
 # PHP-FPM packages need a nudge to make them docker-friendly
 COPY overrides.conf /etc/php/7.2/fpm/pool.d/z-overrides.conf
index 1ab9096d50047084e0347c3fd0d0e4982b0d8ca2..ff2962836f310cb01ed5af7b286b622e0daa9586 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -55,6 +55,10 @@ AddCharset UTF-8 log
 #      RewriteCond %{HTTP_HOST} extranet.cubedesigners.com\r
 #      RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\r
 \r
+    RewriteRule ^.docker - [F]\r
+    RewriteRule ^bin - [F]\r
+    RewriteRule ^scripts - [F]\r
+\r
        RewriteRule (.{255,}) index.php/$1 [L,QSA]\r
 \r
     RewriteRule ^download - [L]\r
diff --git a/bin/cleantmp b/bin/cleantmp
new file mode 100644 (file)
index 0000000..60359f4
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+find /tmp/. -type f -mmin +60 -delete
+find /var/lib/php/sessions/. -type f -mtime +21 -delete
+find /tmp -maxdepth 1 -name "cubeit_*" -type d -exec rm -rf {} \;
\ No newline at end of file
diff --git a/bin/compresslogs b/bin/compresslogs
new file mode 100644 (file)
index 0000000..2b9c38b
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+gzip -f -9 /application/fluidbook/docs/*/logs/*.log
\ No newline at end of file
diff --git a/bin/fixpackagerrights b/bin/fixpackagerrights
new file mode 100644 (file)
index 0000000..5280ca0
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+chmod -R 777 /usr/local/web2exe
+mkdir -p /application/fluidbook/packager/download
+mkdir -p /application/fluidbook/packager/nwbuild
+chmod -R 777 /application/fluidbook/packager
+chown -R extranet:www-data /application/fluidbook/packager
+chmod -R 777 /tmp
+chown -R extranet:www-data /tmp
\ No newline at end of file
diff --git a/bin/fixrights b/bin/fixrights
new file mode 100644 (file)
index 0000000..2c4f369
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+chmod -R 775 /application
+chmod -R 777 /application/fluidbook/compile/player
+chmod 600 /application/.ssh/id_rsa
+chmod 700 /application/.ssh
+chmod 600 /application/.ssh/authorized_keys2
+chown -R extranet:www-data /application
index 3dce1237cf684b719db1b8306ad995b830c2c4d7..2e154d33966160521fca7bdffea902eba137e0ce 100644 (file)
@@ -196,13 +196,6 @@ class wsMaintenance
         }
     }
 
-    public static function cleanUnusedDocs()
-    {
-        global $core;
-        cubePHP::neverStop();
-    }
-
-
 //    public static function mergeEntreprise($args)
 //    {
 //        global $core;