From 2bb66c03d8028bc0fcf3daaee6a08e3a9baf6613 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Wed, 9 Feb 2022 14:37:14 -0500 Subject: [PATCH 01/28] this is for the new advanced.php --- scripts/update_db_pwd_bullseye.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/update_db_pwd_bullseye.sh b/scripts/update_db_pwd_bullseye.sh index 16f0aab..723e81c 100755 --- a/scripts/update_db_pwd_bullseye.sh +++ b/scripts/update_db_pwd_bullseye.sh @@ -5,9 +5,7 @@ source /etc/birdnet/birdnet.conf mysql -e " SET PASSWORD FOR 'birder'@'localhost' = PASSWORD('${DB_PWD}'); FLUSH PRIVILEGES"; -sudo -u ${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/server.py -sudo -u ${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/viewdb.php -sudo -u ${USER} sed -i "s/databasepassword/${DB_PWD}/g" /home/pi/BirdNET-Pi/scripts/server.py sed -i "s/mysqli.default_host =.*/mysqli.default_host = localhost/g" /etc/php/7.4/fpm/php.ini sed -i "s/mysqli.default_user =.*/mysqli.default_user = birder/g" /etc/php/7.4/fpm/php.ini sed -i "s/mysqli.default_pw =.*/mysqli.default_pw = ${DB_PWD}/g" /etc/php/7.4/fpm/php.ini +systemctl restart php7.4-fpm.service From b06f58094b875d8019a505ef640eb5d0b9ffda13 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Wed, 9 Feb 2022 15:50:36 -0500 Subject: [PATCH 02/28] advanced settings now update the settings in the system not just the files --- scripts/advanced.php | 209 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 183 insertions(+), 26 deletions(-) diff --git a/scripts/advanced.php b/scripts/advanced.php index 9859c1d..966780f 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -1,3 +1,162 @@ + /dev/null 2>&1 &'); +} +} + +if(isset($_POST["db_pwd"])) { +$db_pwd = $_POST["db_pwd"]; +if(strcmp($db_pwd,$config['DB_PWD']) !== 0) { +shell_exec('sudo /usr/local/bin/update_db_pwd_bullseye.sh'); +$contents = preg_replace("/DB_PWD=.*/", "DB_PWD=$db_pwd", $contents); +$contents2 = preg_replace("/DB_PWD=.*/", "DB_PWD=$db_pwd", $contents2); +} +} + +if(isset($_POST["ice_pwd"])) { +$ice_pwd = $_POST["ice_pwd"]; +if(strcmp($ice_pwd,$config['ICE_PWD']) !== 0) { +$contents = preg_replace("/ICE_PWD=.*/", "ICE_PWD=$ice_pwd", $contents); +$contents2 = preg_replace("/ICE_PWD=.*/", "ICE_PWD=$ice_pwd", $contents2); +} +} + +if(isset($_POST["birdnetpi_url"])) { +$birdnetpi_url = $_POST["birdnetpi_url"]; +if(strcmp($birdnetpi_url,$config['BIRDNETPI_URL']) !== 0) { +$contents = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents); +$contents2 = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents2); +$fh = fopen("/home/pi/BirdNET-Pi/birdnet.conf", "w"); +$fh2 = fopen("/home/pi/BirdNET-Pi/thisrun.txt", "w"); +fwrite($fh, $contents); +fwrite($fh2, $contents2); +exec('sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 &'); +} +} + +if(isset($_POST["webterminal_url"])) { +$webterminal_url = $_POST["webterminal_url"]; +if(strcmp($webterminal_url,$config['WEBTERMINAL_URL']) !== 0) { +$contents = preg_replace("/WEBTERMINAL_URL=.*/", "WEBTERMINAL_URL=$webterminal_url", $contents); +$contents2 = preg_replace("/WEBTERMINAL_URL=.*/", "WEBTERMINAL_URL=$webterminal_url", $contents2); +$fh = fopen("/home/pi/BirdNET-Pi/birdnet.conf", "w"); +$fh2 = fopen("/home/pi/BirdNET-Pi/thisrun.txt", "w"); +fwrite($fh, $contents); +fwrite($fh2, $contents2); +exec('sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 &'); +} +} + +if(isset($_POST["birdnetlog_url"])) { +$birdnetlog_url = $_POST["birdnetlog_url"]; +if(strcmp($birdnetlog_url,$config['BIRDNETLOG_URL']) !== 0) { +$contents = preg_replace("/BIRDNETLOG_URL=.*/", "BIRDNETLOG_URL=$birdnetlog_url", $contents); +$contents2 = preg_replace("/BIRDNETLOG_URL=.*/", "BIRDNETLOG_URL=$birdnetlog_url", $contents2); +$fh = fopen("/home/pi/BirdNET-Pi/birdnet.conf", "w"); +$fh2 = fopen("/home/pi/BirdNET-Pi/thisrun.txt", "w"); +fwrite($fh, $contents); +fwrite($fh2, $contents2); +exec('sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 &'); +} +} + +if(isset($_POST["overlap"])) { +$overlap = $_POST["overlap"]; +if(strcmp($overlap,$config['OVERLAP']) !== 0) { +$contents = preg_replace("/OVERLAP=.*/", "OVERLAP=$overlap", $contents); +$contents2 = preg_replace("/OVERLAP=.*/", "OVERLAP=$overlap", $contents2); +} +} + +if(isset($_POST["confidence"])) { +$confidence = $_POST["confidence"]; +if(strcmp($confidence,$config['CONFIDENCE']) !== 0) { +$contents = preg_replace("/CONFIDENCE=.*/", "CONFIDENCE=$confidence", $contents); +$contents2 = preg_replace("/CONFIDENCE=.*/", "CONFIDENCE=$confidence", $contents2); +} +} + +if(isset($_POST["sensitivity"])) { +$sensitivity = $_POST["sensitivity"]; +if(strcmp($sensitivity,$config['SENSITIVITY']) !== 0) { +$contents = preg_replace("/SENSITIVITY=.*/", "SENSITIVITY=$sensitivity", $contents); +$contents2 = preg_replace("/SENSITIVITY=.*/", "SENSITIVITY=$sensitivity", $contents2); +} +} + +if(isset($_POST["full_disk"])) { +$full_disk = $_POST["full_disk"]; +if(strcmp($full_disk,$config['FULL_DISK']) !== 0) { +$contents = preg_replace("/FULL_DISK=.*/", "FULL_DISK=$full_disk", $contents); +$contents2 = preg_replace("/FULL_DISK=.*/", "FULL_DISK=$full_disk", $contents2); +} +} + +if(isset($_POST["rec_card"])) { +$rec_card = $_POST["rec_card"]; +if(strcmp($rec_card,$config['REC_CARD']) !== 0) { +$contents = preg_replace("/REC_CARD=.*/", "REC_CARD=$rec_card", $contents); +$contents2 = preg_replace("/REC_CARD=.*/", "REC_CARD=$rec_card", $contents2); +} +} + +if(isset($_POST["channels"])) { +$channels = $_POST["channels"]; +if(strcmp($channels,$config['CHANNELS']) !== 0) { +$contents = preg_replace("/CHANNELS=.*/", "CHANNELS=$channels", $contents); +$contents2 = preg_replace("/CHANNELS=.*/", "CHANNELS=$channels", $contents2); +} +} + +if(isset($_POST["recording_length"])) { +$recording_length = $_POST["recording_length"]; +if(strcmp($recording_length,$config['RECORDING_LENGTH']) !== 0) { +$contents = preg_replace("/RECORDING_LENGTH=.*/", "RECORDING_LENGTH=$recording_length", $contents); +$contents2 = preg_replace("/RECORDING_LENGTH=.*/", "RECORDING_LENGTH=$recording_length", $contents2); +} +} + +if(isset($_POST["extraction_length"])) { +$extraction_length = $_POST["extraction_length"]; +if(strcmp($extraction_length,$config['EXTRACTION_LENGTH']) !== 0) { +$contents = preg_replace("/EXTRACTION_LENGTH=.*/", "EXTRACTION_LENGTH=$extraction_length", $contents); +$contents2 = preg_replace("/EXTRACTION_LENGTH=.*/", "EXTRACTION_LENGTH=$extraction_length", $contents2); +} +} + +$fh = fopen("/home/pi/BirdNET-Pi/birdnet.conf", "w"); +$fh2 = fopen("/home/pi/BirdNET-Pi/thisrun.txt", "w"); +fwrite($fh, $contents); +fwrite($fh2, $contents2); +@session_start(); +if(true){ + $_SESSION['success'] = 1; + header('Location:/scripts/update_settings_inprogress.php'); +} +} +?> + +

Advanced Settings

-
- +

Defaults

-
+
-
+
-
+
-
+

Passwords

-
+
-
+
-
+

Custom URLs

-
+
-
+
-
+

BirdNET-Lite Settings

-
+
-
+
-
+


-
- From e37663cfc1b0026b458fa34ef099e507a7ee0cc8 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Wed, 9 Feb 2022 15:53:08 -0500 Subject: [PATCH 03/28] smarter advanced.php -- handles updating system with new settings instead of jsut files --- scripts/update_caddyfile.sh | 66 ++++++++++++++++++++++++++ scripts/update_settings_inprogress.php | 40 ++++++++++++++++ scripts/write_advanced.php | 60 ----------------------- 3 files changed, 106 insertions(+), 60 deletions(-) create mode 100755 scripts/update_caddyfile.sh create mode 100644 scripts/update_settings_inprogress.php delete mode 100644 scripts/write_advanced.php diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh new file mode 100755 index 0000000..f2da502 --- /dev/null +++ b/scripts/update_caddyfile.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +source /etc/birdnet/birdnet.conf +set -x +[ -d /etc/caddy ] || mkdir /etc/caddy +if [ -f /etc/caddy/Caddyfile ];then + cp /etc/caddy/Caddyfile{,.original} +fi +if ! [ -z ${CADDY_PWD} ];then +HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) +cat << EOF > /etc/caddy/Caddyfile +http://localhost http://$(hostname).local ${BIRDNETPI_URL} { + root * ${EXTRACTED} + file_server browse + basicauth /Processed* { + birdnet ${HASHWORD} + } + basicauth /scripts* { + birdnet ${HASHWORD} + } + basicauth /stream { + birdnet ${HASHWORD} + } + basicauth /phpsysinfo* { + birdnet ${HASHWORD} + } + reverse_proxy /stream localhost:8000 + php_fastcgi unix//run/php/php7.4-fpm.sock +} +EOF +else + cat << EOF > /etc/caddy/Caddyfile +http://localhost http://$(hostname).local ${BIRDNETPI_URL} { + root * ${EXTRACTED} + file_server browse + reverse_proxy /stream localhost:8000 + php_fastcgi unix//run/php/php7.4-fpm.sock +} +EOF +fi + +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 + cat << EOF >> /etc/caddy/Caddyfile + +${BIRDNETLOG_URL} { + reverse_proxy localhost:8080 +} +EOF +fi + +( systemctl reload caddy ) & diff --git a/scripts/update_settings_inprogress.php b/scripts/update_settings_inprogress.php new file mode 100644 index 0000000..0977e53 --- /dev/null +++ b/scripts/update_settings_inprogress.php @@ -0,0 +1,40 @@ + + + + + + + + +
+ + + + diff --git a/scripts/write_advanced.php b/scripts/write_advanced.php deleted file mode 100644 index fd13f39..0000000 --- a/scripts/write_advanced.php +++ /dev/null @@ -1,60 +0,0 @@ - - From 092bb28d5ccdab55dd3c56e7c8805103d044dec5 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Wed, 9 Feb 2022 17:02:05 -0500 Subject: [PATCH 04/28] added some descriptions to the advanced settings page --- scripts/advanced.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/advanced.php b/scripts/advanced.php index 966780f..0e770e3 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -152,7 +152,6 @@ fwrite($fh2, $contents2); @session_start(); if(true){ $_SESSION['success'] = 1; - header('Location:/scripts/update_settings_inprogress.php'); } } ?> @@ -274,37 +273,51 @@ if (strcmp($newconfig['FULL_DISK'], "purge") == 0) { if (strcmp($newconfig['FULL_DISK'], "keep") == 0) { echo "checked"; }?>>Keep +

When the disk becomes full, you can choose to 'purge' old files to make room for new ones or 'keep' your data and stop all services instead.


+

Set Audio Card to 'default' to use PulseAudio (always recommended), or an ALSA recognized sound card device from the output of `aplay -L`.


+

Set Channels to the number of channels supported by your sound card. 32 max.


+

Set Recording Length in seconds between 6 and 60. Multiples of 3 are recommended, as BirdNET analyzes in 3-second chunks.


+

Set Extraction Length to something less than your Recording Length above. Min=3 Max=Recording Length

Passwords


+

This password protects the Live Audio Stream, the Processed extractions, phpSysInfo, your Tools, and WebTerminal. When you update this value, the web server will reload, so wait about 30 seconds and then reload the page.


+

This password protects the database. When you update this value, it will be updated automatically.


Custom URLs

+

When you update any of the URL settings below, the web server will reload, so be sure to wait at least 30 seconds and then reload the page.


+

This URL is how the main page will be reached. If you want your installation to respond to an IP address, place that here, but be sure to indicate `http://`.
Example for IP:http://192.168.0.109
Example if you own your own domain:https://birdnetpi.pmcgui.xyz


+

This URL is how the log will be reached. Only use this variable if you own your own domain.


+

This URL is how the Web browser terminal will be reached. Only use this variable if you own your own domain.

BirdNET-Lite Settings


+

Min=0.0, Max=2.9


+

Min=0.01, Max=0.99


+

Min=0.5, Max=1.5




diff --git a/scripts/backup_data.php b/scripts/backup_data.php deleted file mode 100644 index c6587be..0000000 --- a/scripts/backup_data.php +++ /dev/null @@ -1,4 +0,0 @@ - /tmp/birdnetbackup.log 2&>1"); -header('Location: /backup_inprogress.html'); -?> diff --git a/scripts/backup_data.sh b/scripts/backup_data.sh deleted file mode 100755 index 2379fde..0000000 --- a/scripts/backup_data.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -# Tar and compress all data -source /etc/birdnet/birdnet.conf - -tar -czvf /home/pi/BirdNET-Pi/BirdNET-Pi_Data_Dump_$(date +%F).tar.gz ${EXTRACTED} /home/pi/BirdNET-Pi/BirdDB.txt diff --git a/scripts/restart_birdnet_analysis.php b/scripts/restart_birdnet_analysis.php index 2bca34d..f381d8b 100644 --- a/scripts/restart_birdnet_analysis.php +++ b/scripts/restart_birdnet_analysis.php @@ -1,4 +1,4 @@ diff --git a/scripts/stop_core_services.php b/scripts/stop_core_services.php index e335b68..28c09ad 100644 --- a/scripts/stop_core_services.php +++ b/scripts/stop_core_services.php @@ -1,4 +1,4 @@ diff --git a/scripts/update_birdnet.php b/scripts/update_birdnet.php index a5d5b44..892fa42 100644 --- a/scripts/update_birdnet.php +++ b/scripts/update_birdnet.php @@ -1,4 +1,4 @@ /tmp/phpupdate.log 2&>1"); -header('Location: http://birdnetpi.local/scripts/update_inprogress.php'); +header('Location: /update_inprogress.php'); ?> diff --git a/templates/Caddyfile_livestream b/templates/Caddyfile_livestream deleted file mode 100644 index 53f522b..0000000 --- a/templates/Caddyfile_livestream +++ /dev/null @@ -1,17 +0,0 @@ -http://birdnetpi.local ${BIRDNETPI_URL} { - root * ${EXTRACTED} - file_server browse - basicauth ${PROCESSED}* { - birdnet ${HASHWORD} - } - basicauth /stream { - birdnet ${HASHWORD} - } - reverse_proxy /stream localhost:8000 -} -http://birdlog.local { - reverse_proxy localhost:8080 -} -http://extractionlog.local { - reverse_proxy localhost:8888 -} diff --git a/templates/Caddyfile_nostream b/templates/Caddyfile_nostream deleted file mode 100644 index f60161f..0000000 --- a/templates/Caddyfile_nostream +++ /dev/null @@ -1,16 +0,0 @@ -http://birdnetpi.local ${BIRDNETPI_URL} { - root * ${EXTRACTED} - file_server browse - basicauth ${PROCESSED}* { - birdnet ${HASHWORD} - } - basicauth /stream { - birdnet ${HASHWORD} - } -} -http://birdlog.local { - reverse_proxy localhost:8080 -} -http://extractionlog.local { - reverse_proxy localhost:8888 -} From 8fe9fa7178da1a526f7dfc2b131f6ffefae1c522 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 09:48:02 -0500 Subject: [PATCH 07/28] removed link --- scripts/update_inprogress.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/update_inprogress.php b/scripts/update_inprogress.php index 5fe6c21..7eff704 100644 --- a/scripts/update_inprogress.php +++ b/scripts/update_inprogress.php @@ -21,8 +21,6 @@ function countDown(secs,elem) { element.innerHTML = '

