diff --git a/setup b/setup index b49bafa..b04b870 100755 --- a/setup +++ b/setup @@ -27,6 +27,8 @@ KIMAI_DB_NAME="" KIMAI_DB_USER="" KIMAI_DB_PASSWORD="" +DISABLE_REGISTRATION="" + if [ -f ".env" ]; then CONFIG_EXISTS="true" read -p "Config file '.env' already exists! Would you like to use this? (y/n)" KEEP_CONFIG @@ -63,6 +65,8 @@ else echo "Use existing config file '.env'!" fi +read -p "Would you like to disable user registration and password reset via mail? (y/n)" DISABLE_REGISTRATION + read -p "Should the config file '.env' be deleted after creating the container? (y/n)" DELETE_CONFIG docker-compose up -d @@ -76,29 +80,31 @@ done echo -e "\nContainer is running!" -echo "Create 'local.yaml' file and restart container." +if [ $DISABLE_REGISTRATION == "y" ]; then + echo "Create 'local.yaml' file and restart container." -rm -f tmp -touch tmp -echo "kimai:" >> tmp -echo " user:" >> tmp -echo " registration: false" >> tmp -echo " password_reset: false" >> tmp + rm -f tmp + touch tmp + echo "kimai:" >> tmp + echo " user:" >> tmp + echo " registration: false" >> tmp + echo " password_reset: false" >> tmp -docker exec -i $KIMAI_CONTAINER_NAME dd of=/opt/kimai/config/packages/local.yaml < tmp >> /dev/null 2>&1 + docker exec -i $KIMAI_CONTAINER_NAME dd of=/opt/kimai/config/packages/local.yaml < tmp >> /dev/null 2>&1 -rm -f tmp + rm -f tmp -docker restart -t 0 $KIMAI_CONTAINER_NAME >> /dev/null + docker restart -t 0 $KIMAI_CONTAINER_NAME >> /dev/null -echo -n "Wait until container is running ..." + echo -n "Wait until container is running ..." -while [ "`docker inspect -f {{.State.Health.Status}} $KIMAI_CONTAINER_NAME`" != "healthy" ]; do - echo -n "." - sleep 1 -done + while [ "`docker inspect -f {{.State.Health.Status}} $KIMAI_CONTAINER_NAME`" != "healthy" ]; do + echo -n "." + sleep 1 + done -echo -e "\nContainer is running!" + echo -e "\nContainer is running!" +fi if [ $DELETE_CONFIG == "y" ]; then rm -f .env