Using Environment Variables Inside The Connection
OpenLegacy allows you to use environment variables within your connection profiles dynamically. This feature enables flexible configuration, particularly when deploying your project across various environments, including development, staging, and production.
In many cases, connection details such as hostnames, ports, authentication credentials, or database names differ between environments. Manually editing the connection profile for each deployment can be error-prone and inconvenient. To solve this, OpenLegacy supports environment variable substitution directly in connection profiles.
Benefits
- Simplifies configuration management across environments.
 - Keeps sensitive values external to the project repository.
 - Enables safer and more portable deployments when combined with containerization or CI/CD pipelines.
 - Allows integration with secret management systems, such as HashiCorp Vault or AWS Secrets Manager, enabling environment variables to be securely loaded when deploying to Kubernetes.
 
How to configure
When defining a value, you need to use this format:
${ENVIRONMENT_VARIABLE_NAME}
At runtime, OpenLegacy automatically resolves these placeholders by reading the corresponding environment variables from the system or container environment.
For example, this profile:
If your operating system or container defines the "${HOST_URL}" environment variable, for example:
HOST_URL="http://openlegacy.test"
Then OpenLegacy automatically replaces the placeholder with the value when the connection is established.
Updated about 21 hours ago
