1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cryptpad_ynh.git synced 2024-09-03 18:26:14 +02:00

Update install

This commit is contained in:
DDATAA 2022-10-31 16:29:33 +01:00 committed by GitHub
parent edc3c1203e
commit 8892ac39d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,15 +51,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin 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
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#================================================= #=================================================
@ -180,6 +171,7 @@ then
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission="main" --add="visitors"
fi fi
# We authorize access to sandbox domain
# We don't test that in CI # We don't test that in CI
if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then 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=$sandboxdomain --auth_header=true
@ -188,12 +180,13 @@ if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
# we use jq to correct /etc/ssowat/conf.json # we use jq to correct /etc/ssowat/conf.json
uri1=$domain uri1=$domain
uri2=$sandboxdomain uri2=$sandboxdomain
app=$app
#we delete the uris from cryptpad.main #we delete the uris from cryptpad.main
cat /etc/ssowat/conf.json | jq 'del(.permissions[] | select(.label=="CryptPad") | .uris)' cat /etc/ssowat/conf.json | jq 'del(.permissions[] | select(.label=="$app") | .uris)'
#we write them again #we write them again
cat /etc/ssowat/conf.json | jq --arg uri1 "$uri1" '(.permissions[] | select(.label=="CryptPad") | .uris[0]) |=$uri1' cat /etc/ssowat/conf.json | jq --arg uri1 "$uri1" '(.permissions[] | select(.label=="$app") | .uris[0]) |=$uri1'
cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' > /etc/ssowat/tmp.conf.json cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="$app") | .uris[1]) |=$uri2' > /etc/ssowat/tmp.conf.json
rm /etc/ssowat/conf.json rm /etc/ssowat/conf.json
mv /etc/ssowat/tmp.conf.json /etc/ssowat/conf.json mv /etc/ssowat/tmp.conf.json /etc/ssowat/conf.json
fi fi