diff --git a/tandoor_recipes/config.json b/tandoor_recipes/config.json index 3048f590c..a7796fec8 100644 --- a/tandoor_recipes/config.json +++ b/tandoor_recipes/config.json @@ -4,7 +4,8 @@ "description": "recipe manager", "environment": { "DB_ENGINE": "django.db.backends.sqlite3", - "POSTGRES_DB": "/config/addons_config/tandoor_recipes/recipes.db" + "POSTGRES_DB": "/config/addons_config/tandoor_recipes/recipes.db", + "DEBUG": "0" }, "map": ["config:rw"], "name": "Tandoor recipes", @@ -22,7 +23,7 @@ "services": ["mysql:want"], "schema": { "SECRET_KEY": "str", - "DB_TYPE": "list(sqlite|postgresql_external|mariadb_addon)", + "DB_TYPE": "list(sqlite|postgresql_external)", "ALLOWED_HOSTS": "str?", "POSTGRES_HOST": "str?", "POSTGRES_PORT": "str?", @@ -33,6 +34,6 @@ "slug": "tandoor_recipes", "upstream": "1.0.4", "url": "https://github.com/alexbelgium/hassio-addons", - "version": "1.0.4-4", + "version": "1.0.4-7", "webui": "[PROTO:ssl]://[HOST]:[PORT:8080]" } diff --git a/tandoor_recipes/rootfs/etc/cont-init.d/99-run.sh b/tandoor_recipes/rootfs/etc/cont-init.d/99-run.sh index a28550506..cb6cb87c0 100644 --- a/tandoor_recipes/rootfs/etc/cont-init.d/99-run.sh +++ b/tandoor_recipes/rootfs/etc/cont-init.d/99-run.sh @@ -5,6 +5,7 @@ ##################### export ALLOWED_HOSTS=$(bashio::config 'ALLOWED_HOSTS') && bashio::log.blue "ALLOWED_HOSTS=$ALLOWED_HOSTS" +export SECRET_KEY=$(bashio::config 'SECRET_KEY') && bashio::log.blue "SECRET_KEY=$SECRET_KEY" ################### # Define database # @@ -30,6 +31,9 @@ mariadb_addon) "Please ensure it is installed and started" fi + # Install mysqlclient + pip install pymysql &>/dev/null + # Use values export DB_ENGINE=django.db.backends.mysql export POSTGRES_HOST=$(bashio::services "mysql" "host") && bashio::log.blue "POSTGRES_HOST=$POSTGRES_HOST" diff --git a/zzz_templates/automatic_packages.sh b/zzz_templates/automatic_packages.sh index b75ee6a1e..4e5076b97 100644 --- a/zzz_templates/automatic_packages.sh +++ b/zzz_templates/automatic_packages.sh @@ -116,6 +116,13 @@ for files in "/etc/cont-init.d" "/etc/services.d"; do [ "$PACKMANAGER" = "apt" ] && PACKAGES="$PACKAGES sqlite3" fi + COMMAND="mysql" + if grep -q -rnw "$files/" -e "$COMMAND" && ! command -v $COMMAND &>/dev/null; then + [ "$VERBOSE" = true ] && echo "$COMMAND required" + [ "$PACKMANAGER" = "apk" ] && PACKAGES="$PACKAGES mysql-client" + [ "$PACKMANAGER" = "apt" ] && PACKAGES="$PACKAGES mysql-client" + fi + COMMAND="pip" if grep -q -rnw "$files/" -e "$COMMAND" && ! command -v $COMMAND &>/dev/null; then [ "$VERBOSE" = true ] && echo "$COMMAND required"