Table des matières

Nextcloud

Nextcloud est un fork de Owncloud.

Installation

Prérequis

Installation sur un serveur Debian

Configuration de la base de données

Configuration de l'envoi des mails

  'mail_domain' => 'bidule.com',
  'mail_from_adress' => 'support'
  'mail_smtpdebug' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '',
  'mail_smtpport' => 587,
  'mail_smtptimeout' => 20,
  'mail_smtpsecure' => 'tls',
  'mail_smtpauth' => true,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'mail_template_class' => '\OC\Mail\EMailTemplate',
  'mail_send_plaintext_only' => false,

Pas encore réussi à faire marcher ça…

source: https://docs.nextcloud.com/server/13/admin_manual/configuration_server/config_sample_php_parameters.html#mail-parameters

Maintenance

Mettre nextcloud en maintenance :

root@Marvin:/var/www/simonlefort/cloud# sudo -u www-data php occ maintenance:mode --on

Sortir de la maintenance :

root@Marvin:/var/www/simonlefort/cloud# sudo -u www-data php occ maintenance:mode --off

Backup

Avec un rsync :

# rsync -lrtv --include ".*" /mnt/hetzner/data-simon/ /dossier/sauvegarde/

Applications

Passman

L'application passman permer de gérer ses mots de passe depuis Nextcloud. Il y a une extension pour Firefox (et Chrome).

Erreurs rencontrées

"Server replied: Service Unavailable"

La solution trouvée sur le forum de nextcloud.com :

# cd /dossier/de/nextcloud/
# sudo -u www-data ./occ files:scan --all
 
Scanning files for x users
Starting scan for user 1 out of x (user1)
Starting scan for user 2 out of x (user2)
Starting scan for user 3 out of x (user3)
Starting scan for user 4 out of x (user4)
(...)
 
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 3299    | 37944 | 00:07:00     |
+---------+-------+--------------+

Docker

$ cat docker-compose.yml 
version: '3'
 
services:
  nextcloud:
    image: nextcloud:16.0.4-fpm
    links:
      - database
    volumes:
      - nextcloud:/var/www/html/
    restart: always
  database:
    image: mariadb:10.3
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD='EPz6zjB5!r}xSze=:z56-*a~'
      - MYSQL_PASSWORD='v}A5:K?3JZ{.F#&YdJqkgdc#'
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
 
volumes:
  nextcloud:
  mariadb:

Et on lance :

# docker-compose up
Creating network "nextcloud_default" with the default driver
Creating volume "nextcloud_nextcloud" with default driver
Creating volume "nextcloud_mariadb" with default driver
Pulling database (mariadb:10.3)...
10.3: Pulling from library/mariadb
35c102085707: Pull complete
251f5509d51d: Pull complete
8e829fe70a46: Pull complete
6001e1789921: Pull complete
6bc078a5dcb0: Pull complete
4be519c4f814: Pull complete
647855e9b65b: Pull complete
e44db8874b85: Pull complete
7c6f5f838eb7: Pull complete
2c6ac0d09e1d: Pull complete
bad309e896c7: Pull complete
d0e3b74dbcd6: Pull complete
b7455e0ab09f: Pull complete
3c4168d73d11: Pull complete
Digest: sha256:2269c4fd6671574fbc1cae3e30840c219bed1797c430e70a8c16956d146215ac
Status: Downloaded newer image for mariadb:10.3
Pulling nextcloud (nextcloud:16.0.4-fpm)...
16.0.4-fpm: Pulling from library/nextcloud
1ab2bdfe9778: Pull complete
1448c64389e0: Pull complete
4b8a4e62b444: Pull complete
9eb9d1e8e241: Pull complete
b7aac27c4079: Pull complete
733740f60de6: Pull complete
2105771e2b29: Pull complete
de7014ad8aad: Pull complete
07a60a873600: Pull complete
ed5b29347ce0: Pull complete
0cd5ceabf475: Pull complete
29d6d7917f19: Pull complete
2e87ae764673: Pull complete
9ef82f4e77e7: Pull complete
93f33472bee4: Pull complete
d144687897e8: Pull complete
bc409af3e74e: Pull complete
Digest: sha256:ce4a3c19b4eca11a03cc4f96514f62cc780e41b26b90d7d29ffc2a62f850bf49
Status: Downloaded newer image for nextcloud:16.0.4-fpm
Creating nextcloud_database_1 ... error
 
ERROR: for nextcloud_database_1  Cannot start service database: AppArmor enabled on system but the docker-default profile could not be loaded: running `/usr/sbin/apparmor_parser apparmor_parser -Kr /var/lib/docker/tmp/docker-default097860693` failed with output: AppArmor parser error for /var/lib/docker/tmp/docker-default097860693 in /etc/apparmor.d/tunables/global at line 17: Could not open 'tunables/proc'
 
error: exit status 1
 
ERROR: for database  Cannot start service database: AppArmor enabled on system but the docker-default profile could not be loaded: running `/usr/sbin/apparmor_parser apparmor_parser -Kr /var/lib/docker/tmp/docker-default097860693` failed with output: AppArmor parser error for /var/lib/docker/tmp/docker-default097860693 in /etc/apparmor.d/tunables/global at line 17: Could not open 'tunables/proc'
 
error: exit status 1
ERROR: Encountered errors while bringing up the project.

AppArmor fout la merde…