Skip to content

Instantly share code, notes, and snippets.

@burningTyger
Forked from ryanj/gist:4446113
Created January 3, 2013 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burningTyger/4446176 to your computer and use it in GitHub Desktop.
Save burningTyger/4446176 to your computer and use it in GitHub Desktop.

#Here is how I keep my secrets out of my source code when working with OpenShift

  1. find your app's ssh address:

    rhc app show YOUR_APP_NAME

  2. ssh into your gear to set your environment variables:

    ssh YOUR_APPS_SSH_URL

  3. add your environment variables to your ~/app-root/data/.bash_profile

    echo "export SECRET_PASS=12345678910" >> ~/app-root/data/.bash_profile

  4. make sure that your .bash_profile is sourced during your app's start up:

    cd YOUR_LOCAL_REPO echo "source ~/app-root/data/.bash_profile" >> .openshift/action_hooks/pre_start_nodejs-0.6 git add .openshift/action_hooks/pre_start_nodejs-0.6 git commit -m 'importing bash profile during app init'

    git push

Once you have completed these steps, you should be able to reference these variables via process.env.* The above example should make process.env.SECRET_PASS available in your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment