From f47d4961830b8a440cb82396549eeb8b1adc19e1 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 20 Jun 2023 16:35:42 +0000 Subject: [PATCH 1/2] Ensure that app_shell() does not lock the CLI --- share/actionsmap.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/actionsmap.yml b/share/actionsmap.yml index e1de66bc8..0a12b94a1 100644 --- a/share/actionsmap.yml +++ b/share/actionsmap.yml @@ -957,6 +957,8 @@ app: ### app_shell() shell: action_help: Open an interactive shell with the app environment already loaded + # Here we set a GET only not to lock the command line. There is no actual API endpoint for app_shell() + api: GET /apps//shell arguments: app: help: App ID From b2aaefe0e6a20f92ad0822b6de8032f1e4122b6d Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 20 Jun 2023 16:44:22 +0000 Subject: [PATCH 2/2] Add phpflags setting for app_shell() --- helpers/apps | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helpers/apps b/helpers/apps index 4b253ff90..7a93298c0 100644 --- a/helpers/apps +++ b/helpers/apps @@ -124,7 +124,7 @@ ynh_remove_apps() { # Requires YunoHost version 11.0.* or higher, and that the app relies on packaging v2 or higher. # The spawned shell will have environment variables loaded and environment files sourced # from the app's service configuration file (defaults to $app.service, overridable by the packager with `service` setting). -# If the app relies on a specific PHP version, then `php` will be aliased that version. +# If the app relies on a specific PHP version, then `php` will be aliased that version. The PHP command will also be appended with the `phpflags` settings. ynh_spawn_app_shell() { # Declare an array to define the options of this helper. local legacy_args=a @@ -176,9 +176,10 @@ ynh_spawn_app_shell() { # Force `php` to its intended version # We use `eval`+`export` since `alias` is not propagated to subshells, even with `export` local phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + local phpflags=$(ynh_app_setting_get --app=$app --key=phpflags) if [ -n "$phpversion" ] then - eval "php() { php${phpversion} \"\$@\"; }" + eval "php() { php${phpversion} ${phpflags} \"\$@\"; }" export -f php fi