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 6524c9b..80e2ce2 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,11 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= diff --git a/scripts/change_url b/scripts/change_url index 643b687..ae914ad 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..." --time +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" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_change_url_nginx_config @@ -30,7 +30,7 @@ ynh_change_url_nginx_config #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time +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" @@ -38,4 +38,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index a48b89b..73c047b 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" # chmod +x $install_dir/garage # this file doesnt seem to exist ... remove this line ? @@ -43,7 +43,7 @@ ynh_setup_source --dest_dir="$install_dir" #================================================= # 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 @@ -51,7 +51,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" @@ -64,7 +64,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 @@ -79,7 +79,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 @@ -87,7 +87,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 @@ -100,7 +100,7 @@ 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" @@ -108,7 +108,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # 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" @@ -138,24 +138,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 806a3f4..c5a9009 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,4 +1,4 @@ - #!/bin/bash +#!/bin/bash #================================================= # GENERIC START @@ -9,10 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= - #================================================= # REMOVE NODE CONFIGURATION #================================================= @@ -24,7 +20,6 @@ then ynh_print_warn --message="unable to remove the node. Maybe the number of node staying alive is not enough" fi - #================================================= # STANDARD REMOVE #================================================= @@ -60,7 +55,7 @@ then #================================================= # REMOVE VIRTUAL DISK #================================================= - ynh_script_progression --message="umount virtual disk..." + ynh_script_progression --message="Umount virtual disk..." # Remove the app directory securely $install_dir/umount_disk.sh @@ -82,17 +77,6 @@ ynh_remove_nginx_config ynh_replace_string --replace_string="server_name $domain" --match_string="server_name $domain *.$domain" --target_file="/etc/nginx/conf.d/$domain.conf" ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.conf" - -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # SPECIFIC REMOVE #=================================================