Getting PgAdmin 4 in server mode to behave more like PhpPgAdmin?

From: "Langley, Scott E" <slangley(at)scharp(dot)org>
To: "'pgadmin-support(at)postgresql(dot)org'" <pgadmin-support(at)postgresql(dot)org>
Subject: Getting PgAdmin 4 in server mode to behave more like PhpPgAdmin?
Date: 2016-10-03 21:00:58
Message-ID: 338A7B0E9A69874B9D933A0B0D2527A4ECEBE021@adama.fhcrc.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

How would I go about getting PgAdmin 4 running in server mode to behave more like PhpPgAdmin where the configured database connections are set up once in the server's configuration, and individual database users only need to use their database credentials to connect, rather than requiring separate web login accounts?

For example, one can edit the configuration file for PhpPgAdmin:

phpPgAdmin/conf/config.inc.php

to not require a login to the web server:

$conf['extra_login_security'] = false;

and define the configured databases like so:

$conf['servers'][0]['desc'] = 'First Database';
$conf['servers'][0]['host'] = 'pgserver1.mydomain.com';
$conf['servers'][0]['port'] = 5432;
$conf['servers'][0]['sslmode'] = 'allow';
$conf['servers'][0]['defaultdb'] = 'template1';

$conf['servers'][1]['desc'] = 'Second Database';
$conf['servers'][1]['host'] = 'pgserver2.mydomain.com';
$conf['servers'][1]['port'] = 5432;
$conf['servers'][1]['sslmode'] = 'allow';
$conf['servers'][1]['defaultdb'] = 'template1';

Why would I want to do this?

First, I don't want to have to maintain two login accounts per user, and second, I want to pre-configure the database configurations for our less-savvy users in our controlled network environment.

Would this functionality require substantial code changes to PgAdmin 4 or could it be achieved via an add-on module?

Note: If I turn on SERVER_MODE for PhpAdmin 4 after first running the setup for Desktop mode, all the web client sessions I point at the server attempt to use the same database user login. That certainly is not what I want for a multi-user application. This is with the server running as a web application in a Python environment. Perhaps it behaves differently when run as WSGI application under Apache?

Thanks.
Scott Langley
Systems Analyst/Programmer
Statistical Center for HIV/AIDS Research and Prevention (SCHARP)
Fred Hutchinson Cancer Research Center
Seattle, Washington

slangley(at)scharp(dot)org
(206) 667-5117
Fax (206) 667-4812

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2016-10-04 09:07:35 Re: pgAdmin4 - Query Tool stuck "Initializing the query execution!" on localhost
Previous Message Laczkóczki Ákos 2016-10-03 18:53:45 Re: Cannot launch pgAdmin4