1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cryptpad_ynh.git synced 2024-09-03 18:26:14 +02:00
This commit is contained in:
Éric Gaspar 2024-09-01 21:52:27 +02:00
parent 451e6817e1
commit 7d94920c66
4 changed files with 4 additions and 36 deletions

View file

@ -48,20 +48,15 @@ ynh_nodejs_install
#================================================= #=================================================
ynh_script_progression "Setting up source files..." 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" ynh_setup_source --dest_dir="$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:$app "$install_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression "Adding system configurations related to $app..." ynh_script_progression "Adding system configurations related to $app..."
# Create a dedicated NGINX config
ynh_config_add_nginx ynh_config_add_nginx
# Create a dedicated systemd config
ynh_config_add_systemd ynh_config_add_systemd
yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log" yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log"
@ -91,7 +86,6 @@ popd
#================================================= #=================================================
ynh_script_progression "Starting $app's systemd service..." ynh_script_progression "Starting $app's systemd service..."
# Start a systemd service
ynh_systemctl --service=$app --action="start" --log_path="systemd" ynh_systemctl --service=$app --action="start" --log_path="systemd"
#================================================= #=================================================

View file

@ -11,24 +11,16 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression "Removing system configurations related to $app..." 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 if ynh_hide_warnings yunohost service status $app >/dev/null
then then
ynh_script_progression "Removing $app service integration..." ynh_script_progression "Removing $app service integration..."
yunohost service remove $app yunohost service remove $app
fi fi
# Remove the dedicated systemd config
ynh_config_remove_systemd ynh_config_remove_systemd
# Remove the dedicated NGINX config
ynh_config_remove_nginx ynh_config_remove_nginx
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression "Removing dependencies..."
ynh_nodejs_remove ynh_nodejs_remove
#================================================= #=================================================

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/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 ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -11,10 +10,6 @@ ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir" 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:$app "$install_dir"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/config/config.js"
#================================================= #=================================================
# APPLY FOLDER GROUP RIGHTS FOR WWW-DATA # APPLY FOLDER GROUP RIGHTS FOR WWW-DATA
#================================================= #=================================================
@ -26,14 +21,11 @@ chgrp -R www-data $install_dir
#================================================= #=================================================
ynh_script_progression "Reinstalling dependencies..." ynh_script_progression "Reinstalling dependencies..."
# Define and install dependencies
ynh_nodejs_install ynh_nodejs_install
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression "Restoring system configurations related to $app..." ynh_script_progression "Restoring system configurations related to $app..."
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"

View file

@ -63,16 +63,14 @@ fi
#================================================= #=================================================
ynh_script_progression "Upgrading NGINX web server configuration..." ynh_script_progression "Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_config_add_nginx ynh_config_add_nginx
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression "Upgrading dependencies..."
ynh_nodejs_install ynh_nodejs_install
ynh_config_add_systemd
yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# INSTALL CRYPTPAD # INSTALL CRYPTPAD
#================================================= #=================================================
@ -86,14 +84,6 @@ pushd "$install_dir"
ynh_hide_warnings npm run build ynh_hide_warnings npm run build
popd popd
#=================================================
# CREATE SYSTEMD SERVICE
#=================================================
ynh_config_add_systemd
yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# ADD UPGRADED CONFIG WITH SANDBOX # ADD UPGRADED CONFIG WITH SANDBOX
#================================================= #=================================================