Nextcloud/fr

From SME Server
Revision as of 17:10, 30 June 2022 by Gieres (talk | contribs) (Created page with "{{Languages}} <!-- here we define the contrib name variable --> <!-- we get the page title, remove suffix for translated version; if needed you can define there with the value...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search




nextcloud
Nextcloud Logo.svg
nextcloud logo
MaintainerUnnilennium
Urlhttps://nextcloud.com
LicenceAGPLv3
Category

Cloud

Tags cloudfilesdropboxseafilepydioajaxplorerowncloud


Mainteneur

Jean-Philippe Pialasse

Version

Devel 10:
Contrib 10:
Contrib 9:
smeserver-nextcloud
The latest version of smeserver-nextcloud is available in the SME repository, click on the version number(s) for more information.


Contrib 9:
nextcloud
The latest version of nextcloud is available in the SME repository, click on the version number(s) for more information.


Description

Nextcloud est un ensemble de logiciels client-serveur permettant de créer et d'utiliser des services d'hébergement de fichiers. Il est fonctionnellement similaire à Dropbox, bien que Nextcloud soit gratuit et « open-source », permettant à quiconque de l'installer et de l'utiliser sur un serveur privé.

Selon l'adage de SME Server « Keep It Simple » (Rester simple), tous vos baies d'information et dossiers personnels seront accessibles via l'interface « nextcloud » à l'aide de l'application « fichiers externes ». Vous aurez également votre dossier Nextcloud d'utilisateur principal enregistré sous /home/e-smith/files/owncloud/data qui se trouve dans la zone sauvegardée par défaut. Ainsi, vous pouvez désormais profiter à la fois de votre propre référentiel cloud et de l'accès aux mêmes fichiers sur votre partage Samba !

Comment ajouter mes utilisateurs SME ? Ils sont déjà là ! Dites leur simplement de se connecter à https://mon-domaine/nextcloud. Vous pouvez également ajouter des utilisateurs externes ou leur permettre de s'inscrire auprès d'une application nextcloud.

Quels sont les administrateurs ? Par défaut, vous avez un utilisateur nextcloudadmin et l'utilisateur administrateur habituel de SME. Le premier utilise le mot de passe que vous pouvez voir avec la commande « config getprop nextcloud AdminPassword », et le second, eh bien, utilisez simplement votre mot de passe administrateur habituel. Ensuite, vous pouvez gérer les applications, les référentiels de fichiers externes et l'appartenance au groupe d'administrateurs.

Installation

yum install smeserver-nextcloud --enablerepo=smecontribs

Vous pouvez avoir besoin d'un second « event » si quelquefois un répertoire de baie d'information n'était pas visible.

signal-event nextcloud-update

Vous n'avez pas besoin de suivre les pages des dépôts de fws et de remi-safe pour installer ces 2 dépôts qui sont nécessaires. Utilisez plutôt les paquets qui les installent, suivi d'un « yum-modify event ». Puis exécutez l'installation principale.

yum install smeserver-extrarepositories-remi-safe smeserver-extrarepositories-fws smeserver-extrarepositories-epel
signal-event yum-modify
yum install smeserver-nextcloud --enablerepo=smecontribs,epel,fws
signal-event webapps-update
service php-fpm start
service php71-php-fpm start
service php72-php-fpm start
service php73-php-fpm start
signal-event nextcloud-update

Vous pouvez éviter les du service php-fpm* s'il est déjà installé et fonctionne avant l'installation de nextcloud.

Puis vous pouvez faire ce qui suit et vous pouvez ignorer en toute sécurité le redémarrage « signal-event post-upgrade reboot » si vous y êtes invité, sauf si vous avez également installé d'autres paquets qui en ont besoin.

config set UnsavedChanges no

ou faire

signal-event post-upgrade 
signal-event reboot

puis

signal-event nextcloud-update

Si vous voulez ajouter l'administrateur de SME comme administrateur de nextcloud, faites :

 OCC group:adduser admin admin

Utiliser un domaine dédié pour se connecter à Nextcloud

Changer em premier lieu le contenu de la variable de la première ligne par votre domaine de nextcloud tel que défini par votre fournisseur DNS.

NEXTCLOUDDOMAIN="cloud.mon-domaine.com"
db domains set $NEXTCLOUDDOMAIN domain Description "Nextcloud" Content Primary Nameservers internet TemplatePath WebAppVirtualHost DocumentRoot /usr/share/nextcloud RequireSSL enabled letsencryptSSLcert enabled
signal-event domain-create cloud.mon-domaine.com

# Cette ligne permet au DAV de nextcloud d'être redirigé correctement :
config setprop nextcloud CloudDomain $NEXTCLOUDDOMAIN
# Cette ligne permet à collabora de reconnaître le domaine :
config setprop nextcloud VirtualHost $NEXTCLOUDDOMAIN
signal-event nextcloud-update

# Uniquement si vous utilisez un certificat Let's Encrypt :
expand-template /etc/dehydrated/domains.txt
dehydrated -c

Configuration

property default values
AdminPassword GENERATED string Mot de passe pour votre principal administrateur de nextcloud *
AdminUser nextcloudadmin string Utilisateur administrateur pincipal de votre installation *
DbName nextcloud string Pour mysql db
DbPassword GENERATED string Pour mysql db
DbUser nextcloud string Pour mysql db
TrustedDomains empty strings coma separated Ajoute un domaine ou une adresse ip qui doivent être nécessairement ajoutés à l'accès par défaut à nextcloud
CloudDomain empty domain name Duplication de VirtualHost, sera fusionné à VirtualHost dans une prochaine version, les 2 ne nécessitenr pas d'être configurés pour l'instant
VirtualHost empty Nom de domaine
access private privé, public
status enabled enabled,disabled
MaxUploadSize 4096M nombre Si un nombre doit être converti en mégabits, sinon, utiliser le suffixe habituel : 2T pour 2 terrabits, etc...
MemoryLimit 528M number Si un nombre doit être converti en mégabits, sinon, utiliser le suffixe habituel : 2T pour 2 terrabits, etc...
Shares enabled enabled,disabled Ajoute les partages samba de la contribution « shared-folders » dans les baies d'information nextcloud ainsi que dans les baies d'information normales
IncludeIbay empty strings coma separated Ajoute les noms des baies d'information qui ont besoin d'être incluses. S'il n'est pas vide, seul le nom indiqué ici sera accessible via nextcloud. A la priorité sur ExcludeIbay. Vous le définissez avec une chaîne aléatoire pour exclure tous les baies d'information et les partages de l'inclusion automatique.
ExcludeIbay Primary strings coma separated will exclude from nexcloud access any ibay via nextcloud. Default excludes Primary ibay. If you want to include Primary set it with a random string.
UseSMB enabled enabled,disabled allow you to set ibay access via samba share or via Local driver in nextcloud. Enabled is for samba, this allow you to access as your user and have your quota accounted. It might be a little slower, and need you to have your password loaded in the session. Local driver if disabled, will let you access only what apache user (www) has right to access as member of a group.
  • the SME admin user is also an admin of your nextcloud installation. You have two admin account as per default installation on SME Server.


example of setting :

 config setprop nextcloud ExcludeIbay ibay1,ibay2
 signal-event nextcloud-update

Command line

if you happen to need tweaking your installation, here is how to access the command line for Nextcloud on SME, we made it easier for you, just log as root and use the OCC command (using capitals), This command will execute for you what you need as the www user, using the needed version of php. Here two examples:

occ maintenance:mode --off
occ maintenance:repair

to seek for additional command consult Nextcloud documentation : https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html

Upgrade

yum  update smeserver-nextcloud nextcloud --enablerepo=smecontribs

Uninstall

yum remove smeserver-nextcloud  nextcloud

Change Database

If you are in the situation your are unable to update your nextcloud because of database requirements, you might need to install a newer and then migrate your db.

Here a simple procedure, after having the new db working as a sclo Mariadb105 for SME10 as example.

occ maintenance:mode --on
mysqldump `config getprop nextcloud DbName` > nextcloud.sql
echo "CREATE DATABASE IF NOT EXISTS `config getprop nextcloud DbName` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"| mysql105
mysql105 `config getprop nextcloud DbName`< nextcloud.sql
echo "CREATE USER IF NOT EXISTS `config getprop nextcloud DbUser`@localhost IDENTIFIED BY '`config getprop nextcloud DbPassword`';"| mysql105
echo "GRANT ALL PRIVILEGES ON `config getprop nextcloud DbName`.* TO `config getprop nextcloud DbUser`@localhost; FLUSH PRIVILEGES;" | mysql105
occ config:system:set dbhost --value localhost:/var/lib/mysql/mariadb105.sock --type string
occ maintenance:mode --off

After checking that all is working you can then delete yourself the old db from the previous mysql server, or keep it as a backup for a while. If it fails and just want to go back to previous state:

occ maintenance --on
occ config:system:set host --value localhost --type string
occ maintenance --off

Known issues

User cannot see shares/files

After a new install the admin user could see shares but not a user.

We had a single ibay and it was set:

Group Everyone
Write group
Read everyone

We created a new group called localusers and added the admin and single user.

We then set the ibay:

Group localusers
Write group
Read group

This appeared to fix the issue and the user could now see the files.

NC 20-21 : open_basedir restriction in effect. File(/templates/) is not within the allowed path

this is a bug in NC. It has been fixed in NC 22 and not backported to NC20. This is just log noise. You can ignore it while waiting to update see https://help.nextcloud.com/t/error-file-templates-is-not-within-the-allowed-path-s-after-update-from-20-xx-to-21-0-3/119843

Reset Database

For reference, whilst looking at resetting file caches I found this.

It is probably extremely dangerous but wanted to make a note.

https://github.com/nextcloud/server/issues/8113#issuecomment-565876798

Bugs

Please raise bugs under the SME-Contribs section in bugzilla and select the smeserver-nextcloud component or use this link


Below is an overview of the current issues for this contrib:

IDProductVersionStatusSummary (8 tasks)
12611SME Contribs10.0RESOLVEDupdate cron script with maintenance_window_start
12609SME Contribs10.0CONFIRMEDsmeserver-nextcloud S30nextcloud-occ-conf errors when run via ddclient panel
12487SME Contribs10.0CONFIRMEDupdate nextcloud fail2ban filter
12486SME Contribs10.0RESOLVEDocc requires /sbin/e-smith to be in the path
12406SME Contribs10.0CONFIRMEDNFR switch to PHP83 support for NC 29 and after
11169SME Contribs10alphaCONFIRMEDsmeserver-nextcloud requires a modify script
10590SME ContribsFuturCONFIRMEDNFR: limit access to some groups
10566SME Contribs10.0CONFIRMEDNFR: split action nextcloud-occ-conf

Changelog

Only released version in smecontrib are listed here.

smeserver-nextcloud Changelog: SME 10 (smecontribs)

2024/01/29 Jean-Philippe Pialasse 1.2.0-29.sme
- require nextcloud-src >= 26 [SME: 12318]

 multiple fixes and rewrites
- restore default log level [SME: 12412]

2023/09/09 Jean-Philippe Pialasse 1.2.0-28.sme
- workaround opcache segfault with php 81 using in memory only [SME: 12298]

- index file cache using Redis [SME: 12401]
2023/09/09 John Crisp 1.2.0-27.sme
- Fix syntax error in 20opcache.ini [SME: 12298]
2023/08/19 Jean-Philippe Pialasse 1.2.0-26.sme
- fix missing template-begin

2023/08/08 Jean-Philippe Pialasse 1.2.0-25.sme
- make php81 compatible for NC 25 and higher [SME: 12298]
- requires php81-redis [SME: 12401]
- recognize need cpuinfo access [SME: 12339]

- remove simple signup link [SME: 12329]

References

  1. https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html
  2. https://help.nextcloud.com/t/migration-from-mysql-to-mariadb/6816/3
  3. https://help.nextcloud.com/t/changing-mariadb-socket-when-hosting-multiple-db-ubuntu/68294
  4. https://markus-blog.de/index.php/2019/10/21/how-to-migrate-nextcloud-17-database-backend-from-mysql-to-postgresql/