aboutsummaryrefslogtreecommitdiff
path: root/scripts/restore
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2021-04-10 00:18:53 +0200
committeryalh76 <yalh@yahoo.com>2021-04-10 00:18:53 +0200
commitf376290f1397f56e8d12bad5d15ac952fbdc25c6 (patch)
tree792622e5e6c915524ed0924921f2bf93ef98ae23 /scripts/restore
parenta7eb98db3fac0697b923072dcd78c1ca04bf0a12 (diff)
downloadmastodon_ynh-f376290f1397f56e8d12bad5d15ac952fbdc25c6.tar.gz
mastodon_ynh-f376290f1397f56e8d12bad5d15ac952fbdc25c6.tar.bz2
mastodon_ynh-f376290f1397f56e8d12bad5d15ac952fbdc25c6.zip
Apply example_ynh
Diffstat (limited to 'scripts/restore')
-rw-r--r--scripts/restore34
1 files changed, 15 insertions, 19 deletions
diff --git a/scripts/restore b/scripts/restore
index 6744ddb..f51537a 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -6,7 +6,7 @@
# IMPORT GENERIC HELPERS
#=================================================
-#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
+# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source ../settings/scripts/ynh_install_ruby__2
source ../settings/scripts/ynh_add_swap
@@ -25,7 +25,7 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
-ynh_script_progression --message="Loading settings..."
+ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
@@ -51,32 +51,28 @@ test ! -d $final_path \
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
-ynh_script_progression --message="Restoring the nginx configuration..."
+ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
-# RESTORE THE APP MAIN DIR
-#=================================================
-ynh_script_progression --message="Restoring the app main directory..."
-
-ynh_restore_file --origin_path="$final_path"
-
-#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
-ynh_system_user_create --username=$app --home_dir=$final_path
+ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
-# RESTORE USER RIGHTS
+# RESTORE THE APP MAIN DIR
#=================================================
-ynh_script_progression --message="Restoring user rights..."
+ynh_script_progression --message="Restoring the app main directory..."
+
+ynh_restore_file --origin_path="$final_path"
-# Restore permissions on app files
-chown -R $app: $final_path
+chmod 750 "$final_path"
+chmod -R o-rwx "$final_path"
+chown -R root:$app "$final_path"
#=================================================
# SPECIFIC RESTORATION
@@ -102,7 +98,7 @@ ynh_add_swap --size=$swap_needed
ynh_script_progression --message="Reinstalling dependencies..."
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
-ynh_install_app_dependencies $pkg_dependencies
+ynh_install_app_dependencies $pkg_dependencies
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
#=================================================
@@ -141,9 +137,9 @@ systemctl enable "$app-web" "$app-sidekiq" "$app-streaming" --quiet
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
-yunohost service add "$app-web" --description "$app web service"
-yunohost service add "$app-sidekiq" --description "$app sidekiq service"
-yunohost service add "$app-streaming" --description "$app streaming service"
+yunohost service add "$app-web" --description="$app web service"
+yunohost service add "$app-sidekiq" --description="$app sidekiq service"
+yunohost service add "$app-streaming" --description="$app streaming service"
#=================================================
# START SYSTEMD SERVICE