Fix SeedDMS previewers and bump version to 5.1.6

This commit is contained in:
Disassembler 2018-03-27 14:13:01 +02:00
parent 5e06bad941
commit 6cc27f7e48
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
3 changed files with 80 additions and 45 deletions

View File

@ -7,19 +7,19 @@ RUN \
RUN \ RUN \
# Install runtime dependencies # Install runtime dependencies
apk --no-cache add ghostscript imagemagick libreoffice-calc libreoffice-impress libreoffice-writer php7-iconv php7-pear php7-pdo_pgsql php7-simplexml php7-xml poppler-utils apk --no-cache add ghostscript imagemagick libreoffice-calc libreoffice-impress libreoffice-writer php7-iconv php7-pear php7-pdo_pgsql php7-simplexml php7-xml poppler-utils ttf-dejavu
RUN \ RUN \
# Install unoconv # Install unoconv
wget https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv -O /usr/local/bin/unoconv \ wget https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv -O /usr/bin/unoconv \
&& chmod +x /usr/local/bin/unoconv \ && chmod +x /usr/bin/unoconv \
&& ln -s /usr/bin/python3 /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python
RUN \ RUN \
# Install full-featured wget to work around sourceforge bugs # Install full-featured wget to work around sourceforge bugs
apk --no-cache add wget \ apk --no-cache add wget \
# Install SeedDMS # Install SeedDMS
&& wget https://sourceforge.net/projects/seeddms/files/seeddms-5.1.5/seeddms-quickstart-5.1.5.tar.gz/download -O /srv/seeddms.tgz \ && wget https://sourceforge.net/projects/seeddms/files/seeddms-5.1.6/seeddms-quickstart-5.1.6.tar.gz/download -O /srv/seeddms.tgz \
&& tar xzf /srv/seeddms.tgz -C /srv \ && tar xzf /srv/seeddms.tgz -C /srv \
&& mv /srv/seeddms51x /srv/seeddms \ && mv /srv/seeddms51x /srv/seeddms \
&& rm -f /srv/seeddms.tgz \ && rm -f /srv/seeddms.tgz \
@ -27,20 +27,21 @@ RUN \
# Create OS user # Create OS user
&& addgroup -S -g 8010 seeddms \ && addgroup -S -g 8010 seeddms \
&& adduser -S -u 8010 -h /srv/seeddms -s /bin/false -g seeddms -G seeddms seeddms \ && adduser -S -u 8010 -h /srv/seeddms -s /bin/false -g seeddms -G seeddms seeddms \
&& chown -R seeddms:seeddms /srv/seeddms \
# Cleanup # Cleanup
&& apk --no-cache del wget \ && apk --no-cache del wget \
&& cp /srv/seeddms/www/install/create_tables-postgres.sql /srv/seeddms/create_tables-postgres.sql \ && cp /srv/seeddms/www/install/create_tables-postgres.sql /srv/seeddms/create_tables-postgres.sql \
&& rm -rf /srv/seeddms/www/install && rm -rf /srv/seeddms/www/install
COPY docker/ / COPY docker/etc/ /etc/
COPY --chown=8010:8010 docker/srv/seeddms/ /srv/seeddms/
RUN \ RUN \
# Patch Previewers # Patch Previewers
cd /srv/seeddms \ cd /srv/seeddms \
&& patch -p0 </srv/seeddms/previewers.patch && patch -p0 </srv/seeddms/previewers.patch
# TODO: id3 ?
VOLUME ["/srv/seeddms/www/config", "/srv/seeddms/data"] VOLUME ["/srv/seeddms/www/config", "/srv/seeddms/data"]
EXPOSE 8080 EXPOSE 8080

View File

