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 1eygdI-0004jp-TL for pgadmin-hackers@arkaria.postgresql.org; Wed, 21 Mar 2018 16:30:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eygdH-0004q7-5j for pgadmin-hackers@arkaria.postgresql.org; Wed, 21 Mar 2018 16:30:35 +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 1eygdG-0004pv-Ol for pgadmin-hackers@lists.postgresql.org; Wed, 21 Mar 2018 16:30:35 +0000 Received: from mail-it0-x244.google.com ([2607:f8b0:4001:c0b::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eygd8-0000zU-JZ for pgadmin-hackers@postgresql.org; Wed, 21 Mar 2018 16:30:32 +0000 Received: by mail-it0-x244.google.com with SMTP id b136-v6so7631581iti.3 for ; Wed, 21 Mar 2018 09:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pivotal-io.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=C2A4n4Q/f6U9WBUeKbAz8wpbfgQzgEisAY35eWfiU1Y=; b=mh6uEZIZzYMK7LDc7weeDVm8fXmFjJD4exf6C/7LlGhDkV4nEKog5OVDUI5D2VTs/p oBaNBYzbr3v7mygOrhNaw1ck2oQH9nxpEOccRmGM6nj/IXp3iPmDSpByqyYzjGdBrpOK v8Nefw45/7fNqWsHbtIVgZ8Ou39+OK/TilmnPmmJiTI9CnximAm9qlnnXkV4nVWDnyy9 8t7mxrZs7O64OVrRAgCOiAf4vKH1+Ym/jUTSksIdsAiS0gHkMNYeKMzXN2UCfLrPJopB z0Lz/RpJ9V60H0Zi/L1D9rdTwMgyAJ+imGlwYXuRrk/oZZ3ywLayWWcu8OMNaiDoQiE7 r0+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C2A4n4Q/f6U9WBUeKbAz8wpbfgQzgEisAY35eWfiU1Y=; b=k2cXAYDMjMJxrvy+ny/gkqGttD8588ZJhymOgPLt+XIgkUOra2xnTumLfvE5MsH56L /hj9cp1y2INEgW7Ies69rjYmwKOIzMbt+8/jxHjSpm5xl/JYEh2De11pRND73XZTBhGw cDU4f0gRt9H7zz7MPrh+D6n0O7O703yu+n5elwNATjW4SiyVfrP0WpnnzMnAcPRoia3X trd4L+SiwlXGTO7au5KUggd1kdmSwt7W3UFmhK2chnEt0ty2QBbXbnMXVzw9ug/YssbF vr8Ykt131c/hgfisn3gM3FveYHlhkeBwRoJpedExRF67FLYaIFaG/OjsJnAFNOCAVdQS uE5w== X-Gm-Message-State: AElRT7ENtudDLSWtN5gimcIZXwunJuYW3DFpDIwt19s4szxee75y4i9w nSPaE2DVi9bsQWUhNvmUGrcGR7rMRXJzMQwdgP3sAQ== X-Google-Smtp-Source: AG47ELvFztw8KvWi17q1RLAUzx+kjwfl74/pYjB5in7BDF6lwVpMkGG5jJJsqzJvFeUzDgPeIdt8aPKYlAX2kFDOyXY= X-Received: by 2002:a24:3609:: with SMTP id l9-v6mr5041400itl.95.1521649825396; Wed, 21 Mar 2018 09:30:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Joao De Almeida Pereira Date: Wed, 21 Mar 2018 16:30:15 +0000 Message-ID: Subject: Re: Experiencing issues To: Dave Page Cc: Khushboo Vashi , Murtuza Zabuawala , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000050d92b0567eeb593" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000050d92b0567eeb593 Content-Type: text/plain; charset="UTF-8" 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 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 > --00000000000050d92b0567eeb593 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Another thing when I do this configuration:
DEFAULT_SERVER =3D '127.0.0.1'
SESSION_COOKIE_DOMAIN= =3D 'localhost'
CO= OKIE_DEFAULT_DOMAIN =3D 'localhos= t'
I get the following exception:

builtins.ValueError

ValueError= : Setting 'domain' for a cookie on a server running localy (ex: loc= alhost) is not supportted by complying browsers. You should have something = like: '127.0.0.1 localhost dev.localhost' on your hosts file and th= en point your server to run on 'dev.localhost' and also set 'do= main' for 'dev.localhost'

And if you follow the i= nstructions and change the hosts file it allows you to start the applicatio= n but when you try to open a database server you will get the 428 errorThanks
Joao


On Wed, Mar 21, 2018 at 12:01 PM Dave Page <dpage@pgadmin.org> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
<= div class=3D"gmail_quote">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_DOM= AIN =3D DEFAULT_SERVER

If the application lives in the domain pgadmin.somedomain.co= m do I need to have in config_local:
DEFAULT_SERVER =3D '0.0.0.= 0'
SESSION_COOKIE_DOMAIN =3D 'pgadmin.somedomain.com'
COOKIE_= DEFAULT_DOMAIN =3D '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 t= o disable this, because when we are developing doesn't make sense to no= t being able to use localhost and 127.0.0.1=C2=A0
<= div>
+1. I didn't realise we'd added th= is restriction when I tested the patch.

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

=C2=A0

Tha= nks
Joao

On Wed, Mar 21, 2018 at 11:01 AM Khus= hboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
On Wed, Mar 21, 2018 at 8:27 PM, Joao De Almeida Pereira <= span dir=3D"ltr"><jdealmeidapereira@pivotal.io> wrote:
So what you are saying is that if I = have a server, I need to do DEFAULT_SERVER=3D0.0.0.0 and then set the real = domain on the COOKIE domain?

No I= am saying, whatever you set as a DEFAULT_SERVER,=C2=A0 the app can be acce= ssible with that server.
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:
On Wed, Mar 21, 2018 at 8:10 PM, Joao De Almeida Pereira <jdealmeidapereira@pivotal.io> wrote:
Ok Murtuza you are right,=C2=A0
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?

<= /blockquote>
<= div class=3D"gmail_quote">
No, you can't.
Domain based co= okie will work for that domain and it's sub-domains.
<= /div>
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 i= n the inspector for cookies I have none
Share your config_local file.
On Wed, Mar 21, 2018 at 10:30 AM Murtuza Zabuawala <murtuza.z= abuawala@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 =3D '0.0.0.0'=C2=A0
COOKIE_DEFAULT_DOMAIN =3D SESSION_COOKI= E_DOMAIN =3D DEFAULT_SERVER

Clear your browser cookies and server sid= e sessions.


=
--
Regards,
Murtuza Zabuawala
Enterprise= DB:=C2=A0http://www.enterprisedb.com
The Enterprise PostgreSQL Co= mpany


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<= /a>> wrote:


On 21 Mar = 2018 19:41, "Joao De Almeida Pereira" <jdealmeidapereira@pivotal.io= > wrote:
Hello Hackers,
Can anyone use the cur= rent master branch?
When I try to open a server I get a 428. Is t= hat only me?
May be because of cookie changes.=C2=A0
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.

Tha= nks
Joao



<= /div>
=



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
=
--00000000000050d92b0567eeb593--