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 rm -f /tmp/seeddms-createdb.sql
export PGPASSWORD=${SEEDDMS_PWD} export PGPASSWORD=${SEEDDMS_PWD}
psql -f /srv/seeddms/www/install/create_tables-postgres.sql seeddms seeddms psql -f /srv/seeddms/www/install/create_tables-postgres.sql seeddms seeddms
unset PGPASSWORD
# Configure SeedDMS # Configure SeedDMS
envsubst <${SOURCE_DIR}/seeddms/srv/seeddms/www/conf/settings.xml >/srv/seeddms/www/conf/settings.xml envsubst <${SOURCE_DIR}/seeddms/srv/seeddms/www/conf/settings.xml >/srv/seeddms/www/conf/settings.xml
rm -rf /srv/seeddms/www/install/ 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 # Create OS user
adduser --system --group --home /srv/seeddms --shell /bin/false seeddms adduser --system --group --home /srv/seeddms --shell /bin/false seeddms
@ -38,7 +43,7 @@ systemctl restart php7.0-fpm
systemctl restart nginx systemctl restart nginx
# Add portal application definition # 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: id3 ssconvers pdftotext catdoc
# TODO: Test Lucene fulltext search # TODO: Test Lucene fulltext search

View File

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