Like most Platform as a Service providers, OpenShift recommends managing configuration information using using environment variables:
OpenShift has a few environment variables to make it easy for your to configure your application to run properly. The following tables show the variables, some examples of what the value would be, and what you might use them for.
This way you can easily have different settings on your development box, integration box, production box, etc. For example, in development you might want to connect to a local database, but in production you might want to connect to a separate database server.
This also allows you to keep sensitive information like passwords and API keys out of your repository.
You can also set your own custom environment variables:
Environment variables can be used to store a variety of different values: application names, usernames, passwords, hostnames, and IP addresses. OpenShift platform provides several environment variables to make it easy but often there is a need to define custom environment variables on the server to keep sensitive information away from code repositories.
...
If the above provided environment variables do not satisfy your need, you can proceed to creating custom environment variables by using the rhc set-env
command.
rhc set-env VARIABLE1=VALUE1 VARIABLE2=VALUE2 -a myapp --namespace domain
In your application code you can load variables from the environment and use them however you like. Node.js lets you read environment variables using process.env.ENV_VARIABLE
.