checks for caddy_pwd before creating the webterminal block

This commit is contained in:
mcguirepr89
2022-02-06 08:42:28 -05:00
parent c8a80ae0e3
commit acb61f749b
2 changed files with 15 additions and 3 deletions
+8 -1
View File
@@ -311,7 +311,7 @@ http://localhost http://$(hostname).local ${BIRDNETPI_URL} {
EOF
fi
if [ ! -z ${WEBTERMINAL_URL} ];then
if [ ! -z ${WEBTERMINAL_URL} ] && [ -! z ${HASHWORD} ];then
cat << EOF >> /etc/caddy/Caddyfile
${WEBTERMINAL_URL} {
basicauth {
@@ -319,8 +319,15 @@ ${WEBTERMINAL_URL} {
}
reverse_proxy localhost:8888
}
EOF
elif [ ! -z ${WEBTERMINAL_URL} ] && [ -z ${HASHWORD} ];then
cat << EOF >> /etc/caddy/Caddyfile
${WEBTERMINAL_URL} {
reverse_proxy localhost:8888
}
EOF
fi
if [ ! -z ${BIRDNETLOG_URL} ];then
cat << EOF >> /etc/caddy/Caddyfile
${BIRDNETLOG_URL} {
+7 -2
View File
@@ -300,15 +300,20 @@ http://localhost http://$(hostname).local ${BIRDNETPI_URL} {
EOF
fi
if [ ! -z ${WEBTERMINAL_URL} ];then
if [ ! -z ${WEBTERMINAL_URL} ] && [ -! z ${HASHWORD} ];then
cat << EOF >> /etc/caddy/Caddyfile
${WEBTERMINAL_URL} {
basicauth {
birdnet ${HASHWORD}
}
reverse_proxy localhost:8888
}
EOF
elif [ ! -z ${WEBTERMINAL_URL} ] && [ -z ${HASHWORD} ];then
cat << EOF >> /etc/caddy/Caddyfile
${WEBTERMINAL_URL} {
reverse_proxy localhost:8888
}
EOF
fi
if [ ! -z ${BIRDNETLOG_URL} ];then