From fa776f0d0b7b4ca7071f0aa912be84e81caf6b61 Mon Sep 17 00:00:00 2001 From: marios Date: Mon, 18 Apr 2022 15:57:51 +0300 Subject: Callsigns (#37) * Plugin callsigns, filechangehandler thread bug fix, plugin file perms - Plugins are now assigned a callsign (a random string), which they use for all internal identification, like resource fetching and method calls. This is to ensure that plugins only access their own resources and methods. - Made FileChangeHandler send off events to a queue, that is then consumed by the Loader, instead of calling import_plugin on its own, since that caused weird issues with the event loop and the thread watchdog is using. - Plugins are now owned by root and have read-only permissions. This is handled automatically. * Improved general look and feel of plugin tab * Make all plugin entries have the same padding between them * Make "No plugins installed" text look the same as "No new notifications" Co-authored-by: WerWolv --- plugin_loader/browser.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugin_loader/browser.py') diff --git a/plugin_loader/browser.py b/plugin_loader/browser.py index 7fc8773b..ffec26b3 100644 --- a/plugin_loader/browser.py +++ b/plugin_loader/browser.py @@ -9,6 +9,7 @@ from concurrent.futures import ProcessPoolExecutor from asyncio import get_event_loop from time import time from hashlib import sha256 +from subprocess import Popen class PluginInstallContext: def __init__(self, gh_url, version, hash) -> None: @@ -35,6 +36,8 @@ class PluginBrowser: zip_file = ZipFile(zip) zip_file.extractall(self.plugin_path) rename(path.join(self.plugin_path, zip_file.namelist()[0]), path.join(self.plugin_path, name)) + Popen(["chown", "-R", "deck:deck", self.plugin_path]) + Popen(["chmod", "-R", "555", self.plugin_path]) return True async def _install(self, artifact, version, hash): -- cgit v1.2.3