Zum Hauptinhalt springen

app.yaml

This section explains how to set up the app.yaml configuration file, including all related parameters that are crucial for the aqishare startup process.

Parameter Overview

The table highlights all available main level properties in the app.yaml that can be used to setup aqishare. For details refer to the related property explanation in the next section.

ParameterMandatoryTypeDefaultDescription
licenseYesstringContaints the license key to run aqishare.
redisYesObjectSpecifies the Redis database connection required for the queue.
collectorPriorityNonumber1Drives the priority of the collectors queue.
concurrencyNonumber10Maximum number of tasks that can be processed simultaneously.
loggingNoObjectSpecify the log settings.
portNonumber3001The port of aqishare to trigger a collector task manually.
privateKeyPathNostringThe use of encrypted passwords necessitates a private key. This parameter points to the key within the container.

Parameter in Detail

License Key

The most crucial setting in the app.yaml is the license key. This key should be stored under the license property of the file. If there is no license key, or if the provided license key is invalid, aqishare will run in demo mode.

Example
license: 12345-67890-09876-54321

Redis Database

As the queue is based on the open-source database Redis, many additional settings regarding database configuration are available. As a full-featured Redis client, aqishare uses ioredis. For a full list of available parameters, please refer to the ioredis documentation.

Example
redis:
type: client
address: redis:6379

Below are some of the most important properties that influence Redis behavior:

Redis Client

ParameterMandatoryDescription
typeYesin this case client.
addressYesIP-address of the Redis container with port number.
networkNoSpecifies the network . Redis doku lesen...
usernameNoUser to login to the database.
passwordNoPassword to login to the database.
dbNoSpecifies the number of the database. Default: 1
dialTimeoutNoDial timeout, time based format such as 3m, 1h.
readTimeoutNoRead timeout, time based format such as 3m, 1h.
writeTimeoutNoWrite timeout, time based format such as 3m, 1h.
poolSizeNoConnection pooling size.

Redis Cluster

Use the following settings to scale Redis horizontally with Redis Cluster.

ParameterMandatoryDescription
typeYesTo specify setting for Redis cluster, set the value to: cluster.
addressesYesArray of IP addresses of the Redis cluster with port numbers.
networkNoSpecifies the network . Redis doku lesen...
usernameNoUser to login to the database.
passwordNoPassword to login to the database.
dialTimeoutNoDial timeout, time based format such as 3m, 1h.
readTimeoutNoRead timeout, time based format such as 3m, 1h.
writeTimeoutNoWrite timeout, time based format such as 3m, 1h.

Redis Sentinel

Use the following Redis Sentinal settings to run Redis with high availability when not using Redis Cluster above.

ParameterMandatoryDescription
typeYesin this case cluster.
addressesYesArray of IP-addresses of the Redis cluster with port numbers.
masterNameNoMaster name
sentinelPasswordNoPassword to login
dbNoSpecifies the number of the database. Default: 1
usernameNoUser to login to the database.
passwordNoPassword to login to the database.
dialTimeoutNoDial timeout, time based format such as 3m, 1h.
readTimeoutNoRead timeout, time based format such as 3m, 1h.
writeTimeoutNoWrite timeout, time based format such as 3m, 1h.
poolSizeNoConnection pooling size.

Port

Override the default port used to manually trigger a task in the /tasks/ folder.

tip

For details how to trigger a task manually, refer to Manually trigger a Task using an accessToken.

Example
port: 3001

Collector Priority

Change the priority of the collector's queue relative to all other queues.

Example
collectorPriority: 1

Concurrency

Specifies the maximum number of tasks that can be processed simultaneously.

Example
concurrency: 10

Logging

Logging is crucial because it provides visibility into an application's operation, helping to diagnose issues and monitor performance effectively. This section describes how to influence logging and log output in aqishare.

Example
logging:
level: 1
caller: false
structured: true
timeFormat: 2006-01-02T15:04:05Z07:00
fieldName:
timestamp: time
level: level
caller: caller
message: message
error: error

Below, all the parameters used in the example are explained in detail.

ParameterMandatoryTypeDefaultDescription
levelNonumber-1Specify the log level to control the granularity of information captured in the logs. Available log levels:
-1 - trace
0 - debug
1 - info
2 - warn
3 - error
4 - fatal
5 - panic
callerNobooleanfalseThis logs the affected source, providing a detailed record that can help in troubleshooting and understanding the context of operations.
structuredNobooleantrueFormats the log output using JSON syntax, which enhances readability and facilitates easier integration with log management tools.
timeFormatNostring2006-01-02T15:04:05Z07:00Specifies the format used to display the timestamp in log outputs.
fieldnameNoObjectObject to override default names. Refer below to Specify Parameter fieldname.

Specify Parameter fieldname

For various reasons, there may be a need to adapt the default names in the log output to streamline names within the organization, for example, to facilitate easier integration with log management tools and ensure consistency across reporting systems. The following fields names can be overriden:

ParameterMandatoryTypeDefaultDescription
timestampNostringtimestampOverride the timestamp field name according to your needs to specify the name through which the timestamp value can be accessed.
levelNostringlevelOverride the level field name according to your needs to specify the name through which the value can be accessed.
callerNostringcallerOverride the caller field name according to your needs to specify the name through which the value can be accessed.
messageNostringmessageSOverride the message field name according to your needs to specify the name through which the message value can be accessed.
errorNostringerrorOverride the error field name according to your needs to specify the name through which the error value can be accessed.

Password Encryption

The use of encrypted passwords in any other configuration file necessitates the specification of the privateKeyPath parameter. The value should indicate the path within the container to the private key, which will be used to decrypt the passwords. The private key must be either mapped to the container or copied into the image beforehand. If password encryption is not required, this setting can be omitted. The encryption makes use of the RSA mechanism.

tip

For details on generating key pairs and setting up password encryption, refer to Password Encryption.

Example
privateKeyPath: /app/configs/privateKey.pem

Example Configuration

This is a sample configuration that includes the most relevant properties as explained above. These properties must be present in the app.yaml file.

license: 12345-67890-09876-54321
port: 3001
concurrency: 10
collectorPriority: 1
logging:
level: 1
caller: false
structured: true
timeFormat: 2006-01-02T15:04:05Z07:00
fieldName:
timestamp: time
level: level
caller: caller
message: message
error: error
redis:
host: redis
port: 6379
privateKeyPath: /app/configs/privateKey.pem