From 3698618063d729cd7991578c1e65f9050c5476fe Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 10:04:24 -0400 Subject: [PATCH] changing EXTRACTIONS_URL to BIRDNETPI_URL --- Birders_Guide_Installer.sh | 8 ++++---- birdnet.conf-defaults | 4 ++-- scripts/install_services.sh | 10 +++++----- scripts/update_services.sh | 10 +++++----- templates/Caddyfile_livestream | 16 +--------------- templates/Caddyfile_nostream | 15 +-------------- 6 files changed, 18 insertions(+), 45 deletions(-) diff --git a/Birders_Guide_Installer.sh b/Birders_Guide_Installer.sh index de5d05e..9003a9f 100755 --- a/Birders_Guide_Installer.sh +++ b/Birders_Guide_Installer.sh @@ -238,13 +238,13 @@ DO_RECORDING=y # Leave these EMPTY if you do not want to enable web access # -## EXTRACTIONS_URL is the URL where the extractions, data-set, and live-stream +## BIRDNETPI_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep -## the BirdNET-Pi on your local network, you can set this to http://localhost. -## Setting this (even to http://localhost) will also allow you to enable the +## the BirdNET-Pi on your local network, you can set this to +## http://birdnetpi.local. Setting this will also allow you to enable the ## GoTTY web logging features below. -EXTRACTIONS_URL=http://birdnetpi.local +BIRDNETPI_URL=http://birdnetpi.local ## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## the "Processed" directory and live audio stream. This MUST be set if you diff --git a/birdnet.conf-defaults b/birdnet.conf-defaults index f3de83c..160884f 100644 --- a/birdnet.conf-defaults +++ b/birdnet.conf-defaults @@ -59,13 +59,13 @@ DO_RECORDING= # Leave these EMPTY if you do not want to enable web access # -## EXTRACTIONS_URL is the URL where the extractions, data-set, and live-stream +## BIRDNETPI_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep ## BirdNET-Pi on your local network, you can set this to http://localhost. ## Setting this (even to http://localhost) will also allow you to enable the ## GoTTY web logging features below. -EXTRACTIONS_URL= +BIRDNETPI_URL= ## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## the "Processed" directory and live audio stream. This MUST be set if you diff --git a/scripts/install_services.sh b/scripts/install_services.sh index d67cc0c..6822698 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -120,11 +120,11 @@ create_necessary_dirs() { fi [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} - if [ ! -z ${EXTRACTIONS_URL} ];then - EXTRACTIONS_URL="$(echo ${EXTRACTIONS_URL} | sed 's/\/\//\\\/\\\//g')" + if [ ! -z ${BIRDNETPI_URL} ];then + BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" for i in "${phpfiles[@]}";do - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${EXTRACTIONS_URL}"/g" ${i} + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" ${i} done fi @@ -198,7 +198,7 @@ install_Caddyfile() { fi HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) cat << EOF > /etc/caddy/Caddyfile -${EXTRACTIONS_URL} { +http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth /Processed* { @@ -455,7 +455,7 @@ install_selected_services() { install_recording_service fi - if [ ! -z "${EXTRACTIONS_URL}" ];then + if [ ! -z "${BIRDNETPI_URL}" ];then install_caddy install_Caddyfile install_avahi_aliases diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 2e0c76d..5576216 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -120,11 +120,11 @@ create_necessary_dirs() { fi [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} - if [ ! -z ${EXTRACTIONS_URL} ];then - EXTRACTIONS_URL="$(echo ${EXTRACTIONS_URL} | sed 's/\/\//\\\/\\\//g')" + if [ ! -z ${BIRDNETPI_URL} ];then + BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" for i in "${phpfiles[@]}";do - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${EXTRACTIONS_URL}"/g" ${i} + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" ${i} done fi @@ -198,7 +198,7 @@ install_Caddyfile() { fi HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) cat << EOF > /etc/caddy/Caddyfile -${EXTRACTIONS_URL} { +http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth /Processed* { @@ -454,7 +454,7 @@ install_selected_services() { install_recording_service fi - if [ ! -z "${EXTRACTIONS_URL}" ];then + if [ ! -z "${BIRDNETPI_URL}" ];then install_caddy install_Caddyfile install_avahi_aliases diff --git a/templates/Caddyfile_livestream b/templates/Caddyfile_livestream index ad4a10d..53f522b 100644 --- a/templates/Caddyfile_livestream +++ b/templates/Caddyfile_livestream @@ -1,15 +1,4 @@ -${EXTRACTIONS_URL} { - root * ${EXTRACTED} - file_server browse - basicauth ${PROCESSED}* { - birdnet ${HASHWORD} - } - basicauth /stream { - birdnet ${HASHWORD} - } - reverse_proxy /stream localhost:8000 -} -http://birdnetpi.local { +http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth ${PROCESSED}* { @@ -26,6 +15,3 @@ http://birdlog.local { http://extractionlog.local { reverse_proxy localhost:8888 } -http://birdterminal.local { - reverse_proxy localhost:9111 -} diff --git a/templates/Caddyfile_nostream b/templates/Caddyfile_nostream index eef82f8..f60161f 100644 --- a/templates/Caddyfile_nostream +++ b/templates/Caddyfile_nostream @@ -1,14 +1,4 @@ -${EXTRACTIONS_URL} { - root * ${EXTRACTED} - file_server browse - basicauth ${PROCESSED}* { - birdnet ${HASHWORD} - } - basicauth /stream { - birdnet ${HASHWORD} - } -} -http://birdnetpi.local { +http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth ${PROCESSED}* { @@ -24,6 +14,3 @@ http://birdlog.local { http://extractionlog.local { reverse_proxy localhost:8888 } -http://birdterminal.local { - reverse_proxy localhost:9111 -}