FlowX CMS setup
The CMS service is a microservice that allows managing taxonomies and contents. It is available as a Docker image and is designed to make it easy to edit and analyze content. This guide will walk you through the process of setting up the service and configuring it to meet your needs.
Infrastructure prerequisites
The CMS service requires the following components to be set up before it can be started:
- Docker engine - version 17.06 or higher
- MongoDB - version 4.4 or higher for storing taxonomies and contents
- Redis - version 6.0 or higher
- Kafka - version 2.8 or higher
- Elastisearch - version 7.11.0 or higher
The service comes with most of the needed configuration properties filled in, but there are a few that need to be set up using some custom environment variables.
Dependencies
Configuration
Configure the default application name to be used when retrieving content:
If this configuration is not provided, the default value will be set to flowx
.
Configuring authorization & access roles
To connect to the identity management platform, the following variables need to be set:
SECURITY_OAUTH2_BASE_SERVER_URL
- the base URL for the OAuth 2.0 Authorization Server, which is responsible for authentication and authorization for clients and users, it is used to authorize clients, as well as to issue and validate access tokensSECURITY_OAUTH2_CLIENT_CLIENT_ID
- a unique identifier for a client application that is registered with the OAuth 2.0 Authorization Server, this is used to authenticate the client application when it attempts to access resources on behalf of a userSECURITY_OAUTH2_CLIENT_CLIENT_SECRET
- secret key that is used to authenticate requests made by an authorization clientSECURITY_OAUTH2_REALM
- security configuration env var in the Spring Security OAuth2 framework, it is used to specify the realm name used when authenticating with OAuth2 provider
To configure user roles and access rights tailored to your specific use case in FlowX Designer, please refer to the following section:
FlowX CMS access rights
Configuring MongoDB
The MongoDB database is used for storing taxonomies and contents in the CMS service. Configure MongoDB with the following environment 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)
The CMS service also requires connection to a Runtime MongoDB instance for managing additional data related to runtime operations. Use the following environment variables for configuration:
SPRING_DATA_MONGODB_RUNTIME_ENABLED
- Enables Runtime MongoDB usage- Default Value:
true
- Default Value:
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
- environment variable used to configure the hostname or IP address of a Redis server when using Spring Data RedisSPRING_REDIS_PASSWORD
- environment variable is used to store the password used to authenticate with a Redis server, it is used to secure access to the Redis server and should be kept confidentialREDIS_TTL
- environment variable is 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, it should be in the format “host:port”SPRING_KAFKA_CONSUMER_GROUP_ID
- a group of consumersKAFKA_CONSUMER_THREADS
- the number of Kafka consumer threadsKAFKA_AUTH_EXCEPTION_RETRY_INTERVAL
- the interval between retries afterAuthorizationException
is thrown byKafkaConsumer
KAFKA_TOPIC_AUDIT_OUT
- the topic key for receiving audit logs
Request content
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
- the log level for the root spring boot microservice logsLOGGING_LEVEL_APP
- the log level for app-level logsLOGGING_LEVEL_MONGO_DRIVER
- the log level for mongo driver
Configuring file storage
APPLICATION_FILE_STORAGE_S3_SERVER_URL
- environment variable used to store the URL of the S3 server that is used to store files for the application.APPLICATION_FILE_STORAGE_S3_BUCKET_NAME
- environment variable used to store the name of the S3 bucket that is used to store files for the applicationAPPLICATION_FILE_STORAGE_S3_ROOT_DIRECTORY
- environment variable used to store the root directory within the S3 bucket where the files for the application are storedAPPLICATION_FILE_STORAGE_S3_CREATE_BUCKET
- environment variable used to indicate whether the S3 bucket should be created if it does not already exist, it can be set to true or falseAPPLICATION_FILE_STORAGE_S3_PUBLIC_URL
- the public URL of the S3 solution, it specifies the URL that can be used to access the files stored
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?