mirror of
https://github.com/YunoHost-Apps/onlyoffice_ynh.git
synced 2024-09-03 19:56:11 +02:00
Merge pull request #73 from YunoHost-Apps/correct-upgrade
Correct upgrade
This commit is contained in:
commit
6f2b08dfb8
6 changed files with 60 additions and 39 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
# dependencies used by the app
|
||||
pkg_dependencies="postgresql postgresql-contrib libstdc++6 rabbitmq-server libcurl4-dev"
|
||||
extra_dependencies="onlyoffice-documentserver"
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
|
|
|
@ -52,6 +52,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/onlyoffice"
|
||||
ynh_backup --src_path="/var/lib/onlyoffice/documentserver/App_Data/cache/files" --not_mandatory
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE POSTGRESQL DATABASE
|
||||
|
|
|
@ -72,14 +72,6 @@ ynh_script_progression --message="Configuring system user..."
|
|||
# Create a system user
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# ADD ONLYOFFICE REPOSITORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Add OnlyOffice repository..."
|
||||
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||
ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -130,11 +122,14 @@ echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-
|
|||
#=================================================
|
||||
ynh_script_progression --message="Install OnlyOffice..."
|
||||
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||
|
||||
# The onlyoffice dev had the magnificent idea to add a "nginx restart" during
|
||||
# the install/configure of their package, which is awful since that will
|
||||
# restart nginx and the whole webadmin and maybe even the yunohost command
|
||||
# running the install ...
|
||||
ynh_exec_warn_less ynh_add_app_dependencies --package="onlyoffice-documentserver"
|
||||
|
||||
ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
|
@ -151,6 +146,17 @@ ynh_script_progression --message="Storing the config file checksum..."
|
|||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum --file="/etc/onlyoffice/documentserver/default.json"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# Set permissions to app files
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RELOAD ONLYOFFICE
|
||||
#=================================================
|
||||
|
@ -167,8 +173,6 @@ ynh_script_progression --message="Generating fonts..."
|
|||
|
||||
/usr/bin/documentserver-generate-allfonts.sh
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
|
|
|
@ -55,7 +55,7 @@ ynh_script_progression --message="Removing dependencies..."
|
|||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
ynh_remove_extra_repo
|
||||
#ynh_remove_extra_repo
|
||||
|
||||
dpkg --configure -a
|
||||
|
||||
|
|
|
@ -58,16 +58,6 @@ ynh_script_progression --message="Recreating the dedicated system user..."
|
|||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
# ADD ONLYOFFICE REPOSITORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Add OnlyOffice repository..."
|
||||
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||
ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append
|
||||
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -76,6 +66,8 @@ ynh_script_progression --message="Reinstalling dependencies..."
|
|||
# Define and install dependencies
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
|
@ -101,7 +93,9 @@ echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-
|
|||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling OnlyOffice..."
|
||||
|
||||
ynh_exec_warn_less ynh_add_app_dependencies --package="onlyoffice-documentserver"
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||
|
||||
ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE CONFIGURATION
|
||||
|
@ -110,6 +104,11 @@ ynh_script_progression --message="Restoring the configuration..."
|
|||
|
||||
ynh_restore_file --origin_path="/etc/onlyoffice"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE CACHE
|
||||
#=================================================
|
||||
ynh_restore_file --origin_path="/var/lib/onlyoffice/documentserver/App_Data/cache/files"
|
||||
|
||||
#=================================================
|
||||
# REGENERATE FONTS
|
||||
#=================================================
|
||||
|
@ -117,6 +116,17 @@ ynh_script_progression --message="Generating fonts..."
|
|||
|
||||
/usr/bin/documentserver-generate-allfonts.sh
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# Set permissions to app files
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RELOAD ONLYOFFICE
|
||||
#=================================================
|
||||
|
|
|
@ -80,6 +80,13 @@ ynh_script_progression --message="Making sure dedicated system user exists..."
|
|||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..."
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -96,23 +103,8 @@ fi
|
|||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config "nextclouddomain"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..."
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
# ADD ONLYOFFICE REPOSITORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Add OnlyOffice repository..."
|
||||
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||
ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE ONLYOFFICE
|
||||
#=================================================
|
||||
|
@ -130,7 +122,11 @@ echo onlyoffice-documentserver onlyoffice/db-name string $db_name | debconf-set-
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading OnlyOffice..."
|
||||
|
||||
ynh_exec_warn_less ynh_add_app_dependencies --package="onlyoffice-documentserver"
|
||||
ynh_remove_extra_repo --name="$app" # backward compat
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||
|
||||
# ynh_remove_app_dependencies
|
||||
ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
|
@ -153,6 +149,15 @@ ynh_script_progression --message="Generating fonts..."
|
|||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# Set permissions to app files
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RELOAD ONLYOFFICE
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue