1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garage_ynh.git synced 2024-09-03 18:36:32 +02:00

Attempt to fix config panel ...

This commit is contained in:
Alexandre Aubin 2023-12-19 01:22:02 +01:00
parent ef1b1f1848
commit e9ca0f074a
2 changed files with 4 additions and 22 deletions

View file

@ -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"

View file

@ -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"