This document outlines the steps to enable secure file serving in Baserow, a feature that allows the backend to serve files directly without needing another web server. This capability introduces several benefits, including the ability to set expiration times for file links and enforce access controls based on user authentication and workspace membership. However, it’s important to weigh these benefits against potential performance costs and other considerations.
Note that this is an enterprise feature.
To enable secure file serving, you must configure the following environment variables in your Baserow instance:
BASEROW_SERVE_FILES_THROUGH_BACKEND: Set this variable to true
to activate
backend file serving. This feature is disabled by default. Note that enabling this
setting does not automatically secure your storage server against unauthorized
access. You should take additional security measures if your storage server serves
files publicly.
BASEROW_SERVE_FILES_THROUGH_BACKEND_PERMISSION: This variable controls access
permissions for downloading files. The default setting, DISABLED
, allows anyone to
download files. To restrict downloads to signed-in users, set this to SIGNED_IN
.
For tighter control, where only users with workspace access can download files, use
WORKSPACE_ACCESS
.
BASEROW_SERVE_FILES_THROUGH_BACKEND_EXPIRE_SECONDS: Use this variable to set an expiration time for file links, specified in seconds. Unset, or set this to a non-positive integer, makes file links permanent. Setting a positive integer will make the link expire after the specified duration, enhancing security by preventing outdated link access.
By following these steps and considerations, you can securely serve files through Baserow, enhancing the security and control over file access within your organization.