mirror of
https://github.com/YunoHost-Apps/pluxml_ynh.git
synced 2024-09-03 20:16:02 +02:00
[enh] scripts: small fixes.
- ssowatconf is no more necessary at the end of the install script.
This commit is contained in:
parent
4eeef49340
commit
7c6e3b79ec
2 changed files with 7 additions and 14 deletions
|
@ -22,8 +22,7 @@ fi
|
||||||
# Check user
|
# Check user
|
||||||
sudo yunohost user list --json | grep -q "\"username\": \"$admin\""
|
sudo yunohost user list --json | grep -q "\"username\": \"$admin\""
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
echo "Wrong user"
|
echo "Wrong user" && exit 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Save app settings
|
# Save app settings
|
||||||
|
@ -60,7 +59,7 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
#temporary set public accessible
|
#temporary set public accessible
|
||||||
sudo yunohost app setting $app unprotected_uris -v "/"
|
sudo yunohost app setting $app unprotected_uris -v "/"
|
||||||
|
|
||||||
# Restart services
|
# Reload services
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
||||||
|
@ -92,8 +91,7 @@ sudo rm -f $final_path/install.php
|
||||||
sudo sed -i "/#pluxml_hosts/d" /etc/hosts
|
sudo sed -i "/#pluxml_hosts/d" /etc/hosts
|
||||||
|
|
||||||
# If app is private, remove url to SSOWat conf from skipped_uris
|
# If app is private, remove url to SSOWat conf from skipped_uris
|
||||||
if [ "$is_public" = "No" ];
|
if [ "$is_public" = "No" ]; then
|
||||||
then
|
|
||||||
sudo yunohost app setting $app unprotected_uris -d
|
sudo yunohost app setting $app unprotected_uris -d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -101,8 +99,7 @@ fi
|
||||||
sudo yunohost app addaccess $app -u $admin
|
sudo yunohost app addaccess $app -u $admin
|
||||||
|
|
||||||
#allow only allowed users to access admin panel
|
#allow only allowed users to access admin panel
|
||||||
sudo yunohost app setting pluxml protected_uris -v "/core/admin/"
|
sudo yunohost app setting $app protected_uris -v "/core/admin/"
|
||||||
|
|
||||||
# Restart services
|
# Reload nginx service
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ path=$(sudo yunohost app setting $app path)
|
||||||
admin=$(sudo yunohost app setting $app admin)
|
admin=$(sudo yunohost app setting $app admin)
|
||||||
is_public=$(sudo yunohost app setting $app is_public)
|
is_public=$(sudo yunohost app setting $app is_public)
|
||||||
|
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
# Remove trailing "/" for next commands
|
||||||
path=${path%/}
|
path=${path%/}
|
||||||
|
|
||||||
|
@ -24,18 +23,15 @@ sudo chown -R www-data: $final_path/data
|
||||||
sudo find $final_path -type f | xargs sudo chmod 644
|
sudo find $final_path -type f | xargs sudo chmod 644
|
||||||
sudo find $final_path -type d | xargs sudo chmod 755
|
sudo find $final_path -type d | xargs sudo chmod 755
|
||||||
|
|
||||||
|
|
||||||
#configure nginx settings
|
#configure nginx settings
|
||||||
sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf
|
sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf
|
||||||
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path@g" ../conf/nginx.conf
|
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path@g" ../conf/nginx.conf
|
||||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
||||||
# If app is public, add url to SSOWat conf as skipped_uris
|
# If app is public, add url to SSOWat conf as skipped_uris
|
||||||
if [ "$is_public" = "Yes" ];
|
if [ "$is_public" = "Yes" ]; then
|
||||||
then
|
|
||||||
sudo yunohost app setting $app unprotected_uris -v "/"
|
sudo yunohost app setting $app unprotected_uris -v "/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restart services
|
# Reload nginx service
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
|
||||||
|
|
Loading…
Reference in a new issue