Commit Graph

1770 Commits

Author SHA1 Message Date
lloydbayley ed9b7c8055 Security Fixes, Mainly 2023-05-22 23:55:11 +10:00
ehpersonal38 6313cb1d91 Merge pull request #912 from croisez/main
Added possibility in Spectrogram view to activate frequency shifting
2023-05-20 18:14:18 -04:00
Louis Croisez e92da07637 correction bug for var init 2023-05-20 09:49:26 +02:00
ehpersonal38 9c1f4175e2 Revert "Code Consolidation for API preparations & hard coded path replacements" 2023-05-19 20:03:02 -04:00
ehpersonal38 09b4c56c96 Merge pull request #901 from jaredb7/New-UI-API
Code Consolidation for API preparations & hard coded path replacements
2023-05-19 20:00:10 -04:00
ehpersonal38 f25d43d133 make species stats up to 70% faster 2023-05-19 19:48:50 -04:00
jaredb7 aba13452f8 Update common.php 2023-05-19 21:37:29 +10:00
jaredb7 4ffefa8dfb Change the method of how the filepath are generated
To avoid having to update file or directory paths in 3 script locations (PHP Common, Shell Common and Python File path resolver)

The .json file will references by all 3 systems, allowing  them to generate paths from one central location. Files can be then moved around, the file updated and all 3 languages will up to date without any other work.
2023-05-19 21:25:37 +10:00
jaredb7 6b5282037c Merge branch 'BirdNET-pi-main' into New-UI-API 2023-05-17 20:04:19 +10:00
Louis Croisez 38e60f23be correction bug in https://github.com/mcguirepr89/BirdNET-Pi/pull/898 2023-05-16 23:34:42 +02:00
ehpersonal38 0e40aa562a no special characters message 2023-05-16 12:36:32 -04:00
Louis Croisez 04dae073f6 Added option in Spectrogram view to activate a frequency shift in the audio livestream 2023-05-16 10:46:43 +02:00
jaredb7 e998742517 Update to return IdentifiedSoFar.txt - IDFILE location 2023-05-15 23:32:31 +10:00
jaredb7 7a125a6ed8 Create test for common.php filepath resolver
Quick test for the common.php directory and filepath resolver to ensure it's generating the correct paths

And small fix for incorrect firstrun.ini location (thanks test case :) )
2023-05-14 18:38:30 +10:00
jaredb7 9594f3344b Add additional paths to directory and file path resolver 2023-05-14 17:35:52 +10:00
jaredb7 a80d39d7b6 Replace all authentication code with a function that does the auth for us
Makes things a little tidier and easier to change in the future, a custom message can be passed to authenticateUser() and this is output if the authentication fails.

Added protection around Include and Exclude species pages as these still accessible & data can still be written to include and exclude species.txt even with a password.
2023-05-13 01:07:19 +10:00
croisez 21e10dd0bd Merge branch 'mcguirepr89:main' into main 2023-05-12 16:03:30 +02:00
jaredb7 66863f2e6b Save password last to avoid auth check preventing saving other settings
Because saveSetting() checks each time to see that the user has authenticated, if the password is changed first then very next setting will cause a auth prompt (as the password changed) and if cancelled then the other setting won't save.

Putting it last will allow us to save all the other setting and then change the password, then the next attempt to execute a action or access a page that required auth will prompt the user the the password.
2023-05-12 23:09:15 +10:00
jaredb7 6af59a2908 Fix caddyfile not updating due to command execution being intercepted by auth prompt
We always want this command to execute regardless and rebuild the caddy config accordingly.
2023-05-11 06:55:29 +10:00
jaredb7 e99129f5f5 Config.php - Replace apprise.txt hard-coded paths with calculated paths 2023-05-10 23:05:22 +10:00
jaredb7 92bd190334 Authenticate user for all system actions
Wired in an additional check to verify user is authenticated before executing any code that makes changes to the system like saving settings or command execution.
This is a 2nd layer on top of the front end pages authenticating the user

Added in escaping of arguments for set date and change timezone just in case
2023-05-10 23:02:11 +10:00
jaredb7 eee84587f9 Merge branch 'BirdNET-pi-main' into New-UI-API
# Resolve Conflicts due to code movement:
#	homepage/views.php
#	scripts/config.php
#	scripts/play.php
2023-05-10 22:57:49 +10:00
ehpersonal38 1bb17f9705 Update play.php 2023-05-09 15:06:14 -04:00
ehpersonal38 4cc4406083 Update views.php 2023-05-09 13:58:24 -04:00
jaredb7 17697b9767 Disallow direct access to common.php 2023-05-09 22:51:53 +10:00
jaredb7 7169a172d6 Merge branch 'BirdNET-pi-main' into New-UI-API 2023-05-09 20:34:37 +10:00
jaredb7 69c4a6d3b1 Move remaining files to use new code
Include and Exclude list updated to use the calculated path to their respective x_species_list.txt files

