Frontend Service Configuration

Introduction

The frontend service translates various ownCloud-related HTTP APIs to CS3 requests.

Default Values

  • Frontend listens on port 9140 by default.

Endpoints Overview

Currently, the frontend service handles requests for three functionalities, which are

appprovider

The appprovider endpoint, by default /app, forwards HTTP requests to the CS3 App Registry API.

archiver

The archiver endpoint, by default /archiver, implements zip and tar download for collections of files. It will internally use the CS3 API to initiate downloads and then stream the individual files as part of a compressed file.

datagateway

The datagateway endpoint, by default /data, forwards file up- and download requests to the correct CS3 data provider. OCIS starts a dataprovider as part of the storage-* services. The routing happens based on the JWT that was created by a storage provider in response to an InitiateFileDownload or InitiateFileUpload request.

ocs

The ocs endpoint, by default /ocs, implements the ownCloud Classic Open Collaboration Services API by translating it into CS3 API requests. It can handle users, groups, capabilities and also implements the file sharing functionality on top of CS3. The /ocs/v[12].php/cloud/user/signing-key is currently handled by the dedicated ocs service.

Event Handler

The frontend service contains an eventhandler for handling ocs related events. For details see the developer documentation.

Auto-Accept Shares

When setting the FRONTEND_AUTO_ACCEPT_SHARES to true, all incoming shares will be accepted automatically. Users can overwrite this setting individually in their profile.

Passwords

The Password Policy

Note that the password policy impacts only public link password validation.

With the password policy, mandatory criteria for the password can be defined via the environment variables listed below.

Generally, a password can contain any UTF-8 characters, however some characters are regarded as special since they are not used in ordinary texts. Which characters should be treated as special is defined by "The OWASP® Foundation" password-special-characters (between double quotes): " !"#$%&'()*+,-./:;<⇒?@[\]^_`{|}~"

The validation against the banned passwords list can be configured via a text file with words separated by new lines. If a user tries to set a password listed in the banned passwords list, the password can not be used (is invalid) even if the other mandatory criteria are passed. The admin can define the path of the banned passwords list file. If the file doesn’t exist in a location, Infinite Scale tries to load a file from the OCIS_CONFIG_DIR/OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST. An option will be enabled when the file has been loaded successfully.

The following environment variables can be set to define the password policy behavior:

  • OCIS_PASSWORD_POLICY_DISABLED
    Disable the password policy.

  • OCIS_PASSWORD_POLICY_MIN_CHARACTERS
    Define the minimum password length.

  • OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS
    Define the minimum number of uppercase letters.

  • OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS
    Define the minimum number of lowercase letters.

  • OCIS_PASSWORD_POLICY_MIN_DIGITS
    Define the minimum number of digits.

  • OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS
    Define the minimum number of special characters.

  • OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST
    Path to the 'banned passwords list' file.

A password can have a maximum length of 72 bytes. Depending on the alphabet used, a character is encoded by 1 to 4 bytes, defining the maximum length of a password indirectly. While US-ASCII will only need one byte, Latin alphabets and also Greek or Cyrillic ones need two bytes. Three bytes are needed for characters in Chinese, Japanese and Korean etc.

For public accessible shares, independent if read only or writable, a password is enforced. To change this requirement, set the following environment variable to false:

OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD

For public accessible writable shares, a password can be enforced. To change the current setting, set the following environment variable to true:

OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD

Changing this environment variable only makes sense if the OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD environment variable is set to false.

Sharing

Aggregating share information is one of the most time consuming operations in OCIS. The service fetches a list of either received or created shares and has to stat every resource individually. While stats are fast, the default behavior scales linearly with the number of shares.

To save network trips the sharing implementation can cache the stat requests with an in memory cache or in redis. It will shorten the response time by the network round-trip overhead at the cost of the API only eventually being updated.

Setting FRONTEND_OCS_RESOURCE_INFO_CACHE_TTL=60 (deprecated) would cache the stat info for 60 seconds. Increasing this value makes sense for large deployments with thousands of active users that keep the cache up to date. Low frequency usage scenarios should not expect a noticeable improvement.

Space Management Through OIDC Claims

When Space Management Through OIDC Claims has been enabled in the proxy service via the environment variable OCIS_CLAIM_MANAGED_SPACES_ENABLED, this environment variable must also be set for the frontend service. This is necessary to block adding or removing users to or from spaces through the web UI.

Scalability

While the frontend service does not persist any data, it does cache information about files and filesystem (Stat()) responses and user information. Therefore, multiple instances of this service can be spawned in a bigger deployment like when using container orchestration with Kubernetes, when configuring FRONTEND_OCS_RESOURCE_INFO_CACHE_STORE (deprecated) and the related config options.

Define Read-Only Attributes

A lot of user management is done via the standardized LibreGraph API. Depending on how the system is configured, there might be some user attributes that an Infinite Scale instance admin can’t change because of properties coming from an external LDAP server, or similar. This can be the case when the Infinite Scale admin is not the LDAP admin. To make life easier for admins, read-only attributes can be displayed differently, e.g. grayed out. To configure these hints for the frontend, use the environment variable FRONTEND_READONLY_USER_ATTRIBUTES, which takes a comma separated list of attributes. See the environment variable for supported values.

Caching

The frontend service can use a configured store via the global OCIS_CACHE_STORE environment variable.

Note that for each global environment variable, an independent service-based one might be available additionally. For precedences see Environment Variable Notes. Check the configuration section below. Supported stores are:

Store Type Description

memory

Basic in-memory store. Will not survive a restart.
Usually the default for caches. See the store environment variable for which one is used.

nats-js-kv

Stores data using key-value-store feature of NATS JetStream.
Usually the default for stores, see the store environment variable for which one is used.

redis-sentinel

Stores data in a configured Redis Sentinel cluster.

noop

Stores nothing. Useful for testing. Not recommended in production environments.

The frontend service can only be scaled if not using the memory store and the stores are configured identically over all instances!
If you have used one of the deprecated stores of a former version, you should reconfigure to use one of the supported ones as the deprecated stores will be removed in a later version.
Store specific notes
  • When using redis-sentinel:
    The Redis master to use is configured via e.g. OCIS_CACHE_STORE_NODES in the form of <sentinel-host>:<sentinel-port>/<redis-master> like 10.10.0.200:26379/mymaster.

  • When using nats-js-kv:

    • It is recommended to set OCIS_CACHE_STORE_NODES to the same value as OCIS_EVENTS_ENDPOINT. That way the cache uses the same nats instance as the event bus. See the Event Bus Configuration for more details.

    • Authentication can be added, if configured, via OCIS_CACHE_AUTH_USERNAME and OCIS_CACHE_AUTH_PASSWORD.

    • It is possible to set OCIS_CACHE_DISABLE_PERSISTENCE to instruct nats to not persist cache data on disc.

Event Bus Configuration

The Infinite Scale event bus can be configured by a set of environment variables.

  • In case of an orchestrated installation like with Docker or Kubernetes, the event bus must be an external service for scalability like a Redis Sentinel cluster or a key-value-store NATS JetStream. Both named stores are supported and also used in Caching and Persistence. The store used is not part of the Infinite Scale installation and must be separately provided and configured.

  • Note that from a configuration point of view, caching and persistence are independent of the event bus configuration.

Note that for each global environment variable, a service-based one might be available additionally. For precedences see Environment Variable Notes. Check the configuration section below.

Without the aim of completeness, see the list of environment variables to configure the event bus:

Envvar Description

OCIS_EVENTS_ENDPOINT

The address of the event system.

OCIS_EVENTS_CLUSTER

The clusterID of the event system. Mandatory when using NATS as event system.

OCIS_EVENTS_ENABLE_TLS

Enable TLS for the connection to the events broker.

OCIS_INSECURE

Whether to verify the server TLS certificates.

OCIS_EVENTS_AUTH_USERNAME

The username to authenticate with the events broker.

OCIS_EVENTS_AUTH_PASSWORD

The password to authenticate with the events broker.

Configuration

Environment Variables

The frontend service is configured via the following environment variables. Read the Environment Variable Types documentation for important details. Column IV shows with which release the environment variable has been introduced.

404: Not Found

  • 8.1.0

404: Not Found

YAML Example

  • 8.1.0

404: Not Found