From a0ede43e3185b6eba7ff961f597075f37c5d30ad Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:38:54 +0000 Subject: [PATCH 1/9] Update install --- scripts/install | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 4514014..cf73eeb 100644 --- a/scripts/install +++ b/scripts/install @@ -69,7 +69,22 @@ ynh_app_setting_set --app=$app --key=porti --value=$porti #================================================= # CREATE A SANDBOX DOMAIN #================================================= -sandboxdomain=sandbox-$domain + +# if the main domain for the app is a root domain, we create a correct sandbox subdomain +if [ $domain == *"."* ]; then + sandboxdomain=sandbox.$domain +fi +# if the main domain for the app is already a sub-domain, we create a correct sandbox domain +if [ $domain == *"."*"."* ]; then + sandboxdomain=sandbox-$domain +fi +# if the main domain for the app is a .local root domain, we create a correct sandbox subdomain +if [ $domain == *".local" ]; then + sandboxdomain=sandbox-$domain +fi + +ynh_script_progression --message="Setting up sandobx domain $sandboxdomain..." --weight=1 + # We don't test that in CI if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then yunohost domain add $sandboxdomain @@ -176,13 +191,12 @@ fi # We authorize access to sandbox domain # 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 + ynh_permission_url --permission="main" --add_url=re:$sandboxdomain --auth_header=true # there is a bug in core that add a slash at the end of domain in ssowat conf for uris var - # so we use ${sandboxdomain%/} to remove the eccessive trailing slash # it doesnt work # we use jq to correct /etc/ssowat/conf.json - uri2=$sandboxdomain - touch /etc/ssowat/conf.json.persistent - cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' >> /etc/ssowat/conf.json.persistent + #uri2=$sandboxdomain + #touch /etc/ssowat/conf.json.persistent + #cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' >> /etc/ssowat/conf.json.persistent fi #================================================= From 4fd449669b75f72335dcc00ad6e4451150c15908 Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:42:40 +0000 Subject: [PATCH 2/9] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index cf73eeb..ba54c9a 100644 --- a/scripts/install +++ b/scripts/install @@ -71,15 +71,15 @@ ynh_app_setting_set --app=$app --key=porti --value=$porti #================================================= # if the main domain for the app is a root domain, we create a correct sandbox subdomain -if [ $domain == *"."* ]; then +if [[ $domain == *"."* ]]; then sandboxdomain=sandbox.$domain fi # if the main domain for the app is already a sub-domain, we create a correct sandbox domain -if [ $domain == *"."*"."* ]; then +if [[ $domain == *"."*"."* ]]; then sandboxdomain=sandbox-$domain fi # if the main domain for the app is a .local root domain, we create a correct sandbox subdomain -if [ $domain == *".local" ]; then +if [[ $domain == *".local" ]]; then sandboxdomain=sandbox-$domain fi From a8c95bce23aff2d45b42681b0f921b08a345cfb0 Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Thu, 9 Feb 2023 14:33:31 +0000 Subject: [PATCH 3/9] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index ba54c9a..40713fb 100644 --- a/scripts/install +++ b/scripts/install @@ -191,7 +191,7 @@ fi # We authorize access to sandbox domain # We don't test that in CI if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - ynh_permission_url --permission="main" --add_url=re:$sandboxdomain --auth_header=true + ynh_permission_url --permission="main" --add_url=$sandboxdomain --auth_header=true # there is a bug in core that add a slash at the end of domain in ssowat conf for uris var # we use jq to correct /etc/ssowat/conf.json #uri2=$sandboxdomain From 315ad582d2f59b3061bf0c8f170aea4e74db2c27 Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Thu, 9 Feb 2023 14:43:33 +0000 Subject: [PATCH 4/9] Update remove --- scripts/remove | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/remove b/scripts/remove index cdf4fee..6a1ae2e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -67,12 +67,25 @@ ynh_remove_nodejs #================================================= # REMOVE SANDBOX DOMAIN #================================================= -ynh_script_progression --message="Removing sandbox domain..." --weight=1 # We don't test that in CI if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - sandboxdomain=sandbox-$domain - + + # if the main domain for the app is a root domain, we create a correct sandbox subdomain + if [[ $domain == *"."* ]]; then + sandboxdomain=sandbox.$domain + fi + # if the main domain for the app is already a sub-domain, we create a correct sandbox domain + if [[ $domain == *"."*"."* ]]; then + sandboxdomain=sandbox-$domain + fi + # if the main domain for the app is a .local root domain, we create a correct sandbox subdomain + if [[ $domain == *".local" ]]; then + sandboxdomain=sandbox-$domain + fi + + ynh_script_progression --message="Removing sandbox domain : $sandboxdomain" --weight=1 + if yunohost domain list | grep -q $sandboxdomain then #if domain exist we remove it yunohost domain remove $sandboxdomain From c007140415cdecfdea2800268a3eb6cee7e414ac Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Thu, 9 Feb 2023 14:43:37 +0000 Subject: [PATCH 5/9] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 40713fb..618abc5 100644 --- a/scripts/install +++ b/scripts/install @@ -83,7 +83,7 @@ if [[ $domain == *".local" ]]; then sandboxdomain=sandbox-$domain fi -ynh_script_progression --message="Setting up sandobx domain $sandboxdomain..." --weight=1 +ynh_script_progression --message="Setting up sandobx domain : $sandboxdomain" --weight=1 # We don't test that in CI if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then From cf3bd348377abdc888372ff4acce19814a4cce2c Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Thu, 9 Feb 2023 15:29:58 +0000 Subject: [PATCH 6/9] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9aeb854..30bfdb0 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ set $main_domain "__DOMAIN__"; -set $sandbox_domain "sandbox-__DOMAIN__"; +set $sandbox_domain "__SANDBOXDOMAIN__"; set $allowed_origins "https://${sandbox_domain}"; set $api_domain "__DOMAIN__"; set $files_domain "__DOMAIN__"; From 8e0206cc7c21a5f60d6992c477ec2dca194d1c51 Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Thu, 9 Feb 2023 16:12:57 +0000 Subject: [PATCH 7/9] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 618abc5..e8baf4c 100644 --- a/scripts/install +++ b/scripts/install @@ -231,7 +231,7 @@ ynh_script_progression --message="Sending a readme for the admin..." --weight=1 message="CryptPad was successfully installed :) -We have added a sandbox domain for you but you still need to configure your DNS and generate Let's Encrypt Certificates for it. +We have added a sandbox domain : $sandboxdomain for you but you still need to configure your DNS and generate Let's Encrypt Certificates for it. Then you can please open your $app domain: https://$domain$path_url Once CryptPad is installed, create an account via the Sign Up button on the home page which will take you to the Register page. From 6f4d8abb480faf7c0cf021dd02ea17984972ed5e Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Fri, 10 Feb 2023 09:55:57 +0000 Subject: [PATCH 8/9] Update install --- scripts/install | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index e8baf4c..51dd891 100644 --- a/scripts/install +++ b/scripts/install @@ -192,11 +192,6 @@ 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 - # there is a bug in core that add a slash at the end of domain in ssowat conf for uris var - # we use jq to correct /etc/ssowat/conf.json - #uri2=$sandboxdomain - #touch /etc/ssowat/conf.json.persistent - #cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' >> /etc/ssowat/conf.json.persistent fi #================================================= @@ -231,6 +226,8 @@ ynh_script_progression --message="Sending a readme for the admin..." --weight=1 message="CryptPad was successfully installed :) +READ CAREFULLY !! + We have added a sandbox domain : $sandboxdomain for you but you still need to configure your DNS and generate Let's Encrypt Certificates for it. Then you can please open your $app domain: https://$domain$path_url From 6e8b435075866a1c0f6fefe4ca7665c11d9268f4 Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Fri, 10 Feb 2023 10:32:33 +0000 Subject: [PATCH 9/9] Update app.src --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index aed8119..65512e9 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/xwiki-labs/cryptpad/archive/5.1.0.tar.gz -SOURCE_SUM=e8971f8a6439958e8328a8433a696e5ae3915740c5f93cfce9a13776edd83084 +SOURCE_URL=https://github.com/xwiki-labs/cryptpad/archive/5.2.1.tar.gz +SOURCE_SUM=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true