From 97ba7c4665197f99b01cf1e157a9f9be3d8c59cd Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Sat, 22 Oct 2022 14:15:42 +0000 Subject: [PATCH] Update install --- scripts/install | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/scripts/install b/scripts/install index 9efd048..059bc19 100644 --- a/scripts/install +++ b/scripts/install @@ -55,10 +55,10 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin # CHECK IF THE SANDBOX DOMAIN IS ALREADY SETUP WITH CORRECT CERTIFICATE #================================================= # We don't test that in CI -if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - if ! yunohost domain cert status $domain | grep -q "summary: Great!"; then - ynh_die "The domain $domain does not have correct Let's Encrypt certificates !" -fi fi +#if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then +# if ! yunohost domain cert status $domain | grep -q "summary: Great!"; then +# ynh_die "The domain $domain does not have correct Let's Encrypt certificates !" +#fi fi #================================================= # STANDARD MODIFICATIONS @@ -79,28 +79,9 @@ ynh_app_setting_set --app=$app --key=porti --value=$porti # CREATE A SANDBOX DOMAIN #================================================= sandboxdomain=sandbox-$domain -#================================================= -# CHECK IF CRYPTAD_SANDBOX IS INSTALLED, IF NOT INSTALL IT -#================================================= # We don't test that in CI if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - ynh_script_progression --message="Installing Cryptpad Sandboxing App if needed..." --weight=18 - - if ! yunohost app list | grep -q "id: cryptpad_sandboxing"; then - echo "Cryptpad Sandboxing App is not installed. Installing... " - yunohost tools update - if yunohost app list | grep -q "$sandboxdomain"; then - ynh_die "The domain $sandboxdomain provided for Cryptpad Sandboxing App is already used by another app. Please chose another one !" - fi - public=public - if [ $is_public -eq 1 ]; then - #yunohost app install https://github.com/YunoHost-Apps/cryptpad_sandboxing_ynh --force --args "domain=$sandboxdomain&porti=$porti&cryptpad_domain=$domain&is_$public=true" - yunohost app install https://github.com/Ddataa/cryptpad_sandboxing_ynh/tree/testing --force --args "domain=$sandboxdomain&porti=$porti&cryptpad_domain=$domain&is_$public=true" - else - #yunohost app install https://github.com/YunoHost-Apps/cryptpad_sandboxing_ynh --force --args "domain=$sandboxdomain&porti=$porti&cryptpad_domain=$domain&is_$public=false" - yunohost app install https://github.com/Ddataa/cryptpad_sandboxing_ynh/tree/testing --force --args "domain=$sandboxdomain&porti=$porti&cryptpad_domain=$domain&is_$public=false" - fi - fi + yunohost domain add $sandboxdomain fi #================================================= @@ -198,11 +179,21 @@ then ynh_permission_update --permission="main" --add="visitors" fi +# We don't test that in CI +if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + ynh_permission_url --permission="main" --add_url=$sandboxdomain --auth_header=true +fi + #================================================= # APPLY FOLDER RIGHTS #================================================= chgrp -R www-data $final_path +#================================================= +# COPY NGINX CONF IN SANDBOX DOMAIN +#================================================= +ynh_add_config --template="/etc/nginx/conf.d/$domain.d/cryptpad.conf" --destination="/etc/nginx/conf.d/$sandboxdomain.d/cryptpad.conf" + #================================================= # RELOAD NGINX #=================================================