mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
fix: auto-fix linting issues
This commit is contained in:
committed by
github-actions[bot]
parent
3539f328fb
commit
f5428e0950
@@ -19,39 +19,39 @@ urls+=("$(bashio::jq "$result" '.external_url' | cut -d'/' -f3 | cut -d':' -f1)"
|
||||
|
||||
# Get supported interfaces
|
||||
for interface in $(bashio::network.interfaces); do
|
||||
urls+=("$(bashio::network.ipv6_address "${interface}" | cut -d'/' -f1)")
|
||||
urls+=("$(bashio::network.ipv4_address "${interface}" | cut -d'/' -f1)")
|
||||
urls+=("$(bashio::network.ipv6_address "${interface}" | cut -d'/' -f1)")
|
||||
urls+=("$(bashio::network.ipv4_address "${interface}" | cut -d'/' -f1)")
|
||||
done
|
||||
|
||||
if bashio::config.has_value 'csrf_allowed'; then
|
||||
bashio::log.info "Setup manually defined ALLOWED_CSRF domains"
|
||||
bashio::log.info "Setup manually defined ALLOWED_CSRF domains"
|
||||
|
||||
while read -r line; do
|
||||
urls+=("$line")
|
||||
done <<<"$(bashio::config 'csrf_allowed')"
|
||||
while read -r line; do
|
||||
urls+=("$line")
|
||||
done <<< "$(bashio::config 'csrf_allowed')"
|
||||
fi
|
||||
|
||||
# Add internal and external URL as it
|
||||
if [[ "$(bashio::jq "$result" '.external_url')" != "null" ]]; then
|
||||
CSRF=$(bashio::jq "$result" '.external_url')
|
||||
CSRF=$(bashio::jq "$result" '.external_url')
|
||||
fi
|
||||
if [[ "$(bashio::jq "$result" '.internal_url')" != "null" ]]; then
|
||||
CSRF=$(bashio::jq "$result" '.internal_url'),${CSRF}
|
||||
CSRF=$(bashio::jq "$result" '.internal_url'),${CSRF}
|
||||
fi
|
||||
|
||||
# Loop through URls to add them in the CSRF string
|
||||
for url in "${urls[@]}"; do
|
||||
if bashio::var.has_value "${url}"; then
|
||||
if [[ "${url}" != "null" ]] && [[ "${url}" != "null.local" ]]; then
|
||||
CSRF="https://${url}:${port},http://${url}:${port},https://${url},http://${url}",${CSRF}
|
||||
if bashio::var.has_value "$(bashio::addon.port 9810)"; then
|
||||
CSRF="https://${url}:${addon_port},http://${url}:${addon_port}",${CSRF}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if bashio::var.has_value "${url}"; then
|
||||
if [[ "${url}" != "null" ]] && [[ "${url}" != "null.local" ]]; then
|
||||
CSRF="https://${url}:${port},http://${url}:${port},https://${url},http://${url}",${CSRF}
|
||||
if bashio::var.has_value "$(bashio::addon.port 9810)"; then
|
||||
CSRF="https://${url}:${addon_port},http://${url}:${addon_port}",${CSRF}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
CSRF=${CSRF::-1}
|
||||
|
||||
# Save CSFR
|
||||
echo -n "${CSRF}" >/var/run/s6/container_environment/PAPERLESS_CSRF_TRUSTED_ORIGINS
|
||||
echo -n "${CSRF}" > /var/run/s6/container_environment/PAPERLESS_CSRF_TRUSTED_ORIGINS
|
||||
bashio::log.blue "PAPERLESS_CSRF_TRUSTED_ORIGINS is set to ${CSRF}"
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
############
|
||||
|
||||
if bashio::config.has_value 'TZ'; then
|
||||
TIMEZONE=$(bashio::config 'TZ')
|
||||
bashio::log.info "Setting timezone to $TIMEZONE"
|
||||
if [ -f /usr/share/zoneinfo/"$TIMEZONE" ]; then
|
||||
ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime
|
||||
echo "$TIMEZONE" >/etc/timezone
|
||||
else
|
||||
bashio::log.fatal "$TIMEZONE not found, are you sure it is a valid timezone?"
|
||||
fi
|
||||
TIMEZONE=$(bashio::config 'TZ')
|
||||
bashio::log.info "Setting timezone to $TIMEZONE"
|
||||
if [ -f /usr/share/zoneinfo/"$TIMEZONE" ]; then
|
||||
ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime
|
||||
echo "$TIMEZONE" > /etc/timezone
|
||||
else
|
||||
bashio::log.fatal "$TIMEZONE not found, are you sure it is a valid timezone?"
|
||||
fi
|
||||
fi
|
||||
|
||||
#################
|
||||
@@ -32,7 +32,7 @@ export FB_BASEURL
|
||||
declare ADDON_PROTOCOL=http
|
||||
# Generate Ingress configuration
|
||||
if bashio::config.true 'ssl'; then
|
||||
ADDON_PROTOCOL=https
|
||||
ADDON_PROTOCOL=https
|
||||
fi
|
||||
|
||||
#port=$(bashio::addon.port 80)
|
||||
@@ -46,10 +46,10 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
|
||||
|
||||
# Correct baseurl
|
||||
for file in /config/hypercorn.toml $(find /usr -name hypercorn.toml.default); do
|
||||
if [ -f "$file" ]; then
|
||||
sed -i "/root_path/d" "$file"
|
||||
sed -i "1a root_path = \"${FB_BASEURL}\"" "$file"
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
sed -i "/root_path/d" "$file"
|
||||
sed -i "1a root_path = \"${FB_BASEURL}\"" "$file"
|
||||
fi
|
||||
done
|
||||
|
||||
##############
|
||||
|
||||
Reference in New Issue
Block a user