1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/calibreweb_ynh.git synced 2024-09-03 18:16:20 +02:00

revert logic :/

This commit is contained in:
Krakinou 2022-03-13 23:05:21 +01:00
parent 256c022481
commit 6233555105
4 changed files with 7 additions and 7 deletions

View file

@ -6,10 +6,10 @@ app=$1
users=$2 # Tous les utilisateurs autorisés sur l'app. Séparés par des virgules. users=$2 # Tous les utilisateurs autorisés sur l'app. Séparés par des virgules.
if [ echo "$users" | grep visitors ]; then if [ echo "$users" | grep visitors ]; then
if [ tail /etc/yunohost/apps/$app/conf/nginx.conf | grep "# proxy_set_header X-Remote-User" ]; then if [ tail /etc/yunohost/apps/$app/conf/nginx.conf | grep " proxy_set_header X-Remote-User" ]; then
#app is made public #app is made public
ynh_replace_string "# proxy_set_header X-Remote-User" " proxy_set_header X-Remote-User" /etc/yunohost/apps/$app/conf/nginx.conf ynh_replace_string " proxy_set_header X-Remote-User" "# proxy_set_header X-Remote-User" /etc/yunohost/apps/$app/conf/nginx.conf
ynh_add_nginx_config ynh_add_nginx_config
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
fi fi
fi fi

View file

@ -6,9 +6,9 @@ app=$1
users=$2 # Tous les utilisateurs autorisés sur l'app. Séparés par des virgules. users=$2 # Tous les utilisateurs autorisés sur l'app. Séparés par des virgules.
if [ ! echo "$users" | grep visitors ]; then if [ ! echo "$users" | grep visitors ]; then
if [ tail /etc/yunohost/apps/$app/conf/nginx.conf | grep " proxy_set_header X-Remote-User" ]; then if [ tail /etc/yunohost/apps/$app/conf/nginx.conf | grep "# proxy_set_header X-Remote-User" ]; then
#app is made public #app is made public
ynh_replace_string " proxy_set_header X-Remote-User" "# proxy_set_header X-Remote-User" /etc/yunohost/apps/$app/conf/nginx.conf ynh_replace_string "# proxy_set_header X-Remote-User" " proxy_set_header X-Remote-User" /etc/yunohost/apps/$app/conf/nginx.conf
ynh_add_nginx_config ynh_add_nginx_config
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
fi fi

View file

@ -120,7 +120,7 @@ if [ $path_url = "/" ] ; then
ynh_replace_string " proxy_set_header X-Script-Name" "# proxy_set_header X-Script-Name" ../conf/nginx.conf ynh_replace_string " proxy_set_header X-Script-Name" "# proxy_set_header X-Script-Name" ../conf/nginx.conf
fi fi
if [ $is_public -eq 1 ]; then if [ $is_public -eq 0 ]; then
ynh_replace_string "# proxy_set_header X-Remote-User" " proxy_set_header X-Remote-User" ../conf/nginx.conf ynh_replace_string "# proxy_set_header X-Remote-User" " proxy_set_header X-Remote-User" ../conf/nginx.conf
fi fi

View file

@ -163,7 +163,7 @@ if [ $path_url = "/" ] ; then
ynh_replace_string " proxy_set_header X-Script-Name" "# proxy_set_header X-Script-Name" ../conf/nginx.conf ynh_replace_string " proxy_set_header X-Script-Name" "# proxy_set_header X-Script-Name" ../conf/nginx.conf
fi fi
if [ ynh_permission_has_user --permission="main" --user=visitors ]; then if [ ! ynh_permission_has_user --permission="main" --user=visitors ]; then
ynh_replace_string "# proxy_set_header X-Remote-User" " proxy_set_header X-Remote-User" ../conf/nginx.conf ynh_replace_string "# proxy_set_header X-Remote-User" " proxy_set_header X-Remote-User" ../conf/nginx.conf
fi fi
# Create a dedicated nginx config # Create a dedicated nginx config