]> gitweb.michael.orlitzky.com - mailshears.git/commitdiff
*/*: drop tty parameters.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 9 Jun 2022 11:33:07 +0000 (07:33 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 9 Jun 2022 11:36:22 +0000 (07:36 -0400)
The "tty" parameter for postgresql connections has been ignored for as
long as I can remember, but with postgresql-14, it has finally been
removed. Now, attempting to supply it causes an error:

  PG::ConnectionBad: invalid connection option "tty"

This commit removes all mention of the parameter, and updates two
instances where PG::Connection.new() was called with positional
arguments. Now it is called with a hash, sans the :tty key, which
should be backwards-compatible.

doc/mailshears.example.conf.yml
doc/man1/mailshears.1
lib/common/agendav_plugin.rb
lib/common/configuration.rb
lib/common/davical_plugin.rb
lib/common/postfixadmin_plugin.rb
lib/common/roundcube_plugin.rb
test/mailshears.test.conf.yml
test/mailshears_test.rb

index 0764153c71cdbb7d9ed415990117c13d54af77c3..db516a00e6d20e45674f098cb61e06f10c4bc0cb 100644 (file)
@@ -4,7 +4,6 @@ plugins: [agendav, davical, dovecot, postfixadmin, roundcube]
 agendav_dbhost: localhost
 agendav_dbport: 5432
 agendav_dbopts:
-agendav_dbtty:
 agendav_dbuser: postgres
 agendav_dbpass:
 agendav_dbname: agendav
@@ -12,7 +11,6 @@ agendav_dbname: agendav
 davical_dbhost: localhost
 davical_dbport: 5432
 davical_dbopts:
-davical_dbtty:
 davical_dbuser: postgres
 davical_dbpass:
 davical_dbname: davical
@@ -22,7 +20,6 @@ dovecot_mail_root: /var/spool/mail/vhosts
 postfixadmin_dbhost: localhost
 postfixadmin_dbport: 5432
 postfixadmin_dbopts:
-postfixadmin_dbtty:
 postfixadmin_dbuser: postgres
 postfixadmin_dbpass:
 postfixadmin_dbname: postfixadmin
@@ -30,7 +27,6 @@ postfixadmin_dbname: postfixadmin
 roundcube_dbhost: localhost
 roundcube_dbport: 5432
 roundcube_dbopts:
-roundcube_dbtty:
 roundcube_dbuser: postgres
 roundcube_dbpass:
 roundcube_dbname: roundcube
index 286e5e0e3cb3fbb854037ac9f9cae4e4f43b5dba..7efe08f7a82de015abf8e391de3d8ee9a6de1e45 100644 (file)
@@ -165,9 +165,6 @@ on. Their meanings should be self-explanatory.
 \fI<plugin>_dbopts\fR (default: empty)
 \#
 .IP \(bu
-\fI<plugin>_dbtty\fR (default: empty)
-\#
-.IP \(bu
 \fI<plugin>_dbuser\fR (default: 'postgres')
 \#
 .IP \(bu
index 3b3389dcd074ea4c8b3e666ebf0874b5ec7dfc99..187df6e92a695a85aba3091bded527a8ac751038 100644 (file)
@@ -18,7 +18,6 @@ module AgendavPlugin
       :host     => cfg.agendav_dbhost,
       :port     => cfg.agendav_dbport,
       :options  => cfg.agendav_dbopts,
-      :tty      => cfg.agendav_dbtty,
       :dbname   => cfg.agendav_dbname,
       :user     => cfg.agendav_dbuser,
       :password => cfg.agendav_dbpass }
index 02c30d252b796073587ee961011a02ccbebb1936..738dc8c32c9180ebf835618ae893b8cff3dc96d5 100644 (file)
@@ -79,7 +79,6 @@ class Configuration
     d['agendav_dbhost'] = 'localhost'
     d['agendav_dbport'] = 5432
     d['agendav_dbopts'] = ''
-    d['agendav_dbtty'] = ''
     d['agendav_dbuser'] = 'postgres'
     d['agendav_dbpass'] = ''
     d['agendav_dbname'] = 'agendav'
@@ -87,7 +86,6 @@ class Configuration
     d['davical_dbhost'] = 'localhost'
     d['davical_dbport'] = 5432
     d['davical_dbopts'] = ''
-    d['davical_dbtty'] = ''
     d['davical_dbuser'] = 'postgres'
     d['davical_dbpass'] = ''
     d['davical_dbname'] = 'davical'
@@ -97,7 +95,6 @@ class Configuration
     d['postfixadmin_dbhost'] = 'localhost'
     d['postfixadmin_dbport'] = 5432
     d['postfixadmin_dbopts'] = ''
-    d['postfixadmin_dbtty'] = ''
     d['postfixadmin_dbuser'] = 'postgres'
     d['postfixadmin_dbpass'] = ''
     d['postfixadmin_dbname'] = 'postfixadmin'
@@ -105,7 +102,6 @@ class Configuration
     d['roundcube_dbhost'] = 'localhost'
     d['roundcube_dbport'] = 5432
     d['roundcube_dbopts'] = ''
-    d['roundcube_dbtty'] = ''
     d['roundcube_dbuser'] = 'postgres'
     d['roundcube_dbpass'] = ''
     d['roundcube_dbname'] = 'roundcube'
index 06abbfa99e31844b6ae22c5190a828837e59862c..2298a8e1fd18a5ff715cf54af843e2f84f3ac72d 100644 (file)
@@ -18,7 +18,6 @@ module DavicalPlugin
       :host     => cfg.davical_dbhost,
       :port     => cfg.davical_dbport,
       :options  => cfg.davical_dbopts,
-      :tty      => cfg.davical_dbtty,
       :dbname   => cfg.davical_dbname,
       :user     => cfg.davical_dbuser,
       :password => cfg.davical_dbpass }
index 92b7a5b3036cdc8be3bba7df549d9d026cf8e87f..b4c9030cc9b0829785fd2c08c8b5196914e6767a 100644 (file)
@@ -20,7 +20,6 @@ module PostfixadminPlugin
       :host     => cfg.postfixadmin_dbhost,
       :port     => cfg.postfixadmin_dbport,
       :options  => cfg.postfixadmin_dbopts,
-      :tty      => cfg.postfixadmin_dbtty,
       :dbname   => cfg.postfixadmin_dbname,
       :user     => cfg.postfixadmin_dbuser,
       :password => cfg.postfixadmin_dbpass }
index 6d522bb371847e433906af3792f74545916bd7cc..2ba9a98aaf25865960b5ea94b40cbad10dfc595e 100644 (file)
@@ -19,7 +19,6 @@ module RoundcubePlugin
       :host     => cfg.roundcube_dbhost,
       :port     => cfg.roundcube_dbport,
       :options  => cfg.roundcube_dbopts,
-      :tty      => cfg.roundcube_dbtty,
       :dbname   => cfg.roundcube_dbname,
       :user     => cfg.roundcube_dbuser,
       :password => cfg.roundcube_dbpass }
index 0bfbd7f19f24abb4a714c2f75ba9930290d7da4a..35df97c3c0d14dd4439d4d14a7b9ca9f107ff29a 100644 (file)
@@ -4,7 +4,6 @@ plugins: [agendav, davical, dovecot, postfixadmin, roundcube]
 agendav_dbhost: localhost
 agendav_dbport: 5432
 agendav_dbopts:
-agendav_dbtty:
 agendav_dbuser: postgres
 agendav_dbpass:
 agendav_dbname: agendav_test
@@ -12,7 +11,6 @@ agendav_dbname: agendav_test
 davical_dbhost: localhost
 davical_dbport: 5432
 davical_dbopts:
-davical_dbtty:
 davical_dbuser: postgres
 davical_dbpass:
 davical_dbname: davical_test
@@ -22,7 +20,6 @@ dovecot_mail_root: /tmp/mailshears-test
 postfixadmin_dbhost: localhost
 postfixadmin_dbport: 5432
 postfixadmin_dbopts:
-postfixadmin_dbtty:
 postfixadmin_dbuser: postgres
 postfixadmin_dbpass:
 postfixadmin_dbname: postfixadmin_test
@@ -30,7 +27,6 @@ postfixadmin_dbname: postfixadmin_test
 roundcube_dbhost: localhost
 roundcube_dbport: 5432
 roundcube_dbopts:
-roundcube_dbtty:
 roundcube_dbuser: postgres
 roundcube_dbpass:
 roundcube_dbname: roundcube_test
index 94f2f4903bd7894b505fa21e8a3ff340503ba668..22c634f43b643b41c3764f21ec79fbaf5bc1c186 100644 (file)
@@ -32,16 +32,15 @@ class MailshearsTest < MiniTest::Test
     # Connect to the database (specified in the test configuration) as
     # the superuser. Your local configuration is expected to be such
     # that this "just works."
-    db_host = 'localhost'
-    db_port = 5432
-    db_opts = nil
-    db_tty = nil
-    db_name = 'postgres'
-    db_user = 'postgres'
-    db_pass = nil
-
-    connection = PG::Connection.new(db_host, db_port, db_opts, db_tty,
-                                    db_name, db_user, db_pass)
+    db_hash = {
+      :host     => 'localhost',
+      :port     => 5432,
+      :options  => nil,
+      :dbname   => 'postgres',
+      :user     => 'postgres',
+      :password => nil
+    }
+    connection = PG::Connection.new(db_hash)
 
     return connection
   end
@@ -210,17 +209,16 @@ class MailshearsTest < MiniTest::Test
       query = "CREATE DATABASE #{plugin_dbname};"
       connection.sync_exec(query)
 
-      plugin_dbhost = cfg.send("#{plugin}_dbhost")
-      plugin_dbport = cfg.send("#{plugin}_dbport")
-      plugin_dbopts = cfg.send("#{plugin}_dbopts")
-      plugin_dbtty  = cfg.send("#{plugin}_dbtty")
-      plugin_dbuser = cfg.send("#{plugin}_dbuser")
-      plugin_dbpass = cfg.send("#{plugin}_dbpass")
+      plugin_dbhash = {
+        :host     => cfg.send("#{plugin}_dbhost"),
+        :port     => cfg.send("#{plugin}_dbport"),
+        :options  => cfg.send("#{plugin}_dbopts"),
+        :dbname   => plugin_dbname,
+        :user     => cfg.send("#{plugin}_dbuser"),
+        :password => cfg.send("#{plugin}_dbpass")
+      }
 
-      plugin_conn = PG::Connection.new(plugin_dbhost, plugin_dbport,
-                                       plugin_dbopts, plugin_dbtty,
-                                       plugin_dbname, plugin_dbuser,
-                                       plugin_dbpass)
+      plugin_conn = PG::Connection.new(plugin_dbhash)
 
       sql = File.open("test/sql/#{plugin}.sql").read()
       plugin_conn.sync_exec(sql)