From 3bb32dc1e4a166e7c80520338c6c1fc484046924 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 3 May 2023 19:59:28 +0000 Subject: [PATCH] Init app_shell --- share/actionsmap.yml | 6 ++++++ src/app.py | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/share/actionsmap.yml b/share/actionsmap.yml index 58787790c..e1de66bc8 100644 --- a/share/actionsmap.yml +++ b/share/actionsmap.yml @@ -954,6 +954,12 @@ app: help: Delete the key action: store_true + ### app_shell() + shell: + action_help: Open an interactive shell with the app environment already loaded + arguments: + app: + help: App ID ### app_register_url() register-url: diff --git a/src/app.py b/src/app.py index 2eb201a81..0db33a373 100644 --- a/src/app.py +++ b/src/app.py @@ -1645,6 +1645,26 @@ def app_setting(app, key, value=None, delete=False): _set_app_settings(app, app_settings) +def app_shell(app): + """ + Open an interactive shell with the app environment already loaded + + Keyword argument: + app -- App ID + + """ + app_settings = _get_app_settings(app) or {} + + #TODO init a env_dict + #TODO load the app's environment, parsed from: + #TODO - its settings (phpversion, ...) + #TODO - its service configuration (PATH, NodeJS production mode...) + #TODO this one could be performed in Bash, directly after initiating the subprocess: + #TODO - "Environment" clause: `systemctl show $app.service -p "Environment" --value` + #TODO - Source "EnvironmentFile" clauses + #TODO + #TODO find out how to open an interactive Bash shell from Python + def app_register_url(app, domain, path): """ Book/register a web path for a given app