mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-21 16:21:51 +02:00
fix: auto-fix linting issues
This commit is contained in:
committed by
github-actions[bot]
parent
e5adbd266f
commit
f728166b14
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user