Move play.php over to also use the new calculated paths to disk_check_exclude

Spectrogram.php remove unused code & replace setting save code with new function

Stats.php removed old code, update paths to use calculated path.

Rename setSetting func to saveSetting
Remove old code from other pages
2023-05-09 20:29:57 +10:00
croisez d3d7067c52 Merge branch 'mcguirepr89:main' into main 2023-05-09 10:08:51 +02:00
Louis Croisez 098e956e60 Makes DetectionsPanel disappear if it was already displayed, before displaying a new one 2023-05-09 10:02:57 +02:00
ehpersonal38 53fa65e364 Merge pull request #896 from croisez/main
Modified play script to substitute href of <a> tag in case that <vide…
2023-05-08 17:52:22 -04:00
jaredb7 3fb6889364 Merge branch 'BirdNET-pi-main' into New-UI-API
Install langauge code was moved into a different file, updated changeLanguage() in common.php by removing sudo from 3K model language install.
2023-05-09 07:32:20 +10:00
ehpersonal38 8c4e457c1a removing sudo 2023-05-08 13:32:22 -04:00
Louis Croisez d1e0d91711 removed unnecessary logs 2023-05-08 17:56:14 +02:00
Louis Croisez efe52a4638 Modified play script to substitute href of <a> tag in case that <video> tag is absent. This is for the ShiftFreq feature 2023-05-08 17:50:56 +02:00
jaredb7 b4977a62b6 Remove unused code from config.php 2023-05-08 23:32:56 +10:00
jaredb7 31730d58de Merge branch 'BirdNET-pi-main' into New-UI-API 2023-05-08 23:25:12 +10:00
jaredb7 ac9a0e4cbe Consolidate code in remaining pages, setting page updates
The Config and Advanced setting pages received changes to use the new setSetting() function which looks after creating or updated the setting in the required config files.
Optionally it also specification of a command to run after saving the settings.
Some variables like models, audio formats and frequency shift tools were also moved into common.php

Service Controls page received changes with the replacement of the actual command to execute with a sort of shorthand human friendly version e.g. service <action> <service_name> -- service restart livestream.service

These commands map to the original commands in serviceMaintenance() so this could be called through the API without needing the full-blown commend.
views.php was updated to accommodate this also

System Controls page received a small change to make the process checking for new git updates or getting the last commit hash a single function call.

Include and Exclude species updated to use getFilePath() to generate a path to the required file instead of the hard coded path

Views.php also received similar treatment with replacing some hard coded paths with generated paths, but logic changes to handle the change in running service commands
2023-05-08 23:24:15 +10:00
jaredb7 bf0131cf27 Query Consolidate Code for API Preparations
All SQL Queries were moved into their respective functions and parameterized, there were some slight logic changes in the front end pages to accommodate data being returned differently but existing functionality is maintained

A common function is used to execute the queries and looks after binding any parameterized values that have been supplied.

Other code for deleting / protecting detection's, frequency shift, Flickr API call etc have also been moved into common.php to be used later by the API

Two new functions getDirectory and getFilePath were introduced in aims and make it easier to relocate files. This will be worked into all existing php files to replace hardcoded paths
2023-05-07 11:59:50 +10:00
ehpersonal38 bddd8b3b9f Tim's requests
https://github.com/mcguirepr89/BirdNET-Pi/discussions/184#discussioncomment-5825259
2023-05-06 15:28:02 -04:00
ehpersonal38 520e9825d8 highlight current hour label on daily_plot 2023-05-06 13:37:11 -04:00
gerritzen ef3916a043 Fixed year number 2023-05-03 23:58:49 +02:00
lloydbayley b3e496f876 Merge branch 'main' of https://github.com/lloydbayley/BirdNET-Pi 2023-05-03 23:02:05 +10:00
lloydbayley 743074b9df Update weekly_report.php 2023-05-03 23:01:39 +10:00
ehpersonal38 6d3857b86e Apprise ONLY notify for certain species 2023-05-02 15:51:10 -04:00
ehpersonal38 f30e48356c better purge exclude language 2023-05-02 12:45:35 -04:00
ehpersonal38 dd2e90eeb7 bug 2023-04-30 21:46:09 -04:00
ehpersonal38 a97679633a add delete button to Today's Detections 2023-04-29 17:19:27 -04:00
ehpersonal38 2c77964b1a fix #876 2023-04-27 14:53:02 -04:00
ehpersonal38 898101d111 Merge pull request #872 from croisez/main
Use of git command to retrieve the current commit hash - more robust way, take care of branch cases
2023-04-25 19:14:59 -04:00
ehpersonal38 5de300caa5 fix kiosk mode 2023-04-25 16:10:21 -04:00