Let\'s see

'; - element.innerHTML += ''; - } secs--; From 8ea901849079140a9b167016946a383130ad815c Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 09:58:32 -0500 Subject: [PATCH 08/28] update_caddyfile fixes links now --- scripts/update_caddyfile.sh | 38 ++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index f2da502..73c069b 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash source /etc/birdnet/birdnet.conf +USER=pi +HOME=/home/pi set -x [ -d /etc/caddy ] || mkdir /etc/caddy if [ -f /etc/caddy/Caddyfile ];then @@ -54,6 +56,7 @@ ${WEBTERMINAL_URL} { } EOF fi + if [ ! -z ${BIRDNETLOG_URL} ];then cat << EOF >> /etc/caddy/Caddyfile @@ -62,5 +65,38 @@ ${BIRDNETLOG_URL} { } EOF fi +################################################################################ +if [ ! -z ${BIRDNETLOG_URL} ];then + sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f homepage/* + sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/* + BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/ phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" + for i in "${phpfiles[@]}";do + sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" ${i} + done +fi +if [ ! -z ${WEBTERMINAL_URL} ];then + WEBTERMINAL_URL="$(echo ${WEBTERMINAL_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" $(dirname ${my_dir})/homepage + phpfiles="$(grep -l "$(hostname).local:8888" ${my_dir}/*.php)" + for i in "${phpfiles[@]}";do + sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" ${i} + done +fi -( systemctl reload caddy ) & +if [ -z ${BIRDNETPI_URL} ];then + sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/homepage/*.html + sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/scripts/*.html + sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/scripts/*.html + sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/scripts/*.php + sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/scripts/*/*.php +else + BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/${BIRDNETPI_URL}/g" $(dirname ${my_dir})/homepage/*.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/${BIRDNETPI_URL}/g" $(dirname ${my_dir})/scripts/*.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/${BIRDNETPI_URL}/g" $(dirname ${my_dir})/scripts/*.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/${BIRDNETPI_URL}/g" $(dirname ${my_dir})/scripts/*.php + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/${BIRDNETPI_URL}/g" $(dirname ${my_dir})/scripts/*/*.php +fi + +systemctl reload caddy From 51ec859e752530950a582cb40a71451def71817f Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:01:00 -0500 Subject: [PATCH 09/28] fixing missing variable --- scripts/update_caddyfile.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index 73c069b..d603492 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -2,6 +2,7 @@ source /etc/birdnet/birdnet.conf USER=pi HOME=/home/pi +my_dir=/home/pi/BirdNET-Pi/scripts set -x [ -d /etc/caddy ] || mkdir /etc/caddy if [ -f /etc/caddy/Caddyfile ];then From 79344f673ddc567bb99938d74e213515bfa0cc16 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:04:45 -0500 Subject: [PATCH 10/28] see if this works! --- scripts/update_caddyfile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index d603492..2ff0889 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -67,9 +67,9 @@ ${BIRDNETLOG_URL} { EOF fi ################################################################################ +sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f homepage/* +sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/* if [ ! -z ${BIRDNETLOG_URL} ];then - sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f homepage/* - sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/* BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/ phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" for i in "${phpfiles[@]}";do From a7ea304154ad9b88c0ccd777f9b0228f99491e9a Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:07:34 -0500 Subject: [PATCH 11/28] more testing --- scripts/update_caddyfile.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index 2ff0889..9fe844d 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -69,6 +69,7 @@ fi ################################################################################ sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f homepage/* sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/* +sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/*/* if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/ phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" From 497512b3599c2e47df577f155e42641ff28aa95a Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:13:07 -0500 Subject: [PATCH 12/28] another try! --- scripts/update_caddyfile.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index 9fe844d..4cfa46d 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -72,19 +72,25 @@ sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/* sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/*/* if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/ phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" - for i in "${phpfiles[@]}";do - sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" ${i} - done +else + BIRDNETLOG_URL="$(echo \"http://$(hostname).local:8080\" | sed 's/\/\//\\\/\\\//g')" fi +sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/ phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" +for i in "${phpfiles[@]}";do + sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" ${i} +done + if [ ! -z ${WEBTERMINAL_URL} ];then WEBTERMINAL_URL="$(echo ${WEBTERMINAL_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" $(dirname ${my_dir})/homepage - phpfiles="$(grep -l "$(hostname).local:8888" ${my_dir}/*.php)" - for i in "${phpfiles[@]}";do - sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" ${i} - done +else + WEBTERMINAL_URL="$(echo \"http://$(hostname).local:8888\" | sed 's/\/\//\\\/\\\//g')" fi +sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" $(dirname ${my_dir})/homepage +phpfiles="$(grep -l "$(hostname).local:8888" ${my_dir}/*.php)" +for i in "${phpfiles[@]}";do + sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" ${i} +done + if [ -z ${BIRDNETPI_URL} ];then sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/homepage/*.html From b91c9b9cc99070a5059b21b8a645139df4e49b6f Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:15:05 -0500 Subject: [PATCH 13/28] more kinks --- scripts/update_caddyfile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index 4cfa46d..0bf40c8 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -75,7 +75,7 @@ if [ ! -z ${BIRDNETLOG_URL} ];then else BIRDNETLOG_URL="$(echo \"http://$(hostname).local:8080\" | sed 's/\/\//\\\/\\\//g')" fi -sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/ phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" +sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" for i in "${phpfiles[@]}";do sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" ${i} done @@ -85,7 +85,7 @@ if [ ! -z ${WEBTERMINAL_URL} ];then else WEBTERMINAL_URL="$(echo \"http://$(hostname).local:8888\" | sed 's/\/\//\\\/\\\//g')" fi -sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" $(dirname ${my_dir})/homepage +sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" $(dirname ${my_dir})/homepage/* phpfiles="$(grep -l "$(hostname).local:8888" ${my_dir}/*.php)" for i in "${phpfiles[@]}";do sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" ${i} From a187d69d7c6e3dd1f2b451bdd0c78eeb087fd9d6 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:17:07 -0500 Subject: [PATCH 14/28] spaving --- scripts/update_caddyfile.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index 0bf40c8..b9621ba 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -75,7 +75,8 @@ if [ ! -z ${BIRDNETLOG_URL} ];then else BIRDNETLOG_URL="$(echo \"http://$(hostname).local:8080\" | sed 's/\/\//\\\/\\\//g')" fi -sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" +sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* +phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" for i in "${phpfiles[@]}";do sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" ${i} done From 475793cba4bacdba4a40c0957cddc66c6e575255 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:21:14 -0500 Subject: [PATCH 15/28] I think this is more straighforward --- scripts/update_caddyfile.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index b9621ba..1be1f27 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -75,22 +75,22 @@ if [ ! -z ${BIRDNETLOG_URL} ];then else BIRDNETLOG_URL="$(echo \"http://$(hostname).local:8080\" | sed 's/\/\//\\\/\\\//g')" fi -sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* -phpfiles="$(grep -l "$(hostname).local:8080" ${my_dir}/*.php)" -for i in "${phpfiles[@]}";do - sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8080/"${BIRDNETLOG_URL}"/g" ${i} -done +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/homepage/*.html +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/scripts/*.html +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/scripts/*.html +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/scripts/*.php +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/scripts/*/*.php if [ ! -z ${WEBTERMINAL_URL} ];then WEBTERMINAL_URL="$(echo ${WEBTERMINAL_URL} | sed 's/\/\//\\\/\\\//g')" else WEBTERMINAL_URL="$(echo \"http://$(hostname).local:8888\" | sed 's/\/\//\\\/\\\//g')" fi -sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" $(dirname ${my_dir})/homepage/* -phpfiles="$(grep -l "$(hostname).local:8888" ${my_dir}/*.php)" -for i in "${phpfiles[@]}";do - sudo -u${USER} sed -i "s/http:\/\/$(hostname).local:8888/"${WEBTERMINAL_URL}"/g" ${i} -done +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/homepage/*.html +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/scripts/*.html +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/scripts/*.html +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/scripts/*.php +sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/scripts/*/*.php if [ -z ${BIRDNETPI_URL} ];then From d0290e25d540874c6e66cc6bc27dfbf1643154af Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:23:52 -0500 Subject: [PATCH 16/28] removing quotations from url scheme --- scripts/update_caddyfile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index 1be1f27..6d8008a 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -73,7 +73,7 @@ sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/*/* if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" else - BIRDNETLOG_URL="$(echo \"http://$(hostname).local:8080\" | sed 's/\/\//\\\/\\\//g')" + BIRDNETLOG_URL="$(echo http://$(hostname).local:8080 | sed 's/\/\//\\\/\\\//g')" fi sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/homepage/*.html sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/scripts/*.html @@ -84,7 +84,7 @@ sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(di if [ ! -z ${WEBTERMINAL_URL} ];then WEBTERMINAL_URL="$(echo ${WEBTERMINAL_URL} | sed 's/\/\//\\\/\\\//g')" else - WEBTERMINAL_URL="$(echo \"http://$(hostname).local:8888\" | sed 's/\/\//\\\/\\\//g')" + WEBTERMINAL_URL="$(echo http://$(hostname).local:8888 | sed 's/\/\//\\\/\\\//g')" fi sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/homepage/*.html sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/scripts/*.html From a47ca9651c88d601e03df86818400af0ea6c26f6 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:26:58 -0500 Subject: [PATCH 17/28] making sure wttr.in links stays the same --- scripts/update_caddyfile.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/update_caddyfile.sh b/scripts/update_caddyfile.sh index 6d8008a..6b8982d 100755 --- a/scripts/update_caddyfile.sh +++ b/scripts/update_caddyfile.sh @@ -70,6 +70,8 @@ fi sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f homepage/* sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/* sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/*/* +sudo -u${USER} sed -i "s/https:\/\/v2.wttr.in\//https:\/\/v2.wttr.in\/"${LATITUDE},${LONGITUDE}"/g" $(dirname ${my_dir})/homepage/menu.html + if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" else From 558d5729f48dca1660b88bfd5b845e10d11c259f Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 10:30:23 -0500 Subject: [PATCH 18/28] changed order of caddy reloads --- scripts/advanced.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/advanced.php b/scripts/advanced.php index 36f6502..c4d4bf3 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -42,19 +42,6 @@ if(isset($_POST['submit'])) { } } - if(isset($_POST["birdnetpi_url"])) { - $birdnetpi_url = $_POST["birdnetpi_url"]; - if(strcmp($birdnetpi_url,$config['BIRDNETPI_URL']) !== 0) { - $contents = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents); - $contents2 = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents2); - $fh = fopen("/home/pi/BirdNET-Pi/birdnet.conf", "w"); - $fh2 = fopen("/home/pi/BirdNET-Pi/thisrun.txt", "w"); - fwrite($fh, $contents); - fwrite($fh2, $contents2); - exec('sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 &'); - } - } - if(isset($_POST["webterminal_url"])) { $webterminal_url = $_POST["webterminal_url"]; if(strcmp($webterminal_url,$config['WEBTERMINAL_URL']) !== 0) { @@ -81,6 +68,19 @@ if(isset($_POST['submit'])) { } } + if(isset($_POST["birdnetpi_url"])) { + $birdnetpi_url = $_POST["birdnetpi_url"]; + if(strcmp($birdnetpi_url,$config['BIRDNETPI_URL']) !== 0) { + $contents = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents); + $contents2 = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents2); + $fh = fopen("/home/pi/BirdNET-Pi/birdnet.conf", "w"); + $fh2 = fopen("/home/pi/BirdNET-Pi/thisrun.txt", "w"); + fwrite($fh, $contents); + fwrite($fh2, $contents2); + exec('sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 &'); + } + } + if(isset($_POST["overlap"])) { $overlap = $_POST["overlap"]; if(strcmp($overlap,$config['OVERLAP']) !== 0) { From f987e9699070fff2788a4054e341aa9649535b97 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 11:00:41 -0500 Subject: [PATCH 19/28] should help with updates --- scripts/update_birdnet2.sh | 1 + scripts/update_services.sh | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh index 56b33bd..9379732 100755 --- a/scripts/update_birdnet2.sh +++ b/scripts/update_birdnet2.sh @@ -39,6 +39,7 @@ chart_viewer.service birdnet_recording.service birdnet_log.service) +sudo systemctl reload caddy for i in "${services[@]}";do sudo systemctl restart "${i}" done diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 181cbd9..0c13c18 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -26,7 +26,6 @@ install_scripts() { install_mariadb() { if ! which mysql &> /dev/null;then echo "Installing MariaDB Server" - apt -qqy update apt -qqy install mariadb-server echo "MariaDB Installed" fi @@ -201,7 +200,6 @@ install_alsa() { echo "alsa-utils installed" else echo "Installing alsa-utils" - apt -qqq update apt install -qqy alsa-utils echo "alsa-utils installed" fi @@ -209,7 +207,6 @@ install_alsa() { echo "PulseAudio installed" else echo "Installing pulseaudio" - apt -qqq update apt install -qqy pulseaudio echo "PulseAudio installed" fi @@ -251,7 +248,6 @@ install_caddy() { curl -1sLf \ 'https://dl.cloudsmith.io/public/caddy/stable/setup.deb.sh' \ | sudo -E bash - apt -qq update apt install -qqy caddy=2.4.5 systemctl enable --now caddy else @@ -324,7 +320,6 @@ ${BIRDNETLOG_URL} { } EOF fi - systemctl reload caddy } update_etc_hosts() { @@ -441,7 +436,6 @@ install_sox() { echo "Sox is installed" else echo "Installing sox" - apt -qq update apt install -y sox echo "Sox installed" fi @@ -450,7 +444,6 @@ install_sox() { install_php() { if ! which php &> /dev/null || ! which php-fpm || ! apt list --installed | grep php-xml;then echo "Installing PHP modules" - apt -qq update apt install -qqy php php-fpm php-mysql php-xml php-zip else echo "PHP and PHP-FPM installed" @@ -472,7 +465,6 @@ EOF install_icecast() { if ! which icecast2;then echo "Installing IceCast2" - apt -qq update echo "icecast2 icecast2/icecast-setup boolean false" | debconf-set-selections apt install -qqy icecast2 config_icecast @@ -536,6 +528,7 @@ install_cleanup_cron() { } install_selected_services() { + sudo apt -qqqq update install_scripts install_birdnet_analysis install_birdnet_server From f9b9541e0936f7dd985f22c10b85aa26839748eb Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 11:06:36 -0500 Subject: [PATCH 20/28] removed php restart that made webgui update fail --- scripts/update_services.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 0c13c18..ce30fe4 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -33,7 +33,12 @@ install_mariadb() { if [[ "${VERSION_CODENAME}" == "buster" ]];then USER=${USER} ${my_dir}/update_db_pwd_buster.sh elif [[ "${VERSION_CODENAME}" == "bullseye" ]];then - USER=${USER} ${my_dir}/update_db_pwd_bullseye.sh + mysql -e " + SET PASSWORD FOR 'birder'@'localhost' = PASSWORD('${DB_PWD}'); + FLUSH PRIVILEGES"; + sed -i "s/mysqli.default_host =.*/mysqli.default_host = localhost/g" /etc/php/7.4/fpm/php.ini + sed -i "s/mysqli.default_user =.*/mysqli.default_user = birder/g" /etc/php/7.4/fpm/php.ini + sed -i "s/mysqli.default_pw =.*/mysqli.default_pw = ${DB_PWD}/g" /etc/php/7.4/fpm/php.ini fi } From 02d718ea444297033f8d1de4568134e1d9f75548 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 11:07:07 -0500 Subject: [PATCH 21/28] file not found fixed --- scripts/update_birdnet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update_birdnet.php b/scripts/update_birdnet.php index 892fa42..413b337 100644 --- a/scripts/update_birdnet.php +++ b/scripts/update_birdnet.php @@ -1,4 +1,4 @@ /tmp/phpupdate.log 2&>1"); -header('Location: /update_inprogress.php'); +header('Location: update_inprogress.php'); ?> From 52359f1ef98261ecf45856de8c0b9eeab13dbbb6 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 11:09:04 -0500 Subject: [PATCH 22/28] reload caddy last thing and then reload php7.4-fpm to allow new DB password --- scripts/update_birdnet2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh index 9379732..19f4182 100755 --- a/scripts/update_birdnet2.sh +++ b/scripts/update_birdnet2.sh @@ -39,8 +39,8 @@ chart_viewer.service birdnet_recording.service birdnet_log.service) -sudo systemctl reload caddy for i in "${services[@]}";do sudo systemctl restart "${i}" done - +sudo systemctl reload caddy +sudo systemctl restart php7.4-fpm.service From 078e528e61fe9a55422ad0e5b0029a997cd0219f Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 11:29:00 -0500 Subject: [PATCH 23/28] adding some info to the config.php page (Basic Settings) --- scripts/config.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/config.php b/scripts/config.php index 9268c05..c35eee8 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -124,13 +124,15 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {

