Re: [pgadmin-hackers] First time launch as simple user (improvement needed) - Mailing list pgadmin-hackers

From Dave Page
Subject Re: [pgadmin-hackers] First time launch as simple user (improvement needed)
Date
Msg-id CA+OCxoyVfEP-rsOy=N1dSAQxw8cne19e+eBX7N3jVMWLzrOFBg@mail.gmail.com
Whole thread Raw
In response to Re: [pgadmin-hackers] First time launch as simple user (improvement needed)  (Bruno Friedmann <bruno@ioda-net.ch>)
List pgadmin-hackers
Hi

On Tue, Jan 17, 2017 at 4:50 PM, Bruno Friedmann <bruno@ioda-net.ch> wrote:
> On mardi, 17 janvier 2017 09.23:49 h CET Dave Page wrote:
>> Hi
>>
>> On Mon, Jan 16, 2017 at 5:20 PM, Bruno Friedmann <bruno@ioda-net.ch> wrote:
>> > In packaged world, the user will have a pgAdmin4.desktop file to be able
>> > to
>> > run it from normal menus.
>>
>> Yes.
>>
>> > I've just tested a full fresh install on user system, and if it is run
>> > from
>> > graphical environnement, nobody will see the console output
>> > The configuration database - '/ioda/home/bruno/.pgadmin/pgadmin4.db' does
>> > not exist.
>> > Entering initial setup mode...
>> > NOTE: Configuring authentication for SERVER mode.
>> >
>> >     Enter the email address and password to use for the initial pgAdmin
>> >     user
>> >
>> > account:
>> Right - but why would you run it in server mode under a graphical
>> environment? Server mode is intended for people running in multi-user
>> mode behind a webserver - in which case the docs are pretty clear that
>> the user should manually run setup.py from the command line.
>>
>> If you're in graphical mode (what we call desktop mode), then there
>> are no prompts.
> I guess you didn't catch what I've tried to explain.
> I've run runtime/pgAdmin4 which has launched the qt web windows in which
> nothing happen (cause the first time configuration was never run)
>
> The text I copy and paste is coming from the output of pgAdmin4 in the console
> I've run it. I was not trying to run it in server-mode.
> Just emulating what a n00bs will do click on executable.

Right, but whatever packages you're using should configure the
settings for you correctly (in a Git checkout or source build, it's
assumed you know what you're doing).

The reason the default in the config file in git is SERVER_MODE = True
is for security - setting it to false disables application logins, and
we want it to default to a secure setup rather than risk someone stick
it behind a web server, but not enable server mode by mistake.

>> > The console is "polluated" by the graphical engine, leading to a confused
>> > user.
>> >
>> > What or how can the situation be improved to be able to send pgAdmin4 to
>> > "dumb" end-users ?
>> >
>> > Who can I blame for having a setup for font size (in editor super) and not
>> > the rest of the interface ... see attachment on my external hidpi
>> > (192dpi) screen. I can't imagine the hassle to live with so small fonts
>> > on the internal laptop screen at 288dpi :-)))
>>
>> I'm not sure why you've got such differences in font size, unless
>> you've changed your config (the query tool/SQL box font size is
>> specified in em units in File -> Preferences -> SQL Editor -> Options.
>> On my retina display, the defaults seem to work nicely. I haven't
>> heard of anyone else experiencing a mismatch.
>>
>> The zoom level might be an issue under some OSs. macOS handles it just
>> fine, but I know on some Windows setups the default is unusably small.
>> We probably need some code in the runtime to auto-adjust the zoom
>> level in such cases.
>
> The editor is right cause I've put 2em as font size, but I was thinking that
> all the interface can be adapted to my favorite resolution.
>
> So If the rest should follow the global setup, as you have on osx then there's
> at least a problem with qt5/plasma5 here (which is not really a surprise, just
> a damn thing more to debug)...
>
> I will do some tests to check, if I found something.
> If you have a pointer in code to a place to be hacked I'm your guinea pig :-)

I'm really not sure if it's a bug or just the way some platforms work.
I've heard of similar issues on Windows - but on there (at least what
I've seen running it on VMware) is that you run in high-DPI mode, but
then have to set the application zoom level to be able to see anything
(and even then, some of the older Windows standard dialogues don't
play nicely).

I assume you're on Linux - but I don't know what your window
manager/desktop environment will be doing in terms of zooming in
response to high-DPI displays. Should it handle it automagically as
macOS does, or badly like Windows? Or something in between?

If we know what is supposed to happen on each platform, and can figure
out how to detect the display mode, then we can introduce a
compensating factor into the default zoom level in the runtime (see
line 145 in BrowserWindow.cpp). Or maybe Qt/QtWebEngine can deal with
it for us, and I just haven't figured out how yet).

>> > Last things I found strange is the connection to
>> > CLOSE-WAIT 1      0      10.26.8.2:43718              192.0.73.2:443
>> > users:(("pgAdmin4",pid=11818,fd=109))
>> > the ip point to automattic inc (automattic.com)
>> >
>> > I don't know what it does, nor the purpose for that, but I'm afraid to
>> > have to give an anwser to openSUSE security team if they digg in, and
>> > also to suspicious users.
>>
>> I have no idea what that is, and can't find any reference to either
>> the IP or domain in the code. I also cannot reproduce it on my
>> machine.
>>
>> I wonder if it could be Qt Web Engine loading some plugin you have for
>> Chrome or something like that?
>>
>> Can you reproduce it outside of the pgAdmin runtime?
>
> I will check that again several time on fresh vm with no internet access.
> Thanks to have confirmed what I've tried to proove that nothing in the code
> seems to point to this address.

OK, thanks.



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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


pgadmin-hackers by date:

Previous
From: Bruno Friedmann
Date:
Subject: Re: [pgadmin-hackers] First time launch as simple user (improvement needed)
Next
From: Dave Page
Date:
Subject: [pgadmin-hackers] pgAdmin 4 commit: Fix typo in virtualenvwrapper's name. Fixes #2083