mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
stop using skipped_uris to force access of an app
This commit is contained in:
parent
06a1f367a7
commit
9af4091505
1 changed files with 4 additions and 6 deletions
10
lib/tests.sh
10
lib/tests.sh
|
@ -190,7 +190,7 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
|
||||||
# For example, that's the case for agendav which is always installed as
|
# For example, that's the case for agendav which is always installed as
|
||||||
# private by default For "regular" apps (with a is_public arg) they are
|
# private by default For "regular" apps (with a is_public arg) they are
|
||||||
# installed as public, and we precisely want to check they are publicly
|
# installed as public, and we precisely want to check they are publicly
|
||||||
# accessible *without* tweaking skipped_uris...
|
# accessible *without* tweaking main permission...
|
||||||
if [[ -e $package_path/manifest.json ]]
|
if [[ -e $package_path/manifest.json ]]
|
||||||
then
|
then
|
||||||
local has_public_arg=$([[ -n "$(jq -r '.arguments.install[] | select(.name=="is_public")' $package_path/manifest.json)" ]] && echo true || echo false)
|
local has_public_arg=$([[ -n "$(jq -r '.arguments.install[] | select(.name=="is_public")' $package_path/manifest.json)" ]] && echo true || echo false)
|
||||||
|
@ -200,11 +200,9 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
|
||||||
|
|
||||||
if [ "$install_type" != 'private' ] && [[ $has_public_arg == "false" ]]
|
if [ "$install_type" != 'private' ] && [[ $has_public_arg == "false" ]]
|
||||||
then
|
then
|
||||||
log_debug "Forcing public access using a skipped_uris setting"
|
log_debug "Forcing public access using tools shell"
|
||||||
# Add a skipped_uris on / for the app
|
# Force the public access by setting force=True, which is not possible with "yunohost user permission update"
|
||||||
_RUN_YUNOHOST_CMD "app setting $app_id_to_check skipped_uris -v /"
|
_RUN_YUNOHOST_CMD "tools shell -c 'from yunohost.permission import user_permission_update; user_permission_update(\"$app_id_to_check.main\", add=\"visitors\", force=True)'"
|
||||||
# Regen the config of sso
|
|
||||||
_RUN_YUNOHOST_CMD "app ssowatconf"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try to access to the URL in 2 times, with a final / and without
|
# Try to access to the URL in 2 times, with a final / and without
|
||||||
|
|
Loading…
Add table
Reference in a new issue