renaming src folder to sources, adding upgrade script and changing skipped_uris mode by unprotected_uris mode
|
@ -25,13 +25,15 @@ fi
|
||||||
# Save app settings
|
# Save app settings
|
||||||
sudo yunohost app setting $app admin -v "$admin"
|
sudo yunohost app setting $app admin -v "$admin"
|
||||||
sudo yunohost app setting $app is_public -v "$is_public"
|
sudo yunohost app setting $app is_public -v "$is_public"
|
||||||
|
sudo yunohost app setting $app domain -v "$domain"
|
||||||
|
sudo yunohost app setting $app path -v "$path"
|
||||||
|
|
||||||
#create path for copying
|
#create path for copying
|
||||||
final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
sudo mkdir -p $final_path
|
sudo mkdir -p $final_path
|
||||||
|
|
||||||
#copy files to final folder and set permissions
|
#copy files to final folder and set permissions
|
||||||
sudo cp -R ../src/* $final_path/
|
sudo cp -R ../sources/* $final_path/
|
||||||
sudo chown www-data:www-data -R $final_path
|
sudo chown www-data:www-data -R $final_path
|
||||||
sudo chmod 750 -R $final_path
|
sudo chmod 750 -R $final_path
|
||||||
|
|
||||||
|
@ -43,7 +45,7 @@ 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 skipped_uris -v "/"
|
sudo yunohost app setting $app unprotected_uris -v "/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#adding admin to the allowed users
|
#adding admin to the allowed users
|
||||||
|
|
33
scripts/upgrade
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
app=pluxml
|
||||||
|
|
||||||
|
#retrieve arguments
|
||||||
|
domain=$(sudo yunohost app setting $app domain)
|
||||||
|
path=$(sudo yunohost app setting $app path)
|
||||||
|
admin=$(sudo yunohost app setting $app admin)
|
||||||
|
is_public=$(sudo yunohost app setting $app is_public)
|
||||||
|
|
||||||
|
|
||||||
|
# Remove trailing "/" for next commands
|
||||||
|
path=${path%/}
|
||||||
|
|
||||||
|
# Copy source files
|
||||||
|
final_path=/var/www/$app
|
||||||
|
sudo mkdir -p $final_path
|
||||||
|
sudo cp -a ../sources/* $final_path
|
||||||
|
|
||||||
|
#configure nginx settings
|
||||||
|
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 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 [ "$is_public" = "Yes" ];
|
||||||
|
then
|
||||||
|
sudo yunohost app setting $app unprotected_uris -v "/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Restart services
|
||||||
|
sudo service nginx reload
|
||||||
|
sudo yunohost app ssowatconf
|
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 626 B |
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 689 B After Width: | Height: | Size: 689 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |