Working with Nextcloud

Working with Netcloud

Introduction

This manual contains different Nextcloud tips and tricks, as well as on integration of your cloud-based third-party applications. Please refer to this manual to install Netcloud.

Files

File preview

File types

Similar to file managers, Nextcloud can create thumbnails with a preview for pictures, video and audio files, text documents, and so on. Learn more here. To enable video preview, edit the configuration file by turning on thumbnails for all types of image and video files:

/var/calculate/www/nextcloud/htdocs/config/config.php

'enabledPreviewProviders' => array (
    'OC\\Preview\\Movie',
    'OC\\Preview\\Image'
),

To extract the preview from a video file, install the ffmpeg package:

emerge ffmpeg

Size

You should limit the size of the previews, otherwise all your images will be cached in the original size. To do so, add the following lines:

/var/calculate/www/nextcloud/htdocs/config/config.php

'preview_max_x' => 512,
'preview_max_y' => 512,

Cache update

For faster access to directories with thumbnail files, keep the cache up-to-date with [Preview Generator] (https://github.com/rullzer/previewgenerator), which is provided by Nextcloud and can be installed in the "Multimedia" section.

Once installation completed, run:

su nginx -s /bin/bash

cd /var/calculate/www/nextcloud/htdocs

php occ preview:generate-all

If you have many image files stored in one directory, you may need to increase the size of RAM allocated for PHP. To do so, edit the value of the memory_limit variable:

/etc/php/cli-php7.1/php.ini

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 512M

File naming

By default, the Nextcloud client loads the camera pictures in one dedicated directory on the cloud, naming them somewhat like this: IMG_20180806_124329_1.jpg, where "20180806" stands for YYYYMMDD, "124329" stands for HHMMSS, "1" stands for the second pic made at same second.

Pictures imported from the social media can though be random, as in "MY0bLxnxTaM.jpg". If they are photos (not drawings or screenshots), you can extract the time from the file's EXIF data. To do so, use the exiv2 utility, included in media-gfx/exiv2:

exiv2 -F -r'IMG_%Y%m%d_%H%M%S' rename -- *.jpg

To check all pics, you can replace the path for the renamed:

mkdir new; exiv2 -F -r'new/IMG_%Y%m%d_%H%M%S' rename -- *.jpg

As a result, there may remain screenshots and processed photos in the source directory, which you can easily separate from the original pictures.

This naming has several advantages.

  1. When merging photos from different cameras or memory cards, it is very unlikely that you encounter two identical names, which means you can easily put files into one directory after processing them.
  2. Photos will always be arranged in chronological order. You can store photos from different sources in one place.
  3. When merging cropped photos downloaded from the cloud and the originals, the file names will be the same. This means that after merging into one directory you will heve no duplicates and the cropped pictures will be replaced correctly.

If the filename extension was in capitals, you can lowercase it with the following command:

rename .JPG .jpg *.JPG

File creation date and time

When you copy photos, the file modification time may change. This is not convenient, because information about the time when the picture was taken gets lost. You can restore the time of file creation by retrieving EXIF information with the exiv2 tool, that was described above. To fetch it, go to the pictures directory and run:

exiv2 -T *.jpg

Reset the index to validate.

A viewer for Android

To manage your photos stored on Nextcloud, you can install the QuickPic gallery application.

Music

An audio player for Android

To play music your files stored on Nextcloud you can use the Soumi: Network Music Player. Besides allowing to play audio files stored on the cloud, this music player has its own play-list cache, as shown on the screenshot below:

Soumi: Network Music Player

Site password storage

We recommend Passman for storing passwords in Nextcloud. Passman creates an encrypted storage in your own cloud. Several storages of this type can be used simultaneously. For interaction with the password storage, you can use the password storage extensions developed for Firefox (including the mobile version) and Chrome. When connecting to the storage in the cloud, you create a password to encrypt the connection data:

Passman

Passman looks for authorization fields on the site and adds its icon to them. If there is a saved password, the fields will be filled in, as in: on the screenshot below:

Authenticate

Page bookmarks

To work with bookmarks in Nextcloud, use the Bookmarks application. Instead of the usual tree structure, it uses tags to find bookmarks. You can install the Bookmark extension FreedomMarks for Firefox or Chromium to access your bookmarks:

FreedomMarks

There is also the [Nextcloud Bookmarks] application (https://play.google.com/store/apps/details?id=org.schabi.nxbookmarks) for Android, to access bookmarks. It uses tags as well.

If you stick to the classic approach to storing bookmarks, you can use the floccus extension. This extension adds its tag to each tab, together with the nesting level.

GPS navigation

To work with GPS navigation, use can use [PhoneTrack] (https://apps.nextcloud.com/apps/phonetrack) that allows you to import routes from files with the .gpx extensiongpx так и отслеживать положение устройств в режиме реального времени.

PhoneTrack configuration

All devices from which you need to receive data can be combined into groups, or sessions. A session is created and then it is necessary to reserve a device in it.

PhoneTrack

On the screenshot above, a "Family" group was created, containing three reserved devices, each of them has a name and a label.

In the next tab, all possible URLs for data transmission in real time are listed. Each option has an exclamation mark next to it. Click on it to get the link to be specified. The device label must also be specified.

PhoneTrack

Below a GPS Logger configuration is described as an example.

GPS logger configuration

GPS Logger saves routes to a .gpx file,gpx и передавать их как в ручном режиме так и в автоматическом. It is possible to send coordinates in real time.

{3bf1d273b31c29615fa229f37ea351b0

GPS Logger

The check-up includes a HTTP Test and log check-up.

GPS Logger

GPS Logger

On the screenshots below a successful test and the log contents are shown, informing the user that the coordinates have been defined and forwarded to the specified address.

The data is written to your database. The device will immediately appear in the list as a colored circle with the first letter of the device name inside.

Note

{82bf8bbf257b6c1b0e0f962dddf48c1e

{e86e4198e89a07711f8907aa8dcf8fa9

{a35e0798e11457c626a0f828c7558ae6 {6369407da2fa199e241a8368b6829a42
{fc0d703efd53b844e3dd95efcb5e6ad8

{ea9bf856d8d00a4a7bc5feb3cbb4185c

{f0727a7ea06feaf44ff0cb210b060870

{574664260eab625d77ef134727d5ff20

{21f1f88f88ba41458e5aa2f065d0d9c9

{53dc1458d1dba1721decd0d435ec3f4d

{045c3ac0d0494e5d1bd057330a539501

{4f8c1753b8f2da1180f6ec487c6d0e2d

{2a273c4a0b6b8021e52460fc701650fd

{12261a9fb50f4325d8aaa7183b3e314a

{d5889ca02d5cc15654661e0a53365a93

{e33c6d292e9f3085b80406b9db012179

Note

{78bf88d7900fbb8ea7fac9e65c4e6414 {51ec7395155d2a50b686d42b4d0bd03f

{339755c070147e04994944364c8281f9

{b4ca3eadc2eb9752791ceff8d20bcec8

{2979edd4a27b741c59dd7f1df29b150d

{f2c15fc945053d717a9752c724939d68

{8291fda3c34a093f474f5406d07121a4 {5abee12e3e3e7147182a2cc2e4f4a24c

{c888a0b0c869406b4d09bddfdadff4fc

{f7764b0797b42b9aec63fb8136e21d5a

{b62764f969c89a1e73ec364e536fe183

{cc7ae17468072c2aa3159a7aec50797b

{8356c05fca57785ab1113c3f09204087

{4f4c6161c72386b9e1514e7460cbc5bb
{b63125e32d904dd210c47e4fef8b2de9

Administration

Database reindexing

You should update your Nextcloud database whenever you copy or forward files, modify access rights or edit files directly on the server, not via the Nextcloud Web interface of WebDAV. To so, run:

If you have direct access to Nextcloud files (not via WebDAV or a Web interface), do not forget to re-scan the files. To so, run:

su nginx -s /bin/bash

cd /var/calculate/www/nextcloud/htdocs

php occ files:scan user

Replace user with your login.