+

Set your Latitude and Longitude to 4 decimal places. Get your coordinates here.


-

Email Tim to request a BirdWeather ID

+

BirdWeather.com is a weather map for bird sounds. Stations around the world supply audio and video streams to BirdWeather where they are then analyzed by BirdNET and compared to eBird Grid data. BirdWeather catalogues the bird audio and spectrogram visualizations so that you can listen to, view, and read about birds throughout the world. Email Tim to request a BirdWeather ID



+

Pushed iOS Notifications can be setup and enabled for New Species notifications. Sorry, Android users, this only works on iOS.


-

Set Extraction Length to something less than your Recording Length above. Min=3 Max=Recording Length +

Set Extraction Length to something less than your Recording Length. Min=3 Max=Recording Length

Passwords


From 3894487a8396eb7467435c3711389dfcc23d3749 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 11:31:28 -0500 Subject: [PATCH 25/28] adding `forms` back to newinstaller for more tseting --- newinstaller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newinstaller.sh b/newinstaller.sh index e89c8e6..48d42f4 100644 --- a/newinstaller.sh +++ b/newinstaller.sh @@ -2,7 +2,7 @@ # Simple new installer HOME=/home/pi USER=pi -branch=main +branch=forms if ! which git &> /dev/null;then sudo apt update sudo apt -y install git From 80bbfccb49ba13dbf739c210dc05bae9659c07ba Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 12:32:34 -0500 Subject: [PATCH 26/28] fixed link targets to make their own window/tab --- scripts/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config.php b/scripts/config.php index c35eee8..421b5c9 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -124,10 +124,10 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {

-

Set your Latitude and Longitude to 4 decimal places. Get your coordinates here.

+

Set your Latitude and Longitude to 4 decimal places. Get your coordinates here.


-

BirdWeather.com is a weather map for bird sounds. Stations around the world supply audio and video streams to BirdWeather where they are then analyzed by BirdNET and compared to eBird Grid data. BirdWeather catalogues the bird audio and spectrogram visualizations so that you can listen to, view, and read about birds throughout the world. Email Tim to request a BirdWeather ID

+

BirdWeather.com is a weather map for bird sounds. Stations around the world supply audio and video streams to BirdWeather where they are then analyzed by BirdNET and compared to eBird Grid data. BirdWeather catalogues the bird audio and spectrogram visualizations so that you can listen to, view, and read about birds throughout the world. Email Tim to request a BirdWeather ID


From be1faf5813161f59f9619e3d59fab9c495718c4f Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Thu, 10 Feb 2022 12:38:18 -0500 Subject: [PATCH 27/28] removed link --- scripts/update_settings_inprogress.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/update_settings_inprogress.php b/scripts/update_settings_inprogress.php index 0977e53..496a00e 100644 --- a/scripts/update_settings_inprogress.php +++ b/scripts/update_settings_inprogress.php @@ -21,8 +21,6 @@ function countDown(secs,elem) { element.innerHTML = '

Let\'s see

'; - element.innerHTML += ''; - } secs--; From da11a26349b7cff740eaa312d590d34c0ab9ee79 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Thu, 10 Feb 2022 12:42:09 -0500 Subject: [PATCH 28/28] Update newinstaller.sh --- newinstaller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newinstaller.sh b/newinstaller.sh index 48d42f4..e89c8e6 100644 --- a/newinstaller.sh +++ b/newinstaller.sh @@ -2,7 +2,7 @@ # Simple new installer HOME=/home/pi USER=pi -branch=forms +branch=main if ! which git &> /dev/null;then sudo apt update sudo apt -y install git