mirror of
https://github.com/YunoHost-Apps/pluxml_ynh.git
synced 2024-09-03 20:16:02 +02:00
[enh] scripts: rename variable final_path to src_path.
This commit is contained in:
parent
7c6e3b79ec
commit
c8b5cd8118
2 changed files with 22 additions and 22 deletions
|
@ -32,25 +32,25 @@ sudo yunohost app setting $app domain -v "$domain"
|
||||||
sudo yunohost app setting $app path -v "$path"
|
sudo yunohost app setting $app path -v "$path"
|
||||||
|
|
||||||
#create path for copying
|
#create path for copying
|
||||||
final_path=/var/www/$app
|
src_path=/var/www/$app
|
||||||
sudo mkdir -p $final_path
|
sudo mkdir -p $src_path
|
||||||
|
|
||||||
#copy files to final folder and set permissions
|
#copy files to src folder and set permissions
|
||||||
sudo cp -R ../sources/* $final_path/
|
sudo cp -R ../sources/* $src_path/
|
||||||
sudo find $final_path -type f -name ".htaccess" | xargs sudo rm
|
sudo find $src_path -type f -name ".htaccess" | xargs sudo rm
|
||||||
|
|
||||||
#setup permissions
|
#setup permissions
|
||||||
sudo chown -R root: $final_path
|
sudo chown -R root: $src_path
|
||||||
sudo chown -R www-data: $final_path/data
|
sudo chown -R www-data: $src_path/data
|
||||||
sudo chown -R www-data: $final_path/plugins
|
sudo chown -R www-data: $src_path/plugins
|
||||||
sudo find $final_path -type f | xargs sudo chmod 644
|
sudo find $src_path -type f | xargs sudo chmod 644
|
||||||
sudo find $final_path -type d | xargs sudo chmod 755
|
sudo find $src_path -type d | xargs sudo chmod 755
|
||||||
|
|
||||||
#configure nginx settings
|
#configure nginx settings
|
||||||
folder_path=${path%/}
|
folder_path=${path%/}
|
||||||
sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf
|
sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf
|
||||||
# If path is only / (without subfolder), add trailing slash to alias
|
# If path is only / (without subfolder), add trailing slash to alias
|
||||||
alias_path=$final_path
|
alias_path=$src_path
|
||||||
[ "$path" == '/' ] && alias_path=$alias_path'/'
|
[ "$path" == '/' ] && alias_path=$alias_path'/'
|
||||||
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$alias_path@g" ../conf/nginx.conf
|
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$alias_path@g" ../conf/nginx.conf
|
||||||
sudo sed -i "s@YNH_EXAMPLE_FOLDER@$folder_path@g" ../conf/nginx.conf
|
sudo sed -i "s@YNH_EXAMPLE_FOLDER@$folder_path@g" ../conf/nginx.conf
|
||||||
|
@ -85,7 +85,7 @@ curl -k -X POST \
|
||||||
--data-urlencode "token=$token" \
|
--data-urlencode "token=$token" \
|
||||||
https://$domain$curl_path/install.php > /dev/null 2>&1
|
https://$domain$curl_path/install.php > /dev/null 2>&1
|
||||||
|
|
||||||
sudo rm -f $final_path/install.php
|
sudo rm -f $src_path/install.php
|
||||||
|
|
||||||
#remove domain name from /etc/hosts
|
#remove domain name from /etc/hosts
|
||||||
sudo sed -i "/#pluxml_hosts/d" /etc/hosts
|
sudo sed -i "/#pluxml_hosts/d" /etc/hosts
|
||||||
|
|
|
@ -12,20 +12,20 @@ is_public=$(sudo yunohost app setting $app is_public)
|
||||||
path=${path%/}
|
path=${path%/}
|
||||||
|
|
||||||
# Copy source files
|
# Copy source files
|
||||||
final_path=/var/www/$app
|
src_path=/var/www/$app
|
||||||
sudo mkdir -p $final_path
|
sudo mkdir -p $src_path
|
||||||
sudo cp -a ../sources/* $final_path
|
sudo cp -a ../sources/* $src_path
|
||||||
sudo find $final_path -type f -name ".htaccess" | xargs sudo rm
|
sudo find $src_path -type f -name ".htaccess" | xargs sudo rm
|
||||||
sudo rm $final_path/install.php
|
sudo rm $src_path/install.php
|
||||||
|
|
||||||
sudo chown -R root: $final_path
|
sudo chown -R root: $src_path
|
||||||
sudo chown -R www-data: $final_path/data
|
sudo chown -R www-data: $src_path/data
|
||||||
sudo find $final_path -type f | xargs sudo chmod 644
|
sudo find $src_path -type f | xargs sudo chmod 644
|
||||||
sudo find $final_path -type d | xargs sudo chmod 755
|
sudo find $src_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@$src_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
|
||||||
|
|
Loading…
Reference in a new issue