mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
Merge branch 'enh_postgresql_migration' into Update-to-PHP8.1
This commit is contained in:
commit
24a069da67
11 changed files with 129 additions and 54 deletions
19
README.md
19
README.md
|
@ -29,16 +29,23 @@ Online storage, file sharing platform and various other applications
|
|||
|
||||
## Configuration
|
||||
|
||||
#### Configure OnlyOffice integration
|
||||
### Configure ONLYOFFICE integration
|
||||
|
||||
Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an online rich text document editor) through a Nextcloud app.
|
||||
#### With Nextcloud App (no ARM support, lower performance)
|
||||
|
||||
Starting from Nextcloud 18, it features a direct integration of ONLYOFFICE (an online rich text document editor) through a Nextcloud app.
|
||||
To install and configure it:
|
||||
- Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server.
|
||||
- Install *ONLYOFFICE* application. That's the client part that will connect to an OnlyOffice server.
|
||||
- Then in Settings -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice.
|
||||
- Install *Community Document Server* application in your Nextcloud. That's the part that runs ONLYOFFICE server.
|
||||
- Install *ONLYOFFICE* application. That's the client part that will connect to an ONLYOFFICE server.
|
||||
- Then in Settings -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by ONLYOFFICE.
|
||||
- Here you go :) You should be able to create new type of documents and open them.
|
||||
|
||||
*NB: OnlyOffice is only available for x86 architecture - **ARM** architecture is **not** supported (Raspberry Pi, OLinuXino...)*
|
||||
*NB: ONLYOFFICE Nextcloud App is only available for x86 architecture - for **ARM** architecture (Raspberry Pi, OLinuXino...), consider the YunoHost App below*
|
||||
|
||||
#### With YunoHost App (ARM64 support, better performance)
|
||||
|
||||
For better performance and ARM64 support, install ONLYOFFICE YunoHost App and connect it to Nextcloud, see the tutorial in the [doc of onlyoffice_ynh package](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)
|
||||
|
||||
|
||||
## YunoHost specific features
|
||||
|
||||
|
|
21
README_fr.md
21
README_fr.md
|
@ -29,16 +29,23 @@ Stockage en ligne, plateforme de partage de fichiers et diverses autres applicat
|
|||
|
||||
## Configuration
|
||||
|
||||
#### Configurer l'intégration d'OnlyOffice
|
||||
### Configurer l'intégration d'ONLYOFFICE
|
||||
|
||||
À partir de sa version 18, Nextcloud inclut une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud.
|
||||
#### Avec l'application Nextcloud (pas de support ARM, performances limitées)
|
||||
|
||||
À partir de sa version 18, Nextcloud inclut une intégration directe de ONLYOFFICE (un éditeur de texte enrichi en ligne) via une application Nextcloud.
|
||||
Pour l'installer et la configurer :
|
||||
- Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice.
|
||||
- Installez l'application *ONLYOFFICE*. C'est la partie cliente qui va se connecter au serveur OnlyOffice.
|
||||
- Ensuite dans les Paramètres -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice.
|
||||
- Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur ONLYOFFICE.
|
||||
- Installez l'application *ONLYOFFICE*. C'est la partie cliente qui va se connecter au serveur ONLYOFFICE.
|
||||
- Ensuite dans les Paramètres -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec ONLYOFFICE.
|
||||
- Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir.
|
||||
|
||||
*NB : OnlyOffice n'est disponible que sous architecture x86 - L'architecture **ARM** n'est **pas** supporté (Raspberry Pi, OLinuXino...)*
|
||||
|
||||
*NB : l'app Nextcloud ONLYOFFICE Community Document Server n'est disponible que sous architecture x86 - Pour un support de l'architecture **ARM** (Raspberry Pi, OLinuXino...), installez plutôt l'App YunoHost, voir ci-dessous*
|
||||
|
||||
#### Avec l'application YunoHost (support ARM64, meilleures performances)
|
||||
|
||||
Pour de meilleures performances et le support de ARM64, installez l'app YunoHost ONLYOFFICE, voir le tutoriel dans la [doc du paquet onlyoffice_ynh](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)
|
||||
|
||||
|
||||
## Caractéristiques spécifiques YunoHost
|
||||
|
||||
|
|
|
@ -25,3 +25,6 @@ Notification=none
|
|||
; commit=f565b6d216f5340f752e6d6a21a14abc3811e0e7
|
||||
name=Merge pull request #495 from YunoHost-Apps/22.2.9
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&user_home=1&
|
||||
; commit=e9e7015ed7667352c1c191fc632a9f6f382dd9d2
|
||||
name=[fix] Upgrade to 20.0.4 (#346)
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&user_home=1&
|
|
@ -1,15 +1,22 @@
|
|||
## Configuration
|
||||
|
||||
#### Configure OnlyOffice integration
|
||||
### Configure ONLYOFFICE integration
|
||||
|
||||
Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an online rich text document editor) through a Nextcloud app.
|
||||
#### With Nextcloud App (no ARM support, lower performance)
|
||||
|
||||
Starting from Nextcloud 18, it features a direct integration of ONLYOFFICE (an online rich text document editor) through a Nextcloud app.
|
||||
To install and configure it:
|
||||
- Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server.
|
||||
- Install *ONLYOFFICE* application. That's the client part that will connect to an OnlyOffice server.
|
||||
- Then in Settings -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice.
|
||||
- Install *Community Document Server* application in your Nextcloud. That's the part that runs ONLYOFFICE server.
|
||||
- Install *ONLYOFFICE* application. That's the client part that will connect to an ONLYOFFICE server.
|
||||
- Then in Settings -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by ONLYOFFICE.
|
||||
- Here you go :) You should be able to create new type of documents and open them.
|
||||
|
||||
*NB: OnlyOffice is only available for x86 architecture - **ARM** architecture is **not** supported (Raspberry Pi, OLinuXino...)*
|
||||
*NB: ONLYOFFICE Nextcloud App is only available for x86 architecture - for **ARM** architecture (Raspberry Pi, OLinuXino...), consider the YunoHost App below*
|
||||
|
||||
#### With YunoHost App (ARM64 support, better performance)
|
||||
|
||||
For better performance and ARM64 support, install ONLYOFFICE YunoHost App and connect it to Nextcloud, see the tutorial in the [doc of onlyoffice_ynh package](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)
|
||||
|
||||
|
||||
## YunoHost specific features
|
||||
|
||||
|
|
|
@ -1,15 +1,22 @@
|
|||
## Configuration
|
||||
|
||||
#### Configurer l'intégration d'OnlyOffice
|
||||
### Configurer l'intégration d'ONLYOFFICE
|
||||
|
||||
À partir de sa version 18, Nextcloud inclut une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud.
|
||||
#### Avec l'application Nextcloud (pas de support ARM, performances limitées)
|
||||
|
||||
À partir de sa version 18, Nextcloud inclut une intégration directe de ONLYOFFICE (un éditeur de texte enrichi en ligne) via une application Nextcloud.
|
||||
Pour l'installer et la configurer :
|
||||
- Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice.
|
||||
- Installez l'application *ONLYOFFICE*. C'est la partie cliente qui va se connecter au serveur OnlyOffice.
|
||||
- Ensuite dans les Paramètres -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice.
|
||||
- Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur ONLYOFFICE.
|
||||
- Installez l'application *ONLYOFFICE*. C'est la partie cliente qui va se connecter au serveur ONLYOFFICE.
|
||||
- Ensuite dans les Paramètres -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec ONLYOFFICE.
|
||||
- Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir.
|
||||
|
||||
*NB : OnlyOffice n'est disponible que sous architecture x86 - L'architecture **ARM** n'est **pas** supporté (Raspberry Pi, OLinuXino...)*
|
||||
|
||||
*NB : l'app Nextcloud ONLYOFFICE Community Document Server n'est disponible que sous architecture x86 - Pour un support de l'architecture **ARM** (Raspberry Pi, OLinuXino...), installez plutôt l'App YunoHost, voir ci-dessous*
|
||||
|
||||
#### Avec l'application YunoHost (support ARM64, meilleures performances)
|
||||
|
||||
Pour de meilleures performances et le support de ARM64, installez l'app YunoHost ONLYOFFICE, voir le tutoriel dans la [doc du paquet onlyoffice_ynh](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)
|
||||
|
||||
|
||||
## Caractéristiques spécifiques YunoHost
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
#=================================================
|
||||
|
||||
YNH_PHP_VERSION="8.1"
|
||||
pkg_dependencies="imagemagick libmagickcore-6.q16-6-extra acl tar smbclient at php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary php${YNH_PHP_VERSION}-bcmath"
|
||||
pkg_dependencies="postgresql imagemagick libmagickcore-6.q16-6-extra acl tar smbclient at php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary php${YNH_PHP_VERSION}-bcmath"
|
||||
|
||||
|
||||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
|
|
|
@ -53,11 +53,11 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE MYSQL DATABASE
|
||||
# BACKUP THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
ynh_print_info --message="Backing up the MySQL database..."
|
||||
ynh_print_info --message="Backing up the PostgreSQL database..."
|
||||
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
ynh_psql_dump_db --database="$db_name" > db.sql
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
|
|
|
@ -66,17 +66,18 @@ ynh_app_setting_set --app=$app --key=maintenance_mode --value=$maintenance_mode
|
|||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=10
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# CREATE A MYSQL DATABASE
|
||||
# CREATE A POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a MySQL database..." --weight=2
|
||||
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
||||
ynh_psql_test_if_first_run
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -179,8 +180,8 @@ admin_password="$(ynh_string_random --length=6)"
|
|||
|
||||
# Install Nextcloud using a temporary admin user
|
||||
exec_occ maintenance:install \
|
||||
--database "mysql" --database-name $db_name \
|
||||
--database-user $db_user --database-pass "$db_pwd" \
|
||||
--database "pgsql" --database-name $db_name \
|
||||
--database-user $db_name --database-pass "$db_pwd" \
|
||||
--admin-user "admin" --admin-pass "$admin_password" \
|
||||
--data-dir "$datadir" \
|
||||
|| ynh_die --message="Unable to install Nextcloud"
|
||||
|
@ -275,7 +276,7 @@ exec_occ config:system:set overwrite.cli.url --value="https://${domain}"
|
|||
#=================================================
|
||||
|
||||
# Set the user as admin
|
||||
ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \
|
||||
ynh_psql_connect_as --user=$db_name --password="$db_pwd" --database=$db_name \
|
||||
<<< "INSERT INTO oc_group_user VALUES ('admin','$admin');"
|
||||
# And delete admin user
|
||||
exec_occ user:delete admin
|
||||
|
|
|
@ -33,12 +33,12 @@ ynh_script_progression --message="Removing dependencies..." --weight=20
|
|||
ynh_remove_app_dependencies
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE MYSQL DATABASE
|
||||
# REMOVE THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the MySQL database..." --weight=5
|
||||
ynh_script_progression --message="Removing the PostgreSQL database..." --weight=5
|
||||
|
||||
# Remove a database if it exists, along with the associated user
|
||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
ynh_psql_remove_db --db_user=$db_name --db_name=$db_name
|
||||
|
||||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
|
|
|
@ -44,6 +44,29 @@ test ! -d $final_path \
|
|||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=10
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
# Check if .well-known is available for this domain
|
||||
if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav"
|
||||
then
|
||||
ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book."
|
||||
|
||||
# Remove lines about .well-known/carddav and caldav with sed.
|
||||
sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
@ -52,13 +75,15 @@ ynh_script_progression --message="Restoring the app main directory..."
|
|||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the MySQL database..." --weight=9
|
||||
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=9
|
||||
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||
ynh_psql_test_if_first_run
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd
|
||||
# Restore dump
|
||||
ynh_psql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
|
@ -70,14 +95,6 @@ ynh_system_user_create --username=$app
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=10
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -131,6 +131,9 @@ then
|
|||
ynh_app_setting_delete $app backup_core_only
|
||||
|
||||
ynh_clean_setup () {
|
||||
# Remove both databases in case script fails during database migration
|
||||
ynh_exec_warn_less ynh_psql_remove_db --db_user=$db_name --db_name=$db_name
|
||||
ynh_exec_warn_less ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
|
@ -150,7 +153,7 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..." --weight=7
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
|
@ -232,6 +235,28 @@ local mount_id=$(exec_occ files_external:create --output=json \
|
|||
# Define app's data directory
|
||||
datadir="/home/yunohost.app/$app/data"
|
||||
|
||||
#=================================================
|
||||
# HANDLE DATABASE MIGRATION
|
||||
#=================================================
|
||||
|
||||
mysql_db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
if [ -n "$mysql_db_pwd" ]
|
||||
then
|
||||
ynh_script_progression --message="Migrate Database..."
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/config/config.php"
|
||||
|
||||
ynh_psql_test_if_first_run
|
||||
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
|
||||
|
||||
exec_occ db:convert-type --all-apps --clear-schema pgsql $db_name 127.0.0.1 $db_name --password=$db_pwd -n
|
||||
|
||||
ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name
|
||||
ynh_app_setting_delete --app=$app --key=mysqlpwd
|
||||
|
||||
ynh_store_file_checksum --file="${final_path}/config/config.php"
|
||||
fi
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading Nextcloud..." --weight=3
|
||||
|
|
Loading…
Add table
Reference in a new issue