public inbox for [email protected]  
help / color / mirror / Atom feed
From: Murtuza Zabuawala <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: PATCH: Allow pgAdmin4 application to host over LAN
Date: Tue, 26 Apr 2016 04:09:06 -0700
Message-ID: <CAKKotZSVrQbD3o4KgVs0U1oYE5LRLCYwsMaqnPNe=y8zKFv3jA@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi,

Given patch will allow user to host pgAdmin4 to host over LAN network by
default it hosts on localhost (using 'lo' adapter).


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


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [text/x-patch] Allow_to_host_over_LAN_v1.patch (1.1K, 3-Allow_to_host_over_LAN_v1.patch)
  download | inline diff:
diff --git a/web/config.py b/web/config.py
index 9cf2644..fb169d0 100644
--- a/web/config.py
+++ b/web/config.py
@@ -98,6 +98,11 @@ SERVER_MODE = True
 # The default should be fine here, as it's not exposed in the app.
 DESKTOP_USER = '[email protected]'

+# This configuration allows user to host application on LAN
+# Default hosting is on lo (DEFAULT_SERVER='localhost'),
+# To host pgAdmin4 over LAN set DEFAULT_SERVER='0.0.0.0'
+DEFAULT_SERVER = 'localhost'
+
 # The default port on which the app server will listen if not set in the
 # environment by the runtime
 DEFAULT_SERVER_PORT = 5050
diff --git a/web/pgAdmin4.py b/web/pgAdmin4.py
index 977d4e8..dea50ef 100644
--- a/web/pgAdmin4.py
+++ b/web/pgAdmin4.py
@@ -74,6 +74,8 @@ else:
     server_port = config.DEFAULT_SERVER_PORT

 try:
-    app.run(port=server_port, use_reloader=(config.SERVER_MODE and app.debug))
+    app.run(host=config.DEFAULT_SERVER,
+        port=server_port,
+        use_reloader=(config.SERVER_MODE and app.debug))
 except IOError:
     app.logger.error("Error starting the app server: %s", sys.exc_info())


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: PATCH: Allow pgAdmin4 application to host over LAN
  In-Reply-To: <CAKKotZSVrQbD3o4KgVs0U1oYE5LRLCYwsMaqnPNe=y8zKFv3jA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox