This commit is contained in:
Alexandre
2022-01-14 17:12:15 +01:00
3 changed files with 15 additions and 3 deletions

View File

@@ -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]"
}

View File

@@ -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"

View File

@@ -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"