From 51f91a24da2dbd560d6f7d456af1f18f9b17b434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Wed, 15 Feb 2017 10:45:04 +0100 Subject: [PATCH] [enh] Add a Cesium public access option --- manifest.json | 11 ++++++++++- scripts/functions.sh | 9 ++++++++- scripts/install | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index cbb45c0..b78bae5 100644 --- a/manifest.json +++ b/manifest.json @@ -96,7 +96,16 @@ "fr": "Administrateur. Ce doit être un utilisateur YunoHost" }, "example": "jon doe" - } + }, + { + "name": "is_cesium_public", + "ask": { + "en": "Make Cesium available publicly?", + "fr": "Permettre à Cesium d'être consulté publiquement ?" + }, + "choices": ["Yes", "No"], + "default": "Yes" + } ] } } diff --git a/scripts/functions.sh b/scripts/functions.sh index d12dbb0..ca48920 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -25,7 +25,14 @@ CONFIG_SSOWAT_FOR_RESTRICTED_ACCESS () { sudo yunohost app addaccess $app -u $admin # Allow only allowed users to access admin panel -ynh_app_setting_set "$app" protected_uris "/webui","/webmin","/cesium" +if [ "$is_cesium_public" = "Yes" ]; +then + # Cesium is public, do not protect it + ynh_app_setting_set "$app" protected_uris "/webui","/webmin" +else + # Cesium is not public, protect it + ynh_app_setting_set "$app" protected_uris "/webui","/webmin","/cesium" +fi # Duniter is public app, with only some parts restricted in nginx.conf sudo yunohost app setting $app unprotected_uris -v "/" diff --git a/scripts/install b/scripts/install index 17dc5cd..d49e17a 100755 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,7 @@ sync_port=$YNH_APP_ARG_SYNC_PORT salt=$YNH_APP_ARG_SALT password=$YNH_APP_ARG_PASSWORD admin=$YNH_APP_ARG_ADMIN +is_cesium_public=YNH_APP_ARG_IS_CESIUM_PUBLIC # Source app helpers and functions source /usr/share/yunohost/helpers @@ -56,6 +57,7 @@ fi ynh_app_setting_set $app port $port ynh_app_setting_set $app arch $arch ynh_app_setting_set "$app" admin "$admin" +ynh_app_setting_set "$app" is_cesium_public "$is_cesium_public" # Open port on firewall sudo yunohost firewall allow TCP $port > /dev/null 2>&1