How to test …

This page should explain how to test given features in Nextcloud.

Redis

First you need to install the phpredis extension . There is a install document available inside the repo and many linux distribtutions ship it in their repositories as well.

pecl install redis

Cluster

For a local Redis cluster setup there are some docker script collected in this repository. It boils down to clone the repo and run make up. Then the redis cluster is available at localhost:7000.

Following config.php can be used:

  1. 'memcache.distributed' => '\OC\Memcache\Redis',
  2. 'redis.cluster' => [
  3. 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required
  4. 'localhost:7000',
  5. ],
  6. 'timeout' => 0.0,
  7. 'read_timeout' => 0.0,
  8. 'failover_mode' => \RedisCluster::FAILOVER_ERROR,
  9. ],

SMB

  1. mkdir /tmp/samba
  2. docker run -it -p 139:139 -p 445:445 \
  3. -v /tmp/samba:/smbmount dperson/samba \
  4. -u "user;password" -s "public;/smbmount;yes;no;yes"

Make sure that smbclient is installed on your Nextcloud server and has the following configuration:

  1. # /etc/samba/smb.conf
  2. [global]
  3. client min protocol = SMB2
  4. client max protocol = SMB3
  5. hide dot files = no

The setup can be verified with

  1. smbclient //127.0.0.1/public -u user

SAML setup with onelogin

Collabora without SSL

1) Start Collabora in a docker container

  1. docker run -p 127.0.0.1:9980:9980 -e 'domain=172.17.0.1' \
  2. -e 'username=admin' -e 'password=487903ffcf4' \
  3. -e extra_params='--o:ssl.enable=false' \
  4. --restart always --cap-add MKNOD collabora/code
  • 172.17.0.1 is localhost, which is default by Docker
  • get IP of Collabora container: docker inspect –format=’{{ .NetworkSettings.IPAddress }}’ $containerName

2) Configure Nextcloud

  • go to your local cloud (e.g. 172.17.0.1/nc) -> Settings -> Collabora

    • set URL to IP you found out above, e.g: http://172.17.0.2:9980
    • check “Disable certificate verification (insecure)

3) Use

  • please note that you cannot use it with localhost, but you have to enter a valid IP address of localhost
  • with this approach you can also use it with mobile clients

4) Troubleshoot

  1. {"convert-to":{"available":false},"hasMobileSupport":true,"hasTemplateSaveAs":true,"productName":"Collabora Online Development Edition"}

OnlyOffice

  1. Create self signed cert, should be on a permanent path:

    1. mkdir -p /tmp/oo/certs
    2. cd /tmp/oo/certs
    3. openssl genrsa -out onlyoffice.key 4096
    4. openssl req -new -key onlyoffice.key -out onlyoffice.csr
    5. openssl x509 -req -days 3650 -in onlyoffice.csr -signkey onlyoffice.key -out onlyoffice.crt
    6. openssl dhparam -out dhparam.pem 4096
    7. chmod 400 onlyoffice.key
    8. chmod 400 onlyoffice.crt
    9. chmod 400 onlyoffice.csr
    10. chmod 400 dhparam.pem
  2. Start docker, important: do not use certs folder, but parent folder:

    1. docker run --name=ONLYOFFICEDOCKER -i -t -d -p 4433:443 \
    2. -e JWT_ENABLED='true' -e JWT_SECRET='secret' --restart=always \
    3. -v /tmp/oo/:/var/www/onlyoffice/Data onlyoffice/documentserver
  3. Go into docker container:

    • docker exec -it ONLYOFFICEDOCKER /bin/bash
    • apt-get update
    • apt-get install vim -y
    • vim /etc/onlyoffice/documentserver/default.json

      • change rejectUnauthorized to false
    • vim /etc/onlyoffice/documentserver/local.json

      • change token -> inbox -> header to “AuthorizationJWT”
      • change token -> outbox -> header to “AuthorizationJWT”
    • Add the following to your config.php

    1. 'onlyoffice' => array (
    2. 'verify_peer_off' => true,
    3. 'jwt_secret' => 'secret',
    4. 'jwt_header' => 'AuthorizationJWT'
    5. ),

Test with local ip: https://localhost:4433

  • accept cert warning
  • verify that “Document Server is running” is shown

Test with Nextcloud

  • download & enable OnlyOffice app

  • configure: