You can configure several things in Kafka Magic app:
The configuration settings are stored in the appsettings.json file, and can be modified either directly in the file or through Environment variables. When setting an Environment variable you need to add prefix KMAGIC_
to the parameter name.
By default Kafka Magic app on macOS, Windows, and Linux is configured to listen on port 5777, which makes the default URL http://localhost:5777.
If your Kafka Magic app doesn’t start correctly, most likely reason is that the port number is already in use by some other app. Just change CONFIG_PORT
parameter to a different number and try again.
Desktop versions of Kafka Magic by default start local browser on startup. You can enable/disable this behavior by changing START_BROWSER
parameter.
Cluster connection configuration is stored in the Configuration Database. The database can be stored in memory or in a file.
The type of the storage is defined by the CONFIG_STORE_TYPE
configuration parameter. It can have one of two values: “memory” or “file”. Absence of the configuration item means in-memory storage.
Cluster connection configuration you enter when registering your clusters can be stored in-memory or in an encrypted file.
‘memory’ means that configuration will be lost after you shut down the Kafka Magic application.
To preserve the configuration you need to configure file storage option and encryption key.
By default desktop versions of the Kafka Magic app is configured to store configuration in file, while Docker Container version is configured to store configuration in memory.
When stored in a file the cluster configuration database is encrypted. It is strongly recommended to change the default encryption key by modifying "CONFIG_ENCRYPTION_KEY"
parameter.
As a precaution, topic and schema deletion is disabled by default. You can change configuration to enable topic and schema deletion by setting ALLOW_TOPIC_DELETE
and ALLOW_SCHEMA_DELETE
to true.
Configuration options on Windows, macOS, and Linux are specified in the appsettings.json file. Location of this file depends on the operating system you use.
To find appsettings.json file on macOS: right click on the Kafka Magic item in the Applications folder and select ‘Show Package Contents’ menu item. Navigate to Contents/MacOS/ folder and open appsettings.json file in your favorite text editor.
The appsettings.json file on Windows and Linux is located in the same folder as the Kafka Magic app executable file.
File looks similar to this:
{
"CONFIG_PORT": "5777",
"START_BROWSER": "true",
"CONFIG_STORE_TYPE": "file",
"CONFIG_ENCRYPTION_KEY": "ENTER_YOUR_KEY_HERE",
"ALLOW_TOPIC_DELETE": false,
"ALLOW_SCHEMA_DELETE": false,
"SCRIPT_TIMEOUT_SEC": 1800,
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"System": "Warning",
"Microsoft": "Error",
"Microsoft.Hosting.Lifetime": "Information"
}
}
},
"AllowedHosts": "*"
}
When you are running the Kafka Magic app in a Docker container, to configure the app you can use command parameters, Environment variables, or via docker-compose.yml file.
The web interface is exposed on port 80. To run container and map to a different port (ex. 8080):
docker run -d --rm -p 8080:80 digitsy/kafka-magic
As a precaution, topic and schema deletion is disabled by default. You can change configuration to enable schema deletion by setting Environment variable KMAGIC_ALLOW_TOPIC_DELETE
and KMAGIC_ALLOW_SCHEMA_DELETE
to true.
You can also do that as a docker command parameter:
docker run -e "KMAGIC_ALLOW_SCHEMA_DELETE=true" -d --rm -p 8080:80 digitsy/kafka-magic
You can combine configuration parameters in a single docker-compose.yml
file.
version: '3'
services:
magic:
image: "digitsy/kafka-magic"
ports:
- "8080:80"
volumes:
- .:/config
environment:
KMAGIC_ALLOW_TOPIC_DELETE: "true"
KMAGIC_ALLOW_SCHEMA_DELETE: "true"
KMAGIC_CONFIG_STORE_TYPE: "file"
KMAGIC_CONFIG_STORE_CONNECTION: "Data Source=/config/KafkaMagicConfig.db;"
KMAGIC_CONFIG_ENCRYPTION_KEY: "ENTER_YOUR_KEY_HERE"