Skip to content

Parse Server Push - Path to certificates #383

Description

@oyvindvol

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?

Activity

  1. drew-gross commented on Feb 12, 2016

    @drew-gross
    Contributor

    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.

  2. wangmengyan95 commented on Feb 12, 2016

    @wangmengyan95
    Contributor

    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'}.

  3. connorbode commented on Dec 8, 2016

    @connorbode

    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:

    1. Set your environment variable using heroku config:set APNS_KEY="$(base64 /path/to/key.p12)"
    2. Add a heroku-prebuild script to your package.json: echo $APNS_KEY | base64 --decode > key.p12
    3. In your Parse Server config, set push.ios.pfx = path.join(__dirname, 'key.p12')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions