]> gitweb.michael.orlitzky.com - list-remote-forwards.git/commitdiff
list-remote-forwards.cabal: delete the redundant description master
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 24 Apr 2024 10:59:59 +0000 (06:59 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 24 Apr 2024 10:59:59 +0000 (06:59 -0400)
I'm tired of maintaining this.

13 files changed:
doc/COPYING [new file with mode: 0644]
doc/LICENSE
doc/man1/list-remote-forwards.1
list-remote-forwards.cabal
makefile
src/CommandLine.hs
src/Configuration.hs
src/Forward.hs
src/Main.hs
src/MxList.hs
src/OptionalConfiguration.hs
src/Report.hs
test/Doctests.hs

diff --git a/doc/COPYING b/doc/COPYING
new file mode 100644 (file)
index 0000000..bdda28d
--- /dev/null
@@ -0,0 +1,15 @@
+list-remote-forwards: keep tabs on remote forwards in your MTA
+Copyright (C) 2024  Michael Orlitzky
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <https://www.gnu.org/licenses/>.
index bc08fe2e41e331fcf35fe07812c5f68f637f79ae..dba13ed2ddf783ee8118c6a581dbf75305f816a3 100644 (file)
@@ -1,5 +1,5 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
+                    GNU AFFERO GENERAL PUBLIC LICENSE
+                       Version 3, 19 November 2007
 
  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  Everyone is permitted to copy and distribute verbatim copies
 
  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  Everyone is permitted to copy and distribute verbatim copies
@@ -7,17 +7,15 @@
 
                             Preamble
 
 
                             Preamble
 
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
+  The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
 
   The licenses for most software and other practical works are designed
 to take away your freedom to share and change the works.  By contrast,
 
   The licenses for most software and other practical works are designed
 to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
+our General Public Licenses are intended to guarantee your freedom to
 share and change all versions of a program--to make sure it remains free
 share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
+software for all its users.
 
   When we speak of free software, we are referring to freedom, not
 price.  Our General Public Licenses are designed to make sure that you
 
   When we speak of free software, we are referring to freedom, not
 price.  Our General Public Licenses are designed to make sure that you
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
 want it, that you can change the software or use pieces of it in new
 free programs, and that you know you can do these things.
 
 want it, that you can change the software or use pieces of it in new
 free programs, and that you know you can do these things.
 
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+  The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+  An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
@@ -72,7 +60,7 @@ modification follow.
 
   0. Definitions.
 
 
   0. Definitions.
 
-  "This License" refers to version 3 of the GNU General Public License.
+  "This License" refers to version 3 of the GNU Affero General Public License.
 
   "Copyright" also means copyright-like laws that apply to other kinds of
 works, such as semiconductor masks.
 
   "Copyright" also means copyright-like laws that apply to other kinds of
 works, such as semiconductor masks.
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
 the Program, the only way you could satisfy both those terms and this
 License would be to refrain entirely from conveying the Program.
 
 the Program, the only way you could satisfy both those terms and this
 License would be to refrain entirely from conveying the Program.
 
-  13. Use with the GNU Affero General Public License.
+  13. Remote Network Interaction; Use with the GNU General Public License.
+
+  Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
 
   Notwithstanding any other provision of this License, you have
 permission to link or combine any covered work with a work licensed
 
   Notwithstanding any other provision of this License, you have
 permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
+under version 3 of the GNU General Public License into a single
 combined work, and to convey the resulting work.  The terms of this
 License will continue to apply to the part which is the covered work,
 combined work, and to convey the resulting work.  The terms of this
 License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
 
   14. Revised Versions of this License.
 
   The Free Software Foundation may publish revised and/or new versions of
 
   14. Revised Versions of this License.
 
   The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
+the GNU Affero General Public License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in detail to
 address new problems or concerns.
 
   Each version is given a distinguishing version number.  If the
 address new problems or concerns.
 
   Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
+Program specifies that a certain numbered version of the GNU Affero General
 Public License "or any later version" applies to it, you have the
 option of following the terms and conditions either of that numbered
 version or of any later version published by the Free Software
 Foundation.  If the Program does not specify a version number of the
 Public License "or any later version" applies to it, you have the
 option of following the terms and conditions either of that numbered
 version or of any later version published by the Free Software
 Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
+GNU Affero General Public License, you may choose any version ever published
 by the Free Software Foundation.
 
   If the Program specifies that a proxy can decide which future
 by the Free Software Foundation.
 
   If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
+versions of the GNU Affero General Public License can be used, that proxy's
 public statement of acceptance of a version permanently authorizes you
 to choose that version for the Program.
 
 public statement of acceptance of a version permanently authorizes you
 to choose that version for the Program.
 
@@ -617,3 +615,47 @@ reviewing courts shall apply local law that most closely approximates
 an absolute waiver of all civil liability in connection with the
 Program, unless a warranty or assumption of liability accompanies a
 copy of the Program in return for a fee.
 an absolute waiver of all civil liability in connection with the
 Program, unless a warranty or assumption of liability accompanies a
 copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
index 77eec6e43bbd469b7536fc908ad2153094e69590..851cd60f8f0affdde92edb7e44640b4b5a1b6e34 100644 (file)
@@ -15,10 +15,10 @@ A list of addresses that are forwarded to remote domains.
 .SH DESCRIPTION
 .P
 A list of local domains is supplied to the program (more or less)
 .SH DESCRIPTION
 .P
 A list of local domains is supplied to the program (more or less)
-through the \fI\-\-domain\-query\fR option. Any addresses which
-forward to another address not contained in this list of local domains
-is considered a remote forward. Remote forwards can cause problems for
-a number of reasons, the most common of which are,
+through the \fI\-\-domain\-query\fR option. Any addresses in the list
+that forward to an address \fBnot\fR in the list are considered remote
+forwards. Remote forwards can cause problems for a number of reasons,
+the most common of which are,
 .IP \(bu 2
 If the sender has an SPF record authorizing his mail server to send
 mail on his behalf, then when his message is forwarded by the
 .IP \(bu 2
 If the sender has an SPF record authorizing his mail server to send
 mail on his behalf, then when his message is forwarded by the
@@ -47,7 +47,8 @@ SQL query used to produce a list of local domains. This should return
 the set of all domains (i.e one column) that are local to the
 server. See the default value for an example.
 
 the set of all domains (i.e one column) that are local to the
 server. See the default value for an example.
 
-Default: \(dqSELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY domain;\(dq
+Default: \(dqSELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY
+domain;\(dq
 
 .IP \fB\-\-exclude-mx\fR,\ \fB-e\fR
 The name of a mail exchanger, the forwards of whose domains we should
 
 .IP \fB\-\-exclude-mx\fR,\ \fB-e\fR
 The name of a mail exchanger, the forwards of whose domains we should
@@ -93,6 +94,16 @@ Username used to connect to the database (Postgres-only).
 
 Default: The current user
 
 
 Default: The current user
 
+.SH CONFIGURATION FILE
+
+Any of the options above can be placed in a configuration file rather
+than passed on the command line. An example config file
+\fIdoc/list-remote-forwardsrc.example\fR is included with the
+source. You can edit it and rename it to either
+\fI$sysconfdir/list-remote-forwardsrc\fR or
+\fI~/.list-remote-forwardsrc\fR. The variable \fI$sysconfdir\fR is
+determined at build time and is typically \fI/etc\fR on UNIX systems.
+
 .SH EXAMPLES
 
 .nf
 .SH EXAMPLES
 
 .nf
index 9eb17213bcf3ea91133d19a9ad172367318b0a07..e9a239f6ea973e55559712440791cb0d376ffaec 100644 (file)
+cabal-version:  3.0
 name:           list-remote-forwards
 name:           list-remote-forwards
-version:        0.0.1
-cabal-version:  >= 1.8
+version:        0.0.4
 author:         Michael Orlitzky
 author:         Michael Orlitzky
-maintainer:    Michael Orlitzky <michael@orlitzky.com>
-license:        GPL-3
+maintainer:     Michael Orlitzky <michael@orlitzky.com>
+homepage:       https://michael.orlitzky.com/code/list-remote-forwards.xhtml
+license:        AGPL-3.0-or-later
 license-file:   doc/LICENSE
 bug-reports:    mailto:michael@orlitzky.com
 category:       Mail, Utils
 build-type:     Simple
 extra-source-files:
 license-file:   doc/LICENSE
 bug-reports:    mailto:michael@orlitzky.com
 category:       Mail, Utils
 build-type:     Simple
 extra-source-files:
+  doc/COPYING
   doc/list-remote-forwardsrc.example
   doc/man1/list-remote-forwards.1
   test/fixtures/postfixadmin.sqlite3
 synopsis:
   List all remote forwards for mail accounts stored in a SQL database.
 description:
   doc/list-remote-forwardsrc.example
   doc/man1/list-remote-forwards.1
   test/fixtures/postfixadmin.sqlite3
 synopsis:
   List all remote forwards for mail accounts stored in a SQL database.
 description:
-  /Usage/:
-  .
-  @
-  list-remote-forwards [OPTIONS]
-  @
-  .
-  List all remote forwards for mail accounts stored in a SQL database.
-  .
-  A list of local domains is supplied to the program (more or less)
-  through the @--domain-query@ option. Any addresses which
-  forward to another address not contained in this list of local domains
-  is considered a remote forward. Remote forwards can cause problems for
-  a number of reasons, the most common of which are,
-  .
-    * If the sender has an SPF record authorizing his mail server to send
-      mail on his behalf, then when his message is forwarded by the
-      recipient's mail server, it will fail any subsequent SPF checks. This
-      will likely cause the message to be rejected, and the original
-      recipient's server will generate backscatter.
-  .
-    * If any spam makes it through the filter on the recipient's mail
-      server, that spam will then be forwarded to a remote destination. The
-      remote destination will blame the forwarding server for the spam, and
-      that can impact its reputation and potentially lead to a blacklisting
-      even though the spam did not originate on the recipient's server.
-  .
-  Whether or not these are an issue depends on the circumstances, but in
-  any case it is useful to know who is forwarding mail off-site.
-  .
-  /Input:/
-  .
-  None.
-  .
-  /Output:/
-  .
-  A list of addresses that are forwarded to remote domains.
-  .
-  /Options/:
-  .
-  @
-  \--database
-  @
-  .
-  The name of the database (or file, if SQLite) to which we should
-  connect.
-  .
-  Default: The name of the current user (Postgres only).
-  .
-  @
-  \--domain-query
-  @
-  SQL query used to produce a list of local domains. This should return
-  the set of all domains (i.e one column) that are local to the
-  server. See the default value for an example.
-  .
-  Default: \"SELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY domain;\"
-  .
-  @
-  \--exclude-mx, -e
-  @
-  .
-  The name of a mail exchanger, the forwards of whose domains we should
-  ignore. For example, if one mail exchanger, mx1.example.com, has
-  strict spam filtering, it may be acceptable to have remote forwarding
-  for domains that have mx1.example.com as their sole mail exchanger (MX
-  record). In that case, you might want to exclude those domains from
-  the report by naming mx1.example.com here.
-  .
-  A forward will be excluded from the report only if /all/ of its MX
-  records are contained in the given exclude list.
-  .
-  This option can be repeated to add mail exchangers to the exclude list.
-  .
-  Default: [] (empty)
-  .
-  @
-  \--forward-query, -f
-  @
-  .
-  SQL query used to produce a list of all forwards on the mail
-  system. This query should return the set of all (address, goto)
-  triples, where \"goto\" is the destination address; i.e. to where
-  the \"address\" forwards. The \"goto\" field may contain more
-  than one email address, separated by commas.
-  .
-  Default: \"SELECT address,goto FROM alias ORDER BY address;\"
-  .
-  @
-  \--host, -h
-  @
-  .
-  Hostname where the database is located (Postgres-only).
-  .
-  Default: None, a UNIX domain socket connection is attempted (Postgres only)
-  .
-  @
-  \--password
-  @
-  .
-  Password used to connect to the database (Postgres-only).
-  .
-  Default: None (assumes passwordless authentication)
-  .
-  @
-  \--port
-  @
-  Port number used to connect to the database (Postgres-only).
-  .
-  Default: None, a UNIX domain socket connection is attempted (Postgres only)
-  .
-  @
-  \--username, -u
-  @
-  .
-  Username used to connect to the database (Postgres-only).
-  .
-  Default: The current user
-  .
-  /Examples/:
-  .
-  @
-  $ list-remote-forwards --database=test\/fixtures\/postfixadmin.sqlite3
-  user1@example.com -> user1@example.net
-  user2@example.com -> user1@example.org
-  user2@example.com -> user2@example.org
-  user2@example.com -> user3@example.org
-  user7@example.com -> user8@example.net
-  @
+  List all remote forwards for mail accounts stored in a SQL
+  database. A description, options, and examples can be found in the
+  man page.
 
 executable list-remote-forwards
   build-depends:
 
 executable list-remote-forwards
   build-depends:
-    base                        >= 4.6 && < 5,
+    base                        >= 4.15 && < 5,
     bytestring                  >= 0.10,
     cmdargs                     >= 0.10,
     configurator                >= 0.2,
     bytestring                  >= 0.10,
     cmdargs                     >= 0.10,
     configurator                >= 0.2,
@@ -159,8 +36,11 @@ executable list-remote-forwards
     HDBC-sqlite3                >= 2.3,
     MissingH                    >= 1.2,
     tasty                       >= 0.8,
     HDBC-sqlite3                >= 2.3,
     MissingH                    >= 1.2,
     tasty                       >= 0.8,
-    tasty-hunit                 >= 0.8,
-    tasty-quickcheck            >= 0.8
+    tasty-hunit                 >= 0.8
+
+  default-language:
+    Haskell2010
+
   main-is:
     Main.hs
 
   main-is:
     Main.hs
 
@@ -172,34 +52,35 @@ executable list-remote-forwards
     CommandLine
     DNS
     Forward
     CommandLine
     DNS
     Forward
-    OptionalConfiguration
     MxList
     MxList
+    OptionalConfiguration
+    Paths_list_remote_forwards
     Report
     String
 
     Report
     String
 
-  ghc-options:
-    -Wall
-    -fwarn-hi-shadowing
-    -fwarn-missing-signatures
-    -fwarn-name-shadowing
-    -fwarn-orphans
-    -fwarn-type-defaults
-    -fwarn-tabs
-    -fwarn-incomplete-record-updates
-    -fwarn-monomorphism-restriction
-    -fwarn-unused-do-bind
-    -rtsopts
-    -threaded
-    -optc-O3
-    -optc-march=native
-
+  autogen-modules:
+    Paths_list_remote_forwards
 
 test-suite testsuite
   type: exitcode-stdio-1.0
   hs-source-dirs: src test
 
 test-suite testsuite
   type: exitcode-stdio-1.0
   hs-source-dirs: src test
+  default-language: Haskell2010
   main-is: TestSuite.hs
   main-is: TestSuite.hs
+
+  other-modules:
+    Configuration
+    DNS
+    Forward
+    MxList
+    OptionalConfiguration
+    Paths_list_remote_forwards
+    Report
+
+  autogen-modules:
+    Paths_list_remote_forwards
+
   build-depends:
   build-depends:
-    base                        >= 4.6 && < 5,
+    base                        >= 4.15 && < 5,
     bytestring                  >= 0.10,
     cmdargs                     >= 0.10,
     configurator                >= 0.2,
     bytestring                  >= 0.10,
     cmdargs                     >= 0.10,
     configurator                >= 0.2,
@@ -208,57 +89,23 @@ test-suite testsuite
     directory                   >= 1.2,
     filepath                    >= 1.3,
     HDBC                        >= 2.4,
     directory                   >= 1.2,
     filepath                    >= 1.3,
     HDBC                        >= 2.4,
-    HDBC-postgresql             >= 2.3,
     HDBC-sqlite3                >= 2.3,
     MissingH                    >= 1.2,
     tasty                       >= 0.8,
     HDBC-sqlite3                >= 2.3,
     MissingH                    >= 1.2,
     tasty                       >= 0.8,
-    tasty-hunit                 >= 0.8,
-    tasty-quickcheck            >= 0.8
-
-  -- It's not entirely clear to me why I have to reproduce all of this.
-  ghc-options:
-    -Wall
-    -fwarn-hi-shadowing
-    -fwarn-missing-signatures
-    -fwarn-name-shadowing
-    -fwarn-orphans
-    -fwarn-type-defaults
-    -fwarn-tabs
-    -fwarn-incomplete-record-updates
-    -fwarn-monomorphism-restriction
-    -fwarn-unused-do-bind
-    -O2
-
+    tasty-hunit                 >= 0.8
 
 test-suite doctests
   type: exitcode-stdio-1.0
   hs-source-dirs: test
 
 test-suite doctests
   type: exitcode-stdio-1.0
   hs-source-dirs: test
+  default-language: Haskell2010
   main-is: Doctests.hs
   build-depends:
   main-is: Doctests.hs
   build-depends:
-    base      == 4.*,
+    base      >= 4.15 && < 5,
     -- Additional test dependencies.
     doctest   >= 0.9,
     filemanip >= 0.3.6
 
     -- Additional test dependencies.
     doctest   >= 0.9,
     filemanip >= 0.3.6
 
-  -- It's not entirely clear to me why I have to reproduce all of this.
-  ghc-options:
-    -Wall
-    -fwarn-hi-shadowing
-    -fwarn-missing-signatures
-    -fwarn-name-shadowing
-    -fwarn-orphans
-    -fwarn-type-defaults
-    -fwarn-tabs
-    -fwarn-incomplete-record-updates
-    -fwarn-monomorphism-restriction
-    -fwarn-unused-do-bind
-    -rtsopts
-    -threaded
-    -optc-O3
-    -optc-march=native
-
-
 source-repository head
   type: git
 source-repository head
   type: git
-  location: http://michael.orlitzky.com/git/list-remote-forwards.git
+  location: https://gitweb.michael.orlitzky.com/list-remote-forwards.git
   branch: master
   branch: master
index c024def798125ea6e2a59e6754db0e8cd0fe36c7..b5cb21bd93b56fe3c31a3a7c3d8c0ef39d5c488a 100644 (file)
--- a/makefile
+++ b/makefile
@@ -2,14 +2,28 @@ PN            = list-remote-forwards
 BIN           = dist/build/$(PN)/$(PN)
 SRCS          = $(shell find src/ -type f -name '*.hs')
 
 BIN           = dist/build/$(PN)/$(PN)
 SRCS          = $(shell find src/ -type f -name '*.hs')
 
-.PHONY : dist hlint
+# Append these warnings to the HCFLAGS environment variable that gets
+# passed as options to GHC. We want to see the warnings while developing
+# but don't want them hard-coded in the cabal file for end users.
+HCFLAGS += -Weverything \
+           -Wno-implicit-prelude \
+           -Wno-safe \
+           -Wno-unsafe \
+           -Wno-all-missed-specialisations \
+           -Wno-prepositive-qualified-module \
+           -Wno-missing-safe-haskell-mode \
+           -Wno-missing-deriving-strategies \
+           -Wno-missing-kind-signatures \
+           -rtsopts \
+           -threaded
+
+.PHONY : doc dist hlint
 
 $(BIN): $(PN).cabal $(SRCS)
        runghc Setup.hs configure --user
 
 $(BIN): $(PN).cabal $(SRCS)
        runghc Setup.hs configure --user
-       runghc Setup.hs build
+       runghc Setup.hs build --ghc-options="${HCFLAGS}"
 
 doc: $(PN).cabal $(SRCS)
 
 doc: $(PN).cabal $(SRCS)
-       runghc Setup.hs hscolour --all
        runghc Setup.hs haddock  --all \
                                 --hyperlink-source \
                                  --haddock-options="--ignore-all-exports"
        runghc Setup.hs haddock  --all \
                                 --hyperlink-source \
                                  --haddock-options="--ignore-all-exports"
@@ -24,14 +38,14 @@ TEST_SRCS := $(shell find test/ -type f -name '*.hs')
 
 $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
        runghc Setup.hs configure --user --enable-tests --prefix=/
 
 $(TESTSUITE_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
        runghc Setup.hs configure --user --enable-tests --prefix=/
-       runghc Setup.hs build
+       runghc Setup.hs build --ghc-options="${HCFLAGS}"
 
 
 $(DOCTESTS_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
        runghc Setup.hs configure --user --enable-tests
 
 
 $(DOCTESTS_BIN): $(PN).cabal $(SRCS) $(TEST_SRCS)
        runghc Setup.hs configure --user --enable-tests
-       runghc Setup.hs build
+       runghc Setup.hs build --ghc-options="${HCFLAGS}"
 
 
-test: $(BIN) $(TESTSUITE_BIN) $(DOCTESTS_BIN)
+check: $(BIN) $(TESTSUITE_BIN) $(DOCTESTS_BIN)
        runghc Setup.hs test
 
 
        runghc Setup.hs test
 
 
index 9033f0dba0424e20db07127aad476ae68e045707..0ce4a6e004a993d240ea86069c79100234637faa 100644 (file)
@@ -16,8 +16,17 @@ import System.Console.CmdArgs (
 import Paths_list_remote_forwards ( version )
 import Data.Version ( showVersion )
 
 import Paths_list_remote_forwards ( version )
 import Data.Version ( showVersion )
 
-import OptionalConfiguration ( OptionalConfiguration(..) )
-
+import OptionalConfiguration (
+  OptionalConfiguration( OptionalConfiguration,
+                         database,
+                         domain_query,
+                         exclude_mx,
+                         forward_query,
+                         host,
+                         password,
+                         port,
+                         username )
+  )
 
 description :: String
 description =
 
 description :: String
 description =
index 7ef072275079f5cd3e521a7bee450ba7a1c9df8d..b11857b2b01e1a3009f5b30935acd97e04c4a5a9 100644 (file)
@@ -7,9 +7,9 @@ module Configuration (
   merge_optional )
 where
 
   merge_optional )
 where
 
-import System.Console.CmdArgs.Default ( Default(..) )
+import System.Console.CmdArgs.Default ( Default( def ) )
 
 
-import MxList (MxList(..))
+import MxList ( MxList( get_mxs ) )
 import qualified OptionalConfiguration as OC (
   OptionalConfiguration(..),
   merge_maybes )
 import qualified OptionalConfiguration as OC (
   OptionalConfiguration(..),
   merge_maybes )
index d4936eda5c2169fbbcdc3130689125cb111195cd..efd78cea7c2aa42d6c96d29a24e4dbe6e456cfcc 100644 (file)
@@ -1,7 +1,7 @@
 -- | The 'Forward' data type, and functions that act thereon.
 --
 module Forward (
 -- | The 'Forward' data type, and functions that act thereon.
 --
 module Forward (
-  Forward(..),
+  Forward( Forward ),
   address_domain,
   dropby_goto_domains,
   fwd,
   address_domain,
   dropby_goto_domains,
   fwd,
index 66d02a084449102dace81985744afdf25e4da8f6..7a17f077f8ad375a2f365ce53bb1b510d39c5958 100644 (file)
@@ -1,12 +1,13 @@
 {-# LANGUAGE DoAndIfThenElse #-}
 {-# LANGUAGE NoMonomorphismRestriction #-}
 {-# LANGUAGE DoAndIfThenElse #-}
 {-# LANGUAGE NoMonomorphismRestriction #-}
-module Main
+module Main (main)
 where
 
 import Data.Maybe ( fromMaybe )
 where
 
 import Data.Maybe ( fromMaybe )
-import Data.Monoid ( (<>) )
 import Data.String.Utils ( join )
 import Data.String.Utils ( join )
-import Database.HDBC ( SqlError(..), handleSql )
+import Database.HDBC (
+  SqlError(seNativeError, seErrorMsg),
+  handleSql )
 import Database.HDBC.PostgreSQL ( connectPostgreSQL )
 import Database.HDBC.Sqlite3 ( connectSqlite3 )
 import System.Console.CmdArgs ( def )
 import Database.HDBC.PostgreSQL ( connectPostgreSQL )
 import Database.HDBC.Sqlite3 ( connectSqlite3 )
 import System.Console.CmdArgs ( def )
@@ -14,7 +15,9 @@ import System.Directory ( doesFileExist )
 import System.IO ( hPutStrLn, stderr )
 
 import CommandLine ( get_args )
 import System.IO ( hPutStrLn, stderr )
 
 import CommandLine ( get_args )
-import Configuration ( Configuration(..), merge_optional )
+import Configuration (
+  Configuration(database, host, password, port, username),
+  merge_optional )
 import qualified OptionalConfiguration as OC ( from_rc )
 import Report ( report )
 import String ( trim )
 import qualified OptionalConfiguration as OC ( from_rc )
 import Report ( report )
 import String ( trim )
index ce0e6490c3bd2d64c26beff26574151cc5d31e67..6a03870c0939ea71950f7f075235c90e36249d48 100644 (file)
@@ -5,7 +5,8 @@
 --   instance of Configured for [String] if we had defined one in
 --   e.g. 'OptionalConfiguration'.
 --
 --   instance of Configured for [String] if we had defined one in
 --   e.g. 'OptionalConfiguration'.
 --
-module MxList
+module MxList (
+  MxList( MxList, get_mxs ) )
 where
 
 -- DC is needed only for the DCT.Configured instance of String.
 where
 
 -- DC is needed only for the DCT.Configured instance of String.
@@ -15,15 +16,14 @@ import qualified Data.Configurator.Types as DCT (
   Value( List ),
   convert )
 import Data.Data (Data)
   Value( List ),
   convert )
 import Data.Data (Data)
-import System.Console.CmdArgs.Default (Default(..))
-import Data.Typeable (Typeable)
+import System.Console.CmdArgs.Default ( Default( def ) )
 
 
 -- | A (wrapper around a) list of MX hostnames.
 --
 newtype MxList =
   MxList { get_mxs :: [String] }
 
 
 -- | A (wrapper around a) list of MX hostnames.
 --
 newtype MxList =
   MxList { get_mxs :: [String] }
-    deriving (Data, Show, Typeable)
+    deriving (Data, Show)
 
 
 -- | The default (empty) list of MXes.
 
 
 -- | The default (empty) list of MXes.
index 072f25beafc4cfd3ffd1b3b4e0c62e43edaa9943..bfd4da755302e87dd74aa427ff286827468e464b 100644 (file)
@@ -20,15 +20,13 @@ import qualified Data.Configurator as DC (
   lookup )
 
 import Data.Maybe ( fromMaybe )
   lookup )
 
 import Data.Maybe ( fromMaybe )
-import Data.Monoid ( Monoid(..) )
 import Data.Data ( Data )
 import Data.Data ( Data )
-import Data.Typeable ( Typeable )
 import Paths_list_remote_forwards ( getSysconfDir )
 import System.Directory ( getHomeDirectory )
 import System.FilePath ( (</>) )
 import System.IO.Error ( catchIOError )
 
 import Paths_list_remote_forwards ( getSysconfDir )
 import System.Directory ( getHomeDirectory )
 import System.FilePath ( (</>) )
 import System.IO.Error ( catchIOError )
 
-import MxList ( MxList(..) )
+import MxList ( MxList(MxList, get_mxs) )
 
 -- | The same as Configuration, except everything is optional. It's easy to
 --   merge two of these by simply dropping the Nothings in favor of
 
 -- | The same as Configuration, except everything is optional. It's easy to
 --   merge two of these by simply dropping the Nothings in favor of
@@ -45,7 +43,7 @@ data OptionalConfiguration =
     password :: Maybe String,
     port     :: Maybe Int,
     username :: Maybe String }
     password :: Maybe String,
     port     :: Maybe Int,
     username :: Maybe String }
-  deriving (Show, Data, Typeable)
+  deriving (Show, Data)
 
 
 -- | Combine two Maybes into one, essentially mashing them
 
 
 -- | Combine two Maybes into one, essentially mashing them
@@ -58,7 +56,7 @@ merge_maybes Nothing (Just x)  = Just x
 merge_maybes (Just _) (Just y) = Just y
 
 
 merge_maybes (Just _) (Just y) = Just y
 
 
--- | The Monoid instance for these lets us "combine" two
+-- | The Semigroup instance for these lets us "combine" two
 --   OptionalConfigurations. The "combine" operation that we'd like to
 --   perform is, essentially, to mash them together. So if we have two
 --   OptionalConfigurations, each half full, we could combine them
 --   OptionalConfigurations. The "combine" operation that we'd like to
 --   perform is, essentially, to mash them together. So if we have two
 --   OptionalConfigurations, each half full, we could combine them
@@ -66,20 +64,10 @@ merge_maybes (Just _) (Just y) = Just y
 --
 --   This is used to merge command-line and config-file settings.
 --
 --
 --   This is used to merge command-line and config-file settings.
 --
-instance Monoid OptionalConfiguration where
-  -- | An empty OptionalConfiguration.
-  mempty = OptionalConfiguration
-             Nothing
-             Nothing
-             (MxList [])
-             Nothing
-             Nothing
-             Nothing
-             Nothing
-             Nothing
 
 
+instance Semigroup OptionalConfiguration where
   -- | Combine @cfg1@ and @cfg2@, giving precedence to @cfg2@.
   -- | Combine @cfg1@ and @cfg2@, giving precedence to @cfg2@.
-  cfg1 `mappend` cfg2 =
+  cfg1 <> cfg2 =
     OptionalConfiguration
       (merge_maybes (database cfg1) (database cfg2))
       (merge_maybes (domain_query cfg1) (domain_query cfg2))
     OptionalConfiguration
       (merge_maybes (database cfg1) (database cfg2))
       (merge_maybes (domain_query cfg1) (domain_query cfg2))
@@ -96,6 +84,21 @@ instance Monoid OptionalConfiguration where
                      then cfg1
                      else cfg2
 
                      then cfg1
                      else cfg2
 
+-- | The Monoid instance essentially only provides the "empty
+--   configuration."
+instance Monoid OptionalConfiguration where
+  -- | An empty OptionalConfiguration.
+  mempty = OptionalConfiguration
+             Nothing
+             Nothing
+             (MxList [])
+             Nothing
+             Nothing
+             Nothing
+             Nothing
+             Nothing
+  mappend = (<>)
+
 
 -- | Obtain an OptionalConfiguration from list-remote-forwardsrc in
 --   either the global configuration directory or the user's home
 
 -- | Obtain an OptionalConfiguration from list-remote-forwardsrc in
 --   either the global configuration directory or the user's home
index 82dd07bc8750944fc9e2f8c526005d4f3e9f69a3..0f77f511448014e3a05572da885be4f94f29650a 100644 (file)
@@ -15,24 +15,26 @@ import Database.HDBC (
   prepare,
   sFetchAllRows')
 import Database.HDBC.Sqlite3 ( connectSqlite3 )
   prepare,
   sFetchAllRows')
 import Database.HDBC.Sqlite3 ( connectSqlite3 )
-import System.Console.CmdArgs.Default ( Default(..) )
+import System.Console.CmdArgs.Default ( Default( def ) )
 import Test.Tasty ( TestTree, testGroup )
 import Test.Tasty.HUnit ( (@?=), testCase )
 
 import Test.Tasty ( TestTree, testGroup )
 import Test.Tasty.HUnit ( (@?=), testCase )
 
-import Configuration ( Configuration(..) )
+import Configuration ( Configuration( domain_query,
+                                      exclude_mx,
+                                      forward_query) )
 import DNS (
   MxSetMap,
   NormalDomain,
   mx_set_map,
   normalize_string )
 import Forward (
 import DNS (
   MxSetMap,
   NormalDomain,
   mx_set_map,
   normalize_string )
 import Forward (
-  Forward(..),
+  Forward(),
   address_domain,
   dropby_goto_domains,
   fwd,
   pretty_print,
   strings_to_forwards )
   address_domain,
   dropby_goto_domains,
   fwd,
   pretty_print,
   strings_to_forwards )
-import MxList ( MxList(..) )
+import MxList ( MxList( get_mxs ) )
 
 -- | Type synonym to make the signatures below a little more clear.
 --   WARNING: Also defined in the "Forward" module.
 
 -- | Type synonym to make the signatures below a little more clear.
 --   WARNING: Also defined in the "Forward" module.
@@ -259,7 +261,7 @@ test_dropby_mxlist_compares_normalized =
     let droplist = ["mx.EXAMple.com", "mx2.example.COM"]
     let normal_droplist = map normalize_string droplist
     let actual = dropby_mxlist normal_droplist mx_map fwds
     let droplist = ["mx.EXAMple.com", "mx2.example.COM"]
     let normal_droplist = map normalize_string droplist
     let actual = dropby_mxlist normal_droplist mx_map fwds
-    let expected = []
+    let expected = [] :: [Forward]
     actual @?= expected
   where
     desc = "dropby_mxlist only performs comparisons on normalized names"
     actual @?= expected
   where
     desc = "dropby_mxlist only performs comparisons on normalized names"
index d183b4b664d289ea123da751f562a937c34ff1ae..00413671aa8ab0b774f7490d6b1efbccfcc8a4ee 100644 (file)
@@ -1,7 +1,7 @@
-module Main
+module Main (main)
 where
 
 where
 
-import Test.DocTest
+import Test.DocTest ( doctest )
 import System.FilePath.Find ((==?), always, extension, find)
 
 find_sources :: IO [FilePath]
 import System.FilePath.Find ((==?), always, extension, find)
 
 find_sources :: IO [FilePath]
@@ -10,4 +10,4 @@ find_sources = find always (extension ==? ".hs") "src/"
 main :: IO ()
 main = do
   sources <- find_sources
 main :: IO ()
 main = do
   sources <- find_sources
-  doctest $ ["-isrc", "-idist/build/autogen"] ++ sources
+  doctest $ ["-isrc", "-idist/build/list-remote-forwards/autogen" ] ++ sources