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:
parent
2308ea4630
commit
b1c750f0ad
2 changed files with 13 additions and 4 deletions
|
@ -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
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -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
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue