Parse Server Push - Path to certificates
I am setting up the new Parse Server Push feature on Parse Server hosted on Heroku.
The Wiki says:
ios: { pfx: '/file/path/to/XXX.p12', ... }
Is it possible to upload the certificates to Heroku somewhere? How do I get them up there, and what will the path to them be like?
The simplest solution would be to check them in to your repo. If you wish to avoid that for any reason (if, say, your app is open source and lives in a public repo) then the solution will depend on your exact setup and needs. We probably wouldn't be able to help you with that.
Hi @oyvindvol, suppose you certificate is push.p12, you can just put that file under your project root's folder(eg. The same folder of your package.json). The configuration should be ios: { pfx: 'push.p12'}.
Don't check config into your repo, especially private keys..
You can store the contents in an environment variable on Heroku. See this StackOverflow post where I got the idea, and this SO post which illustrates storing a binary file in an env variable by base64 encode / decode.
Edit containing my full solution:
- Set your environment variable using
heroku config:set APNS_KEY="$(base64 /path/to/key.p12)" - Add a
heroku-prebuildscript to yourpackage.json:echo $APNS_KEY | base64 --decode > key.p12 - In your Parse Server config, set
push.ios.pfx = path.join(__dirname, 'key.p12')