1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/haste_ynh.git synced 2024-09-03 20:36:28 +02:00
This commit is contained in:
Éric Gaspar 2024-08-31 12:29:13 +02:00
parent 09784ec79f
commit 157e1ad9f6
5 changed files with 2 additions and 24 deletions

View file

@ -1,6 +1,5 @@
#!/bin/bash
#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

View file

@ -16,7 +16,6 @@ ynh_nodejs_install
#=================================================
ynh_script_progression "Setting up source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$install_dir
#=================================================
@ -24,16 +23,13 @@ ynh_setup_source --dest_dir=$install_dir
#=================================================
ynh_script_progression "Configuring NGINX web server..."
# Create a dedicated NGINX config
ynh_config_add_nginx
env_path="$PATH"
ynh_config_add_systemd
# FIXME Currently, the log is only redirected to syslog.
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app -R /var/log/$app
ynh_config_add_logrotate
@ -57,8 +53,7 @@ ynh_replace --match="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.m
ynh_script_progression "Installing $app..."
pushd "$install_dir"
ynh_hide_warnings npm install
ynh_hide_warnings $ynh_npm install
popd
#=================================================
@ -72,9 +67,6 @@ ynh_config_add --template="haste.sh" --destination="/usr/bin/$app"
# SECURE FILES AND DIRECTORIES
#=================================================
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
chmod +x /usr/bin/$app
#=================================================

View file

@ -8,17 +8,14 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression "Removing system configurations related to $app..."
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_hide_warnings yunohost service status $app >/dev/null
then
ynh_script_progression "Removing $app service integration..."
yunohost service remove $app
fi
# Remove the dedicated systemd config
ynh_config_remove_systemd
# Remove the dedicated NGINX config
ynh_config_remove_nginx
ynh_config_remove_logrotate

View file

@ -17,8 +17,6 @@ ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
@ -42,7 +40,6 @@ chmod +x /usr/bin/$app
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app -R /var/log/$app
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -15,7 +15,6 @@ ynh_systemctl --service=$app --action="stop"
#=================================================
ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="config.js"
#=================================================
@ -30,10 +29,8 @@ ynh_nodejs_install
#=================================================
ynh_script_progression "Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_config_add_nginx
# FIXME Currently, the log is only redirected to syslog.
ynh_config_add_logrotate
env_path="$PATH"
@ -47,8 +44,7 @@ yunohost service add $app --description="Haste is a pastebin software" --log="/v
ynh_script_progression "Installing $app..."
pushd "$install_dir"
ynh_hide_warnings npm install
ynh_hide_warnings $ynh_npm install
popd
#=================================================
@ -72,9 +68,6 @@ ynh_config_add --template="haste.sh" --destination="/usr/bin/$app"
# SECURE FILES AND DIRECTORIES
#=================================================
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
chmod +x /usr/bin/$app
#=================================================