Frontend Service Configuration
Endpoints Overview
Currently, the frontend service handles requests for three functionalities, which are
-
datagateway and
-
ocs.
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 10 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. |
Password Enforcement for all Public Links
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
Password Enforcement for Writeable Public Links
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
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.
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
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 |
---|---|
|
Basic in-memory store. Will not survive a restart. |
|
Stores data using key-value-store feature of NATS JetStream. |
|
Stores data in a configured Redis Sentinel cluster. |
|
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>
like10.10.0.200:26379/mymaster
. -
When using
nats-js-kv
:-
It is recommended to set
OCIS_CACHE_STORE_NODES
to the same value asOCIS_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
andOCIS_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.
|
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 |
---|---|
|
The address of the event system. |
|
The clusterID of the event system. Mandatory when using NATS as event system. |
|
Enable TLS for the connection to the events broker. |
|
Whether to verify the server TLS certificates. |
|
The username to authenticate with the events broker. |
|
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.
Name | IV | Type | Default Value | Description |
---|---|---|---|---|
|
pre5.0 |
bool |
false |
Activates tracing. |
|
pre5.0 |
string |
|
The type of tracing. Defaults to '', which is the same as 'jaeger'. Allowed tracing types are 'jaeger' and '' as of now. |
|
pre5.0 |
string |
|
The endpoint of the tracing agent. |
|
pre5.0 |
string |
|
The HTTP endpoint for sending spans directly to a collector, i.e. http://jaeger-collector:14268/api/traces. Only used if the tracing endpoint is unset. |
|
pre5.0 |
string |
|
The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'. |
|
pre5.0 |
bool |
false |
Activates pretty log output. |
|
pre5.0 |
bool |
false |
Activates colorized log output. |
|
pre5.0 |
string |
|
The path to the log file. Activates logging to this file if set. |
|
pre5.0 |
string |
127.0.0.1:9141 |
Bind address of the debug server, where metrics, health, config and debug endpoints will be exposed. |
|
pre5.0 |
string |
|
Token to secure the metrics endpoint. |
|
pre5.0 |
bool |
false |
Enables pprof, which can be used for profiling. |
|
pre5.0 |
bool |
false |
Enables zpages, which can be used for collecting and viewing in-memory traces. |
|
pre5.0 |
string |
127.0.0.1:9140 |
The bind address of the HTTP service. |
|
pre5.0 |
string |
tcp |
The transport protocol of the HTTP service. |
|
pre5.0 |
string |
|
The Path prefix where the frontend can be accessed (defaults to /). |
|
pre5.0 |
[]string |
[https://localhost:9200] |
A list of allowed CORS origins. See following chapter for more details: Access-Control-Allow-Origin at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin. See the Environment Variable Types description for more details. |
|
pre5.0 |
[]string |
[OPTIONS HEAD GET PUT POST PATCH DELETE MKCOL PROPFIND PROPPATCH MOVE COPY REPORT SEARCH] |
A list of allowed CORS methods. See following chapter for more details: Access-Control-Request-Method at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Method. See the Environment Variable Types description for more details. |
|
pre5.0 |
[]string |
[Origin Accept Content-Type Depth Authorization Ocs-Apirequest If-None-Match If-Match Destination Overwrite X-Request-Id X-Requested-With Tus-Resumable Tus-Checksum-Algorithm Upload-Concat Upload-Length Upload-Metadata Upload-Defer-Length Upload-Expires Upload-Checksum Upload-Offset X-HTTP-Method-Override Cache-Control] |
A list of allowed CORS headers. See following chapter for more details: Access-Control-Request-Headers at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Headers. See the Environment Variable Types description for more details. |
|
pre5.0 |
bool |
false |
Allow credentials for CORS.See following chapter for more details: Access-Control-Allow-Credentials at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials. |
|
pre5.0 |
string |
|
Transfer secret for signing file up- and download requests. |
|
pre5.0 |
string |
|
The secret to mint and validate jwt tokens. |
|
pre5.0 |
string |
com.owncloud.api.gateway |
The CS3 gateway endpoint. |
|
pre5.0 |
string |
|
TLS mode for grpc connection to the go-micro based grpc services. Possible values are 'off', 'insecure' and 'on'. 'off': disables transport security for the clients. 'insecure' allows using transport security, but disables certificate verification (to be used with the autogenerated self-signed certificates). 'on' enables transport security, including server certificate verification. |
|
pre5.0 |
string |
|
Path/File name for the root CA certificate (in PEM format) used to validate TLS server certificates of the go-micro based grpc services. |
|
pre5.0 |
string |
|
The machine auth API key used to validate internal requests necessary to access resources from other services. |
|
pre5.0 |
bool |
false |
Disables the loading of user’s group memberships from the reva access token. |
|
pre5.0 |
bool |
false |
Enables the support for favorites in the clients. |
|
pre5.0 |
uint64 |
0 |
Set the global max quota value in bytes. A value of 0 equals unlimited. The value is provided via capabilities. |
|
pre5.0 |
int |
10000000 |
Sets the max chunk sizes in bytes for uploads via the clients. |
|
pre5.0 |
string |
|
Advise TUS to replace PATCH requests by POST requests. |
|
pre5.0 |
string |
tus |
The default upload protocol to use in clients. Currently only 'tus' is available. See the developer API documentation for more details about TUS. |
|
pre5.0 |
bool |
false |
Changing this value is NOT supported. Enables support for incoming federated sharing for clients. The backend behaviour is not changed. |
|
pre5.0 |
bool |
false |
Changing this value is NOT supported. Enables support for outgoing federated sharing for clients. The backend behaviour is not changed. |
|
pre5.0 |
int |
3 |
Minimum number of characters to enter before a client should start a search for Share receivers. This setting can be used to customize the user experience if e.g too many results are displayed. |
|
pre5.0 |
string |
Community |
Edition of oCIS. Used for branding purposes. |
|
pre5.0 |
bool |
false |
When set to true, clients are informed that the Server-Sent Events endpoint is not accessible. |
|
5.0 |
int |
1 |
Defines the default permissions a link is being created with. Possible values are 0 (= internal link, for instance members only) and 1 (= public link with viewer permissions). Defaults to 1. |
|
pre5.0 |
string |
https://localhost:9200 |
The public facing URL of the oCIS frontend. |
|
7.0.0 |
int |
1 |
Maximum number of concurrent go-routines. Higher values can potentially get work done faster but will also cause more load on the system. Values of 0 or below will be ignored and the default value will be used. |
|
pre5.0 |
bool |
false |
Allow insecure connections to the frontend. |
|
6.0.0 |
string |
com.owncloud.api.collaboration |
Service name or address of the app provider to use for secure view. Should match the service name or address of the registered CS3 app provider. |
|
pre5.0 |
int64 |
10000 |
Max number of files that can be packed into an archive. |
|
pre5.0 |
int64 |
1073741824 |
Max size in bytes of the zip archive the archiver can create. |
|
pre5.0 |
bool |
false |
Allow insecure connections to the archiver. |
|
pre5.0 |
string |
data |
Path prefix for the data gateway. |
|
pre5.0 |
string |
ocs |
URL path prefix for the OCS service. Note that the string must not start with '/'. |
|
pre5.0 |
string |
/Shares |
Path prefix for shares as part of an ocis resource. Note that the path must start with '/'. |
|
pre5.0 |
string |
/users/{{.Id.OpaqueId}} |
Home namespace identifier. |
|
pre5.0 |
string |
{{.Mail}} |
Additional information attribute for the user like {{.Mail}}. |
|
pre5.0 |
string |
memory |
The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details. |
|
pre5.0 |
[]string |
[127.0.0.1:9233] |
A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details. |
|
pre5.0 |
string |
cache-stat |
The database name the configured store should use. |
|
pre5.0 |
string |
|
The database table the store should use. |
|
pre5.0 |
Duration |
5m0s |
Default time to live for user info in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details. |
|
5.0 |
bool |
false |
Disable persistence of the cache. Only applies when using the 'nats-js-kv' store type. Defaults to false. |
|
5.0 |
string |
|
The username to use for authentication. Only applies when using the 'nats-js-kv' store type. |
|
5.0 |
string |
|
The password to use for authentication. Only applies when using the 'nats-js-kv' store type. |
|
pre5.0 |
bool |
false |
EXPERIMENTAL: enable the feature to deny access on folders. |
|
5.0 |
bool |
true |
Include OCM shares when listing shares. See the OCM service documentation for more details. |
|
5.0 |
bool |
false |
Include OCM sharees when listing sharees. |
|
5.0 |
bool |
true |
Set this to true if you want to enforce passwords on all public shares. |
|
5.0 |
bool |
false |
Set this to true if you want to enforce passwords for writable shares. Only effective if the setting for 'passwords on all public shares' is set to false. |
|
6.0.0 |
bool |
false |
Include user email addresses in responses. If absent or set to false emails will be omitted from results. Please note that admin users can always see all email addresses. |
|
pre5.0 |
[]string |
[sha1 md5 adler32] |
A list of checksum types that indicate to clients which hashes the server can use to verify upload integrity. Supported types are 'sha1', 'md5' and 'adler32'. See the Environment Variable Types description for more details. |
|
pre5.0 |
string |
sha1 |
The supported checksum type for uploads that indicates to clients supporting multiple hash algorithms which one is preferred by the server. Must be one out of the defined list of SUPPORTED_TYPES. |
|
pre5.0 |
[]string |
[] |
A list of user attributes to indicate as read-only. Supported values: 'user.onPremisesSamAccountName' (username), 'user.displayName', 'user.mail', 'user.passwordProfile' (password), 'user.appRoleAssignments' (role), 'user.memberOf' (groups), 'user.accountEnabled' (login allowed), 'drive.quota' (quota). See the Environment Variable Types description for more details. |
|
pre5.0 |
bool |
true |
Allow creating, modifying and deleting LDAP users via the GRAPH API. This can only be set to 'true' when keeping default settings for the LDAP user and group attribute types (the 'OCIS_LDAP_USER_SCHEMA_* and 'OCIS_LDAP_GROUP_SCHEMA_* variables). |
|
pre5.0 |
bool |
false |
Set to true to signal the web client that full-text search is enabled. |
|
5.0 |
string |
127.0.0.1:9233 |
The address of the event system. The event system is the message queuing service. It is used as message broker for the microservice architecture. |
|
5.0 |
string |
ocis-cluster |
The clusterID of the event system. The event system is the message queuing service. It is used as message broker for the microservice architecture. Mandatory when using NATS as event system. |
|
5.0 |
bool |
false |
Whether to verify the server TLS certificates. |
|
5.0 |
string |
|
The root CA certificate used to validate the server’s TLS certificate. If provided NOTIFICATIONS_EVENTS_TLS_INSECURE will be seen as false. |
|
5.0 |
bool |
false |
Enable TLS for the connection to the events broker. The events broker is the ocis service which receives and delivers events between the services. |
|
5.0 |
string |
|
The username to authenticate with the events broker. The events broker is the ocis service which receives and delivers events between the services. |
|
5.0 |
string |
|
The password to authenticate with the events broker. The events broker is the ocis service which receives and delivers events between the services. |
|
5.0 |
bool |
true |
Defines if shares should be auto accepted by default. Users can change this setting individually in their profile. |
|
5.0 |
string |
|
The ID of the service account the service should use. See the 'auth-service' service description for more details. |
|
5.0 |
string |
|
The service account secret. |
|
5.0 |
bool |
false |
Disable the password policy. Defaults to false if not set. |
|
5.0 |
int |
8 |
Define the minimum password length. Defaults to 8 if not set. |
|
5.0 |
int |
1 |
Define the minimum number of uppercase letters. Defaults to 1 if not set. |
|
5.0 |
int |
1 |
Define the minimum number of lowercase letters. Defaults to 1 if not set. |
|
5.0 |
int |
1 |
Define the minimum number of digits. Defaults to 1 if not set. |
|
5.0 |
int |
1 |
Define the minimum number of characters from the special characters list to be present. Defaults to 1 if not set. |
|
5.0 |
string |
|
Path to the 'banned passwords list' file. This only impacts public link password validation. See the documentation for more details. |
YAML Example
-
Note the file shown below must be renamed and placed in the correct folder according to the Configuration File Naming conventions to be effective.
-
See the Notes for Environment Variables if you want to use environment variables in the yaml file.
# Autogenerated
# Filename: frontend-config-example.yaml
tracing:
enabled: false
type: ""
endpoint: ""
collector: ""
log:
level: ""
pretty: false
color: false
file: ""
debug:
addr: 127.0.0.1:9141
token: ""
pprof: false
zpages: false
http:
addr: 127.0.0.1:9140
protocol: tcp
prefix: ""
cors:
allow_origins:
- https://localhost:9200
allow_methods:
- OPTIONS
- HEAD
- GET
- PUT
- POST
- PATCH
- DELETE
- MKCOL
- PROPFIND
- PROPPATCH
- MOVE
- COPY
- REPORT
- SEARCH
allow_headers:
- Origin
- Accept
- Content-Type
- Depth
- Authorization
- Ocs-Apirequest
- If-None-Match
- If-Match
- Destination
- Overwrite
- X-Request-Id
- X-Requested-With
- Tus-Resumable
- Tus-Checksum-Algorithm
- Upload-Concat
- Upload-Length
- Upload-Metadata
- Upload-Defer-Length
- Upload-Expires
- Upload-Checksum
- Upload-Offset
- X-HTTP-Method-Override
- Cache-Control
allow_credentials: false
transfer_secret: ""
token_manager:
jwt_secret: ""
reva:
address: com.owncloud.api.gateway
tls:
mode: ""
cacert: ""
machine_auth_api_key: ""
skip_user_groups_in_token: false
enable_favorites: false
max_quota: 0
upload_max_chunk_size: 10000000
upload_http_method_override: ""
default_upload_protocol: tus
enable_federated_sharing_incoming: false
enable_federated_sharing_outgoing: false
search_min_length: 3
edition: Community
disable_sse: false
default_link_permissions: 1
public_url: https://localhost:9200
max_concurrency: 1
app_handler:
insecure: false
secure_view_app_addr: com.owncloud.api.collaboration
archiver:
max_num_files: 10000
max_size: 1073741824
insecure: false
data_gateway:
prefix: data
ocs:
prefix: ocs
share_prefix: /Shares
home_namespace: /users/{{.Id.OpaqueId}}
additional_info_attribute: '{{.Mail}}'
stat_cache_type: memory
stat_cache_nodes:
- 127.0.0.1:9233
stat_cache_database: cache-stat
stat_cache_table: ""
stat_cache_ttl: 5m0s
stat_cache_disable_persistence: false
stat_cache_auth_username: ""
stat_cache_auth_password: ""
enable_denials: false
list_ocm_shares: true
include_ocm_sharees: false
public_sharing_share_must_have_password: true
public_sharing_writeableshare_must_have_password: false
show_email_in_results: false
checksums:
supported_types:
- sha1
- md5
- adler32
preferred_upload_type: sha1
read_only_user_attributes: []
ldap_server_write_enabled: true
full_text_search: false
middleware:
auth:
credentials_by_user_agent: {}
events:
endpoint: 127.0.0.1:9233
cluster: ocis-cluster
tls_insecure: false
tls_root_ca_certificate: ""
enable_tls: false
username: ""
password: ""
grpc_client_tls: null
auto_accept_shares: true
service_account:
service_account_id: ""
service_account_secret: ""
password_policy:
min_characters: 8
min_lowercase_characters: 1
min_uppercase_characters: 1
min_digits: 1
min_special_characters: 1
banned_passwords_list: ""