mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
fix: auto-fix linting issues
This commit is contained in:
committed by
github-actions[bot]
parent
3539f328fb
commit
f5428e0950
@@ -5,7 +5,7 @@ set -e
|
||||
slug="tandoor_recipes"
|
||||
|
||||
if [ ! -d /config/addons_config/$slug ]; then
|
||||
echo "Creating /config/addons_config/$slug"
|
||||
mkdir -p /config/addons_config/$slug
|
||||
echo "Creating /config/addons_config/$slug"
|
||||
mkdir -p /config/addons_config/$slug
|
||||
fi
|
||||
chmod -R 755 /config/addons_config/$slug
|
||||
|
||||
@@ -13,9 +13,9 @@ export DEBUG=$(bashio::config 'DEBUG') && bashio::log.blue "DEBUG=$DEBUG"
|
||||
|
||||
CSRF_TRUSTED_ORIGINS="http://localhost"
|
||||
for element in ${ALLOWED_HOSTS//,/ }; do # Separate comma separated values
|
||||
element="${element#"https://"}"
|
||||
element="${element#"http://"}"
|
||||
CSRF_TRUSTED_ORIGINS="http://$element,https://$element,$CSRF_TRUSTED_ORIGINS"
|
||||
element="${element#"https://"}"
|
||||
element="${element#"http://"}"
|
||||
CSRF_TRUSTED_ORIGINS="http://$element,https://$element,$CSRF_TRUSTED_ORIGINS"
|
||||
done
|
||||
export CSRF_TRUSTED_ORIGINS
|
||||
export ALLOWED_HOSTS="*"
|
||||
@@ -34,66 +34,66 @@ bashio::log.info "Defining database"
|
||||
export DB_TYPE=$(bashio::config 'DB_TYPE')
|
||||
case $(bashio::config 'DB_TYPE') in
|
||||
|
||||
# Use sqlite
|
||||
sqlite)
|
||||
bashio::log.info "Using a local sqlite database"
|
||||
export DB_ENGINE="django.db.backends.sqlite3"
|
||||
export POSTGRES_DB="/config/addons_config/tandoor_recipes/recipes.db"
|
||||
;;
|
||||
# Use sqlite
|
||||
sqlite)
|
||||
bashio::log.info "Using a local sqlite database"
|
||||
export DB_ENGINE="django.db.backends.sqlite3"
|
||||
export POSTGRES_DB="/config/addons_config/tandoor_recipes/recipes.db"
|
||||
;;
|
||||
|
||||
# tandoor recipes doesnt support mariadb.
|
||||
# mariadb_addon)
|
||||
# bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
|
||||
# if ! bashio::services.available 'mysql'; then
|
||||
# bashio::log.fatal \
|
||||
# "Local database access should be provided by the MariaDB addon"
|
||||
# bashio::exit.nok \
|
||||
# "Please ensure it is installed and started"
|
||||
# fi
|
||||
# tandoor recipes doesnt support mariadb.
|
||||
# mariadb_addon)
|
||||
# bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
|
||||
# if ! bashio::services.available 'mysql'; then
|
||||
# bashio::log.fatal \
|
||||
# "Local database access should be provided by the MariaDB addon"
|
||||
# bashio::exit.nok \
|
||||
# "Please ensure it is installed and started"
|
||||
# fi
|
||||
|
||||
# Install apps
|
||||
# apk add --no-cache postgresql-libs gettext zlib libjpeg libxml2-dev libxslt-dev mysql-client mariadb-connector-c-dev mariadb-dev >/dev/null
|
||||
# Install apps
|
||||
# apk add --no-cache postgresql-libs gettext zlib libjpeg libxml2-dev libxslt-dev mysql-client mariadb-connector-c-dev mariadb-dev >/dev/null
|
||||
|
||||
# Install mysqlclient
|
||||
# pip install pymysql &>/dev/null
|
||||
# Install mysqlclient
|
||||
# pip install pymysql &>/dev/null
|
||||
|
||||
# export DB_ENGINE=django.db.backends.mysql
|
||||
# export POSTGRES_HOST=$(bashio::services "mysql" "host") && bashio::log.blue "POSTGRES_HOST=$POSTGRES_HOST"
|
||||
# export POSTGRES_PORT=$(bashio::services "mysql" "port") && bashio::log.blue "POSTGRES_PORT=$POSTGRES_PORT"
|
||||
# export POSTGRES_USER=$(bashio::services "mysql" "username") && bashio::log.blue "POSTGRES_USER=$POSTGRES_USER"
|
||||
# export POSTGRES_PASSWORD=$(bashio::services "mysql" "password") && bashio::log.blue "POSTGRES_PASSWORD=$POSTGRES_PASSWORD"
|
||||
# export POSTGRES_DB="tandoor" && bashio::log.blue "POSTGRES_DB=tandoor"
|
||||
# export DB_ENGINE=django.db.backends.mysql
|
||||
# export POSTGRES_HOST=$(bashio::services "mysql" "host") && bashio::log.blue "POSTGRES_HOST=$POSTGRES_HOST"
|
||||
# export POSTGRES_PORT=$(bashio::services "mysql" "port") && bashio::log.blue "POSTGRES_PORT=$POSTGRES_PORT"
|
||||
# export POSTGRES_USER=$(bashio::services "mysql" "username") && bashio::log.blue "POSTGRES_USER=$POSTGRES_USER"
|
||||
# export POSTGRES_PASSWORD=$(bashio::services "mysql" "password") && bashio::log.blue "POSTGRES_PASSWORD=$POSTGRES_PASSWORD"
|
||||
# export POSTGRES_DB="tandoor" && bashio::log.blue "POSTGRES_DB=tandoor"
|
||||
|
||||
# Use values
|
||||
# sed -i "1a export DB_ENGINE=django.db.backends.mysql" /opt/recipes/boot.sh
|
||||
# sed -i "1a export POSTGRES_HOST=$(bashio::services "mysql" "host")" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_HOST=$POSTGRES_HOST"
|
||||
# sed -i "1a export POSTGRES_PORT=$(bashio::services "mysql" "port")" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_PORT=$POSTGRES_PORT"
|
||||
# sed -i "1a export POSTGRES_USER=$(bashio::services "mysql" "username")" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_USER=$POSTGRES_USER"
|
||||
# sed -i "1a export POSTGRES_PASSWORD=$(bashio::services "mysql" "password")" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_PASSWORD=$POSTGRES_PASSWORD"
|
||||
# sed -i "1a export POSTGRES_DB=tandoor" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_DB=tandoor"
|
||||
# Use values
|
||||
# sed -i "1a export DB_ENGINE=django.db.backends.mysql" /opt/recipes/boot.sh
|
||||
# sed -i "1a export POSTGRES_HOST=$(bashio::services "mysql" "host")" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_HOST=$POSTGRES_HOST"
|
||||
# sed -i "1a export POSTGRES_PORT=$(bashio::services "mysql" "port")" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_PORT=$POSTGRES_PORT"
|
||||
# sed -i "1a export POSTGRES_USER=$(bashio::services "mysql" "username")" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_USER=$POSTGRES_USER"
|
||||
# sed -i "1a export POSTGRES_PASSWORD=$(bashio::services "mysql" "password")" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_PASSWORD=$POSTGRES_PASSWORD"
|
||||
# sed -i "1a export POSTGRES_DB=tandoor" /opt/recipes/boot.sh && bashio::log.blue "POSTGRES_DB=tandoor"
|
||||
|
||||
# bashio::log.warning "This addon is using the Maria DB addon"
|
||||
# bashio::log.warning "Please ensure this is included in your backups"
|
||||
# bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
|
||||
# bashio::log.warning "This addon is using the Maria DB addon"
|
||||
# bashio::log.warning "Please ensure this is included in your backups"
|
||||
# bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
|
||||
|
||||
# bashio::log.info "Creating database if required"
|
||||
# bashio::log.info "Creating database if required"
|
||||
|
||||
# mysql \
|
||||
# -u "${POSTGRES_USER}" -p"${POSTGRES_PASSWORD}" \
|
||||
# -h "${POSTGRES_HOST}" -P "${POSTGRES_PORT}" \
|
||||
# -e "CREATE DATABASE IF NOT EXISTS \`${POSTGRES_DB}\` ;"
|
||||
# ;;
|
||||
# mysql \
|
||||
# -u "${POSTGRES_USER}" -p"${POSTGRES_PASSWORD}" \
|
||||
# -h "${POSTGRES_HOST}" -P "${POSTGRES_PORT}" \
|
||||
# -e "CREATE DATABASE IF NOT EXISTS \`${POSTGRES_DB}\` ;"
|
||||
# ;;
|
||||
|
||||
# use postgresql
|
||||
postgresql_external)
|
||||
bashio::log.info "Using an external database, please populate all required fields in the addons config"
|
||||
export DB_ENGINE=django.db.backends.postgresql
|
||||
export POSTGRES_HOST=$(bashio::config "POSTGRES_HOST") && bashio::log.blue "POSTGRES_HOST=$POSTGRES_HOST"
|
||||
export POSTGRES_PORT=$(bashio::config "POSTGRES_PORT") && bashio::log.blue "POSTGRES_PORT=$POSTGRES_PORT"
|
||||
export POSTGRES_DB=$(bashio::config "POSTGRES_DB") && bashio::log.blue "POSTGRES_DB=$POSTGRES_DB"
|
||||
export POSTGRES_USER=$(bashio::config "POSTGRES_USER") && bashio::log.blue "POSTGRES_USER=$POSTGRES_USER"
|
||||
export POSTGRES_PASSWORD=$(bashio::config "POSTGRES_PASSWORD") && bashio::log.blue "POSTGRES_PASSWORD=$POSTGRES_PASSWORD"
|
||||
;;
|
||||
# use postgresql
|
||||
postgresql_external)
|
||||
bashio::log.info "Using an external database, please populate all required fields in the addons config"
|
||||
export DB_ENGINE=django.db.backends.postgresql
|
||||
export POSTGRES_HOST=$(bashio::config "POSTGRES_HOST") && bashio::log.blue "POSTGRES_HOST=$POSTGRES_HOST"
|
||||
export POSTGRES_PORT=$(bashio::config "POSTGRES_PORT") && bashio::log.blue "POSTGRES_PORT=$POSTGRES_PORT"
|
||||
export POSTGRES_DB=$(bashio::config "POSTGRES_DB") && bashio::log.blue "POSTGRES_DB=$POSTGRES_DB"
|
||||
export POSTGRES_USER=$(bashio::config "POSTGRES_USER") && bashio::log.blue "POSTGRES_USER=$POSTGRES_USER"
|
||||
export POSTGRES_PASSWORD=$(bashio::config "POSTGRES_PASSWORD") && bashio::log.blue "POSTGRES_PASSWORD=$POSTGRES_PASSWORD"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -109,9 +109,9 @@ ln -s /config/addons_config/tandoor_recipes/mediafiles /opt/recipes
|
||||
ln -s /data/recipes/staticfiles /opt/recipes
|
||||
|
||||
if bashio::config.has_value "externalfiles_folder"; then
|
||||
externalfiles_folder="$(bashio::config "externalfiles_folder")"
|
||||
externalfiles_folder="$(bashio::config "externalfiles_folder")"
|
||||
else
|
||||
externalfiles_folder="/config/addons_config/tandoor_recipes/externalfiles"
|
||||
externalfiles_folder="/config/addons_config/tandoor_recipes/externalfiles"
|
||||
fi
|
||||
mkdir -p "$externalfiles_folder"
|
||||
ln -s "$externalfiles_folder" /opt/recipes
|
||||
|
||||
Reference in New Issue
Block a user