Update 99-run.sh

This commit is contained in:
Alexandre
2025-12-27 09:44:57 +01:00
committed by GitHub
parent 7f10535477
commit 05c4f09e5f

View File

@@ -2,52 +2,6 @@
# shellcheck shell=bash
set -e
required_vars=(
OPENAI_URL
OPENAI_API_KEY
TRANSCRIPTION_MODEL
TEXT_MODEL
MEALIE_URL
MEALIE_API_KEY
)
for var in "${required_vars[@]}"; do
if ! bashio::config.has_value "$var"; then
bashio::exit.nok "Configuration option $var is required"
fi
export "$var"="$(bashio::config "$var")"
sed -i "1a export $var=$(bashio::config "$var")" /app/entrypoint.sh
bashio::log.info "$var configured"
done
optional_vars=(
MEALIE_GROUP_NAME
EXTRA_PROMPT
YTDLP_VERSION
COOKIES
)
for var in "${optional_vars[@]}"; do
if bashio::config.has_value "$var"; then
export "$var"="$(bashio::config "$var")"
sed -i "1a export $var=$(bashio::config "$var")" /app/entrypoint.sh
bashio::log.info "$var configured"
fi
done
if bashio::config.has_value "env_vars"; then
for entry in $(bashio::config 'env_vars | map(@base64) | .[]'); do
item=$(echo "$entry" | base64 -d)
name=$(echo "$item" | jq -r '.name // empty')
value=$(echo "$item" | jq -r '.value // empty')
if [ -n "$name" ]; then
export "$name"="$value"
sed -i "1a export $name=$value" /app/entrypoint.sh
bashio::log.info "Custom env $name configured"
fi
done
fi
bashio::log.info "Starting Social to Mealie"
cd /app || bashio::exit.nok "App directory not found"
exec /bin/sh /app/entrypoint.sh node --run start
/./app/entrypoint.sh node --run start