From 1795a9e18463111aa68e5c451af73f21d8ef04e2 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 May 2024 23:18:22 +0700 Subject: [PATCH] Fixes --- conf/systemd.service | 2 +- scripts/backup | 2 ++ scripts/install | 8 ++++++-- scripts/restore | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index d32ada6..a62b16f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ Type=simple User=__APP__ Group=__APP__ Environment="__YNH_NODE_LOAD_PATH__" -WorkingDirectory=__INSTALL_DIR__/app +WorkingDirectory=/home/__APP__/app Environment=PORT=__PORT__ ExecStart=__YNH_NPM__ run start Restart=on-failure diff --git a/scripts/backup b/scripts/backup index 8cf6b3c..4d6fc8c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,7 +21,9 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +unlink "/home/$app/app" unlink "/home/$app/repos" + ynh_backup --src_path="/home/$app" #================================================= diff --git a/scripts/install b/scripts/install index f244b10..222fef7 100755 --- a/scripts/install +++ b/scripts/install @@ -38,14 +38,18 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir/app" -mkdir -p "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh" +mkdir "/home/$app" && chmod 700 "/home/$app" +ln -s "$install_dir/app" "/home/$app/app" +chmod 700 "/home/$app/app/helpers/shells/*" + +mkdir "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh" touch "/home/$app/.ssh/authorized_keys" && chmod 600 "/home/$app/.ssh/authorized_keys" + mkdir "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app" ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" chown -R $app:www-data "$install_dir" chown -R $app:www-data "/home/$app" -chmod 700 $install_dir/app/helpers/shells/* #================================================= # SYSTEM CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 3241426..48e03df 100755 --- a/scripts/restore +++ b/scripts/restore @@ -25,6 +25,7 @@ ynh_restore_file --origin_path="/home/yunohost.app/$app" chown -R $app:www-data "/home/$app" chown -R $app:www-data "/home/yunohost.app/$app" --not_mandatory ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" +ln -s "$install_dir/app" "/home/$app/app" && chmod 700 "/home/$app/app" #================================================= # REINSTALL DEPENDENCIES