mirror of
https://github.com/YunoHost-Apps/onlyoffice_ynh.git
synced 2024-09-03 19:56:11 +02:00
Fix dependencies
This commit is contained in:
parent
f484ed6930
commit
2f37994b4b
4 changed files with 70 additions and 44 deletions
|
@ -95,12 +95,18 @@ ynh_print_info "Add nodejs repository..."
|
|||
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
|
||||
|
||||
#=================================================
|
||||
# ADD ONLYOFFICE REPOSITORY
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_print_info "Add OnlyOffice repository..."
|
||||
ynh_print_info "Installing dependencies..."
|
||||
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||
echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list
|
||||
### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package.
|
||||
### Those deb packages will be installed as dependencies of this package.
|
||||
### If you're not using this helper:
|
||||
### - Remove the section "REMOVE DEPENDENCIES" in the remove script
|
||||
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
|
||||
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
|
||||
|
||||
ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server
|
||||
|
||||
#=================================================
|
||||
# CREATE A POSTGRESQL DATABASE
|
||||
|
@ -124,27 +130,6 @@ ynh_app_setting_set $app db_pwd $db_pwd
|
|||
ynh_psql_test_if_first_run
|
||||
ynh_psql_create_db $db_name $db_name $db_pwd
|
||||
|
||||
#=================================================
|
||||
# DEFINE PORT
|
||||
#=================================================
|
||||
ynh_print_info "Define OnlyOffice server port..."
|
||||
|
||||
echo onlyoffice-documentserver onlyoffice/ds-port select ${port} | sudo debconf-set-selections
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_print_info "Installing dependencies..."
|
||||
|
||||
### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package.
|
||||
### Those deb packages will be installed as dependencies of this package.
|
||||
### If you're not using this helper:
|
||||
### - Remove the section "REMOVE DEPENDENCIES" in the remove script
|
||||
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
|
||||
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
|
||||
|
||||
ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server onlyoffice-documentserver
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -187,8 +172,26 @@ ynh_system_user_create $app $final_path
|
|||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# ...
|
||||
# DEFINE PORT
|
||||
#=================================================
|
||||
ynh_print_info "Define OnlyOffice server port..."
|
||||
|
||||
echo onlyoffice-documentserver onlyoffice/ds-port select ${port} | sudo debconf-set-selections
|
||||
|
||||
#=================================================
|
||||
# ADD ONLYOFFICE REPOSITORY
|
||||
#=================================================
|
||||
ynh_print_info "Add OnlyOffice repository..."
|
||||
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||
echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list
|
||||
|
||||
#=================================================
|
||||
# INSTALL ONLYOFFICE
|
||||
#=================================================
|
||||
ynh_print_info "Install OnlyOffice..."
|
||||
|
||||
ynh_package_install onlyoffice-documentserver
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
|
|
|
@ -39,14 +39,20 @@ ynh_print_info "Removing the PostgreSQL database"
|
|||
# Remove a database if it exists, along with the associated user
|
||||
ynh_psql_remove_db $db_name $db_name
|
||||
|
||||
#=================================================
|
||||
# REMOVE ONLYOFFICE
|
||||
#=================================================
|
||||
ynh_print_info "Removing OnlyOffice"
|
||||
|
||||
ynh_secure_remove /var/lib/dpkg/info/onlyoffice-documentserver.prerm
|
||||
ynh_package_autoremove onlyoffice-documentserver
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_print_info "Removing dependencies"
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
documentserver-prepare4shutdown.sh
|
||||
ynh_secure_remove /var/lib/dpkg/info/onlyoffice-documentserver.prerm
|
||||
ynh_remove_app_dependencies
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -34,6 +34,7 @@ final_path=$(ynh_app_setting_get $app final_path)
|
|||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
db_pwd=$(ynh_app_setting_get $app db_pwd)
|
||||
port=$(ynh_app_setting_get $app port)
|
||||
nextclouddomain=$(ynh_app_setting_get $app nextclouddomain)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -53,6 +54,9 @@ test ! -d $final_path \
|
|||
|
||||
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
# Fix main domain X-Frame-Options
|
||||
ynh_replace_string "X-Frame-Options : SAMEORIGIN" "X-Frame-Options : ALLOW-FROM https://$nextclouddomain" "/etc/nginx/conf.d/$domain.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
@ -77,6 +81,21 @@ chown -R $app: $final_path
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
# ADD NODEJS REPOSITORY
|
||||
#=================================================
|
||||
ynh_print_info "Add nodejs repository..."
|
||||
|
||||
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
|
||||
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_print_info "Reinstalling dependencies..."
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
|
@ -88,11 +107,11 @@ ynh_psql_create_db $db_name $db_name $db_pwd
|
|||
ynh_psql_execute_file_as_root ./db.sql "$db_name"
|
||||
|
||||
#=================================================
|
||||
# ADD NODEJS REPOSITORY
|
||||
# DEFINE PORT
|
||||
#=================================================
|
||||
ynh_print_info "Installing nodejs..."
|
||||
ynh_print_info "Define OnlyOffice server port..."
|
||||
|
||||
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
|
||||
echo onlyoffice-documentserver onlyoffice/ds-port select ${port} | sudo debconf-set-selections
|
||||
|
||||
#=================================================
|
||||
# ADD ONLYOFFICE REPOSITORY
|
||||
|
@ -103,19 +122,11 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
|||
echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list
|
||||
|
||||
#=================================================
|
||||
# DEFINE PORT
|
||||
# REINSTALL ONLYOFFICE
|
||||
#=================================================
|
||||
ynh_print_info "Define OnlyOffice server port..."
|
||||
ynh_print_info "Reinstalling OnlyOffice..."
|
||||
|
||||
echo onlyoffice-documentserver onlyoffice/ds-port select ${port} | sudo debconf-set-selections
|
||||
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_print_info "Reinstalling dependencies..."
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server onlyoffice-documentserver
|
||||
ynh_package_install onlyoffice-documentserver
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -86,12 +86,15 @@ else
|
|||
fi
|
||||
ynh_add_nginx_config "nextclouddomain"
|
||||
|
||||
# Fix main domain X-Frame-Options
|
||||
ynh_replace_string "X-Frame-Options : SAMEORIGIN" "X-Frame-Options : ALLOW-FROM https://$nextclouddomain" "/etc/nginx/conf.d/$domain.conf"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_print_info "Upgrading dependencies..."
|
||||
|
||||
ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server onlyoffice-documentserver
|
||||
ynh_install_app_dependencies postgresql libstdc++6 redis-server rabbitmq-server
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -104,8 +107,11 @@ ynh_system_user_create $app
|
|||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
# ...
|
||||
# UPGRADE ONLYOFFICE
|
||||
#=================================================
|
||||
ynh_print_info "Upgrading OnlyOffice..."
|
||||
|
||||
ynh_package_install onlyoffice-documentserver
|
||||
|
||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||
|
|
Loading…
Add table
Reference in a new issue