Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Ralph Shnelvar
My question: Is there a way for Rails to know if it is running under Apache or under Webrick?


Background:
I run my Rails website in two environments

1) Under webrick
2) Under Apache

I am "successfully" sending email when I want my registering user to confirm the user's identity.

Devise massages ....gems/devise-4.3.0/app/views/devise/mailer/confirmation_instructions.html.erb
<p>Welcome <%= @email %>!</p>

<p>You can confirm your account email through the link below:</p>

<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>

So I was very puzzled (and spent a couple of hours investigating code) why all the emails had a confirmation link similar to
http://localhost:3000/users/confirmation?confirmation_token=wZ4QQPTH2dHi84ku9z2ms

That is, why is Devise referring to localhost:3000 even when I'm running under Apache.

The code in ~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/devise-4.3.0/lib/devise/controllers/url_helpers.rb is rather complex ... Well above my head.

So I said to myself, "Self, surely someone else has had this problem."  Yup.  They have.

I found the answer in https://groups.google.com/forum/#!topic/plataformatec-devise/0NN5-Zhyb6g.

But I still don't know of a robust way to test the environment: Webrick or Apache



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f7cb6a6d-00f5-409b-a66a-41acd5e7aed5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Hassan Schroeder-2
On Tue, Jul 25, 2017 at 11:40 AM, Ralph Shnelvar <[hidden email]> wrote:
> My question: Is there a way for Rails to know if it is running under Apache
> or under Webrick?
>
> Background:
> I run my Rails website in two environments
>
> 1) Under webrick
> 2) Under Apache

? "environment" usually refers to one of "development", "test", or
"production".

Also, what does "under Apache" mean? Using Passenger? Or as
a proxy? If the latter, something has to be doing the actual serving
(i.e. puma, unicorn, thin, webrick (not in production!)).

Clarification?
--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yB%2BVypKUV-z5h6ALU19qU0ZZ2%2BzFMaFkb7eTK0ubhaFYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Ralph Shnelvar
Re: [Rails] Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000 Hassan,

My comments interspersed.

And thank you for your quick reply.

Ralph


Tuesday, July 25, 2017, 1:00:16 PM, you wrote:

HS> On Tue, Jul 25, 2017 at 11:40 AM, Ralph Shnelvar <
[hidden email]> wrote:
>> My question: Is there a way for Rails to know if it is running under Apache
>> or under Webrick?

>> Background:
>> I run my Rails website in two environments

>> 1) Under webrick
>> 2) Under Apache

HS> ? "environment" usually refers to one of "development", "test", or
HS> "production".

Ok ... you are correct.

So what is the correct phrase for knowing what kind of server Rails is running under?

HS> Also, what does "under Apache" mean? Using Passenger? Or as
HS> a proxy? If the latter, something has to be doing the actual serving
HS> (i.e. puma, unicorn, thin, webrick (not in production!)).

"Under Apache" means, I think, Apache is somewhere in the rack.  (My understanding of "rack" is, at best, nebulous.

HS> Clarification?

Hassan, you know a LOT more about this than I do.  If my English is unclear, it is because I'm not sure of what I am talking about.

So, again, thank you for your response and patience.

HS> --
HS> Hassan Schroeder ------------------------
[hidden email]
HS> twitter: @hassan
HS> Consulting Availability : Silicon Valley or remote




Ralph

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/683989220.20170725131952%40dos32.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Hassan Schroeder-2
On Tue, Jul 25, 2017 at 12:19 PM, Ralph Shnelvar <[hidden email]> wrote:

> So what is the correct phrase for knowing what kind of server Rails is
> running under?

"what server?" should do :-)