@ -1,47 +1,58 @@
diff -ruN orig/SeedDMS/Preview/PdfPreviewer.php pear/SeedDMS/Preview/PdfPreviewer.php --- orig/SeedDMS/Preview/PdfPreviewer.php
--- orig/SeedDMS/Preview/PdfPreviewer.php 2017-12-15 08:23:09.000000000 +0100 +++ pear/SeedDMS/Preview/PdfPreviewer.php
+++ pear/SeedDMS/Preview/PdfPreviewer.php 2018-01-04 09:55:06.117665300 +0100 @@ -27,18 +27,18 @@
@@ -27,12 +27,17 @@
function __construct($previewDir, $timeout=5) { /* {{{ */ function __construct($previewDir, $timeout=5) { /* {{{ */
parent::__construct($previewDir, $timeout); parent::__construct($previewDir, $timeout);
$this->converters = array( $this->converters = array(
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
- 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
'text/rtf' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'text/rtf' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
'application/msword' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/msword' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
- 'application/vnd.ms-excel' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/vnd.ms-excel' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'text/plain' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/postscript' => "ps2pdf '%f' - > '%o'",
+ 'application/vnd.ms-excel' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'", - 'image/jpeg' => "convert '%f' pdf:- > '%o'",
+ 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'", - 'image/png' => "convert '%f' pdf:- > '%o'",
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'", - 'image/gif' => "convert '%f' pdf:- > '%o'",
+ 'application/vnd.ms-powerpoint' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'", - 'video/mp4' => "convert '%f[1-20]' pdf:- > '%o'",
+ 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'", + 'text/rtf' => "unoconv -d document -f pdf -o '%o' '%f'",
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'", + 'application/msword' => "unoconv -d document -f pdf -o '%o' '%f'",
+ 'text/html' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", + 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf -o '%o' '%f'",
'text/plain' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf -o '%o' '%f'",
'application/postscript' => "ps2pdf '%f' - > '%o'", + 'application/vnd.ms-excel' => "unoconv -d spreadsheet -f pdf -o '%o' '%f'",
'image/jpeg' => "convert '%f' pdf:- > '%o'", + 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -f pdf -o '%o' '%f'",
diff -ruN orig/SeedDMS/Preview/Previewer.php pear/SeedDMS/Preview/Previewer.php + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -f pdf -o '%o' '%f'",
--- orig/SeedDMS/Preview/Previewer.php 2017-12-15 08:23:09.000000000 +0100 + 'application/vnd.ms-powerpoint' => "unoconv -d presentation -f pdf -o '%o' '%f'",
+++ pear/SeedDMS/Preview/Previewer.php 2018-01-04 09:56:12.359902000 +0100 + 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -f pdf -o '%o' '%f'",
@@ -41,6 +41,18 @@ + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -f pdf -o '%o' '%f'",
+ 'text/html' => "unoconv -d document -f pdf -o '%o' '%f'",
+ 'text/plain' => "unoconv -d document -f pdf -o '%o' '%f'",
);
} /* }}} */
--- orig/SeedDMS/Preview/Previewer.php
+++ pear/SeedDMS/Preview/Previewer.php
@@ -37,10 +37,19 @@
'image/jpg' => "convert -resize %wx '%f' '%o'",
'image/jpeg' => "convert -resize %wx '%f' '%o'",
'image/svg+xml' => "convert -resize %wx '%f' '%o'",
- 'text/plain' => "convert -resize %wx '%f' '%o'",
'application/pdf' => "convert -density 100 -resize %wx '%f[0]' '%o'", 'application/pdf' => "convert -density 100 -resize %wx '%f[0]' '%o'",
'application/postscript' => "convert -density 100 -resize %wx '%f[0]' '%o'", - 'application/postscript' => "convert -density 100 -resize %wx '%f[0]' '%o'",
'application/x-compressed-tar' => "tar tzvf '%f' | convert -density 100 -resize %wx text:-[0] '%o'", - 'application/x-compressed-tar' => "tar tzvf '%f' | convert -density 100 -resize %wx text:-[0] '%o'",
+ 'text/rtf' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'text/plain' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/msword' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'text/html' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/vnd.oasis.opendocument.text' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'text/rtf' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/msword' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/vnd.ms-excel' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.oasis.opendocument.text' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.ms-excel' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/vnd.ms-powerpoint' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.ms-powerpoint' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'text/html' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
+ 'text/plain' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
); );
$this->width = intval($width); $this->width = intval($width);
} /* }}} */ } /* }}} */

View File

@ -34,11 +34,34 @@
<converter mimeType="application/vnd.ms-powerpoint">unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - -</converter> <converter mimeType="application/vnd.ms-powerpoint">unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - -</converter>
<converter mimeType="application/vnd.oasis.opendocument.presentation">unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - -</converter> <converter mimeType="application/vnd.oasis.opendocument.presentation">unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - -</converter>
<converter mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation">unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - -</converter> <converter mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation">unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - -</converter>
<converter mimeType="audio/mp3">id3 -l -R %s | egrep '(Title|Artist|Album)' | sed 's/^[^:]*: //g'</converter>
<converter mimeType="audio/mpeg">id3 -l -R %s | egrep '(Title|Artist|Album)' | sed 's/^[^:]*: //g'</converter>
<converter mimeType="text/html">unoconv -d document -f txt --stdout %s</converter> <converter mimeType="text/html">unoconv -d document -f txt --stdout %s</converter>
<converter mimeType="text/plain">cat %s</converter> <converter mimeType="text/plain">cat %s</converter>
</converters> </converters>
<converters target="preview">
<converter mimeType="text/rtf">unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/msword">unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/vnd.oasis.opendocument.text">unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document">unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/vnd.ms-excel">unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/vnd.oasis.opendocument.spreadsheet">unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/vnd.ms-powerpoint">unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/vnd.oasis.opendocument.presentation">unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation">unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="text/html">unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
<converter mimeType="text/plain">unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'</converter>
</converters>
<converters target="pdf">
<converter mimeType="application/vnd.oasis.opendocument.text">unoconv -d document -f pdf -o '%o' '%f'</converter>
<converter mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document">unoconv -d document -f pdf -o '%o' '%f'</converter>
<converter mimeType="application/vnd.ms-excel">unoconv -d spreadsheet -f pdf -o '%o' '%f'</converter>
<converter mimeType="application/vnd.oasis.opendocument.spreadsheet">unoconv -d spreadsheet -f pdf -o '%o' '%f'</converter>
<converter mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">unoconv -d spreadsheet -f pdf -o '%o' '%f'</converter>
<converter mimeType="application/vnd.ms-powerpoint">unoconv -d presentation -f pdf -o '%o' '%f'</converter>
<converter mimeType="application/vnd.oasis.opendocument.presentation">unoconv -d presentation -f pdf -o '%o' '%f'</converter>
<converter mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation">unoconv -d presentation -f pdf -o '%o' '%f'</converter>
<converter mimeType="text/html">unoconv -d document -f pdf -o '%o' '%f'</converter>
</converters>
</advanced> </advanced>
<extensions/> <extensions/>
</configuration> </configuration>