From 8665ea54ddd83f948a881e9df0255adb0f41663e Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sat, 29 Feb 2020 18:51:02 -0600 Subject: [PATCH] Try new Dojo PW generation --- rootfs/standard/usr/bin/mynode_gen_dojo_config.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rootfs/standard/usr/bin/mynode_gen_dojo_config.sh b/rootfs/standard/usr/bin/mynode_gen_dojo_config.sh index 0ee33960..30e5e057 100755 --- a/rootfs/standard/usr/bin/mynode_gen_dojo_config.sh +++ b/rootfs/standard/usr/bin/mynode_gen_dojo_config.sh @@ -85,13 +85,13 @@ if [ -f /opt/mynode/dojo/docker/my-dojo/conf/docker-node.conf ]; then echo "File present - skip docker-node.conf" else # Modify node.conf to enter random generated passwords - NODE_API_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) + NODE_API_KEY=$(< /dev/urandom tr -dc 'a-zA-Z0-9' | head -c${1:-64}) sed -i 's|NODE_API_KEY=.*|NODE_API_KEY='$NODE_API_KEY'|' /opt/mynode/dojo/docker/my-dojo/conf/docker-node.conf.tpl - NODE_ADMIN_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 48 | head -n 1) + NODE_ADMIN_KEY=$(< /dev/urandom tr -dc 'a-zA-Z0-9' | head -c${1:-48}) sed -i 's|NODE_ADMIN_KEY=.*|NODE_ADMIN_KEY='$NODE_ADMIN_KEY'|' /opt/mynode/dojo/docker/my-dojo/conf/docker-node.conf.tpl - NODE_JWT_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) + NODE_JWT_SECRET=$(< /dev/urandom tr -dc 'a-zA-Z0-9' | head -c${1:-48}) sed -i 's|NODE_JWT_SECRET=.*|NODE_JWT_SECRET='$NODE_JWT_SECRET'|' /opt/mynode/dojo/docker/my-dojo/conf/docker-node.conf.tpl fi @@ -100,13 +100,13 @@ if [ -f /opt/mynode/dojo/docker/my-dojo/conf/docker-mysql.conf ]; then echo "File present - skip docker-mysql.conf" else # Modify mysql.conf to enter random generated passwords - MYSQL_ROOT_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) + MYSQL_ROOT_PASSWORD=$(< /dev/urandom tr -dc 'a-zA-Z0-9' | head -c${1:-64}) sed -i 's|MYSQL_ROOT_PASSWORD=.*|MYSQL_ROOT_PASSWORD='$MYSQL_ROOT_PASSWORD'|' /opt/mynode/dojo/docker/my-dojo/conf/docker-mysql.conf.tpl MYSQL_USER=mynode sed -i 's|MYSQL_USER=.*|MYSQL_USER='$MYSQL_USER'|' /opt/mynode/dojo/docker/my-dojo/conf/docker-mysql.conf.tpl - MYSQL_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) + MYSQL_PASSWORD=$(< /dev/urandom tr -dc 'a-zA-Z0-9' | head -c${1:-64}) sed -i 's|MYSQL_PASSWORD=.*|MYSQL_PASSWORD='$MYSQL_PASSWORD'|' /opt/mynode/dojo/docker/my-dojo/conf/docker-mysql.conf.tpl fi