Skip to content

Commit

Permalink
Disable security mode trigger via offline on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Apr 9, 2023
1 parent 2465dc0 commit dd77563
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion jarvis/executors/guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import time
from datetime import datetime
from multiprocessing import Process
from multiprocessing import Process, current_process
from threading import Thread, Timer
from typing import NoReturn, Tuple, Union

Expand Down Expand Up @@ -180,6 +180,11 @@ def guard_enable() -> NoReturn:
speaker.speak(text=f"Enabled security mode {models.env.title}! I will look out for potential threats and keep you "
f"posted. Have a nice {util.part_of_day()}, and enjoy yourself {models.env.title}!")
if shared.called_by_offline:
if models.settings.os == "Linux":
pname = (current_process().name or "offline communicator").replace('_', ' ')
speaker.speak(text=f"Security mode cannot be enabled via {pname}, as the host "
"machine is running on Linux OS")
return
process = Process(target=security_runner)
process.start()
with db.connection:
Expand Down
2 changes: 1 addition & 1 deletion jarvis/lib/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if [[ "$OSName" == "Darwin" ]]; then
# Looks for git and installs only if git is not found in /usr/bin or /usr/local/bin (if installed using brew)
git_check=$(which git)
if [[ "$git_check" == "/usr/bin/git" || "$git_check" == "/usr/local/bin/git" ]]; then
git_version="$(git -v)"
git_version="$(git --version)"
echo "$git_version"
else
echo "Installing Git CLI"
Expand Down
4 changes: 4 additions & 0 deletions release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Release Notes
=============

7.2.5 (04/09/2023)
------------------
- Disable security mode trigger via offline on Linux

7.2.4 (04/08/2023)
------------------
- Fix guardian mode - issue #29
Expand Down

0 comments on commit dd77563

Please sign in to comment.