Rework SeedDMS - install from git

This commit is contained in:
Disassembler 2017-06-30 18:17:07 +02:00
parent cc8e2f2234
commit e1548179fc
3 changed files with 71 additions and 6 deletions

View File

@ -3,12 +3,38 @@
SOURCE_DIR=$(realpath $(dirname "${0}"))
# Install dependencies for SeedDMS
apt-get --no-install-recommends install php7.0-gd php7.0-fpm php7.0-mbstring php7.0-xml
apt-get -y --no-install-recommends install php7.0-gd php7.0-fpm php7.0-mbstring php7.0-pgsql php7.0-xml php-log php-mail php-pear
# Install SeedDMS
wget https://sourceforge.net/projects/seeddms/files/seeddms-5.0.11/seeddms-5.0.11.tar.gz/download -O /srv/seeddms-5.0.11.tar.gz
tar xf /srv/seeddms-5.0.11.tar.gz -C /srv/
mv /srv/seeddms-5.0.11 /srv/seeddms
git clone https://git.code.sf.net/p/seeddms/code /srv/seeddms
git -C /srv/seeddms checkout seeddms-5.1.x
rm -rf /srv/seeddms/.git
# Populate database
export SEEDDMS_PWD=$(head -c 260 /dev/urandom | tr -cd '[:alnum:]' | head -c 26)
envsubst <${SOURCE_DIR}/seeddms/tmp/createdb-seeddms.sql >/tmp/createdb-seeddms.sql
sudo -u postgres psql -f /tmp/createdb-seeddms.sql
rm -f /tmp/createdb-seeddms.sql
export PGPASSWORD=${SEEDDMS_PWD}
psql -f /srv/seeddms/install/create_tables-postgres.sql seeddms seeddms
unset PGPASSWORD
# Configure SeedDMS
envsubst <${SOURCE_DIR}/seeddms/srv/seeddms/conf/settings.xml >/srv/seeddms/conf/settings.xml
# Adjust directory structure
mkdir -p /srv/seeddms/data/{lucene,staging,cache}
mkdir /srv/seeddms/SeedDMS
mv /srv/seeddms/SeedDMS_Core/Core* /srv/seeddms/SeedDMS/
mv /srv/seeddms/SeedDMS_Lucene/Lucene* /srv/seeddms/SeedDMS/
mv /srv/seeddms/SeedDMS_Preview/Preview* /srv/seeddms/SeedDMS/
mv /srv/seeddms/SeedDMS_SQLiteFTS/SQLiteFTS* /srv/seeddms/SeedDMS/
rm -rf /srv/seeddms/SeedDMS_*
rm -rf /srv/seeddms/install/
rm -rf /srv/seeddms/ext/example/
chown -R www-data:www-data /srv/seeddms/
# Create nginx app definition
cp ${SOURCE_DIR}/seeddms/etc/nginx/apps-available/seeddms /etc/nginx/apps-available/seeddms
@ -19,5 +45,5 @@ systemctl restart nginx
# TODO: Custom user
# TODO: Set cgroups
# TODO: Dependencies (both PHP and PEAR)
# TODO: Does it run on PostgeSQL or MariaDB only?
# TODO: id3 ssconvers pdftotext catdoc
# TODO: Test Lucene fulltext search

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<site>
<display siteName="SeedDMS" footNote="SeedDMS free document management system - &lt;a href='http://www.seeddms.org'&gt;www.seeddms.org&lt;/a&gt; - please donate if you like SeedDMS!" printDisclaimer="true" language="en_GB" theme="bootstrap" previewWidthList="40" previewWidthDetail="100" availablelanguages="" showFullPreview="false" convertToPdf="false" />
<edition strictFormCheck="false" viewOnlineFileTypes=".txt;.text;.html;.htm;.xml;.pdf;.gif;.png;.jpg;.jpeg" enableConverting="true" enableEmail="true" enableUsersView="true" enableFullSearch="false" enableFolderTree="true" expandFolderTree="1" enableLanguageSelector="true" stopWordsFile="" sortUsersInList="" sortFoldersDefault="s" editOnlineFileTypes="" enableSessionList="false" enableClipboard="false" enableMenuTasks="false" enableDropUpload="false" enableMultiUpload="false" enableRecursiveCount="false" maxRecursiveCount="0" enableHelp="false" enableThemeSelector="false" maxSizeForFullText="0" fullSearchEngine="" defaultSearchMethod="" showSingleSearchHit="false" />
<calendar enableCalendar="true" calendarDefaultView="y" firstDayOfWeek="0" />
</site>
<system>
<server rootDir="/srv/seeddms/" httpRoot="/seeddms/" contentDir="/srv/seeddms/data/" stagingDir="/srv/seeddms/data/staging/" luceneDir="/srv/seeddms/data/lucene/" logFileEnable="true" logFileRotation="d" enableLargeFileUpload="true" partitionSize="2000000" dropFolderDir="" cacheDir="/srv/seeddms/data/cache/" maxUploadSize="" />
<authentication enableGuestLogin="false" enablePasswordForgotten="false" restricted="true" enableUserImage="false" disableSelfEdit="false" passwordStrength="0" passwordExpiration="0" passwordHistory="0" passwordStrengthAlgorithm="simple" loginFailure="0" encryptionKey="" enableGuestAutoLogin="false" autoLoginUser="0" quota="0" undelUserIds="" cookieLifetime="0" defaultAccessDocs="0">
<connectors>
<connector enable="false" type="ldap" host="ldaps://ldap.host.com" port="389" baseDN="" bindDN="" bindPw="" filter="" />
<connector enable="false" type="AD" host="ldap.example.com" port="389" baseDN="" accountDomainName="example.com" bindDN="" bindPw="" />
</connectors>
</authentication>
<database dbDriver="pgsql" dbHostname="localhost" dbDatabase="seeddms" dbUser="seeddms" dbPass="${SEEDDMS_PWD}" doNotCheckVersion="false" />
<smtp smtpServer="localhost" smtpPort="25" smtpSendFrom="seeddms@localhost" smtpUser="" smtpPassword="" />
</system>
<advanced>
<display siteDefaultPage="" rootFolderID="1" titleDisplayHack="true" showMissingTranslations="false" />
<authentication guestID="2" adminIP="" />
<edition enableAdminRevApp="false" versioningFileName="versioning_info.txt" workflowMode="advanced" enableVersionDeletion="true" enableVersionModification="true" enableDuplicateDocNames="true" enableOwnerRevApp="false" enableSelfRevApp="false" enableUpdateRevApp="false" presetExpirationDate="" overrideMimeType="false" removeFromDropFolder="false" />
<notification enableNotificationAppRev="true" enableOwnerNotification="false" enableNotificationWorkflow="false" />
<server coreDir="/srv/seeddms/SeedDMS/" luceneClassDir="/srv/seeddms/SeedDMS/" contentOffsetDir="1048576" maxDirID="0" updateNotifyTime="86400" extraPath="" cmdTimeout="5" maxExecutionTime="30" />
<converters target="fulltext">
<converter mimeType="application/pdf">pdftotext -enc UTF-8 -nopgbrk %s - | sed -e 's/ [a-zA-Z0-9.]\{1\} / /g' -e 's/[0-9.]//g'</converter>
<converter mimeType="application/msword">catdoc %s</converter>
<converter mimeType="application/vnd.ms-excel">ssconvert -T Gnumeric_stf:stf_csv -S %s fd://1</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/plain">cat %s</converter>
</converters>
</advanced>
<extensions />
</configuration>

View File

@ -0,0 +1,4 @@
CREATE ROLE seeddms NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT LOGIN ENCRYPTED PASSWORD '${SEEDDMS_PWD}';
CREATE DATABASE seeddms;
REVOKE ALL ON DATABASE seeddms FROM public;
ALTER DATABASE seeddms OWNER TO seeddms;