For Songs configuration, specify the active profiles within your environment variables file (.env
). Descriptions of the profiles available to Song are provided here. Depending on the type of configuration, some profiles are required to run, and some are optional.
To interact with Song, an application must provide authentication and authorization. This can be done by using an API Key or JWT access token from a user or application authorized with Ego.
The secure
profile:
song.WRITE
is configured for access with Ego. For help installing Ego, please refer to our Ego installation documentation.
# Secure profile configurationSPRING_PROFILES_ACTIVE=secureAUTH_JWT_PUBLIC-KEY-URL=http://localhost:8084/oauth/token/public_keyAUTH_SERVER_URL={{ego-host-url}}/o/check_api_key/AUTH_SERVER_CLIENTID={{song-client-ID}}AUTH_SERVER_CLIENTSECRET={{song-client-secret}}AUTH_SERVER_TOKENNAME={{API-key}}AUTH_SERVER_SCOPE_STUDY_PREFIX=song.AUTH_SERVER_SCOPE_STUDY_SUFFIX=.WRITEAUTH_SERVER_SCOPE_SYSTEM=song.WRITESPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_PUBLIC_KEY_LOCATION={{ego-host-url}}/oauth/token/public_key
The prod profile is designed for production deployments. Specify your Postgres details for the production environment:
# Production Database ConfigurationSPRING_PROFILES_ACTIVE=prodSPRING_DATASOURCE_DRIVER-CLASS-NAME=org.postgresql.DriverSPRING_DATASOURCE_URL=jdbc:tc:postgresql:9.6.12://{{host}}:5432/{{database_name}}?stringtype=unspecifiedSPRING_DATASOURCE_USERNAME={{username-here}}SPRING_DATASOURCE_PASSWORD={{password-here}}SPRING_DATASOURCE_MAX_ACTIVE=10SPRING_DATASOURCE_MAX_IDLE=1SPRING_DATASOURCE_MIN_IDLE=1
The kafka
profile contains the connection details to a deployed Kafka instance. When this profile is enabled, Song will send messages to Kafka whenever an analysis is created or updated, including notices following analysis publishing, unpublishing and suppression.
This profile is only required if Kafka is configured.
For help installing Kafka, please refer to the official Kafka documentation.
By default, song is configured to output to a topic called song-analysis
. If you configure your Kafka with a different name, make sure to adjust accordingly.
# Kafka ConfigurationSPRING_PROFILES_ACTIVE=kafkaSPRING_KAFKA_BOOTSTRAP-SERVERS=localhost:9092SPRING_KAFKA_TEMPLATE_DEFAULT-TOPIC=song-analysis