mirror of
https://github.com/YunoHost-Apps/opensondage_ynh.git
synced 2024-09-03 19:46:28 +02:00
Merge pull request #47 from kay0u/master
Access to "adminstuds.php" when app is in public
This commit is contained in:
commit
0c20921e02
2 changed files with 20 additions and 2 deletions
|
@ -183,7 +183,15 @@ if [ $is_public -eq 0 ];
|
||||||
then
|
then
|
||||||
ynh_app_setting_set "$app" protected_uris "/"
|
ynh_app_setting_set "$app" protected_uris "/"
|
||||||
else
|
else
|
||||||
ynh_app_setting_set "$app" protected_uris "/admin"
|
# If the app is private, viewing images stays publicly accessible.
|
||||||
|
if [ "$path_url" == "/" ]; then
|
||||||
|
# If the path is /, clear it to prevent any error with the regex.
|
||||||
|
path_url=""
|
||||||
|
fi
|
||||||
|
# Modify the domain to be used in a regex
|
||||||
|
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
||||||
|
ynh_app_setting_set $app protected_regex "$domain_regex$path_url/admin/"
|
||||||
|
|
||||||
ynh_replace_string " include conf.d/" " #include conf.d/" "$finalnginxconf"
|
ynh_replace_string " include conf.d/" " #include conf.d/" "$finalnginxconf"
|
||||||
|
|
||||||
ynh_store_file_checksum "$finalnginxconf"
|
ynh_store_file_checksum "$finalnginxconf"
|
||||||
|
|
|
@ -211,7 +211,17 @@ if [ $is_public -eq 0 ];
|
||||||
then
|
then
|
||||||
ynh_app_setting_set "$app" protected_uris "/"
|
ynh_app_setting_set "$app" protected_uris "/"
|
||||||
else
|
else
|
||||||
ynh_app_setting_set "$app" protected_uris "/admin"
|
ynh_app_setting_delete "$app" protected_uris
|
||||||
|
|
||||||
|
# If the app is private, viewing images stays publicly accessible.
|
||||||
|
if [ "$path_url" == "/" ]; then
|
||||||
|
# If the path is /, clear it to prevent any error with the regex.
|
||||||
|
path_url=""
|
||||||
|
fi
|
||||||
|
# Modify the domain to be used in a regex
|
||||||
|
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
||||||
|
ynh_app_setting_set $app protected_regex "$domain_regex$path_url/admin/"
|
||||||
|
|
||||||
ynh_replace_string " include conf.d/" " #include conf.d/" "$finalnginxconf"
|
ynh_replace_string " include conf.d/" " #include conf.d/" "$finalnginxconf"
|
||||||
|
|
||||||
ynh_store_file_checksum "$finalnginxconf"
|
ynh_store_file_checksum "$finalnginxconf"
|
||||||
|
|
Loading…
Add table
Reference in a new issue