Commit b5623670 authored by Aleks's avatar Aleks
Browse files

www_path -> final_path because it's the common name for that variable (c.f. next commits)

parent 742f0471
......@@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url)
app_user=$(ynh_app_setting_get $app app_user)
www_path=$(ynh_app_setting_get $app www_path)
final_path=$(ynh_app_setting_get $app final_path)
opt_path=$(ynh_app_setting_get $app opt_path)
nginx_path=/etc/nginx/conf.d/$domain.d/$app.conf
......@@ -36,7 +36,7 @@ nginx_path=/etc/nginx/conf.d/$domain.d/$app.conf
ynh_script_progression "Backing up..."
ynh_backup "$www_path"
ynh_backup "$final_path"
ynh_backup "$nginx_path"
ynh_backup "$opt_path"
......
......@@ -23,7 +23,7 @@ app=$YNH_APP_INSTANCE_NAME
old_domain=$YNH_APP_OLD_DOMAIN
old_path_url=$YNH_APP_OLD_PATH
www_path=$(ynh_app_setting_get $app www_path)
final_path=$(ynh_app_setting_get $app final_path)
domain=$YNH_APP_NEW_DOMAIN
path_url=$YNH_APP_NEW_PATH
......@@ -59,7 +59,7 @@ if [[ $path_url == "/" ]]; then
fi
sed -i "s@PATHTOCHANGE@$path_url@g" "$nginx_path"
sed -i "s@ALIASTOCHANGE@$www_path@g" "$nginx_path"
sed -i "s@ALIASTOCHANGE@$final_path@g" "$nginx_path"
if [[ $old_domain != $domain ]]; then
rm -f /etc/nginx/conf.d/$old_domain.d/$app.conf
......
......@@ -29,10 +29,10 @@ nginx_path=/etc/nginx/conf.d/$domain.d/$app.conf
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#==================================================
www_path=/var/www/$app
if [[ -e $www_path ]]
final_path=/var/www/$app
if [[ -e $final_path ]]
then
ynh_die "The path $www_path already contains a folder"
ynh_die "The path $final_path already contains a folder"
fi
opt_path=/opt/$app
......@@ -62,7 +62,7 @@ ynh_webpath_register $app $domain $path_url
ynh_app_setting_set $app domain $domain
ynh_app_setting_set $app path_url $path_url
ynh_app_setting_set $app app_user $app_user
ynh_app_setting_set $app www_path $www_path
ynh_app_setting_set $app final_path $final_path
ynh_app_setting_set $app opt_path $opt_path
#=================================================
......@@ -81,8 +81,8 @@ ynh_install_app_dependencies git python3-openssl python3-requests
ynh_script_progression "Creating app's user…"
mkdir -p $www_path
ynh_system_user_create $app_user $www_path
mkdir -p $final_path
ynh_system_user_create $app_user $final_path
#=================================================
# INSTALL STATIC FILE
......@@ -90,8 +90,8 @@ ynh_system_user_create $app_user $www_path
ynh_script_progression "Installing static site…"
cp -a ../sources/. $www_path
chown -R $app_user: $www_path
cp -a ../sources/. $final_path
chown -R $app_user: $final_path
cp ../conf/nginx.conf "$nginx_path"
......@@ -101,7 +101,7 @@ if [[ $path_url == "/" ]]; then
fi
sed -i "s@PATHTOCHANGE@$path_url@g" "$nginx_path"
sed -i "s@ALIASTOCHANGE@$www_path@g" "$nginx_path"
sed -i "s@ALIASTOCHANGE@$final_path@g" "$nginx_path"
nginx -tq
ynh_systemd_action nginx reload
......
......@@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url)
app_user=$(ynh_app_setting_get $app app_user)
www_path=$(ynh_app_setting_get $app www_path)
final_path=$(ynh_app_setting_get $app final_path)
opt_path=$(ynh_app_setting_get $app opt_path)
nginx_path=/etc/nginx/conf.d/$domain.d/$app.conf
......@@ -28,7 +28,7 @@ nginx_path=/etc/nginx/conf.d/$domain.d/$app.conf
ynh_script_progression "Removing static site..."
rm -rf $www_path
rm -rf $final_path
rm -f "$nginx_path"
nginx -tq
......
......@@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url)
app_user=$(ynh_app_setting_get $app app_user)
www_path=$(ynh_app_setting_get $app www_path)
final_path=$(ynh_app_setting_get $app final_path)
opt_path=$(ynh_app_setting_get $app opt_path)
nginx_path=/etc/nginx/conf.d/$domain.d/$app.conf
......@@ -34,7 +34,7 @@ nginx_path=/etc/nginx/conf.d/$domain.d/$app.conf
ynh_script_progression "Checking for conflicts…"
[[ ! -e $www_path ]] || ynh_die "The path $www_path already contains a folder"
[[ ! -e $final_path ]] || ynh_die "The path $final_path already contains a folder"
[[ ! -e $opt_path ]] || ynh_die "The path $opt_path already contains a folder"
# Check web path availability
......@@ -57,8 +57,8 @@ ynh_install_app_dependencies git python3-openssl python3-requests
# CREATE DEDICATED USER
#=================================================
mkdir -p "$www_path"
ynh_system_user_create $app_user "$www_path"
mkdir -p "$final_path"
ynh_system_user_create $app_user "$final_path"
#=================================================
# RESTORE STATIC FILES
......@@ -66,9 +66,9 @@ ynh_system_user_create $app_user "$www_path"
ynh_script_progression "Restoring static site…"
ynh_restore_file "$www_path"
ynh_restore_file "$final_path"
ynh_restore_file "$nginx_path"
chown -R $app_user: "$www_path"
chown -R $app_user: "$final_path"
nginx -tq
ynh_systemd_action nginx reload
......
......@@ -19,7 +19,7 @@ domain=$(ynh_app_setting_get $app domain)
path=$(ynh_app_setting_get $app path)
path_url=$(ynh_app_setting_get $app path_url)
app_user=$(ynh_app_setting_get $app app_user)
www_path=$(ynh_app_setting_get $app www_path)
final_path=$(ynh_app_setting_get $app final_path)
opt_path=$(ynh_app_setting_get $app opt_path)
# There are two ways to get the version:
......@@ -36,11 +36,11 @@ nginx_path=/etc/nginx/conf.d/$domain.d/$app.conf
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
if [[ -z $www_path ]]; then
www_path=/var/www/$app
ynh_app_setting_set $app www_path $www_path
if [[ -z $final_path ]]; then
final_path=/var/www/$app
ynh_app_setting_set $app final_path $final_path
mkdir -p $www_path
mkdir -p $final_path
fi
if [[ -z $opt_path ]]; then
......@@ -100,7 +100,7 @@ ynh_script_progression "Upgrading dependencies..."
if [[ $version < "0.3.0~ynh1" ]]; then
ynh_app_setting_delete $app version
ynh_system_user_create --username $app_user --home_dir $www_path
ynh_system_user_create --username $app_user --home_dir $final_path
fi
if [[ $version < "0.3.0~ynh4" ]]; then
......@@ -119,10 +119,10 @@ fi
ynh_script_progression "Installing static site..."
rm -rf $www_path
mkdir -p $www_path
cp -r ../sources/. $www_path
chown -R $app_user: $www_path
rm -rf $final_path
mkdir -p $final_path
cp -r ../sources/. $final_path
chown -R $app_user: $final_path
cp ../conf/nginx.conf "$nginx_path"
......@@ -132,7 +132,7 @@ if [[ $path_url == "/" ]]; then
fi
sed -i "s@PATHTOCHANGE@$path_url@g" "$nginx_path"
sed -i "s@ALIASTOCHANGE@$www_path@g" "$nginx_path"
sed -i "s@ALIASTOCHANGE@$final_path@g" "$nginx_path"
nginx -tq
ynh_systemd_action nginx reload
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment