Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyqPe-0005nP-Sz for pgadmin-hackers@arkaria.postgresql.org; Thu, 22 Mar 2018 02:57:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eyqPd-0000Hf-A7 for pgadmin-hackers@arkaria.postgresql.org; Thu, 22 Mar 2018 02:57:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyqPc-0000HV-Nb for pgadmin-hackers@lists.postgresql.org; Thu, 22 Mar 2018 02:57:09 +0000 Received: from mail-ot0-x229.google.com ([2607:f8b0:4003:c0f::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eyqPZ-0007CV-0D for pgadmin-hackers@postgresql.org; Thu, 22 Mar 2018 02:57:07 +0000 Received: by mail-ot0-x229.google.com with SMTP id m7-v6so7939435otd.1 for ; Wed, 21 Mar 2018 19:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=l/RCF0mslab1KPOecnP1tRmd/EindMhqE7y+J2+CrZ0=; b=FC+t/6KbgCQBMl8YO07WBfUMk36VLTqpzpqFk+Q9bzAipHGJ8YMYJmI9VGNhdA8UUE zyNZXRUmHHgINzG2c4SjFJQ0mukN0vHd/vgt96R6us0Nx2w4tutG5vFLyO0UDwEZCYfc +MlMZ75sTarlXrldrOhYkVbOvS1npNksancBNYf6GymF8XLeL2Us7C9Yjs1Dt3gxTC+l gmlyQ4ZlKMMxr068n+e+b2lpFRgF0D7oHLlLYOs7qUJyS7mEtHEn9IzsCalqt4UTYodW 4CLszlqxGbm+9iir6gxN63G5A/6Sfo/kdJChE4F1d0gE7quqaAxP1/0SSF2lPyhxGQee 90/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=l/RCF0mslab1KPOecnP1tRmd/EindMhqE7y+J2+CrZ0=; b=nGGgeVJlWT+OOzC2jXodxZr/vP+7Hw0MBdxhL7VLhzPOYdMR4qPZEfzciiv4uBVl8o Os9+s0kfyst7STFjUFmbgskGWJ1ukUSQz9IUevHfLsVLr+i7N5iyzqB7JSugy+TU6Ghz m/GIXDmr94qLDnAitrjSuBcUCbrAJBmCgZ5c6IL8v9JeXMmTRRi1+ypBwgAAAnAXr+8t PnLPdOJNAimLd/SoudnRwxx6NmtzdhNNtv78K/yWrmeMxjTz2rqRCI895tvbC/p0/y77 HpXQPSaRGWhxjZPXYaIzWYjX2rmgUFKa/hsPFO942VK/fI2BzRgVps9ceRDG7Cz7H0EZ NLsA== X-Gm-Message-State: AElRT7G7xAzb4KO76/Dyorj4nljvYogMEYSKDbLuZ8q55uUO89XbyLTP K7JIr5IxzNOLypGH5cvHfMnOLavsaamoKkgfWG2wwA== X-Google-Smtp-Source: AG47ELvQjxCuTAtGkcugpFmlRhevMFrbxZ8MPK3a+t/PR0dVkt4W2rXcsuIBJfjXMC+QJahITQr+82lrv6HlKR91KFg= X-Received: by 2002:a9d:2b54:: with SMTP id f20-v6mr12826439otd.277.1521687423640; Wed, 21 Mar 2018 19:57:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.138.251 with HTTP; Wed, 21 Mar 2018 19:57:03 -0700 (PDT) In-Reply-To: References: From: Khushboo Vashi Date: Thu, 22 Mar 2018 08:27:03 +0530 Message-ID: Subject: Re: Experiencing issues To: Joao De Almeida Pereira Cc: Dave Page , Murtuza Zabuawala , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000587fe80567f77666" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000587fe80567f77666 Content-Type: text/plain; charset="UTF-8" On Wed, Mar 21, 2018 at 10:00 PM, Joao De Almeida Pereira < jdealmeidapereira@pivotal.io> wrote: > Another thing when I do this configuration: > > DEFAULT_SERVER = '127.0.0.1' > SESSION_COOKIE_DOMAIN = 'localhost' > COOKIE_DEFAULT_DOMAIN = 'localhost' > > I get the following exception: > builtins.ValueError > > ValueError: Setting 'domain' for a cookie on a server running localy (ex: > localhost) is not supportted by complying browsers. You should have > something like: '127.0.0.1 localhost dev.localhost' on your hosts file and > then point your server to run on 'dev.localhost' and also set 'domain' for > 'dev.localhost' > And if you follow the instructions and change the hosts file it allows you > to start the application but when you try to open a database server you > will get the 428 error > Thanks > Joao > > Right, many browser doesn't support localhost as a cookie domain. The settings you did is not correct, your cookie will be stored as a 'localhost' domain and you trying to run the app as 127.0.0.1. If we set a domain for the cookie than either that domain or sub-domains can access that cookie. In regards to your question of 2 domain names, this type of situation arrives when any site is configured explicitly to divide the load. In case of pgAdmin 4, this is not going to happen :). It is always recommend to use cookie with domain settings, but as Dave suggested we can leave that upto user. So, we will make it configurable and user will decide to have it or not. > > On Wed, Mar 21, 2018 at 12:01 PM Dave Page wrote: > >> On Wed, Mar 21, 2018 at 3:57 PM, Joao De Almeida Pereira < >> jdealmeidapereira@pivotal.io> wrote: >> >>> Sorry I did not understand what you said. >>> This configuration: >>> >>> DEFAULT_SERVER = '0.0.0.0' >>> SESSION_COOKIE_DOMAIN = DEFAULT_SERVER >>> COOKIE_DEFAULT_DOMAIN = DEFAULT_SERVER >>> >>> If the application lives in the domain pgadmin.somedomain.com do I need >>> to have in config_local: >>> DEFAULT_SERVER = '0.0.0.0' >>> SESSION_COOKIE_DOMAIN = 'pgadmin.somedomain.com' >>> COOKIE_DEFAULT_DOMAIN = 'pgadmin.somedomain.com' >>> ? >>> >>> Does this mean that if for some reason I have a second domain like >>> pgadmin.somedomain2.com that I want to use I cannot? >>> >>> The issue of 127.0.0.1 to localhost is very cumbersome, and somehow we >>> should be able to disable this, because when we are developing doesn't make >>> sense to not being able to use localhost and 127.0.0.1 >>> >> >> +1. I didn't realise we'd added this restriction when I tested the patch. >> >> Perhaps a better approach would be to leave the default cookie handling >> as it was, and just expose the domain and path via config options that the >> user can set if appropriate for their installation. >> >> >> >>> >>> Thanks >>> Joao >>> >>> On Wed, Mar 21, 2018 at 11:01 AM Khushboo Vashi < >>> khushboo.vashi@enterprisedb.com> wrote: >>> >>>> On Wed, Mar 21, 2018 at 8:27 PM, Joao De Almeida Pereira < >>>> jdealmeidapereira@pivotal.io> wrote: >>>> >>>>> So what you are saying is that if I have a server, I need to do >>>>> DEFAULT_SERVER=0.0.0.0 and then set the real domain on the COOKIE domain? >>>>> >>>>> No I am saying, whatever you set as a DEFAULT_SERVER, the app can be >>>> accessible with that server. >>>> As, we have explicitly set DOMAIN in the cookie setting. >>>> >>>>> On Wed, Mar 21, 2018 at 10:55 AM Khushboo Vashi < >>>>> khushboo.vashi@enterprisedb.com> wrote: >>>>> >>>>>> On Wed, Mar 21, 2018 at 8:10 PM, Joao De Almeida Pereira < >>>>>> jdealmeidapereira@pivotal.io> wrote: >>>>>> >>>>>>> Ok Murtuza you are right, >>>>>>> Now my question is I have the default server to 127.0.0.1 and I want >>>>>>> to access it using localhost as well. How can I do this? >>>>>>> >>>>>>> No, you can't. >>>>>> Domain based cookie will work for that domain and it's sub-domains. >>>>>> >>>>>>> On Wed, Mar 21, 2018 at 10:39 AM Khushboo Vashi < >>>>>>> khushboo.vashi@enterprisedb.com> wrote: >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On 21 Mar 2018 20:01, "Joao De Almeida Pereira" < >>>>>>>> jdealmeidapereira@pivotal.io> wrote: >>>>>>>> >>>>>>>> I tried that but still nothing. When i check in the inspector for >>>>>>>> cookies I have none >>>>>>>> >>>>>>>> Share your config_local file. >>>>>>>> >>>>>>>> On Wed, Mar 21, 2018 at 10:30 AM Murtuza Zabuawala < >>>>>>>> murtuza.zabuawala@enterprisedb.com> wrote: >>>>>>>> >>>>>>>>> Yes, that's cookie related issue (RM#3197), To fix that I added >>>>>>>>> below in my config_local.py and it started working again, >>>>>>>>> >>>>>>>>> DEFAULT_SERVER = '0.0.0.0' >>>>>>>>> COOKIE_DEFAULT_DOMAIN = SESSION_COOKIE_DOMAIN = DEFAULT_SERVER >>>>>>>>> >>>>>>>>> Clear your browser cookies and server side sessions. >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Regards, >>>>>>>>> Murtuza Zabuawala >>>>>>>>> EnterpriseDB: http://www.enterprisedb.com >>>>>>>>> The Enterprise PostgreSQL Company >>>>>>>>> >>>>>>>>> >>>>>>>>> On Wed, Mar 21, 2018 at 7:55 PM, Joao De Almeida Pereira < >>>>>>>>> jdealmeidapereira@pivotal.io> wrote: >>>>>>>>> >>>>>>>>>> Where can I find information about that? >>>>>>>>>> >>>>>>>>>> On Wed, Mar 21, 2018 at 10:16 AM Khushboo Vashi < >>>>>>>>>> khushboo.vashi@enterprisedb.com> wrote: >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On 21 Mar 2018 19:41, "Joao De Almeida Pereira" < >>>>>>>>>>> jdealmeidapereira@pivotal.io> wrote: >>>>>>>>>>> >>>>>>>>>>> Hello Hackers, >>>>>>>>>>> Can anyone use the current master branch? >>>>>>>>>>> When I try to open a server I get a 428. Is that only me? >>>>>>>>>>> >>>>>>>>>>> May be because of cookie changes. >>>>>>>>>>> Check your config.py and config_local.py if you have done >>>>>>>>>>> changes related to DEFAULT_SERVER in your config_local.py then you need to >>>>>>>>>>> change other 2 cookie related variables also. >>>>>>>>>>> >>>>>>>>>>> Thanks >>>>>>>>>>> Joao >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>> >>>>>>>> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > --000000000000587fe80567f77666 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, Mar 21, 2018 at 10:00 PM, Joao De Almeida Pereira <= jdealmeidapereira@pivotal.io> wrote:
Another thing when I do this configuration:
=
DEFAULT_SERVER =3D '127.0.0.1'
SESSION_COO= KIE_DOMAIN =3D 'localhost'COOKIE_DEFAULT_DOMAIN =3D = 9;localhost'
I get the following exception:

builtins.ValueError

ValueError: Setting 'domain&#= 39; for a cookie on a server running localy (ex: localhost) is not supportt= ed by complying browsers. You should have something like: '127.0.0.1 lo= calhost dev.localhost' on your hosts file and then point your server to= run on 'dev.localhost' and also set 'domain' for 'dev.= localhost'

And if you follow the instructions and change = the hosts file it allows you to start the application but when you try to o= pen a database server you will get the 428 error
Thanks
Joao

=
Right, many browser doesn't support loca= lhost as a cookie domain.
The settings you did is not correct, yo= ur cookie will be stored as a 'localhost' domain and you trying to = run the app as 127.0.0.1.
If we set a domain for the cookie than = either that domain or sub-domains can access that cookie.

In regards to your question of 2 domain names, this type of situati= on arrives when any site is configured explicitly to divide the load. In ca= se of pgAdmin 4, this is not going to happen :).
It is always rec= ommend to use cookie with domain settings, but as Dave suggested we can lea= ve that upto user. So, we will make it configurable and user will decide to= have it or not.=C2=A0
=C2=A0

On Wed, Mar 21, 2018 at 12:01 PM Dave Pag= e <dpage@pgadmin.= org> wrote:
On Wed, Mar 21, 2018= at 3:57 PM, Joao De Almeida Pereira <jdealmeidapereira@pivotal= .io> wrote:
Sorry I did not understand what you said.
This configuration:
DEFAULT_SERVER =3D '0.0.0.0'
SESSION_COOKIE_DOMAIN =3D DEFAULT= _SERVER
COOKIE_DEFAULT_DOMAIN =3D DEFAULT_SERVER

If the applicati= on lives in the domain pgadmin.somedomain.com do I need to have in config_local:
D= EFAULT_SERVER =3D '0.0.0.0'
SESSION_COOKIE_DOMAIN =3D 'pgadmin.somedomain.c= om'
COOKIE_DEFAULT_DOMAIN =3D 'pgadmin.somedomain.com'
=
?

Does this mean that if for some reason I ha= ve a second domain like pgadmin.somedomain2.com that I want to use I cannot?
<= div>
The issue of 127.0.0.1 to localhost is very cumbersome, = and somehow we should be able to disable this, because when we are developi= ng doesn't make sense to not being able to use localhost and 127.0.0.1= =C2=A0

+1. I didn= 't realise we'd added this restriction when I tested the patch.

Perhaps a better approach would be to leave the defau= lt cookie handling as it was, and just expose the domain and path via confi= g options that the user can set if appropriate for their installation.

=C2=A0

Thanks
Joao=

On Wed, Mar 21, 2018 at 11:01 AM Khu= shboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
On Wed, Mar 21, 2018 at 8:27 PM, Joao De Almeida P= ereira <jdealmeidapereira@pivotal.io> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
So what you are saying is th= at if I have a server, I need to do DEFAULT_SERVER=3D0.0.0.0 and then set t= he real domain on the COOKIE domain?
No I am saying, whatever you = set as a DEFAULT_SERVER,=C2=A0 the app can be accessible with that server.<= /div>
As, we have explicitly set=C2=A0 DOMAIN in the cookie setting.
On Wed, Mar 21, 2018 at 10:= 55 AM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
<= /div>
On Wed, Mar 21, 2018 at 8:10 PM, Joao De Al= meida Pereira <jdealmeidapereira@pivotal.io> wrot= e:
Ok Murtuza you are ri= ght,=C2=A0
Now my question is I have the default server to 127.0.0.1 an= d I want to access it using localhost as well. How can I do this?

No, you can't.
Domain based cookie will work= for that domain and it's sub-domains.
On Wed, Mar 21, 2018 at 10:39 AM Khushboo Vas= hi <khushboo.vashi@enterprisedb.com> wrote:

On 21 Mar 2018 20:01, "Joao De Almeida Per= eira" <jdealmeidapereira@pivotal.io> wrote:
<= blockquote class=3D"m_3207310536348399245m_-6914405037267552826m_-418831870= 7857109845m_2950529412147249125m_-3150612691282222871m_4774345178140320316m= _-5320753082471329630m_6132526579301575792m_5228332074527987056quote" style= =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I tried that but still nothing. When i check in the inspector for = cookies I have none
Share your config_local file.
On Wed, Mar 21, 2018 at 10:30 AM Murtuz= a Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Yes, that's cookie related iss= ue (RM#3197), To fix that I added below in my config_local.py and it starte= d working again,

DEFAULT_SERVER =3D '0= .0.0.0'=C2=A0
COOKIE_DEFAU= LT_DOMAIN =3D SESSION_COOKIE_DOMAIN =3D DEFAULT_SERVER

Clear your bro= wser cookies and server side sessions.


-= -
Regards,
Murtuza Zabuawala
EnterpriseDB:=C2=A0http://www.enterprisedb.com
The Enterprise PostgreSQL Company

=

On Wed, Mar 21, 2018 at 7:55 PM, Joao De Alm= eida Pereira <jdealmeidapereira@pivotal.io> wrote= :
Where can I find infor= mation about that?

On = Wed, Mar 21, 2018 at 10:16 AM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On 21= Mar 2018 19:41, "Joao De Almeida Pereira" <jdealmeidapereira@pivotal.i= o> wrote:
Hello Hackers,<= div>Can anyone use the current master branch?
When I try to open = a server I get a 428. Is that only me?
=
May be because of cookie ch= anges.=C2=A0
Check your config.py and config_local.p= y if you have done changes related to DEFAULT_SERVER in your config_local.p= y then you need to change other 2 cookie related variables also.

Thanks
Joao



<= /div>
=



--
Dave Page
Blog:= http://pgsnake.b= logspot.com
Twitter: @pgsnake

Enterprise= DB UK: http://www= .enterprisedb.com
The Enterprise PostgreSQL Company

--000000000000587fe80567f77666--