How to safely store a .pem file when working with a git -tracked heroku project?

I have a git -tracked repo and I configure it to work with APN for IOS push notifications. I look at the implementation of the npm module https://github.com/argon/node-apn in the same way as here: https://github.com/hollyschinsky/PushNotificationSample

This code has

var options = {
    gateway: 'gateway.sandbox.push.apple.com', // this URL is different for Apple Production Servers and changes when you go to production
    errorCallback: callback,
    cert: 'your-cert.pem', // ** NEED TO SET TO YOURS - see this tutorial - http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
    key:  'your-key.pem',  // ** NEED TO SET TO YOURS
    passphrase: 'your-pw', // ** NEED TO SET TO YOURS
    port: 2195,                       
    enhanced: true,                   
    cacheLength: 100                  
}

However, how should I link to my .pem files without passing them to Github?

Right now I'm going to Heroka.

+4
source share
1 answer

Do this through Heroku (environment) configuration variables.

node -apn - , . ENV vars, , Heroku.

cert: process.env.APN_CERT,
key:  process.env.APN_KEY,
passphrase: process.env.APN_PASSPHRASE,

-, APN_CERT APN_KEY:

$ heroku config:set APN_CERT="-----BEGIN CERTIFICATE-----
> MIIDOjCCAiICCQCZTWzQNz6sqTANBgkqhkiG9w0BAQsFADBfMQswCQYDVQQGEwJB
> VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
...
+5

All Articles