mirror of
https://github.com/YunoHost-Apps/movim_ynh.git
synced 2024-09-03 19:46:19 +02:00
[enh] Use boolean type for ssoenabled argument
This commit is contained in:
parent
9ae09c9f4e
commit
56a1fa361b
3 changed files with 32 additions and 36 deletions
|
@ -20,24 +20,24 @@
|
|||
"requirements": {
|
||||
"yunohost": ">= 2.4.0"
|
||||
},
|
||||
"multi_instance": "false",
|
||||
"multi_instance": false,
|
||||
"arguments": {
|
||||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Pod domain",
|
||||
"en": "Domain of the pod",
|
||||
"fr": "Domaine du pod"
|
||||
},
|
||||
"example": "domain.org"
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "Path",
|
||||
"fr": "Chemin du pod"
|
||||
"en": "Path to the pod",
|
||||
"fr": "Chemin vers le pod"
|
||||
},
|
||||
"example": "/movim",
|
||||
"default": "/movim"
|
||||
|
@ -71,18 +71,18 @@
|
|||
},
|
||||
{
|
||||
"name": "ssoenabled",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Enable SSO (autologin) ?",
|
||||
"fr": "Activer le SSO (connexin auto) ?"
|
||||
"en": "Enable SSO support (autologin)?",
|
||||
"fr": "Activer le support du SSO (connexion auto) ?"
|
||||
},
|
||||
"choices": ["Yes", "No"],
|
||||
"default": "Yes"
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "port",
|
||||
"ask": {
|
||||
"en": "Movim daemon port ? (internal only)",
|
||||
"fr": "Port privé pour Movim ? (interne uniquement)"
|
||||
"en": "Movim daemon port (internal only)",
|
||||
"fr": "Port du daemon Movim (interne uniquement)"
|
||||
},
|
||||
"default": "9537"
|
||||
}
|
||||
|
|
|
@ -128,15 +128,14 @@ sed -i "s@YHPORT@$port@g" ../conf/nginx.conf
|
|||
sed -i "s@//ws/@/ws/@g" ../conf/nginx.conf # Avoid duplicate /
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/movim.conf
|
||||
|
||||
# SSOwat Configuration
|
||||
if [ $ssoenabled = "No" ];
|
||||
then
|
||||
ynh_app_setting_set "$app" skipped_uris "/"
|
||||
exec_cmd php mud.php config --xmppwhitelist=$domain
|
||||
# SSOwat configuration
|
||||
if [[ "$ssoenabled" = "0" ]]; then
|
||||
ynh_app_setting_set "$app" skipped_uris "/"
|
||||
exec_cmd php mud.php config --xmppwhitelist="$domain"
|
||||
else
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
# Next line is to avoid SSO to auto-connect just after disconnect
|
||||
sudo sed -i "s@redirect('login')@redirect('')@g" $DESTDIR/app/controllers/DisconnectController.php
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
# Next line is to avoid SSO to auto-connect just after disconnect
|
||||
sudo sed -i "s@redirect('login')@redirect('')@g" $DESTDIR/app/controllers/DisconnectController.php
|
||||
fi
|
||||
|
||||
# Start Movim
|
||||
|
|
|
@ -52,25 +52,22 @@ ynh_app_setting_delete "$app" skipped_uris
|
|||
sudo yunohost app clearaccess movim
|
||||
|
||||
# Replace old public_site variable (if exists) by ssoenabled
|
||||
if [ ! -z "$public_site" ] && [ $public_site = "Yes" ];
|
||||
then
|
||||
ynh_app_setting_delete "$app" public_site
|
||||
ynh_app_setting_set "$app" ssoenabled "No"
|
||||
elif [ ! -z "$public_site" ] && [ $public_site = "No" ];
|
||||
then
|
||||
ynh_app_setting_delete "$app" public_site
|
||||
ynh_app_setting_set "$app" ssoenabled "Yes"
|
||||
if [ ! -z "$public_site" ]; then
|
||||
[[ $public_site = "Yes" ]] \
|
||||
&& ssoenabled=0 \
|
||||
|| ssoenabled=1
|
||||
ynh_app_setting_delete "$app" public_site
|
||||
ynh_app_setting_set "$app" ssoenabled "$ssoenabled"
|
||||
fi
|
||||
|
||||
# SSOwat Configuration
|
||||
if [ $ssoenabled = "No" ];
|
||||
then
|
||||
ynh_app_setting_set "$app" skipped_uris "/"
|
||||
exec_cmd php mud.php config --xmppwhitelist=$domain
|
||||
# SSOwat configuration
|
||||
if [[ "$ssoenabled" =~ ^0|No$ ]]; then
|
||||
ynh_app_setting_set "$app" skipped_uris "/"
|
||||
exec_cmd php mud.php config --xmppwhitelist=$domain
|
||||
else
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
# Next line is to avoid SSO to auto-connect just after disconnect
|
||||
sudo sed -i "s@redirect('login')@redirect('')@g" $DESTDIR/app/controllers/DisconnectController.php
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
# Next line is to avoid SSO to auto-connect just after disconnect
|
||||
sudo sed -i "s@redirect('login')@redirect('')@g" $DESTDIR/app/controllers/DisconnectController.php
|
||||
fi
|
||||
|
||||
# Update init scripts
|
||||
|
|
Loading…
Reference in a new issue