summaryrefslogtreecommitdiff
path: root/backend/utilities.py
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-08-18 23:50:59 +0200
committerGitHub <noreply@github.com>2022-08-18 14:50:59 -0700
commit43dee863cd5b9d43d79c603021b747ef290ab544 (patch)
treeb36768640e0cdd545de75d1c6fad41163b305eb1 /backend/utilities.py
parent55a76826633ba0678f30aca21153cfc446964f0c (diff)
downloaddecky-loader-43dee863cd5b9d43d79c603021b747ef290ab544.tar.gz
decky-loader-43dee863cd5b9d43d79c603021b747ef290ab544.zip
Add CEF Remote Debugging toggle (#129)v2.0.5-pre14
* feat: add CEF Remote Debugging toggle * feat: disable remote debugger on startup * refactor: stop debugger instead of disable * feat: add option to allow remote debugging by default Co-authored-by: TrainDoctor <traindoctor@protonmail.com>
Diffstat (limited to 'backend/utilities.py')
-rw-r--r--backend/utilities.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/backend/utilities.py b/backend/utilities.py
index 834faeb2..9c0c6388 100644
--- a/backend/utilities.py
+++ b/backend/utilities.py
@@ -5,6 +5,7 @@ from aiohttp import ClientSession, web
from injector import inject_to_tab
import helpers
+import subprocess
class Utilities:
def __init__(self, context) -> None:
@@ -16,7 +17,10 @@ class Utilities:
"confirm_plugin_install": self.confirm_plugin_install,
"execute_in_tab": self.execute_in_tab,
"inject_css_into_tab": self.inject_css_into_tab,
- "remove_css_from_tab": self.remove_css_from_tab
+ "remove_css_from_tab": self.remove_css_from_tab,
+ "allow_remote_debugging": self.allow_remote_debugging,
+ "disallow_remote_debugging": self.disallow_remote_debugging,
+ "remote_debugging_allowed": self.remote_debugging_allowed
}
if context:
@@ -133,3 +137,15 @@ class Utilities:
"success": False,
"result": e
}
+
+
+ async def remote_debugging_allowed(self):
+ return await helpers.is_systemd_unit_active(helpers.REMOTE_DEBUGGER_UNIT)
+
+ async def allow_remote_debugging(self):
+ await helpers.start_systemd_unit(helpers.REMOTE_DEBUGGER_UNIT)
+ return True
+
+ async def disallow_remote_debugging(self):
+ await helpers.stop_systemd_unit(helpers.REMOTE_DEBUGGER_UNIT)
+ return True