diff --git a/scripts/install b/scripts/install index 7f96e3d..f01d7c4 100644 --- a/scripts/install +++ b/scripts/install @@ -56,8 +56,7 @@ ynh_script_progression --message="Validating installation parameters..." --weigh ### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app" -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -112,7 +111,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A POSTGRESQL DATABASE @@ -135,9 +134,9 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ### downloaded from an upstream source, like a git repository. ### `ynh_setup_source` use the file conf/app.src -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" # FIXME: this should be managed by the core in the future # Here, as a packager, you may have to tweak the ownerhsip/permissions @@ -145,9 +144,9 @@ ynh_setup_source --dest_dir="$final_path" # files in some cases. # But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - # this will be treated as a security issue. -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION @@ -165,8 +164,8 @@ ynh_add_nginx_config # Configuration files #================================================= -config="$final_path/.config" -env_file="$final_path/.env" +config="$install_dir/.config" +env_file="$install_dir/.env" export MIX_ENV=prod FLAVOUR=classic @@ -205,7 +204,7 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix release #================================================= # Run the release #================================================= -release_folder="$final_path/_build/prod/rel/bonfire/" +release_folder="$install_dir/_build/prod/rel/bonfire/" # Database created before, let's run the migrations ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'"