> HS> Also, what does "under Apache" mean? Using Passenger? Or as
> HS> a proxy? If the latter, something has to be doing the actual serving
> HS> (i.e. puma, unicorn, thin, webrick (not in production!)).
>
> "Under Apache" means, I think, Apache is somewhere in the rack.  (My
> understanding of "rack" is, at best, nebulous.

First, "Apache" is the name of an organization; "Apache httpd" is a
web server (which many people erroneously refer to as "Apache").

Did you install and configure this yourself, or was it provided by
someone else?

Can you describe exactly how you're starting "Apache"?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yA%3Dg%2BCtHcL_hxYVL3xAg5rr4M27keVsW5CG4ZgbVKT0ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Norm Scherer
In reply to this post by Hassan Schroeder-2
On an ancient version of Rails (2.3) ENV["SERVER_SOFTWARE"] contains
"Apache" when I am running with Passenger.  Do not know about later
versions.

Norm

On 07/25/2017 12:00 PM, Hassan Schroeder wrote:

> On Tue, Jul 25, 2017 at 11:40 AM, Ralph Shnelvar <[hidden email]> wrote:
>> My question: Is there a way for Rails to know if it is running under Apache
>> or under Webrick?
>>
>> Background:
>> I run my Rails website in two environments
>>
>> 1) Under webrick
>> 2) Under Apache
> ? "environment" usually refers to one of "development", "test", or
> "production".
>
> Also, what does "under Apache" mean? Using Passenger? Or as
> a proxy? If the latter, something has to be doing the actual serving
> (i.e. puma, unicorn, thin, webrick (not in production!)).
>
> Clarification?


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1ab90d46-2d40-4cfc-338c-a202f707668a%40earthlink.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Ralph Shnelvar
In reply to this post by Hassan Schroeder-2
Hassan,

Comments interspersed.

And, again, thank you.

Ralph


On Tuesday, July 25, 2017 at 2:42:17 PM UTC-6, Hassan Schroeder wrote:
On Tue, Jul 25, 2017 at 12:19 PM, Ralph Shnelvar <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wDB_Z2hPAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ral...@...> wrote:

> So what is the correct phrase for knowing what kind of server Rails is
> running under?

"what server?" should do :-)

Ok, that was easy.

> HS> Also, what does "under Apache" mean? Using Passenger? Or as
> HS> a proxy? If the latter, something has to be doing the actual serving
> HS> (i.e. puma, unicorn, thin, webrick (not in production!)).
>
> "Under Apache" means, I think, Apache is somewhere in the rack.  (My
> understanding of "rack" is, at best, nebulous.

First, "Apache" is the name of an organization; "Apache httpd" is a
web server (which many people erroneously refer to as "Apache").

Lordy, you're even more of a pedant than I am.  :-)
 
Did you install and configure this yourself, or was it provided by
someone else?
 
 I installed the system myself.  It was about as much fun as going to the dentist while having a stomach flu.

Just for giggles I'll describe my system:
Windows 7 host
VMware Workstation
Ubuntu 16.04 client

I don't have a clue how I would have gotten as far as I have without VMWare.

Can you describe exactly how you're starting "Apache"?
 
Sure. I start Apache httpd with the following script:
#!/bin/bash

export RALPH_SUPPRESS_HTTPS=
sudo apache2ctl start

When I run webrick my script is
#!/bin/bash

export RALPH_SUPPRESS_HTTPS=true
sudo apache2ctl stop
rails s

So I use the environment variable RALPH_SUPPRESS_HTTPS as a proxy for whether I'm using webrick or Apache httpd

And, again, Hassan, thank you

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wDB_Z2hPAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/959cd8b9-d192-4097-9e9d-ddf956760902%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Ralph Shnelvar
In reply to this post by Norm Scherer
Norm,

Please see my answer to Hassan.

I think I'm doing something similar to that ancient version.

I can report that in my operating environment, there is no environment variable named SERVER_SOFTWARE.

Ralph

On Tuesday, July 25, 2017 at 3:49:47 PM UTC-6, Norm wrote:
On an ancient version of Rails (2.3) ENV["SERVER_SOFTWARE"] contains
"Apache" when I am running with Passenger.  Do not know about later
versions.

Norm

On 07/25/2017 12:00 PM, Hassan Schroeder wrote:

> On Tue, Jul 25, 2017 at 11:40 AM, Ralph Shnelvar <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="eIobTRdTAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ral...@...> wrote:
>> My question: Is there a way for Rails to know if it is running under Apache
>> or under Webrick?
>>
>> Background:
>> I run my Rails website in two environments
>>
>> 1) Under webrick
>> 2) Under Apache
> ? "environment" usually refers to one of "development", "test", or
> "production".
>
> Also, what does "under Apache" mean? Using Passenger? Or as
> a proxy? If the latter, something has to be doing the actual serving
> (i.e. puma, unicorn, thin, webrick (not in production!)).
>
> Clarification?


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/61a3094c-3bd1-4b0b-b171-6651791dbdf3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Hassan Schroeder-2
In reply to this post by Ralph Shnelvar
On Wed, Jul 26, 2017 at 2:53 AM, Ralph Shnelvar <[hidden email]> wrote:

>> First, "Apache" is the name of an organization; "Apache httpd" is a
>> web server (which many people erroneously refer to as "Apache").
>>
> Lordy, you're even more of a pedant than I am.  :-)

It's a losing battle, but the ASF (Apache Software Foundation)
hosts/sponsors hundreds of OSS projects (e.g. Apache Tomcat,
Apache Commons) and it can get confusing when people use
"Apache" without any qualifier. But moving on...

>  I installed the system myself.

Do you remember configuring httpd for something called
"Passenger"? If not, what kind of configuration was done to
access your Rails app?

> So I use the environment variable RALPH_SUPPRESS_HTTPS as a proxy for
> whether I'm using webrick or Apache httpd

You can get the command used to start the server (last shell
command) from the environment with "printenv _" e.g.

  puts "started with #{`printenv _`}"

Try putting the above line at the bottom of config/environment.rb
and starting your app both ways to confirm.

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCNB1%2BU1hx098VA6NXmXy6P4e_N-yn0DVkT2M-2GBF65Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Ralph Shnelvar
I think Passenger is running

The following is what I see before I invoked Firefox
ralph-data@ralph-data:~$ date
Wed Jul 26 08:27:49 MDT 2017
ralph
-data@ralph-data:~$ passenger -v
Phusion Passenger 5.1.1
ralph
-data@ralph-data:~$ sudo passenger-status
[sudo] password for ralph-data:
Version : 5.1.1
Date    : 2017-07-26 08:28:50 -0600
Instance: 6eCdJWUs (Apache/2.4.18 (Ubuntu) Phusion_Passenger/5.1.1)

----------- General information -----------
Max pool size : 6
App groups    : 0
Processes     : 0
Requests in top-level queue : 0

----------- Application groups -----------


And once I start Firefox I see
ralph-data@ralph-data:~$ sudo passenger-status
Version : 5.1.1
Date    : 2017-07-26 08:31:25 -0600
Instance: 6eCdJWUs (Apache/2.4.18 (Ubuntu) Phusion_Passenger/5.1.1)

----------- General information -----------
Max pool size : 6
App groups    : 1
Processes     : 4
Requests in top-level queue : 0

----------- Application groups -----------
/home/ralph-data (development):
 
App root: /home/ralph-data
 
Requests in queue: 0
 
* PID: 2602    Sessions: 0       Processed: 22      Uptime: 11s
    CPU
: 7%      Memory  : 79M     Last used: 8s ago
 
* PID: 2614    Sessions: 0       Processed: 1       Uptime: 8s
    CPU
: 4%      Memory  : 60M     Last used: 8s ago
 
* PID: 2623    Sessions: 0       Processed: 1       Uptime: 8s
    CPU
: 4%      Memory  : 52M     Last used: 8s ago
 
* PID: 2632    Sessions: 0       Processed: 0       Uptime: 8s
    CPU
: 0%      Memory  : 2M      Last used: 8s ago

ralph
-data@ralph-data:~$

And this is what I have in /etc/apache2/sites-enabled/ralph-data.com.conf
# Shnelvar
# See https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html
# Turning on
#   LoadModule ssl_module modules/mod_ssl.so
#  appears to break Apache
# This was fixed by running a2enmod ssl.
# The running of a2enmod ssl appears to make the line below unnecessary
# LoadModule ssl_module modules/mod_ssl.so

# Listen 443
<VirtualHost *:443>
 
# See https://www.maketecheasier.com/apache-server-ssl-support/
 
# DocumentRoot /var/www/html
 
DocumentRoot /home/ralph-data/public

 
# Shnelvar:
 
#   See https://www.phusionpassenger.com/library/deploy/apache/deploy/ruby/
 
PassengerRuby /home/ralph-data/.rbenv/versions/2.4.1/bin/ruby

 
ServerName ralph-data.com:443
 
ServerAlias www.ralph-data.com:443
 
SSLEngine on

 
# Shnelvar: SSL Certiticate
 
SSLCertificateFile /etc/ssl/private/ralph-data_com.crt

 
# Shnelvar: Pivate key
 
SSLCertificateKeyFile /etc/ssl/private/myserver.key

 
# Shnelvar:
 
#   See https://www.phusionpassenger.com/library/deploy/apache/deploy/ruby/
 
# Relax Apache security settings
 
<Directory /home/ralph-data/public>
   
RailsEnv development
   
Allow from all
   
Options -MultiViews
   
# Uncomment this if you're on Apache > 2.4:
   
Require all granted
 
</Directory>
  ServerAlias ralph-data.com
ServerAlias www.ralph-data.com
</
VirtualHost>

This is what I get when I want to see the Apache httpd version
ralph-data@ralph-data:~$ sudo apachectl -V
[sudo] password for ralph-data:
Server version: Apache/2.4.18 (Ubuntu)
Server built:   2017-06-26T11:58:04
Server's Module Magic Number: 20120211:52
Server loaded:  APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"
ralph-data@ralph-data:~$


Thanks for asking.  It's a good review of what I've done. :-)

I've read overviews about Passenger ... but I still don't get what it does.  Does it sit between Apache (httpd)  and Rails?  What does it do that Apache (httpd) doesn't do?

Ralph




On Wednesday, July 26, 2017 at 7:16:39 AM UTC-6, Hassan Schroeder wrote:
On Wed, Jul 26, 2017 at 2:53 AM, Ralph Shnelvar <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="LTeK5XJkAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ral...@...> wrote:

>> First, "Apache" is the name of an organization; "Apache httpd" is a
>> web server (which many people erroneously refer to as "Apache").
>>
> Lordy, you're even more of a pedant than I am.  :-)

It's a losing battle, but the ASF (Apache Software Foundation)
hosts/sponsors hundreds of OSS projects (e.g. Apache Tomcat,
Apache Commons) and it can get confusing when people use
"Apache" without any qualifier. But moving on...

>  I installed the system myself.

Do you remember configuring httpd for something called
"Passenger"? If not, what kind of configuration was done to
access your Rails app?

> So I use the environment variable RALPH_SUPPRESS_HTTPS as a proxy for
> whether I'm using webrick or Apache httpd

You can get the command used to start the server (last shell
command) from the environment with "printenv _" e.g.

  puts "started with #{`printenv _`}"

Try putting the above line at the bottom of config/environment.rb
and starting your app both ways to confirm.

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="LTeK5XJkAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cf862433-0c25-4755-addc-c9ba9736340a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Hassan Schroeder-2
On Wed, Jul 26, 2017 at 7:57 AM, Ralph Shnelvar <[hidden email]> wrote:
> I think Passenger is running

Yep, looks like.

> I've read overviews about Passenger ... but I still don't get what it does.
> Does it sit between Apache (httpd)  and Rails?  What does it do that Apache
> (httpd) doesn't do?

Apache httpd handles different kinds of requests and responses
through modules -- static file serving, directory listing, proxy via
http, ajp, etc. Passenger provides a rack interface which is what
Rails uses to talk to the outside world (and which is provided by
webrick, puma, unicorn, thin, etc.).

I'm not a Passenger fan after discovering that any startup error in
production dumps a page full of sensitive data out for anyone to
see, which seems utterly braindead...

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yDcQ_xgTmX3BNgbzRR%2B0WbE9iheSfVUePqpd8Kmnc0%2BNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Ralph Shnelvar
Hassan:

1) Does Passenger dump that sensitive data in development?

