mirror of
https://github.com/YunoHost-Apps/osjs_ynh.git
synced 2024-09-03 19:56:11 +02:00
cleaning
This commit is contained in:
parent
ad86f101eb
commit
1f7f44574a
5 changed files with 16 additions and 23 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue