FlowX CMS setup
The CMS service is a microservice designed for managing taxonomies and content inside an application. Delivered as a Docker image, it simplifies content editing and analysis. This guide provides step-by-step instructions for setting up the service and configuring it to suit your needs.
Ensure the following infrastructure components are available before starting the CMS service:
- Docker Engine: Version 17.06 or higher.
- MongoDB: Version 4.4 or higher for storing taxonomies and content.
- Redis: Version 6.0 or higher.
- Kafka: Version 2.8 or higher.
- Elasticsearch: Version 7.11.0 or higher.
The service is pre-configured with most default values. However, some environment variables require customization during setup.
Dependencies overview
Configuration
Set application defaults
Define the default application name for retrieving content:
If this configuration is not provided, the default value will be set to flowx
.
Configuring authorization & access roles
Connect the CMS to an OAuth 2.0 identity management platform by setting the following variables:
SECURITY_OAUTH2_BASE_SERVER_URL
: Specifies the base URL for the OAuth 2.0 Authorization Server, which handles authentication and token issuance.SECURITY_OAUTH2_CLIENT_CLIENT_ID
: Unique identifier for the client application. Used during authentication with the OAuth 2.0 server.SECURITY_OAUTH2_CLIENT_CLIENT_SECRET
: Secret key to authenticate requests from the client application.SECURITY_OAUTH2_REALM
: Defines the realm name for OAuth 2.0 provider authentication in Spring Security.
For detailed role and access configuration, refer to:
FlowX CMS access rights
Configuring MongoDB
The CMS requires MongoDB for taxonomy and content storage. Configure MongoDB with the following variables:
SPRING_DATA_MONGODB_URI
: URI for connecting to the CMS MongoDB instance.- Format:
mongodb://${DB_USERNAME}:${DB_PASSWORD}@<host1>,<host2>,<arbiter-host>:<port>/<database>?retryWrites=false
- Format:
DB_USERNAME
:cms-core
MONGOCK_TRANSACTIONENABLED
: Enables or disables transactions in MongoDB for compatibility with the Mongock library.- Default Value:
false
(Set it tofalse
to support successful migrations). - Note: Set to
false
due to known issues with transactions in MongoDB version 5.
- Default Value:
Configuring MongoDB (runtime database - additional data)
In addition to core storage, CMS also connects to a Runtime MongoDB instance for operational data. Configure using these variables:
RUNTIME_DB_USERNAME
:app-runtime
SPRING_DATA_MONGODB_RUNTIME_URI
- URI for connecting to the Runtime MongoDB instance (app-runtime
)- Format:
mongodb://${DB_USERNAME}:${DB_PASSWORD}@<host1>,<host2>,<arbiter-host>:<port>/<database>?retryWrites=false
- Format:
SPRING_DATA_MONGODB_STORAGE
- Specifies the storage type used for the Runtime MongoDB instance (Azure environments only)- Possible Values:
mongodb
,cosmosdb
- Default Value:
mongodb
- Possible Values:
Configuring Redis
The service can use the Redis component already deployed for the engine.
The following values should be set with the corresponding Redis-related values:
SPRING_REDIS_HOST
: Hostname or IP address of the Redis server.SPRING_REDIS_PASSWORD
: Authentication password for the Redis server.REDIS_TTL
: Used to specify the maximum time-to-live (TTL) for a key in Redis, it is used to set a limit on how long a key can exist before it is automatically expired (Redis will delete the key after the specified TTL has expired).
All the data produced by the service will be stored in Redis under a specific key. The name of the key can be configured using the environment variable:
Configuring Kafka
To configure the Kafka server, you need to set the following environment variables:
SPRING_KAFKA_BOOTSTRAP_SERVERS
: Address of the Kafka server (host:port).SPRING_KAFKA_CONSUMER_GROUP_ID
: Defines the Kafka consumer group.KAFKA_CONSUMER_THREADS
: Number of Kafka consumer threads.KAFKA_AUTH_EXCEPTION_RETRY_INTERVAL
: Retry interval after an authorization exception.KAFKA_TOPIC_AUDIT_OUT
: Topic for audit logs.
Request content topics
Environment Variable | Default FLOWX.AI value (Customizable) |
---|---|
KAFKA_TOPIC_REQUEST_CONTENT_IN | ai.flowx.dev.plugin.cms.trigger.retrieve.content.v1 |
KAFKA_TOPIC_REQUEST_CONTENT_OUT | ai.flowx.dev.engine.receive.plugin.cms.retrieve.content.results.v1 |
KAFKA_TOPIC_REQUEST_CONTENT_IN
: This variable defines the topic used by the CMS to listen for incoming content retrieval requests.KAFKA_TOPIC_REQUEST_CONTENT_OUT
: This variable defines the topic where the CMS sends the results of content retrieval requests back to the FlowX Engine.
Each action available in the service corresponds to a Kafka event. A separate Kafka topic must be configured for each use case.
It is important to note that all the actions that start with a configured pattern will be consumed by the engine.
Configuring logging
To control the log levels, the following environment variables can be set:
LOGGING_LEVEL_ROOT
: Log level for the root service logs.LOGGING_LEVEL_APP
: Log level for application-specific logs.LOGGING_LEVEL_MONGO_DRIVER
: Log level for the MongoDB driver.
Configuring file storage
APPLICATION_FILE_STORAGE_S3_SERVER_URL
: URL of the S3 server for file storage.APPLICATION_FILE_STORAGE_S3_BUCKET_NAME
: S3 bucket name for file storage.APPLICATION_FILE_STORAGE_S3_ROOT_DIRECTORY
: Root directory in the S3 bucket.APPLICATION_FILE_STORAGE_S3_CREATE_BUCKET
: Indicates if the bucket should be auto-created (true
/false
).APPLICATION_FILE_STORAGE_S3_PUBLIC_URL
: Public URL for accessing files.
Private storage configuration
Private CMS to securely store uploaded documents and AI-generated documents, ensuring they are accessible only via authenticated endpoints. This CMS will support AI services and workflows while maintaining strict access controls.
Private CMS ensures secure file storage by keeping documents hidden from the Media Library and accessible only through authenticated endpoints with access token permissions. Files can be retrieved using tags (e.g., ai_document, ref:UUID_doc) and are excluded from application builds as they aren’t needed at runtime.
APPLICATION_FILE_STORAGE_S3_PRIVATE_SERVER_URL
: This environment variable specifies the URL of the S3 server used for private file storage.APPLICATION_FILE_STORAGE_S3_PRIVATE_BUCKET_NAME
: This environment variable specifies the name of the S3 bucket dedicated to private file storage.APPLICATION_FILE_STORAGE_S3_PRIVATE_CREATE_BUCKET
: This environment variable indicates whether the private S3 bucket should be created if it does not already exist. It can be set to true or false.APPLICATION_FILE_STORAGE_S3_PRIVATE_ACCESS_KEY
: This environment variable holds the access key used to authenticate to the S3 server for private file storage.APPLICATION_FILE_STORAGE_S3_PRIVATE_SECRET_KEY
: This environment variable holds the secret key used to authenticate to the S3 server for private file storage.
Configuring the maximum file size for uploads
To set the maximum file size for uploads through the CMS service (e.g., the Media Library), you can adjust the following environment variables:
SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE: ${MULTIPART_MAX_FILE_SIZE:50MB}
: Defines the maximum file size allowed for uploads. Default is 50 MB.SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE: ${MULTIPART_MAX_REQUEST_SIZE:50MB}
: Defines the maximum request size allowed for uploads. Default is 50 MB.
Please note that raising the file size to a high limit may increase vulnerability to potential attacks. Consider carefully before making this change.
Configuring application management
The FlowX helm chart provides a management service with the necessary parameters to integrate with the Prometheus operator. However, this integration is disabled by default.
Prometheus metrics export configuration
Old configuration from < v4.1 releases (will be deprecated in v4.5):
MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED
: Enables or disables Prometheus metrics export.
New configuration, starting from v4.1 release, available below. Note that this setup is backwards compatible, it does not affect the configuration from v3.4.x. The configuration files will still work until v4.5 release.
To configure Prometheus metrics export for the FlowX.AI Engine, the following environment variable is required:
Environment Variable | Description | Default Value | Possible Values |
---|---|---|---|
MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED | Enables or disables Prometheus metrics export. | false | true , false |
Was this page helpful?