This is *mbank-cli*, a basic command-line interface to the online banking
system of mBank.

**Warning**: You use *mbank-cli* on your own risk! The software is provided
“as is”, without warranty of any kind.

**Warning**: *mbank-cli* uses the web interface at https://online.mbank.pl/
(or https://online.mbank.cz/, or https://online.mbank.sk/)
which is subject to change unexpectedly.


Requirements
------------

- Perl (≥ 5.10) with the following Perl modules:

  - HTML::Form

  - HTML::HeadParser

  - HTML::TreeBuilder

  - IO::Socket::SSL (≥ 1.31)

  - IPC::Run (optionally, for password encryption, or for password manager
    support)

  - JSON or JSON::PP (the latter is a core module since Perl 5.14)

  - LWP::UserAgent (≥ 5.802)

  - LWP::Protocol::https

  - Net::HTTPS

  - Net::SSLeay

  - Term::ReadLine::Gnu

- GnuPG (optional: for password encryption)

Cheat sheet for free software distributions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Arch Linux::

   pacman -S perl-html-form perl-html-tree perl-lwp-protocol-https perl-term-readline-gnu
   pacman -S perl-ipc-run  # for password management
   pacman -S gnupg  # for password encryption

CentOS 6::

   yum install perl-core perl-libwww-perl perl-IO-Socket-SSL perl-HTML-Tree perl-JSON perl-Term-ReadLine-Gnu
   yum install perl-IPC-Run  # for password management
   yum install gnupg2  # for password encryption

Debian 7 (wheezy) or newer::

   apt-get install libwww-perl libhtml-form-perl libterm-readline-gnu-perl
   apt-get install libipc-run-perl  # for password management
   apt-get install gnupg  # for password encryption

Cheat sheet for cpanm(1)
~~~~~~~~~~~~~~~~~~~~~~~~
::

   cpanm HTML::Form HTML::HeadParser HTML::TreeBuilder IO::Socket::SSL JSON::PP LWP::UserAgent LWP::Protocol::https Net::HTTPS Net::SSLeay Term::ReadLine::Gnu
   cpanm IPC::Run  # for password management

CA certificate
--------------

*mbank-cli* has to verify that the server certificate has been signed by a
trusted CA (certificate authority). Unlike many other TLS clients, it
doesn't trust all the CAs whose certificates are installed system-wide, but
only **DigiCert High Assurance EV Root CA**, which
is known to be the root CA for mBank.

*mbank-cli* tries to find the certificate in the system certificate directory;
if that fails, it uses ``ca.crt`` from the same directory as the script
itself.

This procedure might not be adequate when the program is installed
system-wide on some operating systems. Packagers/administrators might want
to patch the ``get_default_ca_path()`` subroutine in such case.

.. vim:ft=rst tw=76 ts=3 sts=3 sw=3 et
