SIEMbitwardendnscrypthome assistantjellyfinjitsimulti-factor authenticationnextcloudonlyofficepiholeraspberry pirocket.chatsyncthingtorwazuhwireguard
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
558 B
30 lines
558 B
|
5 years ago
|
#!/bin/bash
|
||
|
|
|
||
|
|
HASS_CONFIG="/opt/mistborn_volumes/extra/homeassistant/config/configuration.yaml"
|
||
|
|
|
||
|
|
if [[ -f "$HASS_CONFIG" ]]; then
|
||
|
|
# configuration.yaml exists
|
||
|
|
|
||
|
|
if [[ ! -z $(grep "use_x_forwarded_for: true" "$HASS_CONFIG") ]]; then
|
||
|
|
# FOUND
|
||
|
|
exit 0;
|
||
|
|
fi
|
||
|
|
|
||
|
|
fi
|
||
|
|
|
||
|
|
# create parent directory if needed
|
||
|
|
PARENTDIR="$(dirname $HASS_CONFIG)"
|
||
|
|
if [[ ! -d "$PARENTDIR" ]]; then
|
||
|
|
mkdir -p $PARENTDIR
|
||
|
|
fi
|
||
|
|
|
||
|
|
# write the trusted proxies config
|
||
|
|
cat >> ${HASS_CONFIG}<< EOF
|
||
|
|
|
||
|
|
http:
|
||
|
|
use_x_forwarded_for: true
|
||
|
|
trusted_proxies:
|
||
|
|
- 172.16.0.0/12
|
||
|
|
|
||
|
|
EOF
|