1
0
Fork 0
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:
Alexandre Aubin 2023-12-19 02:04:51 +01:00
parent 50f8c5e316
commit d831710621
4 changed files with 9 additions and 6 deletions

View file

@ -7,6 +7,9 @@ source /usr/share/yunohost/helpers
# 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
then
nbd_index=$(cat $data_dir/nbd_index)
@ -36,7 +39,7 @@ set__weight() {
systemctl start $app
sleep 3
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"
ynh_app_setting_set --app=$app --key=weight --value=$weight
}

View file

@ -135,12 +135,12 @@ while [ -z "$($garage_command node id -q 2>/dev/null | cut -d '@' -f1)" ]; do
sleep 1
done
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
secret_node_id=$($garage_command node id -q 2>/dev/null | cut -d '@' -f1)
ynh_app_setting_set --app=$app --key=secret_node_id --value=$secret_node_id
# 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
apply_layout "$garage_command"

View file

@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
# 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 "
if [ $? -ne 0 ]

View file

@ -70,7 +70,7 @@ sleep 2
garage_command="$install_dir/garage -c $install_dir/garage.toml"
# 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
apply_layout "$garage_command"