install: Fix several bugs
This commit is contained in:
parent
b9d2297bbe
commit
ed92c9ddea
|
@ -16,6 +16,7 @@ CHUNK_FOLDER="./var/chunks"
|
||||||
AUDIO_DEVICE="default"
|
AUDIO_DEVICE="default"
|
||||||
# Virtual env for BirdNET AI with required packages
|
# Virtual env for BirdNET AI with required packages
|
||||||
PYTHON_VENV="./.venv/birdnet-stream"
|
PYTHON_VENV="./.venv/birdnet-stream"
|
||||||
|
WORKDIR="/home/$USER/BirdNET-stream"
|
||||||
# Database location
|
# Database location
|
||||||
DATABASE="./var/db.sqlite"
|
DATABASE="./var/db.sqlite"
|
||||||
|
|
||||||
|
|
16
install.sh
16
install.sh
|
@ -165,15 +165,16 @@ setup_http_server() {
|
||||||
sudo ln -s /etc/nginx/sites-available/birdnet-stream.conf /etc/nginx/sites-enabled/birdnet-stream.conf
|
sudo ln -s /etc/nginx/sites-available/birdnet-stream.conf /etc/nginx/sites-enabled/birdnet-stream.conf
|
||||||
debug "Info: Please edit /etc/nginx/sites-available/birdnet-stream.conf to set the correct server name and paths"
|
debug "Info: Please edit /etc/nginx/sites-available/birdnet-stream.conf to set the correct server name and paths"
|
||||||
debug "Setup nginx variables the best way possible"
|
debug "Setup nginx variables the best way possible"
|
||||||
|
sudo sed -i "s|<SYMFONY_PUBLIC>|$WORKDIR/www/public/|g" /etc/nginx/sites-available/birdnet-stream.conf
|
||||||
sudo sed -i "s|<RECORDS_FOLDER>|$CHUNK_FOLDER/out|g" /etc/nginx/sites-available/birdnet-stream.conf
|
sudo sed -i "s|<RECORDS_FOLDER>|$CHUNK_FOLDER/out|g" /etc/nginx/sites-available/birdnet-stream.conf
|
||||||
sudo sed -i "s|<CHARTS_FOLDER>|$WORKDIR/var/charts|g" /etc/nginx/sites-available/birdnet-stream.conf
|
sudo sed -i "s|<CHARTS_FOLDER>|$WORKDIR/var/charts|g" /etc/nginx/sites-available/birdnet-stream.conf
|
||||||
debug "Generate self signed certificate"
|
debug "Generate self signed certificate"
|
||||||
CERTS_LOCATION="/etc/nginx/certs/birdnet"
|
CERTS_LOCATION="/etc/nginx/certs/birdnet"
|
||||||
sudo mkdir -p "$CERTS_LOCATION"
|
sudo mkdir -p "$CERTS_LOCATION"
|
||||||
cd $CERTS_LOCATION
|
cd $CERTS_LOCATION
|
||||||
openssl req -x509 -newkey rsa:4096 -keyout privkey.pem -out fullchain.pem -sha256 -days 365 -nodes --subj '/CN=birdnet.lan'
|
sudo openssl req -x509 -newkey rsa:4096 -keyout privkey.pem -out fullchain.pem -sha256 -days 365 -nodes --subj '/CN=birdnet.lan'
|
||||||
sudo sed -i "s|<CERTIFICATE>|$CERTS_LOCATION/birdnet/fullchain.pem|g" /etc/nginx/sites-available/birdnet-stream.conf
|
sudo sed -i "s|<CERTIFICATE>|$CERTS_LOCATION/fullchain.pem|g" /etc/nginx/sites-available/birdnet-stream.conf
|
||||||
sudo sed -i "s|<PRIVATE_KEY>|$CERTS_LOCATION/birdnet/privkey.pem|g" /etc/nginx/sites-available/birdnet-stream.conf
|
sudo sed -i "s|<PRIVATE_KEY>|$CERTS_LOCATION/privkey.pem|g" /etc/nginx/sites-available/birdnet-stream.conf
|
||||||
sudo systemctl enable --now nginx
|
sudo systemctl enable --now nginx
|
||||||
sudo systemctl restart nginx
|
sudo systemctl restart nginx
|
||||||
cd -
|
cd -
|
||||||
|
@ -205,16 +206,17 @@ install_config() {
|
||||||
|
|
||||||
update_permissions() {
|
update_permissions() {
|
||||||
debug "Updating permissions (may not work properly)"
|
debug "Updating permissions (may not work properly)"
|
||||||
sudo chown -R "$USER":"birdnet" "$WORKDIR"
|
sudo chown -R $USER:birdnet "$WORKDIR"
|
||||||
sudo chown -R "$USER":"birdnet" "$CHUNK_FOLDER"
|
sudo chown -R $USER:birdnet "$CHUNK_FOLDER"
|
||||||
sudo chmod -R 755 "$CHUNK_FOLDER"
|
sudo chmod -R 755 "$CHUNK_FOLDER"
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
install_requirements "$REQUIREMENTS"
|
install_requirements "$REQUIREMENTS"
|
||||||
# install_birdnetstream
|
install_birdnetstream
|
||||||
# install_birdnetstream_services
|
install_birdnetstream_services
|
||||||
install_web_interface
|
install_web_interface
|
||||||
|
setup_http_server
|
||||||
install_config
|
install_config
|
||||||
update_permissions
|
update_permissions
|
||||||
debug "Installation done"
|
debug "Installation done"
|
||||||
|
|
|
@ -42,7 +42,7 @@ server {
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass unix:/run/php/www.sock;
|
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi.conf;
|
include fastcgi.conf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
"core-js": "^3.23.0",
|
"core-js": "^3.23.0",
|
||||||
"git-revision-webpack-plugin": "^5.0.0",
|
"git-revision-webpack-plugin": "^5.0.0",
|
||||||
"regenerator-runtime": "^0.13.9",
|
"regenerator-runtime": "^0.13.9",
|
||||||
"webpack": "^5.74.0",
|
|
||||||
"webpack-notifier": "^1.15.0"
|
"webpack-notifier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
|
|
5722
www/yarn.lock
5722
www/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue