Add SeedDMS admin password generator

This commit is contained in:
Disassembler 2017-09-16 21:35:44 +02:00
parent f9759f3fcc
commit 5614f66a1a
3 changed files with 18 additions and 12 deletions

View File

@ -18,11 +18,16 @@ sudo -u postgres psql -f /tmp/seeddms-createdb.sql
rm -f /tmp/seeddms-createdb.sql
export PGPASSWORD=${SEEDDMS_PWD}
psql -f /srv/seeddms/www/install/create_tables-postgres.sql seeddms seeddms
unset PGPASSWORD
# Configure SeedDMS
envsubst <${SOURCE_DIR}/seeddms/srv/seeddms/www/conf/settings.xml >/srv/seeddms/www/conf/settings.xml
rm -rf /srv/seeddms/www/install/
export SEEDDMS_ADMIN_USER=admin
export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export SEEDDMS_ADMIN_EMAIL=admin@example.com
envsubst <${SOURCE_DIR}/seeddms/tmp/seeddms-adminpwd.sql >/tmp/seeddms-adminpwd.sql
psql -f /tmp/seeddms-adminpwd.sql seeddms seeddms
unset PGPASSWORD
# Create OS user
adduser --system --group --home /srv/seeddms --shell /bin/false seeddms
@ -38,7 +43,7 @@ systemctl restart php7.0-fpm
systemctl restart nginx
# Add portal application definition
${SOURCE_DIR}/basic/portal-app-manager.py seeddms "https://{host}/seeddms/"
${SOURCE_DIR}/basic/portal-app-manager.py seeddms "https://{host}/seeddms/" "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}"
# TODO: id3 ssconvers pdftotext catdoc
# TODO: Test Lucene fulltext search

View File

@ -8,10 +8,10 @@
<system>
<server rootDir="/srv/seeddms/www/" 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>
<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="" />
@ -23,12 +23,12 @@
<notification enableNotificationAppRev="true" enableOwnerNotification="false" enableNotificationWorkflow="false" />
<server coreDir="" luceneClassDir="" contentOffsetDir="1048576" maxDirID="0" updateNotifyTime="86400" extraPath="/srv/seeddms/pear" 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>
<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 />

View File

@ -0,0 +1 @@
UPDATE "tblUsers" SET login = '${SEEDDMS_ADMIN_USER}', pwd = MD5('${SEEDDMS_ADMIN_PWD}'), email = '${SEEDDMS_ADMIN_EMAIL}' WHERE login = 'admin';