diff options
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/localplatform.py | 5 | ||||
| -rw-r--r-- | backend/updater.py | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/backend/localplatform.py b/backend/localplatform.py index 5febfcaf..9b05510b 100644 --- a/backend/localplatform.py +++ b/backend/localplatform.py @@ -40,4 +40,7 @@ def get_keep_systemd_service() -> bool: def get_log_level() -> int: return {"CRITICAL": 50, "ERROR": 40, "WARNING": 30, "INFO": 20, "DEBUG": 10}[ os.getenv("LOG_LEVEL", "INFO") - ]
\ No newline at end of file + ] + +def get_selinux() -> bool: + return os.getenv("DECKY_SELINUX", "0") == "1" diff --git a/backend/updater.py b/backend/updater.py index 61124a72..170cfa40 100644 --- a/backend/updater.py +++ b/backend/updater.py @@ -6,7 +6,7 @@ from ensurepip import version from json.decoder import JSONDecodeError from logging import getLogger from os import getcwd, path, remove -from localplatform import chmod, service_restart, ON_LINUX, get_keep_systemd_service +from localplatform import chmod, service_restart, ON_LINUX, get_keep_systemd_service, get_selinux from aiohttp import ClientSession, web @@ -208,6 +208,9 @@ class Updater: remove(path.join(getcwd(), download_filename)) shutil.move(path.join(getcwd(), download_temp_filename), path.join(getcwd(), download_filename)) chmod(path.join(getcwd(), download_filename), 777, False) + if get_selinux(): + from subprocess import call + call(["chcon", "-t", "bin_t", path.join(getcwd(), download_filename)]) logger.info("Updated loader installation.") await tab.evaluate_js("window.DeckyUpdater.finish()", False, False) |
