Re: Consider default SERVER_MODE =True for pgadmin4-v1-web - Mailing list pgadmin-support

From Dave Page
Subject Re: Consider default SERVER_MODE =True for pgadmin4-v1-web
Date
Msg-id CA+OCxoyxy_qDe3WG_UR9L3HqQw-o3yfEHDfzYOTKUDcsrpciVA@mail.gmail.com
Whole thread Raw
In response to Consider default SERVER_MODE =True for pgadmin4-v1-web  (Mike Surcouf <mikes@surcouf.co.uk>)
Responses RE: Consider default SERVER_MODE =True for pgadmin4-v1-web  (Mike Surcouf <mikes@surcouf.co.uk>)
RE: Consider default SERVER_MODE =True for pgadmin4-v1-web  (Mike Surcouf <mikes@surcouf.co.uk>)
List pgadmin-support


On Wed, Jul 19, 2017 at 4:54 PM, Mike Surcouf <mikes@surcouf.co.uk> wrote:
It would be nice if the pgadmin40v1-web package set the SERVER_MODE  = True

I can't think why you would install the web package without this but there may be a reason?

Yes, it would break the default installation mode (desktop).

The web package is "the web components of pgadmin", not "pgadmin to run in web mode".
 
Also since the setup script does different things depending on this value if you don't do it first you have to delete the config and sqllite database and start again otherwise it will never work

Currently I have this in my setup script

#Overide SERVER_MODE (must be done BEFORE setup)
cat >> /usr/lib/python2.7/site-packages/pgadmin4-web/config_local.py << "EOF"
SERVER_MODE = True
EOF

I tend to just edit that setting in config_local.py as I need it, but then also include:

# Use a different config DB for each server mode.
if SERVER_MODE == False:
    SQLITE_PATH = os.path.join(
        DATA_DIR,
        'pgadmin4-desktop.db'
    )
else:
    SQLITE_PATH = os.path.join(
        DATA_DIR,
        'pgadmin4-server.db'
    ) 

Anyway, to the main point - I've been trying to figure out a half-decent way of being able to support both server and desktop modes out of the box; and have yet to come up with anything that wouldn't be a tangled mess of config files. I still have some ideas though, and hope to explore them some more tomorrow.

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

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

pgadmin-support by date:

Previous
From: Mike Surcouf
Date:
Subject: Consider default SERVER_MODE =True for pgadmin4-v1-web
Next
From: Mike Surcouf
Date:
Subject: RE: Consider default SERVER_MODE =True for pgadmin4-v1-web