1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/haste_ynh.git synced 2024-09-03 20:36:28 +02:00

cleaning up

This commit is contained in:
ericgaspar 2022-05-13 22:11:40 +02:00
parent c6c45ae3c3
commit 3c3f1bc59a
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 31 additions and 8 deletions

View file

@ -12,9 +12,14 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=0ea46c375b775316cec39a96fa917ec240e45970
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
change_url=1 change_url=1
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options
; commit=0ea46c375b775316cec39a96fa917ec240e45970
name=Testing (#33)
manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666&

View file

@ -55,7 +55,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
# BACKUP DATADIR DIRECTORY # BACKUP DATADIR DIRECTORY
#================================================= #=================================================
ynh_backup --src_path="$data_path" ynh_backup --src_path="$data_path" --is_big
#================================================= #=================================================
# BACKUP BINARY # BACKUP BINARY

View file

@ -128,6 +128,7 @@ chown -R $app:www-data "$data_path"
#================================================= #=================================================
# CONFIGURE HASTE # CONFIGURE HASTE
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/config.js" --destination="$final_path/config.js" ynh_add_config --template="../conf/config.js" --destination="$final_path/config.js"
@ -169,6 +170,7 @@ ynh_use_logrotate
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log"

View file

@ -40,6 +40,7 @@ test ! -d $final_path || ynh_die "There is already a directory: $final_path "
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -70,12 +71,21 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================
# RESTORE VARIOUS FILES # RESTORE VARIOUS FILES
#================================================= #=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$data_path" ynh_restore_file --origin_path="$data_path" --not_mandatory
# Create app folders
mkdir -p "$data_path"
chmod 750 "$data_path"
chmod -R o-rwx "$data_path"
chown -R $app:www-data "$data_path"
#================================================= #=================================================
# RESTORE BINARY # RESTORE BINARY
#================================================= #=================================================
ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file --origin_path="/usr/bin/$app" ynh_restore_file --origin_path="/usr/bin/$app"
@ -100,6 +110,7 @@ chown $app -R /var/log/$app
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log"
@ -111,6 +122,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
@ -118,12 +136,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -108,12 +108,14 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# UPGRADE NODEJS # UPGRADE NODEJS
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=8
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================
# UPGRADE NPM MODULES # UPGRADE NPM MODULES
#================================================= #=================================================
ynh_script_progression --message="Installing $app..." --weight=8
pushd "$final_path" pushd "$final_path"
ynh_use_nodejs ynh_use_nodejs
@ -149,6 +151,7 @@ ynh_replace_string --match_string="https://ajax.googleapis.com/ajax/libs/jquery/
#================================================= #=================================================
# UPGRADE HASTE BINARY # UPGRADE HASTE BINARY
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1
haste_url="${domain}${path_url}" haste_url="${domain}${path_url}"
ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app" ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app"
@ -167,6 +170,7 @@ chmod +x /usr/bin/$app
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log"