1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/headscale_ynh.git synced 2024-09-03 19:25:53 +02:00

Remove Dex upon deinstallation of the app

This commit is contained in:
tituspijean 2023-06-11 18:12:27 +02:00
parent 2308ea4630
commit b1c750f0ad
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
2 changed files with 13 additions and 4 deletions

View file

@ -18,10 +18,6 @@ oidc_secret="$(echo $(ynh_string_random --length=32 --filter='A-F0-9'))"
oidc_name="$app" oidc_name="$app"
oidc_callback="$domain/oidc/callback" 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 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 !" ynh_die "The domain and path provided for Dex is already used by another app. Please chose another one !"
fi fi
@ -42,6 +38,12 @@ else
dex_user_uri="https://$dex_domain$dex_path/userinfo" dex_user_uri="https://$dex_domain$dex_path/userinfo"
fi 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 # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================

View file

@ -46,6 +46,13 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_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 # CLOSE A PORT
#================================================= #=================================================