Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add env var to not replace systemd service file #462

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion backend/localplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def get_server_port() -> int:
return int(os.getenv("SERVER_PORT", "1337"))

def get_live_reload() -> bool:
os.getenv("LIVE_RELOAD", "1") == "1"
return os.getenv("LIVE_RELOAD", "1") == "1"

def get_keep_systemd_service() -> bool:
return os.getenv("KEEP_SYSTEMD_SERVICE", "0") == "1"

def get_log_level() -> int:
return {"CRITICAL": 50, "ERROR": 40, "WARNING": 30, "INFO": 20, "DEBUG": 10}[
Expand Down
4 changes: 2 additions & 2 deletions backend/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from json.decoder import JSONDecodeError
from logging import getLogger
from os import getcwd, path, remove
from localplatform import chmod, service_restart, ON_LINUX
from localplatform import chmod, service_restart, ON_LINUX, get_keep_systemd_service

from aiohttp import ClientSession, web

Expand Down Expand Up @@ -159,7 +159,7 @@ async def do_update(self):
tab = await get_gamepadui_tab()
await tab.open_websocket()
async with ClientSession() as web:
if ON_LINUX:
if ON_LINUX and not get_keep_systemd_service():
logger.debug("Downloading systemd service")
# download the relevant systemd service depending upon branch
async with web.request("GET", service_url, ssl=helpers.get_ssl_context(), allow_redirects=True) as res:
Expand Down