mirror of
https://github.com/YunoHost-Apps/calibreweb_ynh.git
synced 2024-09-03 18:16:20 +02:00
fix if statements
This commit is contained in:
parent
7a69b41542
commit
d4bac0470d
4 changed files with 7 additions and 7 deletions
|
@ -8,7 +8,7 @@ permission=$3
|
|||
group=$4
|
||||
|
||||
#Visitor group has been revomed => app is public
|
||||
if echo "$group" | grep visitors ; then
|
||||
if [ $(echo "$group" | grep visitors) ] && [ $permission = "main" ]; then
|
||||
|
||||
#loading settings from the app
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
|
|
|
@ -8,7 +8,7 @@ permission=$3
|
|||
group=$4
|
||||
|
||||
#Visitor group has been revomed => app is private
|
||||
if echo "$group" | grep visitors; then
|
||||
if [ $(echo "$group" | grep visitors) ] && [ $permission = "main" ]; then
|
||||
|
||||
#loading settings from the app
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
|
|
|
@ -37,7 +37,7 @@ ynh_add_config --template="../sources/patches/main-constants.py.patch.src" --des
|
|||
ynh_setup_source --dest_dir="$install_dir"
|
||||
|
||||
# Remove the patch for web.py in case visitor are allowed
|
||||
if [ $(ynh_permission_has_user --permission=main --user=visitors) ]; then
|
||||
if $(ynh_permission_has_user --permission=main --user=visitors); then
|
||||
patch -u /$install_dir/cps/web.py -i ../conf/web.py.revert.patch
|
||||
fi
|
||||
|
||||
|
@ -101,7 +101,7 @@ if [ $path = "/" ] ; then
|
|||
fi
|
||||
|
||||
#
|
||||
if [ $(ynh_permission_has_user --permission=main --user=visitors) ]; then
|
||||
if $(ynh_permission_has_user --permission=main --user=visitors); then
|
||||
ynh_replace_string --match_string=" proxy_set_header X-Remote-User" \
|
||||
--replace_string="# proxy_set_header X-Remote-User" \
|
||||
--target_file="../conf/nginx.conf"
|
||||
|
@ -179,7 +179,7 @@ ynh_systemd_action --service_name=$app --action="start" --line_match="Starting G
|
|||
#Setting the proxy authentication in case calibre is not open to visitor.
|
||||
#https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy#login-via-header-from-upstream-authentication-source
|
||||
#We need to update the sso login parameter, but for that the app needs to have run at least once to initialize the tables.
|
||||
if [ ! $(ynh_permission_has_user --permission=main --user=visitors) ]; then
|
||||
if ! $(ynh_permission_has_user --permission=main --user=visitors); then
|
||||
ynh_systemd_action --service_name=$app --action="stop"
|
||||
sqlite3 $install_dir/app.db "UPDATE settings SET config_reverse_proxy_login_header_name='X-Remote-User', config_allow_reverse_proxy_header_login=1 WHERE ID=1;"
|
||||
ynh_systemd_action --service_name=$app --action="start" --line_match="Starting Gevent server on"
|
||||
|
|
|
@ -98,7 +98,7 @@ then
|
|||
chown -R $app: $install_dir
|
||||
|
||||
# Remove the patch for web.py in case visitor are allowed
|
||||
if [ $(ynh_permission_has_user --permission=main --user=visitors) ]; then
|
||||
if $(ynh_permission_has_user --permission=main --user=visitors); then
|
||||
patch -u /$install_dir/cps/web.py -i ../conf/web.py.revert.patch
|
||||
fi
|
||||
|
||||
|
@ -117,7 +117,7 @@ fi
|
|||
|
||||
#Setting the proxy authentication in case calibre is not open to visitor.
|
||||
#https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy#login-via-header-from-upstream-authentication-source
|
||||
if [ ynh_permission_has_user --permission=main --user=visitors ]; then
|
||||
if $(ynh_permission_has_user --permission=main --user=visitors); then
|
||||
sqlite3 $install_dir/app.db "UPDATE settings SET config_reverse_proxy_login_header_name='', config_allow_reverse_proxy_header_login=0 WHERE ID)1;"
|
||||
ynh_replace_string --match_string=" proxy_set_header X-Remote-User" \
|
||||
--replace_string="# proxy_set_header X-Remote-User" \
|
||||
|
|
Loading…
Add table
Reference in a new issue