Skip to content

Commit

Permalink
Merge branch 'main' of Predator
Browse files Browse the repository at this point in the history
  • Loading branch information
connervieira committed Jun 14, 2024
2 parents 79fb12a + dca9e58 commit 9bb36c4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,9 @@ This update focuses on improving the reliability of Predator, especially when op
- Added the ability to disable capture devices without removing them from the configuration entirely.
- Predator now changes the status light color when a video is being locked.
- Dashcam video save events can now be triggered using buttons via GPIO pins.
- Moved the status lighting configuration to the "general" section.
- Updated status lighting.
- Moved the status lighting configuration to the "general" section.
- Network requests are only made to update the status lighting if it has changed since the last update.
- Updated configuration back-end.
- Predator can now automatically update the configuration file between versions when configuration values are added or removed.
- Added an initial start-up sequence, where Predator shows some basic information before the normal start-up.
Expand Down
3 changes: 2 additions & 1 deletion assets/support/configdefault.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@
"print_timings": false,
"dashcam_saving_queue_overflow": 2000,
"dashcam_shortterm_framerate_interval": 0.25,
"hard_crash_on_error": false
"hard_crash_on_error": false,
"identify_to_remote_sources": true
}
}
4 changes: 3 additions & 1 deletion assets/support/configoutline.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@
"kill_plate": "str",
"print_timings": "bool",
"dashcam_saving_queue_overflow": "+int",
"dashcam_shortterm_framerate_interval": "+float"
"dashcam_shortterm_framerate_interval": "+float",
"hard_crash_on_error": "bool",
"identify_to_remote_sources": "bool"
}
}
2 changes: 2 additions & 0 deletions docs/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,5 @@ This document describes the configuration values found `config.json`.
- This short-term frame-rate is currently only used for visual purposes, and does not effect output files.
- `hard_crash_on_error` is a boolean that determines whether Predator will globally exit if an error is encountered. This is useful if you run Predator as an unmonitored headless service, and you want to force it to restart when an error is encountered.
- Keep in mind that enabling this configuration option will cause Predator to boot-loop if the problem that caused the error isn't resolved between start-ups.
- `identify_to_remote_sources` determines whether Predator will attach its randomly generated identifier when fetching hot-lists from remote sources. This is helpful to allow administrators of remote hot-list sources to see how many clients are using their server.
- If you don't control the servers in your remote hot-list sources, you may consider disabling this feature to make it more difficult to identify you.
24 changes: 14 additions & 10 deletions lighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@
exit()


current_status_light_id = ""
def update_status_lighting(url_id):
global current_status_light_id
debug_message("Updating status lighting")
if (config["general"]["status_lighting"]["enabled"] == True): # Only update the status lighting if it is enabled in the configuration.
status_lighting_update_url = str(config["general"]["status_lighting"]["values"][url_id]).replace("[U]", str(config["general"]["status_lighting"]["base_url"])) # Prepare the URL where a request will be sent in order to update the status lighting.
if (config["developer"]["offline"] == False): # Check to make sure offline mode is disabled before sending the network request to update the status lighting.
if (validators.url(status_lighting_update_url)): # Check to make sure the URL ID supplied actually resolves to a valid URL in the configuration database.
try:
response = requests.get(status_lighting_update_url, timeout=0.5)
except:
display_message("Failed to update status lighting. The request timed out.", 3) # Display a warning indicating that the status lighting request timed out.
else:
display_message("Unable to update status lighting. Invalid URL configured for " + url_id, 3) # Display a warning indicating that the URL was invalid, and no network request was sent.
if (url_id !== current_status_light_id): # Check to see if the status light URL ID is different from the current state of the lights.
current_status_light_id = url_id
if (config["general"]["status_lighting"]["enabled"] == True): # Only update the status lighting if it is enabled in the configuration.
status_lighting_update_url = str(config["general"]["status_lighting"]["values"][url_id]).replace("[U]", str(config["general"]["status_lighting"]["base_url"])) # Prepare the URL where a request will be sent in order to update the status lighting.
if (config["developer"]["offline"] == False): # Check to make sure offline mode is disabled before sending the network request to update the status lighting.
if (validators.url(status_lighting_update_url)): # Check to make sure the URL ID supplied actually resolves to a valid URL in the configuration database.
try:
response = requests.get(status_lighting_update_url, timeout=0.5)
except:
display_message("Failed to update status lighting. The request timed out.", 3) # Display a warning indicating that the status lighting request timed out.
else:
display_message("Unable to update status lighting. Invalid URL configured for " + url_id, 3) # Display a warning indicating that the URL was invalid, and no network request was sent.
9 changes: 8 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
print(" - Remotely-managed hot-lists and ignore-lists")
print(" - Compiled data reports")
print(" - Remote ALPR processing")

print()
print("To learn more, don't hesitate to get in contact: " + style.underline + "https://v0lttech.com/contact.php\n" + style.end)
input(style.faint + "Press enter to continue..." + style.end)
Expand All @@ -111,6 +110,14 @@
print("For more information, see the `SECURITY.md` document.")
input(style.faint + "Press enter to continue..." + style.end)

print("")
clear()
print(style.bold + style.red + "Privacy" + style.end)
print("Predator does not share telemetry or usage data with V0LT, or any other entity. However, by default, Predator will attach a random identifier to requests made to remote license plate list sources (as configured under `general>alerts>databases`). This identifier allows administrators of servers hosting license plate lists to roughly count how many clients are using their lists. If you're concerned about the administrator of one of your remote license plate lists using this unique identifier to derive information about how often you use Predator, you can disable this functionality using the `developer>identify_to_remote_sources` configuration value.")
print("For more information, see the `CONFIGURE.md` document.")
input(style.faint + "Press enter to continue..." + style.end)


with open(predator_root_directory + "/install.json", 'w') as file:
json.dump(install_data, file)
del install_data
Expand Down

0 comments on commit 9bb36c4

Please sign in to comment.