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

Update upgrade

This commit is contained in:
DDATAA 2022-11-02 15:12:51 +00:00 committed by GitHub
parent 73f54839c6
commit b73d0848e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,16 +179,10 @@ if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
# there is a bug in core that add a slash at the end of domain in ssowat conf for uris var # 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 # so we use ${sandboxdomain%/} to remove the eccessive trailing slash # it doesnt work
# we use jq to correct /etc/ssowat/conf.json # we use jq to correct /etc/ssowat/conf.json
uri1=$domain
uri2=$sandboxdomain uri2=$sandboxdomain
#we delete the uris from cryptpad.main
cat /etc/ssowat/conf.json | jq 'del(.permissions[] | select(.label=="CryptPad") | .uris)'
#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 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=="CryptPad") | .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
#================================================= #=================================================