2 How hard is it to remove Passenger?  What are the downsides to removing it?

Ralph


On Wednesday, July 26, 2017 at 11:29:28 AM UTC-6, Hassan Schroeder wrote:
On Wed, Jul 26, 2017 at 7:57 AM, Ralph Shnelvar <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Eipxcz5yAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ral...@...> wrote:
> I think Passenger is running

Yep, looks like.

> I've read overviews about Passenger ... but I still don't get what it does.
> Does it sit between Apache (httpd)  and Rails?  What does it do that Apache
> (httpd) doesn't do?

Apache httpd handles different kinds of requests and responses
through modules -- static file serving, directory listing, proxy via
http, ajp, etc. Passenger provides a rack interface which is what
Rails uses to talk to the outside world (and which is provided by
webrick, puma, unicorn, thin, etc.).

I'm not a Passenger fan after discovering that any startup error in
production dumps a page full of sensitive data out for anyone to
see, which seems utterly braindead...

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Eipxcz5yAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0109da1d-823a-4928-9e2c-4fac111d1bbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Walter Lee Davis
In reply to this post by Hassan Schroeder-2
Not since several versions ago. They heard your displeasure and did something about it.

Walter

> On Jul 26, 2017, at 1:28 PM, Hassan Schroeder <[hidden email]> wrote:
>
> I'm not a Passenger fan after discovering that any startup error in
> production dumps a page full of sensitive data out for anyone to
> see, which seems utterly braindead...

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/20B29F30-9976-4626-95BE-FA01290D347E%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Walter Lee Davis
In reply to this post by Ralph Shnelvar

> On Jul 26, 2017, at 1:35 PM, Ralph Shnelvar <[hidden email]> wrote:
>
> Hassan:
>
> 1) Does Passenger dump that sensitive data in development?
>
> 2 How hard is it to remove Passenger?  What are the downsides to removing it?

You have to replace it with *something* -- Unicorn, Puma, basically another app server. Rails won't do much besides talk to Rack, to reach the outside world, you need something that implements call() and writes out headers and body to stdout.

Walter

>
> Ralph
>
>
> On Wednesday, July 26, 2017 at 11:29:28 AM UTC-6, Hassan Schroeder wrote:
> On Wed, Jul 26, 2017 at 7:57 AM, Ralph Shnelvar <[hidden email]> wrote:
> > I think Passenger is running
>
> Yep, looks like.
>
> > I've read overviews about Passenger ... but I still don't get what it does.
> > Does it sit between Apache (httpd)  and Rails?  What does it do that Apache
> > (httpd) doesn't do?
>
> Apache httpd handles different kinds of requests and responses
> through modules -- static file serving, directory listing, proxy via
> http, ajp, etc. Passenger provides a rack interface which is what
> Rails uses to talk to the outside world (and which is provided by
> webrick, puma, unicorn, thin, etc.).
>
> I'm not a Passenger fan after discovering that any startup error in
> production dumps a page full of sensitive data out for anyone to
> see, which seems utterly braindead...
>
> --
> Hassan Schroeder ------------------------ [hidden email]
> twitter: @hassan
> Consulting Availability : Silicon Valley or remote
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0109da1d-823a-4928-9e2c-4fac111d1bbb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5BAF4D2A-D0D0-4F67-BEDA-6989CB0F1EBE%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Devise's helper - confirmation_url(@resource, confirmation_token: @token) - returns localhost3000

Hassan Schroeder-2
In reply to this post by Walter Lee Davis
On Wed, Jul 26, 2017 at 11:38 AM, Walter Lee Davis <[hidden email]> wrote:
> Not since several versions ago. They heard your displeasure and did something about it.

Well in that case -- nnnnevermind  😀

Still, I prefer the flexibility of having a proxy in front of Unicorn or
Puma since I can strip out nonsense requests like "/phpmyadmin"
before they pollute my Rails logs (among other things).

Setting that up is a whole new learning though, and may not be all
that helpful for anyone who's already happy with Passenger.

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCkXQhE9uG3o9oMOEtoFG3dd%3DV14LaC%3DTn%2BE%2BBrjJQxnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...