|
|
@ -33,7 +33,10 @@ KIMAI_DB_NAME="" |
|
|
|
KIMAI_DB_USER="" |
|
|
|
KIMAI_DB_PASSWORD="" |
|
|
|
|
|
|
|
KIMAI_CONFIG_EXISTS="false" |
|
|
|
USE_EXISTING_KIMAI_CONFIG="" |
|
|
|
DISABLE_REGISTRATION="" |
|
|
|
SESSION_LIFETIME_TO_24H="" |
|
|
|
|
|
|
|
|
|
|
|
read -p "Enter kimai project name suffix (leave empty for none): " KIMAI_PROJECT_NAME_SUFFIX |
|
|
@ -89,7 +92,32 @@ cat "config" >> ".env" |
|
|
|
|
|
|
|
read -p "Should the config file 'config' be deleted after creating the container? (y/n)" DELETE_CONFIG |
|
|
|
|
|
|
|
read -p "Would you like to disable user registration and password reset via mail? (y/n)" DISABLE_REGISTRATION |
|
|
|
if [ -f "config/local.yaml" ]; then |
|
|
|
KIMAI_CONFIG_EXISTS="true" |
|
|
|
read -p "Kimai config file 'config/local.yaml' already exists! Would you like to use this? (y/n)" USE_EXISTING_KIMAI_CONFIG |
|
|
|
fi |
|
|
|
|
|
|
|
if [ $KIMAI_CONFIG_EXISTS == "false" ] || [ $USE_EXISTING_KIMAI_CONFIG == "n" ]; then |
|
|
|
echo "Create blank kimai config file 'config/local.yaml'!" |
|
|
|
|
|
|
|
rm -rf touch config/local.yaml |
|
|
|
mkdir -p config |
|
|
|
touch config/local.yaml |
|
|
|
|
|
|
|
read -p "Would you like to disable user registration and password reset via mail? (y/n)" DISABLE_REGISTRATION |
|
|
|
|
|
|
|
read -p "Would you like to set the session lifetime to 24h? (y/n)" SESSION_LIFETIME_TO_24H |
|
|
|
|
|
|
|
if [ $DISABLE_REGISTRATION == "y" ]; then |
|
|
|
cat "config_examples/disable_registration_and_password_reset.yaml" >> "config/local.yaml" |
|
|
|
fi |
|
|
|
|
|
|
|
if [ $SESSION_LIFETIME_TO_24H == "y" ]; then |
|
|
|
cat "config_examples/session_lifetime_24h.yaml" >> "config/local.yaml" |
|
|
|
fi |
|
|
|
else |
|
|
|
echo "Use existing kimai config file 'config/local.yaml'!" |
|
|
|
fi |
|
|
|
|
|
|
|
docker-compose up -d |
|
|
|
|
|
|
@ -102,32 +130,6 @@ done |
|
|
|
|
|
|
|
echo -e "\nKimai is ready!" |
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
docker exec -i $KIMAI_CONTAINER_NAME dd of=/opt/kimai/config/packages/local.yaml < tmp >> /dev/null 2>&1 |
|
|
|
|
|
|
|
rm -f tmp |
|
|
|
|
|
|
|
docker restart -t 0 $KIMAI_CONTAINER_NAME >> /dev/null |
|
|
|
|
|
|
|
echo -n "Wait until kimai is ready ..." |
|
|
|
|
|
|
|
while [ "`docker inspect -f {{.State.Health.Status}} $KIMAI_CONTAINER_NAME`" != "healthy" ]; do |
|
|
|
echo -n "." |
|
|
|
sleep 1 |
|
|
|
done |
|
|
|
|
|
|
|
echo -e "\nKimai is ready!" |
|
|
|
fi |
|
|
|
|
|
|
|
if [ $DELETE_CONFIG == "y" ]; then |
|
|
|
rm -f config |
|
|
|
|
|
|
|