mirror of
https://github.com/YunoHost-Apps/garage_ynh.git
synced 2024-09-03 18:36:32 +02:00
Rename node_id to secret_node_id such as it gets redacted when sharing logs..
This commit is contained in:
parent
50f8c5e316
commit
d831710621
4 changed files with 9 additions and 6 deletions
|
@ -7,6 +7,9 @@ source /usr/share/yunohost/helpers
|
||||||
# RETRIEVE ARGUMENTS
|
# RETRIEVE ARGUMENTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
data_dir=$(ynh_app_setting_get $app data_dir)
|
||||||
|
secret_node_id=$(ynh_app_setting_get $app data_dir)
|
||||||
|
|
||||||
if system_is_inside_container
|
if system_is_inside_container
|
||||||
then
|
then
|
||||||
nbd_index=$(cat $data_dir/nbd_index)
|
nbd_index=$(cat $data_dir/nbd_index)
|
||||||
|
@ -36,7 +39,7 @@ set__weight() {
|
||||||
systemctl start $app
|
systemctl start $app
|
||||||
sleep 3
|
sleep 3
|
||||||
fi
|
fi
|
||||||
$command layout assign $node_id -c $weight 2>/dev/null
|
$command layout assign $secret_node_id -c $weight 2>/dev/null
|
||||||
apply_layout "$command"
|
apply_layout "$command"
|
||||||
ynh_app_setting_set --app=$app --key=weight --value=$weight
|
ynh_app_setting_set --app=$app --key=weight --value=$weight
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,12 +135,12 @@ while [ -z "$($garage_command node id -q 2>/dev/null | cut -d '@' -f1)" ]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
node_id=$($garage_command node id -q 2>/dev/null | cut -d '@' -f1)
|
secret_node_id=$($garage_command node id -q 2>/dev/null | cut -d '@' -f1)
|
||||||
ynh_app_setting_set --app=$app --key=node_id --value=$node_id
|
ynh_app_setting_set --app=$app --key=secret_node_id --value=$secret_node_id
|
||||||
|
|
||||||
|
|
||||||
# define node
|
# define node
|
||||||
$garage_command layout assign $node_id -z $domain -c $weight -t $domain
|
$garage_command layout assign $secret_node_id -z $domain -c $weight -t $domain
|
||||||
# if there is enough node, apply layout
|
# if there is enough node, apply layout
|
||||||
apply_layout "$garage_command"
|
apply_layout "$garage_command"
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
|
||||||
# REMOVE NODE CONFIGURATION
|
# REMOVE NODE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
$install_dir/garage -c $install_dir/garage.toml layout remove "$node_id"
|
$install_dir/garage -c $install_dir/garage.toml layout remove "$secret_node_id"
|
||||||
|
|
||||||
apply_layout "$install_dir/garage -c $install_dir/garage.toml "
|
apply_layout "$install_dir/garage -c $install_dir/garage.toml "
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
|
|
|
@ -70,7 +70,7 @@ sleep 2
|
||||||
garage_command="$install_dir/garage -c $install_dir/garage.toml"
|
garage_command="$install_dir/garage -c $install_dir/garage.toml"
|
||||||
|
|
||||||
# define node
|
# define node
|
||||||
$garage_command layout assign $node_id -z $domain -c $weight -t $domain
|
$garage_command layout assign $secret_node_id -z $domain -c $weight -t $domain
|
||||||
# if there is enough node, apply layout
|
# if there is enough node, apply layout
|
||||||
apply_layout "$garage_command"
|
apply_layout "$garage_command"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue