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:
parent
bd660864a6
commit
a0ede43e31
1 changed files with 20 additions and 6 deletions
|
@ -69,7 +69,22 @@ ynh_app_setting_set --app=$app --key=porti --value=$porti
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A SANDBOX DOMAIN
|
# 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
|
# We don't test that in CI
|
||||||
if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
|
if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
|
||||||
yunohost domain add $sandboxdomain
|
yunohost domain add $sandboxdomain
|
||||||
|
@ -176,13 +191,12 @@ fi
|
||||||
# We authorize access to sandbox domain
|
# 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=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
|
# 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
|
# we use jq to correct /etc/ssowat/conf.json
|
||||||
uri2=$sandboxdomain
|
#uri2=$sandboxdomain
|
||||||
touch /etc/ssowat/conf.json.persistent
|
#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
|
#cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' >> /etc/ssowat/conf.json.persistent
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue