diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..b420b12 --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1,6 @@ +Your Garage node have been installed. You can now connect to other nodes with the following identifiers : + + rpc_secret: __RPC_SECRET__ + bootstrap_peers: __SELF_BOOTSTRAP_PEERS__ + +Current garage layout: __GARAGE_LAYOUT__ diff --git a/scripts/backup b/scripts/backup index 80e2ce2..d306ce7 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,8 +27,6 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP #================================================= # BACKUP LOGROTATE #================================================= diff --git a/scripts/change_url b/scripts/change_url index 8361d45..3a9b28d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,14 +14,14 @@ source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." +ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_change_url_nginx_config @@ -30,12 +30,12 @@ ynh_change_url_nginx_config #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app"--last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index b5836f0..d93896f 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,7 @@ fi #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=rpc_secret --value=$rpc_secret ynh_app_setting_set --app=$app --key=bootstrap_peers --value=$bootstrap_peers @@ -35,7 +35,7 @@ ynh_app_setting_set --app=$app --key=bootstrap_peers --value=$bootstrap_peers #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" @@ -44,7 +44,7 @@ chmod +x $install_dir/garage #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -52,7 +52,7 @@ ynh_add_nginx_config #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="mount_disk.sh" --destination="$install_dir/mount_disk.sh" ynh_add_config --template="umount_disk.sh" --destination="$install_dir/umount_disk.sh" @@ -65,7 +65,7 @@ chown $app:$app "$install_dir/garage.toml" #================================================= # CREATE DATA DIRECTORY #================================================= -ynh_script_progression --message="Creating a data directory..." --weight=5 +ynh_script_progression --message="Creating a data directory..." --weight=5 if [[ "$system_is_inside_container" == "true" ]] then @@ -80,7 +80,7 @@ fi #================================================= # ADD REGEN-CONF HOOK #================================================= -ynh_script_progression --message="Adding regen-conf hook..." +ynh_script_progression --message="Adding regen-conf hook..." --weight=1 ynh_add_config --template="regenconf_nginx_garage" --destination="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app" yunohost tools regen-conf nginx @@ -88,7 +88,7 @@ yunohost tools regen-conf nginx #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." +ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config @@ -101,15 +101,15 @@ yunohost service add $app --description="s3 storage" --log="/var/log/$app/$app.l #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # CONFIGURE GARAGE #================================================= -ynh_script_progression --message="Configuring garage..." +ynh_script_progression --message="Configuring garage..." --weight=1 garage_command="$install_dir/garage -c $install_dir/garage.toml" @@ -139,24 +139,10 @@ fi self_bootstrap_peers="$($garage_command node id --quiet)" garage_layout="$($garage_command layout show)" - -#================================================= -# Send email to admin -#================================================= -app_message=" -your garage node have been installed. You can now connect to other nodes with the following identifiers : - - rpc_secret: $rpc_secret - bootstrap_peers: $self_bootstrap_peers - -Current garage layout : - -$garage_layout" - -ynh_send_readme_to_admin --app_message="$app_message" +ynh_app_setting_set --app=$app --key=garage_layout --value=$garage_layout #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index 872de97..c7210aa 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,4 +1,4 @@ - #!/bin/bash +#!/bin/bash #================================================= # GENERIC START @@ -18,7 +18,7 @@ $install_dir/garage -c $install_dir/garage.toml layout remove "$node_id" apply_layout "$install_dir/garage -c $install_dir/garage.toml " if [ $? -ne 0 ] then - ynh_print_warn --message="unable to remove the node. Maybe the number of node staying alive is not enough" + ynh_print_warn --message="Unable to remove the node. Maybe the number of node staying alive is not enough" fi #================================================= @@ -42,9 +42,6 @@ ynh_remove_logrotate if [[ "$system_is_inside_container" == "true" ]] then - #================================================= - # REMOVE VIRTUAL DISK - #================================================= ynh_script_progression --message="Umount virtual disk..." # Remove the app directory securely @@ -68,4 +65,4 @@ yunohost tools regen-conf nginx # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 3f8f6c0..37f1510 100755 --- a/scripts/restore +++ b/scripts/restore @@ -59,7 +59,7 @@ ynh_script_progression --message="Starting a systemd service..." #recreate log folder mkdir /var/log/$app -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RECREATE CONFIGURATION @@ -78,12 +78,13 @@ if [ -n "$bootstrap_peers" ] then garage_connect "$garage_command" "$bootstrap_peers" fi + #================================================= # GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index bf7a341..acc63af 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -68,10 +68,10 @@ ynh_add_config --template="garage.toml" --destination="$install_dir/garage.toml" #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression --message="Upgrade of $app completed" --last diff --git a/tests.toml b/tests.toml index 8282c93..137a83f 100644 --- a/tests.toml +++ b/tests.toml @@ -6,4 +6,9 @@ test_format = 1.0 # Tests to run # ------------ - args.weight = "10" \ No newline at end of file + exclude = ["install.private", "install.root", "install.subdir", "install.multi"] + + # ------------------------------- + # Default args to use for install + # ------------------------------- + args.weight = "10"