diff --git a/10-seeddms.sh b/10-seeddms.sh index 75b71f5..b4318b6 100755 --- a/10-seeddms.sh +++ b/10-seeddms.sh @@ -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 diff --git a/seeddms/srv/seeddms/www/conf/settings.xml b/seeddms/srv/seeddms/www/conf/settings.xml index 354571a..1dd457e 100644 --- a/seeddms/srv/seeddms/www/conf/settings.xml +++ b/seeddms/srv/seeddms/www/conf/settings.xml @@ -8,10 +8,10 @@ - - - - + + + + @@ -23,12 +23,12 @@ - pdftotext -enc UTF-8 -nopgbrk %s - | sed -e 's/ [a-zA-Z0-9.]\{1\} / /g' -e 's/[0-9.]//g' - catdoc %s - ssconvert -T Gnumeric_stf:stf_csv -S %s fd://1 - id3 -l -R %s | egrep '(Title|Artist|Album)' | sed 's/^[^:]*: //g' - id3 -l -R %s | egrep '(Title|Artist|Album)' | sed 's/^[^:]*: //g' - cat %s + pdftotext -enc UTF-8 -nopgbrk %s - | sed -e 's/ [a-zA-Z0-9.]\{1\} / /g' -e 's/[0-9.]//g' + catdoc %s + ssconvert -T Gnumeric_stf:stf_csv -S %s fd://1 + id3 -l -R %s | egrep '(Title|Artist|Album)' | sed 's/^[^:]*: //g' + id3 -l -R %s | egrep '(Title|Artist|Album)' | sed 's/^[^:]*: //g' + cat %s diff --git a/seeddms/tmp/seeddms-adminpwd.sql b/seeddms/tmp/seeddms-adminpwd.sql new file mode 100644 index 0000000..4935a83 --- /dev/null +++ b/seeddms/tmp/seeddms-adminpwd.sql @@ -0,0 +1 @@ +UPDATE "tblUsers" SET login = '${SEEDDMS_ADMIN_USER}', pwd = MD5('${SEEDDMS_ADMIN_PWD}'), email = '${SEEDDMS_ADMIN_EMAIL}' WHERE login = 'admin';