Setup ownCloud Infinite Scale Server
Build and setup your own oCIS server as NAS.
history
History
Published at Tue, 08 Oct 2024 14:00:00 GMT
nas
owncloud

Intro

Before this?

I want to have my own NAS with my own data and quota under my control. Then I set up my own NextCloud server on my Banana Pi F3 with Spacemit K1 RISC-V processor. And the reverse proxy is provided by Cloudflare network.

But the NextCloud server is implemented in PHP. And the processor Spacemit K1’s performance is mediocre. To improve the throughput, I decided to try oCIS.

Why oCIS?

I had once used my friend’s ownCloud instance back in 2015. This also constitutes my impression of ownCloud before 2024. Then I was surprised by the decision that ownCloud made: turn to the Go!

And, oCIS does not require external database. It simplifies the setup.

ownCloud Infinite Scale ensures better performance and scalability. This is made possible by the new implementation in Go, a microservice architecture and the high-performance file system EoS developed at CERN.

The next ownCloud version should be a revolution and not merely evolution. Consequent to this decision, ownCloud Infinite Scale is a complete modernization of ownCloud in Go.

The new architecture indeed achieves what the developers hope for – faster response, much better scalability and interfaces for enterprise features that supercedes the functions of its predecessor. Of course, Infinite Scale is also a bet on the future. The act of leaving the PHP community behind is courageous, all the more so because ownCloud was well rooted in the PHP world.

Go, Cloud, Go! from ownCloud Blog.

I was attracted by its better performance.

Problems

However, the ownCloud Infinite Scale has a disadvantage, which is that it does not support access from multiple domain names, otherwise there will be some unsolvable problems in the authorization process.

It means I can’t access it from both my home lab LAN and Cloudflare at the same time. So I still use NextCloud as the intranet and leave-home backup solution. And ownCloud as the leave-home hot backup solution.

Resources

Here is the list of environment variables used by oCIS.

Build

oCIS is written in Golang. Which means it is highly portable and can be running on many machine targets.

Environment

I’ve built deployed oCIS on ArchLinux on Spacemit K1.

Toolchain

Go toolchain is required to build oCIS source code.

Source

While building web interface assets, the heap allocated to Node.js programs running in pnpm must be enough or may cause Out-Of-Memory during build process.

At the final build process, all web client assets will be bundled in to the Go program ocis.

# Get the source
git clone git@github.com:owncloud/ocis.git

# Enter the source repository
cd ocis

# Set max heap size for Node.js
export NODE_OPTIONS=--max_old_space_size=4096

# Generate web client assets
make generate

# Build the oCIS
make -C ocis build

# Copy oCIS to $PATH
cp ./ocis/bin/ocis /bin/

Customize web client (optional)

ownCloud provides a reference to build web client.

Configure

This is an example of configuration for owncloud.jellyterra.com below.

Initialize oCIS data directory

ocis init
Do you want to configure Infinite Scale with certificate checking disabled?
 This is not recommended for public instances! [yes | no = default] 

=========================================
 generated OCIS Config
=========================================
 configpath : /home/owncloud/.ocis/config/ocis.yaml
 user       : admin
 password   : VKVmzQ.G+K*smdFCm^-RRuU73kSJjfPp

It will initialize one .ocis directory in $HOME. This directory contains all the configuration, metadata and storage used by oCIS. And self-signed certificate, keypair.

Configure web frontend

config.json

This file will fetched by web client as configuration.

Sample from oCIS repository: config.json

{
  "server": "https://owncloud.jellyterra.com",
  "theme": "https://owncloud.jellyterra.com/themes/owncloud/theme.json",
  "openIdConnect": {
    "metadata_url": "https://owncloud.jellyterra.com/.well-known/openid-configuration",
    "authority": "https://owncloud.jellyterra.com",
    "client_id": "web",
    "response_type": "code",
    "scope": "openid profile email"
  },
  "apps": [
    "files",
    "preview",
    "pdf-viewer",
    "search",
    "text-editor",
    "external",
    "admin-settings",
    "epub-reader"
  ],
  "options": {
    "contextHelpersReadMore": true
  }
}

For more oCIS apps, see ownCloud’s list.

Run

Manually launch

OCIS_URL=https://owncloud.jellyterra.com WEB_UI_CONFIG_FILE=/home/owncloud/config.json ocis server

Systemd service

systemctl edit --force --full ocis
[Unit]
Description=ownCloud Infinite Scale
After=network.target

[Service]
User=owncloud
Group=owncloud
ExecStart=ocis server
Type=simple

Environment="OCIS_URL=https://owncloud.jellyterra.com"
Environment="WEB_UI_CONFIG_FILE=/home/owncloud/config.json"

[Install]
WantedBy=default.target
systemctl enable --now ocis

Client

Use the web client, in the example it is https://owncloud.jellyterra.com

Download ownCloud desktop client from the official.

Follow the wizard to set up synchronization.

Dig deeper

The most complete reference must be the official documentation.

Conclusion

I’ve tried ownCloud and NextCloud Desktop and Android apps. And they are not compatible.

The performance of oCIS looks good. At least its connections perform better than NextCloud on Cloudflare Tunnel.

I really enjoy deploying web programs written in Go because the Go supports many rare machine architectures, and it is stable!

I’m surprised and glad to see that ownCloud team turned to Go for more flexibility, security and performance!

Let me know you were here!