mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
Merge branch 'testing' into enh_postgresql_migration
This commit is contained in:
commit
6f6ef69b5a
7 changed files with 29 additions and 165 deletions
26
README.md
26
README.md
|
@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
|
|||
|
||||
[Nextcloud](https://nextcloud.com) gives you freedom and control over your own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices.
|
||||
|
||||
**Shipped version:** 20.0.4
|
||||
**Shipped version:** 20.0.5
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
@ -81,30 +81,6 @@ If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/n
|
|||
¹ See https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html
|
||||
Use this only if you know what you're doing :)
|
||||
|
||||
#### Migrate from ownCloud
|
||||
|
||||
**This is not considered as stable yet, please do it with care and only for testing!**
|
||||
|
||||
This package handles the migration from ownCloud to Nextcloud. For that, your ownCloud application must be **up-to-date** in YunoHost.
|
||||
|
||||
You will then have to upgrade your ownCloud application with this repository. This can only be done from the command-line interface - e.g. through SSH. Once you're connected, you simply have to execute the following:
|
||||
|
||||
```bash
|
||||
sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh owncloud --debug
|
||||
```
|
||||
|
||||
The `--debug` option will let you see the full output. If you encounter any
|
||||
issue, please paste it.
|
||||
|
||||
Note that a cron job will be executed at some time after the end of this command. You must wait that before doing any other application operations! You should see that Nextcloud is installed after that.
|
||||
|
||||
Note that it does not change the application label nor the URL. To rename the label, you can execute the following - replace `Nextcloud` with whatever you want:
|
||||
|
||||
```bash
|
||||
sudo yunohost app setting nextcloud label -v "Nextcloud"
|
||||
sudo yunohost app ssowatconf
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
* Report a bug: https://github.com/YunoHost-Apps/nextcloud_ynh/issues
|
||||
|
|
27
README_fr.md
27
README_fr.md
|
@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
|||
[Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur.
|
||||
Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils.
|
||||
|
||||
**Version incluse :** 20.0.4
|
||||
**Version incluse :** 20.0.5
|
||||
|
||||
## Captures d'écran
|
||||
|
||||
|
@ -72,31 +72,6 @@ Et enfin, le message d'erreur suivant dans les logs de Nextcloud peut être igno
|
|||
Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/home/yunohost.multimedia/share/' not inside '/home/yunohost.multimedia/user/')
|
||||
```
|
||||
|
||||
## Informations supplémentaires
|
||||
|
||||
#### Migrer depuis ownCloud
|
||||
|
||||
**La migration n'est pas encore considérée comme stable, merci de la faire prudemment et uniquement pour tester !**
|
||||
|
||||
Ce package gère la migration de ownCloud vers Nextcloud. Pour ça, l'application ownCloud doit **être à jour** dans YunoHost.
|
||||
|
||||
Vous allez ensuite mettre à niveau votre ownCloud avec ce dépôt.
|
||||
Ça ne peut être fait qu'en ligne de commande - par exemple via SSH. Une fois connecté, vous n'avez plus qu'à exécuter la commande suivante :
|
||||
```bash
|
||||
sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh owncloud --debug
|
||||
```
|
||||
|
||||
L'option `--debug` va vous permettre de visualiser entièrement les retours de la mise à niveau. Si vous rencontrez un problème, merci de nous le transmettre.
|
||||
|
||||
Notez qu'une tâche cron va être exécutée une fois la fin de cette commande. Vous devez attendre qu'elle se fasse avant de faire une autre opération liée aux applications.
|
||||
Vous devriez constater que Nextcloud sera installé après ça.
|
||||
|
||||
Notez que ça ne changera pas le label ni l'URL. Pour renommer le label, vous pouvez exécuter la commande suivante (en remplaçant `Nextcloud` par ce que vous voulez) :
|
||||
```bash
|
||||
sudo yunohost app setting nextcloud label -v "Nextcloud"
|
||||
sudo yunohost app ssowatconf
|
||||
```
|
||||
|
||||
## Liens
|
||||
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/nextcloud_ynh/issues
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
# File to migrate from Owncloud
|
||||
|
||||
# Final path
|
||||
/var/www/$app
|
||||
|
||||
# Data directory
|
||||
/home/yunohost.app/$app
|
||||
|
||||
# Nginx config
|
||||
/etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# php-fpm config
|
||||
/etc/php5/fpm/pool.d/$app.conf
|
|
@ -1,45 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Ending the migration process from Owncloud to Nextcloud
|
||||
|
||||
set -u
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# SET VARIABLES
|
||||
#=================================================
|
||||
|
||||
old_app="__OLD_APP__"
|
||||
new_app="__NEW_APP__"
|
||||
script_name="$0"
|
||||
|
||||
#=================================================
|
||||
# MOVE HOOKS
|
||||
#=================================================
|
||||
|
||||
hooks_dir="/etc/yunohost/hooks.d/"
|
||||
mv "$hooks_dir/post_user_create/50-$old_app" "$hooks_dir/post_user_create/50-$new_app"
|
||||
|
||||
#=================================================
|
||||
# DELETE OLD APP'S SETTINGS
|
||||
#=================================================
|
||||
|
||||
ynh_secure_remove "/etc/yunohost/apps/$old_app"
|
||||
yunohost app ssowatconf
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE OLD USER
|
||||
#=================================================
|
||||
|
||||
ynh_system_user_delete $old_app
|
||||
|
||||
#=================================================
|
||||
# DELETE THIS SCRIPT
|
||||
#=================================================
|
||||
|
||||
echo "rm $script_name" | at now + 1 minutes
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Online storage, file sharing platform and various other applications",
|
||||
"fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications"
|
||||
},
|
||||
"version": "20.0.4~ynh1",
|
||||
"version": "20.0.5~ynh1",
|
||||
"url": "https://nextcloud.com",
|
||||
"license": "AGPL-3.0",
|
||||
"maintainer": {
|
||||
|
@ -14,7 +14,7 @@
|
|||
"email": "apps@yunohost.org"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.8.1"
|
||||
"yunohost": ">= 4.1.6"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
|
|
@ -65,6 +65,11 @@ if [ -z "$fpm_usage" ]; then
|
|||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
fi
|
||||
|
||||
# If phpversion doesn't exist, create it
|
||||
if [ -z "$phpversion" ]; then
|
||||
phpversion="$YNH_PHP_VERSION"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -89,46 +94,17 @@ then
|
|||
ynh_app_setting_delete $app backup_core_only
|
||||
|
||||
ynh_clean_setup () {
|
||||
# Remove the post migration script before its execution !
|
||||
ynh_exec_warn_less ynh_secure_remove --file="/tmp/owncloud_post_migration.sh"
|
||||
|
||||
# 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
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
fi
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# HANDLE MIGRATION FROM OWNCLOUD
|
||||
#=================================================
|
||||
|
||||
ynh_handle_app_migration "owncloud" "owncloud_migration"
|
||||
if [ $migration_process -eq 1 ]
|
||||
then
|
||||
# If a migration has been performed
|
||||
# Reload some values changed by the migration process
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
|
||||
# Remove the old fake package for owncloud.
|
||||
# Its name is specific, so the migration process can't remove it
|
||||
ynh_package_autopurge owncloud-deps
|
||||
|
||||
# Change the database access in the config
|
||||
ynh_replace_string "\('dbname' =>\).*" "\1 '$db_name'," "$final_path/config/config.php"
|
||||
ynh_replace_string "\('dbuser' =>\).*" "\1 '$db_name'," "$final_path/config/config.php"
|
||||
|
||||
# Change the path of the data directory
|
||||
ynh_replace_string "\('dbuser' =>\).*" "\1 '$db_name'," "$final_path/config/config.php"
|
||||
ynh_replace_string "\('datadirectory' =>.*\)$old_app" "\1$app" "$final_path/config/config.php"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -270,6 +246,17 @@ then
|
|||
# Print the current version number of Nextcloud
|
||||
exec_occ -V
|
||||
|
||||
|
||||
# Upgrade may fail if this app is enabled
|
||||
# Take all apps enabled, and check if mail is one of them
|
||||
# Then temporary disable the mail app
|
||||
mail_app_must_be_reactived=0
|
||||
|
||||
if exec_occ app:list | awk '/Enabled/{f=1;next} /Disabled/{f=0} f' | grep -q -w mail; then
|
||||
exec_occ app:disable mail
|
||||
mail_app_must_be_reactived=1
|
||||
fi
|
||||
|
||||
# While the current version is not the last version, do an upgrade
|
||||
while [ "$last_version" != "$current_version" ]
|
||||
do
|
||||
|
@ -372,6 +359,11 @@ then
|
|||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$nc_conf"
|
||||
ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$nc_conf"
|
||||
|
||||
# Reneable the mail app
|
||||
if [ $mail_app_must_be_reactived -eq 1 ]; then
|
||||
exec_occ app:enable mail
|
||||
fi
|
||||
|
||||
# Ensure that UpdateNotification app is disabled
|
||||
exec_occ app:disable updatenotification
|
||||
|
||||
|
@ -511,27 +503,6 @@ ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
|
|||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload
|
||||
|
||||
#=================================================
|
||||
# FINISH MIGRATION PROCESS
|
||||
#=================================================
|
||||
|
||||
if [ $migration_process -eq 1 ]
|
||||
then
|
||||
ynh_print_info --message="ownCloud has been successfully migrated to Nextcloud! \
|
||||
A last scheduled operation will run in a couple of minutes to finish the \
|
||||
migration in YunoHost side. Do not proceed any application operation while \
|
||||
you don't see Nextcloud as installed."
|
||||
|
||||
# Execute a post migration script after the end of this upgrade.
|
||||
# Mainly for some cleaning
|
||||
script_post_migration=owncloud_post_migration.sh
|
||||
ynh_replace_string --match_string="__OLD_APP__" --replace_string="$old_app" --target_file=../conf/$script_post_migration
|
||||
ynh_replace_string --match_string="__NEW_APP__" --replace_string="$app" --target_file=../conf/$script_post_migration
|
||||
cp ../conf/$script_post_migration /tmp
|
||||
chmod +x /tmp/$script_post_migration
|
||||
(cd /tmp; echo "/tmp/$script_post_migration > /tmp/$script_post_migration.log 2>&1" | at now + 2 minutes)
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Last available Nextcloud version
|
||||
next_version="20.0.4"
|
||||
next_version="20.0.5"
|
||||
|
||||
# Nextcloud tarball checksum sha256
|
||||
nextcloud_source_sha256="269f1622e326f5d11e387d3861aad4e2b0e79334ae97eed5a7b3352ba7661420"
|
||||
nextcloud_source_sha256="5c70dd33024012a1651fd099133d052d129a4dadc6935f44bb9c3e2b360befe3"
|
||||
|
|
Loading…
Add table
Reference in a new issue