Automatic Update Feature (#424)
* Update advanced.php Added a checkbox in the Advanced Settings page to enable Automatic Update * Update install_config.sh The AUTOMATIC_UPDATE parameter needs to be created in the BirdNET-Pi configuration file. * Update install_services.sh Add a cron job to the system to performa automatic updates. * Create automatic_update.cron The line to be added to the cron table to check for need to perform automatic update. * Create automatic_update.sh Script to perform the automatic update if the flag is set in the configuration. Also, the services are restarted after the update. * Update install_services.sh * Update automatic_update.sh * Update advanced.php Correct typo * Update update_birdnet_snippets.sh Add the automatic_update.cron to the list of cron jobs * Update update_birdnet_snippets.sh * Update automatic_update.cron Change automatic update to once a week on Sunday at 3AM * Update update_birdnet_snippets.sh Adjusted to add option to existing installations * Update automatic_update.sh Removed unnecessary call to restart_services.sh * Update advanced.php Cleaned up the Options section line spacing in the settings table * Update templates/automatic_update.cron Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com> * Update scripts/update_birdnet_snippets.sh Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com> * Delete scripts/automatic_update.sh * Update advanced.php Modified the description of the Automatic Update feature on the Advanced Configuration tab. * Update install_config.sh --------- Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com>
This commit is contained in:
+22
-6
@@ -203,6 +203,15 @@ if (isset($_GET["max_files_species"])) {
|
||||
$contents = preg_replace("/SILENCE_UPDATE_INDICATOR=.*/", "SILENCE_UPDATE_INDICATOR=0", $contents);
|
||||
}
|
||||
|
||||
if(isset($_GET["automatic_update"])) {
|
||||
$automatic_update = 1;
|
||||
if(strcmp($automatic_update,$config['AUTOMATIC_UPDATE']) !== 0) {
|
||||
$contents = preg_replace("/AUTOMATIC_UPDATE=.*/", "AUTOMATIC_UPDATE=$automatic_update", $contents);
|
||||
}
|
||||
} else {
|
||||
$contents = preg_replace("/AUTOMATIC_UPDATE=.*/", "AUTOMATIC_UPDATE=0", $contents);
|
||||
}
|
||||
|
||||
if(isset($_GET["raw_spectrogram"])) {
|
||||
$raw_spectrogram = 1;
|
||||
if(strcmp($RAW_SPECTROGRAM,$config['RAW_SPECTROGRAM']) !== 0) {
|
||||
@@ -454,19 +463,26 @@ foreach($formats as $format){
|
||||
<input style="width:40ch;" name="birdnetpi_url" type="url" value="<?php print($newconfig['BIRDNETPI_URL']);?>" /><br>
|
||||
<p>The BirdNET-Pi 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 "<i>http://</i>".<br>Example for IP: <i>http://192.168.0.109</i><br>Example if you own your own domain: <i>https://virginia.birdnetpi.com</i></p>
|
||||
</td></tr></table><br>
|
||||
|
||||
<table class="settingstable"><tr><td>
|
||||
<h2>Options</h2>
|
||||
|
||||
<label for="silence_update_indicator">Silence Update Indicator: </label>
|
||||
<input type="checkbox" name="silence_update_indicator" <?php if($newconfig['SILENCE_UPDATE_INDICATOR'] == 1) { echo "checked"; };?> ><br>
|
||||
<p>This allows you to quiet the display of how many commits your installation is behind by relative to the Github repo. This number appears next to "Tools" when you're 50 or more commits behind.</p>
|
||||
|
||||
<input type="checkbox" name="silence_update_indicator" <?php if($newconfig['SILENCE_UPDATE_INDICATOR'] == 1) { echo "checked"; };?> >
|
||||
<p>This allows you to quiet the display of how many commits your installation is behind by relative to the Github repo. This number appears next to "Tools" when you're 50 or more commits behind.</p><br>
|
||||
|
||||
<label for="automatic_update">Automatic Update: </label>
|
||||
<input type="checkbox" name="automatic_update" <?php if($newconfig['AUTOMATIC_UPDATE'] == 1) { echo "checked"; };?> >
|
||||
<p>This configures an automatic update of the installation each Sunday at 3:00 AM but the timing can be changed using crontab.</p><br>
|
||||
|
||||
<label for="raw_spectrogram">Minimalist Spectrograms: </label>
|
||||
<input type="checkbox" name="raw_spectrogram" <?php if($newconfig['RAW_SPECTROGRAM'] == 1) { echo "checked"; };?> ><br>
|
||||
<p>This allows you to remove the axes and labels of the spectrograms that are generated by Sox for each detection for a cleaner appearance.</p>
|
||||
<input type="checkbox" name="raw_spectrogram" <?php if($newconfig['RAW_SPECTROGRAM'] == 1) { echo "checked"; };?> >
|
||||
<p>This allows you to remove the axes and labels of the spectrograms that are generated by Sox for each detection for a cleaner appearance.</p><br>
|
||||
|
||||
<label for="rare_species_threshold">Rare Species Threshold (days): </label>
|
||||
<input type="number" name="rare_species_threshold" min="1" value="<?php echo isset($newconfig['RARE_SPECIES_THRESHOLD']) ? $newconfig['RARE_SPECIES_THRESHOLD'] : 30; ?>"><br>
|
||||
<input type="number" name="rare_species_threshold" min="1" value="<?php echo isset($newconfig['RARE_SPECIES_THRESHOLD']) ? $newconfig['RARE_SPECIES_THRESHOLD'] : 30; ?>">
|
||||
<p>This setting defines after how many days since last detection a species is considered rare. Default is 30 days.</p>
|
||||
|
||||
</td></tr></table><br>
|
||||
|
||||
<table class="settingstable"><tr><td>
|
||||
|
||||
Reference in New Issue
Block a user