diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 080bc45..822ccb4 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,4 +1,7 @@ -* Other infos that people should be aware of, such as: +* Limitations : + * This application is not usable if you're not part of a cluster with minimun 3 other nodes + +* infos you should be aware of: * This application provide a node that you can connect to a garage cluster. Few option are manageable by the config panel for the current node but IT DOESN'T offer simpler way to manage bucket and keys. You have to do it by command line or let an other node managing it. * This application consider that the weight of the node is the size reserved to garage in G * This application will try to create a virtual disk to ensure garage doesn't use more than allowed. If virtualisation is not available your responsible to check space used by garage. diff --git a/scripts/upgrade b/scripts/upgrade index a9fb031..20c7b2a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,7 +23,15 @@ port_api=$(ynh_app_setting_get --app=$app --key=port_api) port_web=$(ynh_app_setting_get --app=$app --key=port_web) datadir=$(ynh_app_setting_get --app=$app --key=datadir) bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) +virtualisation=$(ynh_app_setting_get --app=$app --key=virtualisation) +if [ "$virtualisation" = "true" ] ; +then + virt_protection="" +else + virt_protection="#" +fi #================================================= # CHECK VERSION #================================================= @@ -64,44 +72,29 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# -# N.B. : the followings setting migrations snippets are provided as *EXAMPLES* -# of what you may want to do in some cases (e.g. a setting was not defined on -# some legacy installs and you therefore want to initiaze stuff during upgrade) -# - -# If db_name doesn't exist, create it -#if [ -z "$db_name" ]; then -# db_name=$(ynh_sanitize_dbid --db_name=$app) -# ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#fi - -# If final_path doesn't exist, create it -#if [ -z "$final_path" ]; then -# final_path=/var/www/$app -# ynh_app_setting_set --app=$app --key=final_path --value=$final_path -#fi - -### If nobody installed your app before 4.1, -### then you may safely remove these lines - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -if ! ynh_permission_exists --permission="admin"; then - # Create the required permissions - ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin -fi # Create a permission if needed if ! ynh_permission_exists --permission="api"; then ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" fi +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. +### Those deb packages will be installed as dependencies of this package. +### If you're not using this helper: +### - Remove the section "REMOVE DEPENDENCIES" in the remove script +### - Remove the variable "pkg_dependencies" in _common.sh +### - As well as the section "REINSTALL DEPENDENCIES" in the restore script +### - And the section "UPGRADE DEPENDENCIES" in the upgrade script +if [ "$virtualisation" = "true" ] +then + ynh_install_app_dependencies $pkg_dependencies_virtualisation +fi + #================================================= # CREATE DEDICATED USER #=================================================