changing EXTRACTIONS_URL to BIRDNETPI_URL

This commit is contained in:
Patrick McGuire
2021-10-20 10:04:24 -04:00
parent bb86cbe3fd
commit 3698618063
6 changed files with 18 additions and 45 deletions
+4 -4
View File
@@ -238,13 +238,13 @@ DO_RECORDING=y
# Leave these EMPTY if you do not want to enable web access # # 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 ## 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. ## the BirdNET-Pi on your local network, you can set this to
## Setting this (even to http://localhost) will also allow you to enable the ## http://birdnetpi.local. Setting this will also allow you to enable the
## GoTTY web logging features below. ## 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 ## 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 ## the "Processed" directory and live audio stream. This MUST be set if you
+2 -2
View File
@@ -59,13 +59,13 @@ DO_RECORDING=
# Leave these EMPTY if you do not want to enable web access # # 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 ## 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. ## 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 ## Setting this (even to http://localhost) will also allow you to enable the
## GoTTY web logging features below. ## GoTTY web logging features below.
EXTRACTIONS_URL= BIRDNETPI_URL=
## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## 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 ## the "Processed" directory and live audio stream. This MUST be set if you
+5 -5
View File
@@ -120,11 +120,11 @@ create_necessary_dirs() {
fi fi
[ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED}
if [ ! -z ${EXTRACTIONS_URL} ];then if [ ! -z ${BIRDNETPI_URL} ];then
EXTRACTIONS_URL="$(echo ${EXTRACTIONS_URL} | sed 's/\/\//\\\/\\\//g')" BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')"
phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)"
for i in "${phpfiles[@]}";do 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 done
fi fi
@@ -198,7 +198,7 @@ install_Caddyfile() {
fi fi
HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD})
cat << EOF > /etc/caddy/Caddyfile cat << EOF > /etc/caddy/Caddyfile
${EXTRACTIONS_URL} { http://birdnetpi.local ${BIRDNETPI_URL} {
root * ${EXTRACTED} root * ${EXTRACTED}
file_server browse file_server browse
basicauth /Processed* { basicauth /Processed* {
@@ -455,7 +455,7 @@ install_selected_services() {
install_recording_service install_recording_service
fi fi
if [ ! -z "${EXTRACTIONS_URL}" ];then if [ ! -z "${BIRDNETPI_URL}" ];then
install_caddy install_caddy
install_Caddyfile install_Caddyfile
install_avahi_aliases install_avahi_aliases
+5 -5
View File
@@ -120,11 +120,11 @@ create_necessary_dirs() {
fi fi
[ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED}
if [ ! -z ${EXTRACTIONS_URL} ];then if [ ! -z ${BIRDNETPI_URL} ];then
EXTRACTIONS_URL="$(echo ${EXTRACTIONS_URL} | sed 's/\/\//\\\/\\\//g')" BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')"
phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)"
for i in "${phpfiles[@]}";do 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 done
fi fi
@@ -198,7 +198,7 @@ install_Caddyfile() {
fi fi
HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD})
cat << EOF > /etc/caddy/Caddyfile cat << EOF > /etc/caddy/Caddyfile
${EXTRACTIONS_URL} { http://birdnetpi.local ${BIRDNETPI_URL} {
root * ${EXTRACTED} root * ${EXTRACTED}
file_server browse file_server browse
basicauth /Processed* { basicauth /Processed* {
@@ -454,7 +454,7 @@ install_selected_services() {
install_recording_service install_recording_service
fi fi
if [ ! -z "${EXTRACTIONS_URL}" ];then if [ ! -z "${BIRDNETPI_URL}" ];then
install_caddy install_caddy
install_Caddyfile install_Caddyfile
install_avahi_aliases install_avahi_aliases
+1 -15
View File
@@ -1,15 +1,4 @@
${EXTRACTIONS_URL} { http://birdnetpi.local ${BIRDNETPI_URL} {
root * ${EXTRACTED}
file_server browse
basicauth ${PROCESSED}* {
birdnet ${HASHWORD}
}
basicauth /stream {
birdnet ${HASHWORD}
}
reverse_proxy /stream localhost:8000
}
http://birdnetpi.local {
root * ${EXTRACTED} root * ${EXTRACTED}
file_server browse file_server browse
basicauth ${PROCESSED}* { basicauth ${PROCESSED}* {
@@ -26,6 +15,3 @@ http://birdlog.local {
http://extractionlog.local { http://extractionlog.local {
reverse_proxy localhost:8888 reverse_proxy localhost:8888
} }
http://birdterminal.local {
reverse_proxy localhost:9111
}
+1 -14
View File
@@ -1,14 +1,4 @@
${EXTRACTIONS_URL} { http://birdnetpi.local ${BIRDNETPI_URL} {
root * ${EXTRACTED}
file_server browse
basicauth ${PROCESSED}* {
birdnet ${HASHWORD}
}
basicauth /stream {
birdnet ${HASHWORD}
}
}
http://birdnetpi.local {
root * ${EXTRACTED} root * ${EXTRACTED}
file_server browse file_server browse
basicauth ${PROCESSED}* { basicauth ${PROCESSED}* {
@@ -24,6 +14,3 @@ http://birdlog.local {
http://extractionlog.local { http://extractionlog.local {
reverse_proxy localhost:8888 reverse_proxy localhost:8888
} }
http://birdterminal.local {
reverse_proxy localhost:9111
}