From 1f7f44574ae65706daeab010bcf3ec8e1088239e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:27:36 +0100 Subject: [PATCH] cleaning --- manifest.toml | 3 +++ scripts/install | 16 +++++++--------- scripts/remove | 5 ----- scripts/restore | 1 - scripts/upgrade | 14 ++++++-------- 5 files changed, 16 insertions(+), 23 deletions(-) diff --git a/manifest.toml b/manifest.toml index 364b3ac..8040a6f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -20,8 +20,11 @@ code = "https://github.com/os-js/OS.js" yunohost = ">= 11.2" architectures = "all" multi_instance = false + ldap = false + sso = false + disk = "50M" ram.build = "300M" ram.runtime = "50M" diff --git a/scripts/install b/scripts/install index e450519..f2db285 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,6 @@ ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" @@ -32,14 +31,13 @@ chown -R $app:$app "$install_dir" #================================================= ynh_script_progression --message="Configuring NGINX web server..." -# Create a dedicated NGINX config ynh_add_nginx_config -# Create a dedicated systemd config ynh_add_systemd_config mkdir -p "/var/log/$app" chown $app:$app "/var/log/$app" + # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -52,12 +50,12 @@ yunohost service add $app --description="Desktop you have accesss through your b #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/client.config.js" --destination="$install_dir/src/client/config.js" +ynh_add_config --template="client.config.js" --destination="$install_dir/src/client/config.js" chmod 400 "$install_dir/src/client/config.js" chown $app:$app "$install_dir/src/client/config.js" -ynh_add_config --template="../conf/server.index.js" --destination="$install_dir/src/server/index.js" +ynh_add_config --template="server.index.js" --destination="$install_dir/src/server/index.js" chmod 400 "$install_dir/src/server/index.js" chown $app:$app "$install_dir/src/server/index.js" @@ -69,10 +67,10 @@ ynh_script_progression --message="Building $app..." pushd $install_dir ynh_use_nodejs - ynh_exec_warn_less $ynh_npm install - ynh_exec_warn_less $ynh_npm run package:discover - ynh_exec_warn_less $ynh_npm run build - ynh_exec_warn_less npm install --save --production @osjs/pam-auth + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run package:discover + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install --save --production @osjs/pam-auth popd ynh_replace_string --match_string="8000" --replace_string="$port" --target_file="$install_dir/src/server/config.js" diff --git a/scripts/remove b/scripts/remove index f0f5cad..3b493cc 100644 --- a/scripts/remove +++ b/scripts/remove @@ -22,19 +22,14 @@ then yunohost service remove $app fi -# Remove the dedicated systemd config ynh_remove_systemd_config -# Remove the app-specific logrotate config ynh_remove_logrotate -# Remove the dedicated NGINX config ynh_remove_nginx_config -# Remove metapackage and its dependencies ynh_remove_nodejs -# Remove the log files ynh_secure_remove --file="/var/log/$app" #================================================= diff --git a/scripts/restore b/scripts/restore index 45daf0e..1fc12db 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/upgrade b/scripts/upgrade index 7042fc6..0778669 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." - # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep="src/client/config.js src/server/index.js" fi @@ -44,7 +43,6 @@ chown -R $app:$app "$install_dir" #================================================= ynh_script_progression --message="Upgrading NGINX web server configuration..." -# Create a dedicated NGINX config ynh_add_nginx_config ynh_install_nodejs --nodejs_version=$nodejs_version @@ -62,12 +60,12 @@ yunohost service add $app --description="Desktop you have accesss through your b #================================================= ynh_script_progression --message="Updating a configuration file..." -ynh_add_config --template="../conf/client.config.js" --destination="$install_dir/src/client/config.js" +ynh_add_config --template="client.config.js" --destination="$install_dir/src/client/config.js" chmod 400 "$install_dir/src/client/config.js" chown $app:$app "$install_dir/src/client/config.js" -ynh_add_config --template="../conf/server.index.js" --destination="$install_dir/src/server/index.js" +ynh_add_config --template="server.index.js" --destination="$install_dir/src/server/index.js" chmod 400 "$install_dir/src/server/index.js" chown $app:$app "$install_dir/src/server/index.js" @@ -79,10 +77,10 @@ ynh_script_progression --message="Building app..." pushd $install_dir ynh_use_nodejs - ynh_exec_warn_less $ynh_npm install - ynh_exec_warn_less $ynh_npm run package:discover - ynh_exec_warn_less $ynh_npm run build - ynh_exec_warn_less npm install --save --production @osjs/pam-auth + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run package:discover + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install --save --production @osjs/pam-auth popd ynh_replace_string --match_string="8000" --replace_string="$port" --target_file="$install_dir/src/server/config.js"