From b1c750f0ad4e04270ecff01fd0781cdaa4b3e66b Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 11 Jun 2023 18:12:27 +0200 Subject: [PATCH] Remove Dex upon deinstallation of the app --- scripts/install | 10 ++++++---- scripts/remove | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index dafc414..12a1000 100755 --- a/scripts/install +++ b/scripts/install @@ -18,10 +18,6 @@ oidc_secret="$(echo $(ynh_string_random --length=32 --filter='A-F0-9'))" oidc_name="$app" oidc_callback="$domain/oidc/callback" -ynh_app_setting_set --app=$app --key=oidc_secret --value=$oidc_secret -ynh_app_setting_set --app=$app --key=oidc_name --value=$oidc_name -ynh_app_setting_set --app=$app --key=oidc_callback --value=$oidc_callback - if yunohost app list | grep -q "$YNH_APP_ARG_DEX_DOMAIN$YNH_APP_ARG_DEX_PATH"; then ynh_die "The domain and path provided for Dex is already used by another app. Please chose another one !" fi @@ -42,6 +38,12 @@ else dex_user_uri="https://$dex_domain$dex_path/userinfo" fi +# Store Dex settings +ynh_app_setting_set --app=$app --key=oidc_secret --value=$oidc_secret +ynh_app_setting_set --app=$app --key=oidc_name --value=$oidc_name +ynh_app_setting_set --app=$app --key=oidc_callback --value=$oidc_callback +ynh_app_setting_set --app=$app --key=dex_app --value=$dex_app + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/remove b/scripts/remove index 22bcc4d..78d5d13 100755 --- a/scripts/remove +++ b/scripts/remove @@ -46,6 +46,13 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config +#================================================= +# REMOVE DEX APP +#================================================= +ynh_script_progression --message="Removing Dex app used for Headscale authentication..." --weight=1 + +yunohost app remove $dex_app + #================================================= # CLOSE A PORT #=================================================