public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024
6+ messages / 3 participants
[nested] [flat]

* [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024
@ 2018-05-16 11:24 Aditya Toshniwal <[email protected]>
  2018-05-16 13:34 ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Victoria Henry <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Aditya Toshniwal @ 2018-05-16 11:24 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

PFA patch to allow server port number below 1024 till 1 in Create Server
dialog.

Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"


Attachments:

  [text/x-patch] RM3307.patch (925B, 3-RM3307.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 8e5ca23..3c10eaa 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -676,7 +676,7 @@ define('pgadmin.node.server', [
           mode: ['properties', 'edit', 'create'], disabled: 'isConnected',
         },{
           id: 'port', label: gettext('Port'), type: 'int', group: gettext('Connection'),
-          mode: ['properties', 'edit', 'create'], disabled: 'isConnected', min: 1024, max: 65535,
+          mode: ['properties', 'edit', 'create'], disabled: 'isConnected', min: 1, max: 65535,
         },{
           id: 'db', label: gettext('Maintenance database'), type: 'text', group: gettext('Connection'),
           mode: ['properties', 'edit', 'create'], disabled: 'isConnected',


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024
  2018-05-16 11:24 [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
@ 2018-05-16 13:34 ` Victoria Henry <[email protected]>
  2018-05-18 10:13   ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Dave Page <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Victoria Henry @ 2018-05-16 13:34 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

Hi Aditya,

Looks good to us!

Sincerely,

Anthony & Victoria


On Wed, May 16, 2018 at 7:24 AM Aditya Toshniwal <
[email protected]> wrote:

> Hi Hackers,
>
> PFA patch to allow server port number below 1024 till 1 in Create Server
> dialog.
>
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"
>


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024
  2018-05-16 11:24 [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
  2018-05-16 13:34 ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Victoria Henry <[email protected]>
@ 2018-05-18 10:13   ` Dave Page <[email protected]>
  2018-06-04 09:42     ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Dave Page @ 2018-05-18 10:13 UTC (permalink / raw)
  To: Victoria Henry <[email protected]>; +Cc: Aditya Toshniwal <[email protected]>; pgadmin-hackers

Thanks, applied.

On Wed, May 16, 2018 at 2:34 PM, Victoria Henry <[email protected]> wrote:

> Hi Aditya,
>
> Looks good to us!
>
> Sincerely,
>
> Anthony & Victoria
>
>
> On Wed, May 16, 2018 at 7:24 AM Aditya Toshniwal <aditya.toshniwal@
> enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> PFA patch to allow server port number below 1024 till 1 in Create Server
>> dialog.
>>
>> Thanks and Regards,
>> Aditya Toshniwal
>> Software Engineer | EnterpriseDB Software Solutions | Pune
>> "Don't Complain about Heat, Plant a tree"
>>
>


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

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


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024
  2018-05-16 11:24 [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
  2018-05-16 13:34 ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Victoria Henry <[email protected]>
  2018-05-18 10:13   ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Dave Page <[email protected]>
@ 2018-06-04 09:42     ` Aditya Toshniwal <[email protected]>
  2018-06-04 09:43       ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Aditya Toshniwal @ 2018-06-04 09:42 UTC (permalink / raw)
  To: Dave Page <[email protected]>; +Cc: Victoria Henry <[email protected]>; pgadmin-hackers

Hi Hackers,

I missed one part here. There is a constraint on port in in sqlite config
database also, and is not allowing ports below 1024.
PFA patch - part2 which includes constraint change and migration script for
the db file.
Kindly review.

Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"

On Fri, May 18, 2018 at 3:43 PM, Dave Page <[email protected]> wrote:

> Thanks, applied.
>
> On Wed, May 16, 2018 at 2:34 PM, Victoria Henry <[email protected]> wrote:
>
>> Hi Aditya,
>>
>> Looks good to us!
>>
>> Sincerely,
>>
>> Anthony & Victoria
>>
>>
>> On Wed, May 16, 2018 at 7:24 AM Aditya Toshniwal <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> PFA patch to allow server port number below 1024 till 1 in Create Server
>>> dialog.
>>>
>>> Thanks and Regards,
>>> Aditya Toshniwal
>>> Software Engineer | EnterpriseDB Software Solutions | Pune
>>> "Don't Complain about Heat, Plant a tree"
>>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024
  2018-05-16 11:24 [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
  2018-05-16 13:34 ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Victoria Henry <[email protected]>
  2018-05-18 10:13   ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Dave Page <[email protected]>
  2018-06-04 09:42     ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
@ 2018-06-04 09:43       ` Aditya Toshniwal <[email protected]>
  2018-06-05 09:46         ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Dave Page <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Aditya Toshniwal @ 2018-06-04 09:43 UTC (permalink / raw)
  To: Dave Page <[email protected]>; +Cc: Victoria Henry <[email protected]>; pgadmin-hackers

Missed the attachment. Apologies :(

PFA.

Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"

On Mon, Jun 4, 2018 at 3:12 PM, Aditya Toshniwal <
[email protected]> wrote:

> Hi Hackers,
>
> I missed one part here. There is a constraint on port in in sqlite config
> database also, and is not allowing ports below 1024.
> PFA patch - part2 which includes constraint change and migration script
> for the db file.
> Kindly review.
>
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"
>
> On Fri, May 18, 2018 at 3:43 PM, Dave Page <[email protected]> wrote:
>
>> Thanks, applied.
>>
>> On Wed, May 16, 2018 at 2:34 PM, Victoria Henry <[email protected]>
>> wrote:
>>
>>> Hi Aditya,
>>>
>>> Looks good to us!
>>>
>>> Sincerely,
>>>
>>> Anthony & Victoria
>>>
>>>
>>> On Wed, May 16, 2018 at 7:24 AM Aditya Toshniwal <
>>> [email protected]> wrote:
>>>
>>>> Hi Hackers,
>>>>
>>>> PFA patch to allow server port number below 1024 till 1 in Create
>>>> Server dialog.
>>>>
>>>> Thanks and Regards,
>>>> Aditya Toshniwal
>>>> Software Engineer | EnterpriseDB Software Solutions | Pune
>>>> "Don't Complain about Heat, Plant a tree"
>>>>
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


Attachments:

  [text/x-patch] RM3307_part2.patch (4.0K, 3-RM3307_part2.patch)
  download | inline diff:
diff --git a/web/migrations/versions/7c56ea250085_.py b/web/migrations/versions/7c56ea250085_.py
new file mode 100644
index 0000000..24af349
--- /dev/null
+++ b/web/migrations/versions/7c56ea250085_.py
@@ -0,0 +1,90 @@
+
+"""Change server port constraint to allow port below 1024 RM#3307
+
+Revision ID: 7c56ea250085
+Revises: a68b374fe373
+Create Date: 2018-06-04 14:23:31.472645
+
+"""
+from alembic import op
+import sqlalchemy as sa
+
+from pgadmin.model import db
+
+# revision identifiers, used by Alembic.
+revision = '7c56ea250085'
+down_revision = 'a68b374fe373'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # To Save previous data
+    db.engine.execute("ALTER TABLE server RENAME TO server_old")
+
+    # Create table with new constraint definition
+    db.engine.execute("""
+            CREATE TABLE server (
+            id	INTEGER NOT NULL,
+            user_id	INTEGER NOT NULL,
+            servergroup_id	INTEGER NOT NULL,
+            name	VARCHAR(128) NOT NULL,
+            host	VARCHAR(128),
+            port	INTEGER NOT NULL CHECK(port >= 1 AND port <= 65534),
+            maintenance_db	VARCHAR(64),
+            username	VARCHAR(64) NOT NULL,
+            password	VARCHAR(64),
+            role	VARCHAR(64),
+            ssl_mode	VARCHAR(16) NOT NULL CHECK(ssl_mode IN
+                ( 'allow' , 'prefer' , 'require' , 'disable' ,
+                  'verify-ca' , 'verify-full' )
+            ),
+            comment	VARCHAR(1024),
+            discovery_id	VARCHAR(128),
+            hostaddr	TEXT(1024),
+            db_res	TEXT,
+            passfile	TEXT,
+            sslcert	TEXT,
+            sslkey	TEXT,
+            sslrootcert	TEXT,
+            sslcrl	TEXT,
+            sslcompression	INTEGER DEFAULT 0,
+            bgcolor TEXT(10),
+            fgcolor TEXT(10),
+            service TEXT,
+            use_ssh_tunnel INTEGER DEFAULT 0,
+            tunnel_host TEXT,
+            tunnel_port TEXT,
+            tunnel_username TEXT,
+            tunnel_authentication INTEGER DEFAULT 0,
+            tunnel_identity_file TEXT,
+            PRIMARY KEY(id),
+            FOREIGN KEY(user_id) REFERENCES user(id),
+            FOREIGN KEY(servergroup_id) REFERENCES servergroup(id)
+        )
+    """)
+
+    # Copy old data again into table
+    db.engine.execute("""
+    INSERT INTO server (
+        id, user_id, servergroup_id, name, host, port, maintenance_db,
+        username, password, role, ssl_mode, comment, discovery_id, hostaddr,
+        db_res, passfile, sslcert, sslkey, sslrootcert, sslcrl,
+        sslcompression, bgcolor, fgcolor, service, use_ssh_tunnel,
+        tunnel_host, tunnel_port, tunnel_username, tunnel_authentication,
+        tunnel_identity_file
+
+    ) SELECT
+        id, user_id, servergroup_id, name, host, port, maintenance_db,
+        username, password, role, ssl_mode, comment, discovery_id, hostaddr,
+        db_res, passfile, sslcert, sslkey, sslrootcert, sslcrl,
+        sslcompression, bgcolor, fgcolor, service, use_ssh_tunnel,
+        tunnel_host, tunnel_port, tunnel_username, tunnel_authentication,
+        tunnel_identity_file
+    FROM server_old""")
+
+    # Remove old data
+    db.engine.execute("DROP TABLE server_old")
+
+def downgrade():
+    pass
diff --git a/web/pgadmin/model/__init__.py b/web/pgadmin/model/__init__.py
index c3171ce..df88116 100644
--- a/web/pgadmin/model/__init__.py
+++ b/web/pgadmin/model/__init__.py
@@ -29,7 +29,7 @@ from flask_sqlalchemy import SQLAlchemy
 #
 ##########################################################################
 
-SCHEMA_VERSION = 15
+SCHEMA_VERSION = 16
 
 ##########################################################################
 #
@@ -111,7 +111,7 @@ class Server(db.Model):
     hostaddr = db.Column(db.String(128), nullable=True)
     port = db.Column(
         db.Integer(),
-        db.CheckConstraint('port >= 1024 AND port <= 65534'),
+        db.CheckConstraint('port >= 1 AND port <= 65534'),
         nullable=False)
     maintenance_db = db.Column(db.String(64), nullable=True)
     username = db.Column(db.String(64), nullable=False)


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024
  2018-05-16 11:24 [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
  2018-05-16 13:34 ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Victoria Henry <[email protected]>
  2018-05-18 10:13   ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Dave Page <[email protected]>
  2018-06-04 09:42     ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
  2018-06-04 09:43       ` Re: [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
@ 2018-06-05 09:46         ` Dave Page <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Dave Page @ 2018-06-05 09:46 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: Victoria Henry <[email protected]>; pgadmin-hackers

Thanks, applied.

On Mon, Jun 4, 2018 at 10:43 AM, Aditya Toshniwal <
[email protected]> wrote:

> Missed the attachment. Apologies :(
>
> PFA.
>
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"
>
> On Mon, Jun 4, 2018 at 3:12 PM, Aditya Toshniwal <aditya.toshniwal@
> enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> I missed one part here. There is a constraint on port in in sqlite config
>> database also, and is not allowing ports below 1024.
>> PFA patch - part2 which includes constraint change and migration script
>> for the db file.
>> Kindly review.
>>
>> Thanks and Regards,
>> Aditya Toshniwal
>> Software Engineer | EnterpriseDB Software Solutions | Pune
>> "Don't Complain about Heat, Plant a tree"
>>
>> On Fri, May 18, 2018 at 3:43 PM, Dave Page <[email protected]> wrote:
>>
>>> Thanks, applied.
>>>
>>> On Wed, May 16, 2018 at 2:34 PM, Victoria Henry <[email protected]>
>>> wrote:
>>>
>>>> Hi Aditya,
>>>>
>>>> Looks good to us!
>>>>
>>>> Sincerely,
>>>>
>>>> Anthony & Victoria
>>>>
>>>>
>>>> On Wed, May 16, 2018 at 7:24 AM Aditya Toshniwal <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Hackers,
>>>>>
>>>>> PFA patch to allow server port number below 1024 till 1 in Create
>>>>> Server dialog.
>>>>>
>>>>> Thanks and Regards,
>>>>> Aditya Toshniwal
>>>>> Software Engineer | EnterpriseDB Software Solutions | Pune
>>>>> "Don't Complain about Heat, Plant a tree"
>>>>>
>>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>


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

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


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2018-06-05 09:46 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 11:24 [pgAdmin4][RM#3307]User interface unable to connect to database running on port range 1-1024 Aditya Toshniwal <[email protected]>
2018-05-16 13:34 ` Victoria Henry <[email protected]>
2018-05-18 10:13   ` Dave Page <[email protected]>
2018-06-04 09:42     ` Aditya Toshniwal <[email protected]>
2018-06-04 09:43       ` Aditya Toshniwal <[email protected]>
2018-06-05 09:46         ` Dave Page <[email protected]>

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