user411103
user411103

Reputation:

Path to private assets on Ruby on Rails

I have a PEM file that should be stored somewhere in my Ruby on Rails web app, and be referenced from the production.rb config file with the path, as per below.

APNS.pem = '/path/to/pem/file'

I want to keep this file private, so storing it in the assets folder is not a good idea. Where can I safely store it and what would be the path like?

Upvotes: 2

Views: 936

Answers (1)

user229044
user229044

Reputation: 239382

You can place it anywhere in your app outside of public and assets and it will be inaccessable from the web. Placing it in config/ is a common option.

To build a path to the file, you would use Rails.root.join('config/file.pem')

Upvotes: 4

Related Questions