Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Allow environment variables in the configuration file #75

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

IamNaN
Copy link

@IamNaN IamNaN commented Apr 23, 2013

This eases deployment by allowing environment variables in private_pub.yml.

Because Faye needs to run in production mode, the yaml file's production block gets used for both development and production, making private_pub hard to deploy.

production:
  server: <%= ENV["FAYE_SERVER"] %>
  secret_token: <%= ENV["FAYE_KEY"] %>

This change also forces signature_expiration to an integer regardless of how it is entered in the configuration, and it adds tests.

@IamNaN
Copy link
Author

IamNaN commented Apr 23, 2013

Also, I required yaml in private_pub.rb because tests weren't passing without it, even before this pull request.

@@ -4,7 +4,7 @@ require "yaml"
require "faye"
require "private_pub"

Faye::WebSocket.load_adapter('thin')
Faye::WebSocket.load_adapter('puma')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not related to this pull request :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. I was experimenting with puma rack hijacking. I'm surprised this is here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. My bad, I thought the pull request was for the commit when I submitted the pull request, not my branch's head.

On May 24, 2013, at 5:16 AM, Vasiliy Ermolovich notifications@github.com wrote:

In lib/generators/private_pub/templates/private_pub.ru:

@@ -4,7 +4,7 @@ require "yaml"
require "faye"
require "private_pub"

-Faye::WebSocket.load_adapter('thin')
+Faye::WebSocket.load_adapter('puma')
I think it's not related to this pull request :)


Reply to this email directly or view it on GitHub.

@rubytastic
Copy link

This would have been interesting,
How about Puma? what is needed to get puma to work with private_pub,

Changing adapter to puma still gives a

19:39:24 privpub.1 | /Users/Jordan/.rvm/gems/ruby-2.0.0-head@books/gems/rack-1.5.2/lib/rack/handler/thin.rb:1:in `require': cannot load such file -- thin (LoadError)

Where/ How to overrule this?

@gakshay
Copy link

gakshay commented Jul 22, 2015

@ryanb How about merging this pull request. Having a similar need to use the Environment variables on production..

@ferydjzz
Copy link

+1
I also need to use ENV['variable'] on production

ferydjzz pushed a commit to ferydjzz/private_pub that referenced this pull request Nov 25, 2016
Copy link

@navdeep21 navdeep21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helped me to handle this successfully.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants