Nextcloud: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
m (copyedits)
(install link)
Line 85: Line 85:
Unlike [https://curl.haxx.se/ curl], [https://rclone.org rclone] lets you create a configuration once for each remote and use it repeatedly without having to enter the remote host details and your password every time. The password will be stored encrypted on your computer in ~/.config/rclone/rclone.conf.
Unlike [https://curl.haxx.se/ curl], [https://rclone.org rclone] lets you create a configuration once for each remote and use it repeatedly without having to enter the remote host details and your password every time. The password will be stored encrypted on your computer in ~/.config/rclone/rclone.conf.


First, install rclone on your computer via your favourite package manager, e.g. via [https://brew.sh Homebrew] on MacOS.
First, [https://rclone.org/install/ install rclone on your computer].


Next, configure a remote. Run the command:
Next, configure a remote. Run the command:

Revision as of 14:41, 17 May 2024

Other languages:

Introduction[edit]

We now provide Nextcloud, a Dropbox-like cloud storage service, for all Alliance users. You can use your Alliance username and password to log in to the Nextcloud server. A complete Nextcloud user manual is available from docs.nextcloud.com. Another manual is available as a PDF document under your account once you connect. All data transfers between local devices and Alliance's Nextcloud are encrypted.

The Nextcloud service is aimed at users with relatively small datasets (up to 100 GB). For anything larger, the Globus service is much to be preferred.

If you are not familiar with the concept of Nextcloud, you may try the online demo on the Nextcloud website.

We recommend taking this opportunity to take a look at your data and do some cleanup: remove data you no longer need, check with whom you share your data, etc.

Alliance Nextcloud service description[edit]

  • Server URL: https://nextcloud.computecanada.ca
  • Server Location: Simon Fraser University, Burnaby, BC
  • Fixed Quota: 100 GB per user
  • Backup Policy: Daily backup without offsite copy
  • Access Methods: Web interface, Nextcloud Desktop Sync Client, Nextcloud mobile apps, and any WebDAV client
  • Documentation: PDF and online

Using the Nextcloud web interface[edit]

To use the web interface, log in to Alliance Nextcloud from a web browser using your Alliance username and password. You can upload and download files between your desktop (or laptop) and Nextcloud, edit files, and share files with other Alliance users. For more information, please refer to the Nextcloud user manual.

Using Nextcloud Desktop Synchronization Client and mobile apps[edit]

Once installed on your devices, this client will "sync" everything between your Nextcloud folder and your desktop/mobile device folder. Please note, it may take some time to sync all data. You can make changes to files locally on your device and they will be updated in Nextcloud automatically. You can download the Nextcloud Desktop Sync Client and Nextcloud mobile apps for iOS devices and Android devices from https://nextcloud.com/install/.

Using WebDAV clients[edit]

In general, you can use any WebDAV clients to "mount" a Nextcloud folder to your desktop using the following WebDAV URL: https://nextcloud.computecanada.ca/remote.php/webdav/

Once mounted, you can drag and drop files between the WebDAV drive and your local desktop.

Mac OSX: Select Go -> Connect to the Server, enter the WebDAV URL for the Server Address, and click Connect. You will be asked for your username and password to log in. After authentication, you will see a WebDAV drive on your desktop.

Windows: Use the "Map Network Drive ..." option, select a drive letter, then use WebDAV URL https://nextcloud.computecanada.ca/remote.php/webdav/ in the Folder field.

You may also consider using Cyberduck or other clients instead. Cyberduck is available for OSX and Windows.

Linux: There are many WebDAV applications available for Linux, please consult the Nextcloud user manual for recommendations.

Detail: WebDAV vs Synchronization Client[edit]

The WebDAV clients mount your Nextcloud storage on your desktop. Files are not copied, e.g., when you edit a file you edit the original file on the Alliance Nextcloud system at Simon Fraser University.

When you connect with a Synchronization client, the first thing the client does is synchronize your files stored in the Alliance Nextcloud system with a copy of those files on your own desktop or laptop. All files that are different get downloaded to your own client. When files are changed, they are re-copied to all the synchronized systems to ensure that the files are the same everywhere. The synchronization copies can take a lot of time when you (and/or your collaborators) change files frequently. The advantage is that you can work on the files offline, i.e., when you do not have network connectivity. They will be synchronized when network connectivity is re-established.

Using UNIX command line tools[edit]

You can also use any available WebDAV command line clients, like curl and cadaver, to copy files between your host and Nextcloud. Command line tools are useful when you copy data between a remote host you log in to and Nextcloud.

curl is usually installed on Mac OSX and Linux systems and can be used to upload and download files using an URL.

Upload a file using curl[edit]

Question.png
[name@server ~]$ curl -k -u <username> -T <filename> https://nextcloud.computecanada.ca/remote.php/webdav/

Download a file using curl[edit]

Question.png
[name@server ~]$ curl -k -u <username> https://nextcloud.computecanada.ca/remote.php/webdav/<filename> -o <filename>

Upload and download files using rclone[edit]

Unlike curl, rclone lets you create a configuration once for each remote and use it repeatedly without having to enter the remote host details and your password every time. The password will be stored encrypted on your computer in ~/.config/rclone/rclone.conf.

First, install rclone on your computer.

Next, configure a remote. Run the command:

$ rclone config

There you have an option to edit an existing remote, create a new remote, delete a remote, and so on. Let's say we want to create a new remote called "nextcloud":

choose "n"  for "New remote"
Enter name for new remote --> nextcloud
Type of storage to configure --> 52 / WebDAV
URL of http host to connect to --> https://nextcloud.computecanada.ca/remote.php/dav/files/<your CCDB username>
Name of the WebDAV site/service/software you are using --> 2 / Nextcloud
User name --> <your CCDB username>
choose "y" for "Option pass"
Password --> <your CCDB password>
Leave "Option bearer_token" empty
choose "no" for "Edit advanced config"
choose "yes" for "Keep this 'nextcloud' remote"
choose "q" to quit config

Now you should be able to see your new remote in the list of configured remotes:

$ rclone listremotes

You can probe available disk space with:

$ rclone about nextcloud:

To upload a file, run:

$ rclone copy /path/to/local/file nextcloud:remote/path

To download a file, run:

$ rclone copy nextcloud:remote/path/file .

Sharing files using Nextcloud[edit]

When you select a file or directory to share, type the user’s first name, last name, or username and the list of matched users registered in CCDB will be displayed in “Firstname Lastname (username)” format. Please review the name carefully as some are very similar; in doubt, enter the username which is unique. You can also share files with a group using their CCDB group name (default, RPP, RRG, or other shared groups). To share a file with people who don’t have a Alliance account, use the Share link option and provide their email address. Nextcloud will send an email notification with a link to access the file.