diff --git a/README.md b/README.md index f764685..7c5e225 100644 --- a/README.md +++ b/README.md @@ -243,15 +243,11 @@ $ docker run -d -p 8000:8000 --name librenms \ ### First launch -On first launch, an initial administrator user will be created: - -| Login | Password | -|------------|------------| -| `librenms` | `librenms` | +When you first access the webui, you will be prompted to create an admin user. > **Note** > -> You can create another one using the [`lnms` command](#lnms-command). +> If you lose access, you can create another one using the [`lnms` command](#lnms-command). ## Upgrade diff --git a/rootfs/etc/cont-init.d/04-svc-main.sh b/rootfs/etc/cont-init.d/04-svc-main.sh index 6d6c8ba..29df329 100644 --- a/rootfs/etc/cont-init.d/04-svc-main.sh +++ b/rootfs/etc/cont-init.d/04-svc-main.sh @@ -69,7 +69,13 @@ while ! ${dbcmd} -e "show databases;" >/dev/null 2>&1; do fi done echo "Database ready!" + +# Enable first run wizard if db is empty counttables=$(echo 'SHOW TABLES' | ${dbcmd} "$DB_NAME" | wc -l) +if [ "${counttables}" -eq "0" ]; then + echo "Enabling First Run Wizard..." + echo "INSTALL=user,finish">> ${LIBRENMS_PATH}/.env +fi echo "Updating database schema..." lnms migrate --force --no-ansi --no-interaction @@ -79,11 +85,6 @@ echo "Clear cache" artisan cache:clear --no-interaction artisan config:cache --no-interaction -if [ "${counttables}" -eq "0" ]; then - echo "Creating admin user..." - lnms user:add --password=librenms --email=librenms@librenms.docker --role=admin --no-ansi --no-interaction librenms -fi - mkdir -p /etc/services.d/nginx cat >/etc/services.d/nginx/run <