Subject: PATCH: Allow pgAdmin4 application to host over LAN

From: Murtuza Zabuawala <[email-masked]>
Date: Tue, 26 Apr 2016 04:09:06 -0700

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
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-masked]'

+# 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())

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

---

From: Dave Page <[email-masked]>
Date: Fri, 6 May 2016 15:26:18 +0100

Thanks, patch committed.

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

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