mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-17 21:09:13 +02:00
Trusted headers
https://github.com/alexbelgium/hassio-addons/issues/540
This commit is contained in:
@@ -118,6 +118,20 @@ if [ -f "$WEBTREES_HOME"/data/config.ini.php ]; then
|
|||||||
sed -i "$LINE d" "$WEBTREES_HOME"/data/config.ini.php
|
sed -i "$LINE d" "$WEBTREES_HOME"/data/config.ini.php
|
||||||
fi || true
|
fi || true
|
||||||
|
|
||||||
|
###################
|
||||||
|
# TRUSTED HEADERS #
|
||||||
|
###################
|
||||||
|
|
||||||
|
if bashio::config.has_value "trusted_headers" && [ -f "$WEBTREES_HOME"/data/config.ini.php ]; then
|
||||||
|
bashio::log.info "Aligning trusted_headers addon config (use single address, or a range of addresses in CIDR format)"
|
||||||
|
sed -i "/trusted_headers/ d" "$WEBTREES_HOME" /data/config.ini.php
|
||||||
|
sed -i "1a trusted_headers=\"$(bashio::config 'trusted_headers')\""/data/config.ini.php
|
||||||
|
elif [ -f "$WEBTREES_HOME"/data/config.ini.php ]; then
|
||||||
|
bashio::log.info "Aligning trusted_headers addon config with cf-connecting-ip"
|
||||||
|
sed -i "/trusted_headers/ d" "$WEBTREES_HOME" /data/config.ini.php
|
||||||
|
sed -i "1a trusted_headers=\"cf-connecting-ip\"" /data/config.ini.php
|
||||||
|
fi
|
||||||
|
|
||||||
############
|
############
|
||||||
# END INFO #
|
# END INFO #
|
||||||
############
|
############
|
||||||
|
|||||||
Reference in New Issue
Block a user