mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-22 15:26:04 +02:00
URi encoding
https://github.com/alexbelgium/hassio-addons/issues/1775#issuecomment-2667577802
This commit is contained in:
@@ -13,11 +13,13 @@ export_options() {
|
|||||||
for key in "${keys[@]}"; do
|
for key in "${keys[@]}"; do
|
||||||
local value
|
local value
|
||||||
value=$(jq -r ".${key}" "${json_source}")
|
value=$(jq -r ".${key}" "${json_source}")
|
||||||
|
# Hide passwords
|
||||||
if bashio::config.false "verbose" || [[ "$key" == *"PASS"* ]]; then
|
if bashio::config.false "verbose" || [[ "$key" == *"PASS"* ]]; then
|
||||||
bashio::log.blue "${key}=******"
|
bashio::log.blue "${key}=******"
|
||||||
else
|
else
|
||||||
bashio::log.blue "${key}='${value}'"
|
bashio::log.blue "${key}='${value}'"
|
||||||
fi
|
fi
|
||||||
|
# Export value
|
||||||
export "${key}=${value}"
|
export "${key}=${value}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -169,20 +171,12 @@ check_vector_extension() {
|
|||||||
#########################
|
#########################
|
||||||
|
|
||||||
export_options
|
export_options
|
||||||
|
# Encode password
|
||||||
|
DB_PASSWORD="$(jq -rn --arg x "$DB_PASSWORD" '$x|@uri')"
|
||||||
check_db_hostname
|
check_db_hostname
|
||||||
migrate_database
|
migrate_database
|
||||||
validate_config
|
validate_config
|
||||||
|
|
||||||
# Reload DB configuration from the addon options (this ensures we have the correct values)
|
|
||||||
export DB_USERNAME=$(bashio::config 'DB_USERNAME')
|
|
||||||
#export DB_HOSTNAME=$(bashio::config 'DB_HOSTNAME')
|
|
||||||
export DB_PASSWORD=$(bashio::config 'DB_PASSWORD')
|
|
||||||
export DB_DATABASE_NAME=$(bashio::config 'DB_DATABASE_NAME')
|
|
||||||
export DB_PORT=$(bashio::config 'DB_PORT')
|
|
||||||
export JWT_SECRET=$(bashio::config 'JWT_SECRET')
|
|
||||||
|
|
||||||
export_db_env
|
export_db_env
|
||||||
|
|
||||||
setup_root_user
|
setup_root_user
|
||||||
setup_database
|
setup_database
|
||||||
check_vector_extension
|
check_vector_extension
|
||||||
|
|||||||
Reference in New Issue
Block a user