Download & Extend

Allow certificates to be stored in places other than in the module

Project:Push Notifications
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:haagendazs
Status:closed (fixed)

Issue Summary

Hi,

I'd like to be able to store the certificates outside the webroot and also be able to have different certificate names for different environments. i.e. I dont want to call the certificates apns-production.pem and apns-development.pem as I have several sites and environments sharing a common codebase and would just like to be able to specify absolute paths to the pem files in the settings.php file for each site.

I see its possible to change the file name with a hidden variable but would also like to change the path.

I'm putting together a patch that shouldn't break the current model but will allow optional overriding of the certification location to an absolute path.

Kind regards,

John

Comments

#1

Status:active» needs review

Hi,

This patch suggestion adds a new variable called push_notifications_apns_certificate_folder. If empty the certificates folder in the module is used. It also adds a text field on the configuration screen to specify this folder location. The variable folder location is relative to the site root

For example, you may specify your certificates folder to be sites/example.org/certificates/

Kind regards,

John

AttachmentSize
push_notifications-specify_certificate_folder_location-1765196.patch 4.9 KB

#2

Hi John,

Thanks for writing this patch. I reviewed it and made a few changes:

  • Absolute path vs. relative to site root: I had a request from a different user that wanted to store his certificates completely outside the any folder that is accessible from the web, so I think it would make more sense to let a user specify the absolute path when they want to store the certificate in a custom location
  • When a user removes a custom path from the admin interface, the variable wasn't cleared out
  • I changed the wording of the field description a bit

See attached patch and let me know your thoughts.
Danny

AttachmentSize
patch_commit_6899b0d45c3c.patch 4.75 KB

#3

Assigned to:Anonymous» haagendazs

#4

Hi Danny,

Looks great to me!

Rgds,
John

#5

Status:needs review» fixed

Awesome. Committed here: http://drupalcode.org/project/push_notifications.git/commit/adf518c3b3c1...

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.