summaryrefslogtreecommitdiff
path: root/backend/main.py
diff options
context:
space:
mode:
authorPhilipp Richter <richterphilipp.pops@gmail.com>2023-01-23 00:54:05 +0000
committerGitHub <noreply@github.com>2023-01-22 16:54:05 -0800
commitc2b76d9099ac551f829f9cec821c23a9aff6b018 (patch)
tree30102595e2f19779cc81a6e146e157d5a17e1211 /backend/main.py
parentc05e8f9ae0a38a58e73e98589133e9140eb8f46a (diff)
downloaddecky-loader-c2b76d9099ac551f829f9cec821c23a9aff6b018.tar.gz
decky-loader-c2b76d9099ac551f829f9cec821c23a9aff6b018.zip
Expose useful env vars to plugin processes (#349)v2.5.2-pre1v2.5.2
* recommended paths for storing data * improve helper functions
Diffstat (limited to 'backend/main.py')
-rw-r--r--backend/main.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/backend/main.py b/backend/main.py
index c48ad752..a2ac008a 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -19,8 +19,7 @@ from aiohttp_jinja2 import setup as jinja_setup
# local modules
from browser import PluginBrowser
from helpers import (REMOTE_DEBUGGER_UNIT, csrf_middleware, get_csrf_token,
- get_home_path, get_homebrew_path, get_user,
- get_user_group, set_user, set_user_group,
+ get_home_path, get_homebrew_path, get_user, get_user_group,
stop_systemd_unit, start_systemd_unit)
from injector import get_gamepadui_tab, Tab, get_tabs, close_old_tabs
from loader import Loader
@@ -28,18 +27,11 @@ from settings import SettingsManager
from updater import Updater
from utilities import Utilities
-# Ensure USER and GROUP vars are set first.
-# TODO: This isn't the best way to do this but supports the current
-# implementation. All the config load and environment setting eventually be
-# moved into init or a config/loader method.
-set_user()
-set_user_group()
USER = get_user()
GROUP = get_user_group()
-HOME_PATH = "/home/"+USER
-HOMEBREW_PATH = HOME_PATH+"/homebrew"
+HOMEBREW_PATH = get_homebrew_path()
CONFIG = {
- "plugin_path": getenv("PLUGIN_PATH", HOMEBREW_PATH+"/plugins"),
+ "plugin_path": getenv("PLUGIN_PATH", path.join(HOMEBREW_PATH, "plugins")),
"chown_plugin_path": getenv("CHOWN_PLUGIN_PATH", "1") == "1",
"server_host": getenv("SERVER_HOST", "127.0.0.1"),
"server_port": int(getenv("SERVER_PORT", "1337")),