diff --git a/README.md b/README.md index f0153fe..3c48bca 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # Nextcloud for YunoHost -[![Integration level](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) +[![Integration level](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) [![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) +*[Lire ce readme en français.](./README_fr.md)* > *This package allow you to install Nextcloud quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* @@ -13,7 +14,7 @@ own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 18.0.2 +**Shipped version:** 18.0.4 ## Screenshots @@ -24,25 +25,37 @@ you can synchronize your files over your devices. * [YunoHost demo](https://demo.yunohost.org/nextcloud/) * [Official demo](https://demo.nextcloud.com/) -## Configuration - ## Documentation * Official documentation: https://docs.nextcloud.com/server/18/user_manual/ - * YunoHost documentation: https://github.com/YunoHost/doc/blob/master/app_nextcloud_fr.md + * YunoHost documentation: https://github.com/YunoHost/doc/blob/master/app_nextcloud.md + +## Configuration + +#### Configure OnlyOffice integration + +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`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (an URL might be defined by default, but is not always correct). Please note the **`/index.php/`**. Keep others server parameters empty. Save it. +- You can also 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** (Raspberry Pi, …) is **not** supported* ## YunoHost specific features In addition to Nextcloud core features, the following are made available with this package: - * Integrate with YunoHost users and SSO - i.e. logout button + * Integrate with YunoHost users and SSO - i.e logout button * Allow one user to be the administrator (set at the installation) * Allow multiple instances of this application * Optionally access the user home folder from Nextcloud files (set at the installation, the sharing is enabled by default) * Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's - not already served - i.e. by Baïkal + not already served - i.e by Baïkal #### Multi-users support @@ -68,6 +81,15 @@ Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/h ## Additionnal informations +#### `occ` command usage + +If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/nextcloud/` folder (or `/var/www/nextcloud__n/` depending on your instance number in case of multiple concurrent installations), then use `sudo -u nextcloud php7.3 occ` instead of `occ` (as an alternative, you can use `/var/www/nextcloud/occ` to run the command from another directory). + +*NB: You may need to adapt `php7.3` to the PHP version that Nextcloud is using. Starting from Nextcloud 18, YunoHost uses php7.3, it used before php7.0.* + +¹ 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 diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..1adf19e --- /dev/null +++ b/README_fr.md @@ -0,0 +1,119 @@ +# Nextcloud pour YunoHost + +[![Niveau d'integration](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) +[![Installer Nextcloud avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) + +*[Read this readme in english.](./README.md)* + + +> *Ce package vous permet d'installer Nextcloud rapidement et simplement sur un serveur Yunohost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* + +## Vue d'ensemble + +[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 :** 18.0.4 + +## Captures d'écran + +![](https://raw.githubusercontent.com/nextcloud/screenshots/master/files/Files%20Overview.png) + +## Démo + +* [Démo YunoHost](https://demo.yunohost.org/nextcloud/) +* [Démo officielle](https://demo.nextcloud.com/) + +## Documentation + + * Documentation officielle : https://docs.nextcloud.com/server/18/user_manual/ + * Documentation YunoHost : https://github.com/YunoHost/doc/blob/master/app_nextcloud_fr.md + +## Configuration + +#### Configurer l'intégration d'OnlyOffice + +À partir de sa version 18, Nextcloud intégre une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud. +Pour l'installer et le 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`), vous devez le configurer avec l'URL suivante `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (une URL peut-être préremplie, mais elle n'est pas toujours correcte). Veuillez noter la présence de **`/index.php/`**. Laissez les autres paramètres vides. Sauvegardez. + - Vous pouvez aussi 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 - **ARM** (Raspberry Pi, …) n'est **pas** supporté* + +## Caractéristiques spécifiques YunoHost + +En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suivantes sont incluses dans ce package : + + * Intégration avec les utilisateurs YunoHost et le SSO - exemple, le bouton de déconnexion + * Permet à un utilisateur d'être l'administrateur (choisi à l'installation) + * Permet de multiples instances de cette application + * Accès optionnel au répertoire home depuis les fichiers Nextcloud (à activer à l'installation, le partage étant activé par défaut) + * Utilise l'adresse `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - par exemple, baikal + +#### Support multi-utilisateurs + +#### Architectures supportées + +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nextcloud/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nextcloud/) + +## Limitations + +Pour intégrer le bouton de déconnexion du SSO, nous devons patcher les sources de Nextcloud. +En attendant un intégration de leur part, la vérification d'intégrité du code source est désactivée pour ne pas avoir de message d'avertissement. + +Notez également que nous avons choisi de désactiver les applications tierces-parties lors des mises à jour. Ça permet d'éviter une installation de Nextcloud instable - ou qui pourrait planter. +Vous devrez juste les réactiver manuellement après chaque mise à jour. + +Et enfin, le message d'erreur suivant dans les logs de Nextcloud peut être ignoré sans problème : +``` +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 +``` + +## Links + + * Signaler un bug : https://github.com/YunoHost-Apps/nextcloud_ynh/issues + * Site web de Nextcloud : https://nextcloud.com/ + * Dépôt de Nextcloud : https://github.com/nextcloud/server + * Site web de YunoHost : https://yunohost.org/ + +--- +Informations pour les développeurs +---------------- + +Merci de faire votre « pull request » sur la [branche testing](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). +Pour tester la branche testing, faites comme ceci. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug +ou +sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug +``` diff --git a/actions.toml b/actions.toml new file mode 100644 index 0000000..38c52a8 --- /dev/null +++ b/actions.toml @@ -0,0 +1,8 @@ +[disable_maintenance] +name = "Disable the maintenance mode of Nextcloud" +command = "/bin/bash scripts/actions/disable_maintenance" +# user = "root" # optional +# cwd = "/" # optional +# accepted_return_codes = [0, 1, 2, 3] # optional +accepted_return_codes = [0] +description = "Disable the maintenance mode of Nextcloud if you're stuck after an upgrade" diff --git a/conf/config.json b/conf/config.json index 2e7aca8..7d24587 100644 --- a/conf/config.json +++ b/conf/config.json @@ -10,7 +10,8 @@ "port": "6379", "timeout": "0.0", "password": "" - } + }, + "hashing_default_password": true }, "apps": { "user_ldap": { diff --git a/conf/nginx.conf b/conf/nginx.conf index 8f2b3fb..c4b73e1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,18 +4,24 @@ location = /.well-known/carddav { location = /.well-known/caldav { return 301 https://$server_name__PATH__/remote.php/dav; } -location = /.well-known/host-meta { - return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta; -} -location = /.well-known/host-meta.json { - return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta-json; -} -location = /.well-known/webfinger { - return 301 $scheme://$host:$server_port__PATH__/public.php?service=webfinger; -} -location = /.well-known/nodeinfo { - return 301 $scheme://$host:$server_port__PATH__/public.php?service=nodeinfo; -} + +# The following 2 rules are only needed for the user_webfinger app. +# Uncomment it if you're planning to use this app. +#location = /.well-known/host-meta { +# return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta; +#} +#location = /.well-known/host-meta.json { +# return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta-json; +#} + +# The following 2 rules are only needed for the Social app. +# Uncomment it if you're planning to use this app. +#location = /.well-known/webfinger { +# return 301 $scheme://$host:$server_port__PATH__/public.php?service=webfinger; +#} +#location = /.well-known/nodeinfo { +# return 301 $scheme://$host:$server_port__PATH__/public.php?service=nodeinfo; +#} #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location ^~ __PATH__/ { diff --git a/manifest.json b/manifest.json index 9976a6e..c3cc160 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "18.0.2~ynh1", + "version": "18.0.4~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/actions/disable_maintenance b/scripts/actions/disable_maintenance new file mode 100755 index 0000000..0ea0edb --- /dev/null +++ b/scripts/actions/disable_maintenance @@ -0,0 +1,52 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source scripts/_common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +app=$YNH_APP_INSTANCE_NAME + +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +#================================================= +# CHECK IF ARGUMENTS ARE CORRECT +#================================================= + +#================================================= +# CHECK IF AN ACTION HAS TO BE DONE +#================================================= + +# Check the current status of the maintenance mode + +if [ "$(grep "maintenance" "$final_path/config/config.php" | awk '{print $3}' | cut -d',' -f1)" != "true" ] +then + ynh_die --message="Nextcloud isn't currently under maintenance." --ret_code=0 +fi + +#================================================= +# SPECIFIC ACTION +#================================================= +# DISABLE THE MAINTENANCE MODE +#================================================= + +ynh_script_progression --message="Disabling maintenance mode..." --weight=3 + +( +cd "$final_path" && exec_as "$app" \ + php$YNH_PHP_VERSION occ --no-interaction --no-ansi maintenance:mode --off +) + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Execution completed" --last diff --git a/scripts/config b/scripts/config index b0314f0..d06b98b 100644 --- a/scripts/config +++ b/scripts/config @@ -14,7 +14,7 @@ source _ynh_add_fpm_config # RETRIEVE ARGUMENTS #================================================= -app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} +app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD VALUES diff --git a/scripts/upgrade b/scripts/upgrade index bcc8182..8d109b4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -151,9 +151,12 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." - ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" # Delete current nginx configuration to be able to check if .well-known is already served. -ynh_remove_nginx_config $YNH_PHP_VERSION +ynh_remove_nginx_config ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$app.conf" +# Wait untils nginx has fully reloaded +ynh_systemd_action --service_name=nginx --action=reload --line_match="Reloaded" --log_path="systemd" + # 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 @@ -292,7 +295,7 @@ then # Upgrade Nextcloud (SUCCESS = 0, UP_TO_DATE = 3) exec_occ maintenance:mode --off exec_occ upgrade \ - || ([ $? -eq 3 ] || ynh_die --message="Unable to upgrade Nextcloud") + || [ $? -eq 3 ] || ynh_die --message="Unable to upgrade Nextcloud" # Get the new current version number current_version=$(grep OC_VersionString "$final_path/version.php" | cut -d\' -f2) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 24a1692..6a77d34 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="18.0.2" +next_version="18.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="d033660923dd27106ec64bff0e3afa2f595bd1b9661b7ea7882a1a33006ecb81" +nextcloud_source_sha256="fad8e12632b352247ffc5ae181d4e414d732b9072caa0401774cfdb93a714329" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () {