diff --git a/config_panel.toml b/config_panel.toml index 9375c6b..8a9db1c 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -19,7 +19,7 @@ version = "1.0" ask = "allocated space (Gio)" help = "This value is doubled used by yunohost. It set the weight of the garage node and if virtualisation is enabled, it create a virtual disk with the same size" type = "number" - bind = "weight()" + bind = "null" [main.garage_conf.bootstrap_peers] ask = "Friend serveur adress" diff --git a/scripts/config b/scripts/config index f96b00b..61950b5 100644 --- a/scripts/config +++ b/scripts/config @@ -1,31 +1,18 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= source _common.sh source /usr/share/yunohost/helpers -ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS #================================================= -final_path=$(ynh_app_setting_get $app final_path) -node_id=$(ynh_app_setting_get $app node_id) -datadir=$(ynh_app_setting_get $app datadir) if [[ "$system_is_inside_container" == "true" ]] then - nbd_index=$(cat $datadir/nbd_index) + nbd_index=$(cat $data_dir/nbd_index) fi -command="$final_path/garage -c $final_path/garage.toml" -get__weight() { - ynh_app_setting_get --app=$app --key=weight -} +command="$install_dir/garage -c $install_dir/garage.toml" set__weight() { if [[ "$system_is_inside_container" == "true" ]] @@ -45,7 +32,7 @@ set__weight() { qemu-nbd --disconnect /dev/nbd$nbd_index qemu-img resize --shrink $datadir/garage_data.qcow2 "$weight"G fi - $final_path/umount_disk.sh + $install_dir/umount_disk.sh systemctl start $app sleep 3 fi @@ -55,11 +42,6 @@ set__weight() { } - -get__bootstrap_peers() { - ynh_app_setting_get --app=$app --key=bootstrap_peers -} - set__bootstrap_peers() { garage_connect "$command" "$bootstrap_peers" 2>/dev/null apply_layout "$command"