gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-bank] branch stable updated (7d02404 -> 4963d08)


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch stable updated (7d02404 -> 4963d08)
Date: Wed, 18 Oct 2017 09:58:45 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a change to branch stable
in repository bank.

    from 7d02404  bank uses talercheck db by default for tests
     add 827a006  ChangeLog
     add 74ae21c  remove "admin" realated content from README
     add 31739df  readme
     add 77ceb31  make dist: forgotten files
     add 6ae3de8  submodule (make dist fix)
     add 3deb410  right version for autoconf
     add fda13f8  TEST -> test
     add 73639b2  + logging
     add 82128e4  + logging
     add bb19657  re-enabling faulty tests
     add 8391a13  only enabling faulty tests, faster testing.
     add 563c343  fix logging
     add b6c8487  config parser catches exception for config file not found
     add 6c17ea3  add testcase wrapper for faulty testcases
     add 400cd6b  running a test against a non existent config file.
     add cb1ec7c  comment
     add 759ba24  No #-line within make rule
     add 7293a18  using logger in test launchers
     add e9bb1a6  Unifying all tests in one file.
     add a567e25  run tests with non existent config file and NOT crash the 
'make check' command.
     add 1c74d4f  readme
     add 5968328  Testing against bad db string in config
     add 5b8a6f3  fix filename
     add 8f55fe3  remove superfluous code
     add 3941874  ChangeLog
     add 77d37fb  Test against bad amount string in config
     add 2683506  See note 12332 of bug #5045 (fixed).
     add 64c671b  fix handling of no currency given in config
     add 042a451  submodule
     add 0be750d  including web-common among static content dirs
     add d8b71ba  start bank docs
     add e592f93  fix title
     add 4d75dd6  add X-Taler-Sender-Wire header
     add d20ff10  Prevent no-currency-in-config testcase from picking 
[taler]/currency from base config directory.
     add 5012f75  documenting bank-exchange interaction/API.
     add 43fc47b  Fix compiler warnings.
     add dacd671  minor edits, some restructuring
     add c6ff493  Documenting the /history API.
     add 54cc782  making 'make pylint' available
     add 05664e8  use function result instead of function
     add ef7e739  add option to withdraw 2000 KUDOS, as Saleor samples tend to 
cost quite a lot!
     add e5abb10  reverting last change
     add 8813216  make 5 the least amount withdrawable.
     add 6f6650f  fix unshown negative amount (#5148)
     add dba82cb  authors
     add 40c0d0c  README
     add aeb362d  dist include new .conf's for testing
     add 4963d08  including testcase for bad configs

No new revisions were added by this update.

Summary of changes:
 ChangeLog                                          |    8 +
 INSTALL                                            |  320 +++--
 Makefile.am                                        |   24 +-
 README                                             |   38 +-
 ...check-alt.conf => bank-check-alt-badamount.conf |    4 +-
 bank-check-alt.conf => bank-check-alt-baddb.conf   |    2 +-
 bank.conf => bank-check-alt-nocurrency.conf        |    2 +-
 configure.ac                                       |   26 +-
 doc/Makefile.am                                    |   27 +
 doc/agpl.texi                                      |  698 +++++++++
 doc/brown-paper.css                                |   63 +
 doc/docstyle.css                                   |   80 ++
 doc/fdl-1.3.texi                                   |  506 +++++++
 doc/syntax.texi                                    |   43 +
 doc/taler-bank.texi                                |  313 ++++
 run_tests.py                                       |   13 -
 setup.py                                           |    4 +-
 talerbank/Makefile.am                              |    1 +
 talerbank/app/Makefile.am                          |    3 +-
 talerbank/app/models.py                            |    9 +
 talerbank/app/static/Makefile.am                   |    3 +-
 talerbank/app/static/profile-page.js               |    2 +-
 talerbank/app/static/pure.css                      | 1508 --------------------
 talerbank/app/static/web-common                    |    2 +-
 talerbank/app/templates/pin_tan.html               |    2 +-
 talerbank/app/templates/profile_page.html          |    4 +-
 talerbank/app/tests.py                             |   71 +-
 talerbank/app/tests_alt.py                         |   51 +
 talerbank/app/tests_err.py                         |  301 ----
 talerbank/app/views.py                             |   19 +-
 talerbank/settings.py                              |   20 +-
 talerbank/talerconfig.py                           |   81 +-
 32 files changed, 2162 insertions(+), 2086 deletions(-)
 copy bank-check-alt.conf => bank-check-alt-badamount.conf (77%)
 rename bank-check-alt.conf => bank-check-alt-baddb.conf (86%)
 copy bank.conf => bank-check-alt-nocurrency.conf (82%)
 create mode 100644 doc/Makefile.am
 create mode 100644 doc/agpl.texi
 create mode 100644 doc/brown-paper.css
 create mode 100644 doc/docstyle.css
 create mode 100644 doc/fdl-1.3.texi
 create mode 100644 doc/syntax.texi
 create mode 100644 doc/taler-bank.texi
 delete mode 100755 run_tests.py
 delete mode 100644 talerbank/app/static/pure.css
 create mode 100644 talerbank/app/tests_alt.py
 delete mode 100644 talerbank/app/tests_err.py

diff --git a/ChangeLog b/ChangeLog
index eb5c846..ff7ace9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,2 +1,10 @@
+Thu Jul 13 11:43:05 CEST 2017
+        Testing against ill-formed config file
+
+Tue Jun  6 14:39:45 CEST 2017
+        Implementing /history API where any authenticated user
+        can check his financial situation.  Removing the "admin"
+        interface.  Implementing debt limiting.  -MS
+
 Wed Jun  1 17:27:36 CEST 2016
        Releasing taler-bank-0.0.0. -CG
diff --git a/INSTALL b/INSTALL
index 2099840..8865734 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
-Inc.
+   Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
+Foundation, Inc.
 
    Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -12,97 +12,96 @@ without warranty of any kind.
 Basic Installation
 ==================
 
-   Briefly, the shell command `./configure && make && make install'
+   Briefly, the shell command './configure && make && make install'
 should configure, build, and install this package.  The following
-more-detailed instructions are generic; see the `README' file for
+more-detailed instructions are generic; see the 'README' file for
 instructions specific to this package.  Some packages provide this
-`INSTALL' file but do not implement all of the features documented
+'INSTALL' file but do not implement all of the features documented
 below.  The lack of an optional feature in a given package is not
 necessarily a bug.  More recommendations for GNU packages can be found
 in *note Makefile Conventions: (standards)Makefile Conventions.
 
-   The `configure' shell script attempts to guess correct values for
+   The 'configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
+those values to create a 'Makefile' in each directory of the package.
+It may also create one or more '.h' files containing system-dependent
+definitions.  Finally, it creates a shell script 'config.status' that
 you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
+file 'config.log' containing compiler output (useful mainly for
+debugging 'configure').
 
-   It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.
+   It can also use an optional file (typically called 'config.cache' and
+enabled with '--cache-file=config.cache' or simply '-C') that saves the
+results of its tests to speed up reconfiguring.  Caching is disabled by
+default to prevent problems with accidental use of stale cache files.
 
    If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
+to figure out how 'configure' could check whether to do them, and mail
+diffs or instructions to the address given in the 'README' so they can
 be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
+some point 'config.cache' contains results you don't want to keep, you
 may remove or edit it.
 
-   The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
+   The file 'configure.ac' (or 'configure.in') is used to create
+'configure' by a program called 'autoconf'.  You need 'configure.ac' if
+you want to change it or regenerate 'configure' using a newer version of
+'autoconf'.
 
    The simplest way to compile this package is:
 
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.
+  1. 'cd' to the directory containing the package's source code and type
+     './configure' to configure the package for your system.
 
-     Running `configure' might take a while.  While running, it prints
+     Running 'configure' might take a while.  While running, it prints
      some messages telling which features it is checking for.
 
-  2. Type `make' to compile the package.
+  2. Type 'make' to compile the package.
 
-  3. Optionally, type `make check' to run any self-tests that come with
+  3. Optionally, type 'make check' to run any self-tests that come with
      the package, generally using the just-built uninstalled binaries.
 
-  4. Type `make install' to install the programs and any data files and
+  4. Type 'make install' to install the programs and any data files and
      documentation.  When installing into a prefix owned by root, it is
      recommended that the package be configured and built as a regular
-     user, and only the `make install' phase executed with root
+     user, and only the 'make install' phase executed with root
      privileges.
 
-  5. Optionally, type `make installcheck' to repeat any self-tests, but
+  5. Optionally, type 'make installcheck' to repeat any self-tests, but
      this time using the binaries in their final installed location.
      This target does not install anything.  Running this target as a
-     regular user, particularly if the prior `make install' required
+     regular user, particularly if the prior 'make install' required
      root privileges, verifies that the installation completed
      correctly.
 
   6. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  To also remove the
-     files that `configure' created (so you can compile the package for
-     a different kind of computer), type `make distclean'.  There is
-     also a `make maintainer-clean' target, but that is intended mainly
+     source code directory by typing 'make clean'.  To also remove the
+     files that 'configure' created (so you can compile the package for
+     a different kind of computer), type 'make distclean'.  There is
+     also a 'make maintainer-clean' target, but that is intended mainly
      for the package's developers.  If you use it, you may have to get
      all sorts of other programs in order to regenerate files that came
      with the distribution.
 
-  7. Often, you can also type `make uninstall' to remove the installed
+  7. Often, you can also type 'make uninstall' to remove the installed
      files again.  In practice, not all packages have tested that
      uninstallation works correctly, even though it is required by the
      GNU Coding Standards.
 
-  8. Some packages, particularly those that use Automake, provide `make
+  8. Some packages, particularly those that use Automake, provide 'make
      distcheck', which can by used by developers to test that all other
-     targets like `make install' and `make uninstall' work correctly.
+     targets like 'make install' and 'make uninstall' work correctly.
      This target is generally not run by end users.
 
 Compilers and Options
 =====================
 
    Some systems require unusual options for compilation or linking that
-the `configure' script does not know about.  Run `./configure --help'
+the 'configure' script does not know about.  Run './configure --help'
 for details on some of the pertinent environment variables.
 
-   You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment.  Here
-is an example:
+   You can give 'configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here is
+an example:
 
      ./configure CC=c99 CFLAGS=-g LIBS=-lposix
 
@@ -113,21 +112,21 @@ Compiling For Multiple Architectures
 
    You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
-own directory.  To do this, you can use GNU `make'.  `cd' to the
+own directory.  To do this, you can use GNU 'make'.  'cd' to the
 directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.  This
-is known as a "VPATH" build.
+the 'configure' script.  'configure' automatically checks for the source
+code in the directory that 'configure' is in and in '..'.  This is known
+as a "VPATH" build.
 
-   With a non-GNU `make', it is safer to compile the package for one
+   With a non-GNU 'make', it is safer to compile the package for one
 architecture at a time in the source code directory.  After you have
-installed the package for one architecture, use `make distclean' before
+installed the package for one architecture, use 'make distclean' before
 reconfiguring for another architecture.
 
    On MacOS X 10.5 and later systems, you can create libraries and
 executables that work on multiple system types--known as "fat" or
-"universal" binaries--by specifying multiple `-arch' options to the
-compiler but only a single `-arch' option to the preprocessor.  Like
+"universal" binaries--by specifying multiple '-arch' options to the
+compiler but only a single '-arch' option to the preprocessor.  Like
 this:
 
      ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
@@ -136,105 +135,104 @@ this:
 
    This is not guaranteed to produce working output in all cases, you
 may have to build one architecture at a time and combine the results
-using the `lipo' tool if you have problems.
+using the 'lipo' tool if you have problems.
 
 Installation Names
 ==================
 
-   By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc.  You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX', where PREFIX must be an
+   By default, 'make install' installs the package's commands under
+'/usr/local/bin', include files under '/usr/local/include', etc.  You
+can specify an installation prefix other than '/usr/local' by giving
+'configure' the option '--prefix=PREFIX', where PREFIX must be an
 absolute file name.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
 PREFIX as the prefix for installing programs and libraries.
 Documentation and other data files still use the regular prefix.
 
    In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.  In general, the
-default for these options is expressed in terms of `${prefix}', so that
-specifying just `--prefix' will affect all of the other directory
+options like '--bindir=DIR' to specify different values for particular
+kinds of files.  Run 'configure --help' for a list of the directories
+you can set and what kinds of files go in them.  In general, the default
+for these options is expressed in terms of '${prefix}', so that
+specifying just '--prefix' will affect all of the other directory
 specifications that were not explicitly provided.
 
    The most portable way to affect installation locations is to pass the
-correct locations to `configure'; however, many packages provide one or
+correct locations to 'configure'; however, many packages provide one or
 both of the following shortcuts of passing variable assignments to the
-`make install' command line to change installation locations without
+'make install' command line to change installation locations without
 having to reconfigure or recompile.
 
    The first method involves providing an override variable for each
-affected directory.  For example, `make install
+affected directory.  For example, 'make install
 prefix=/alternate/directory' will choose an alternate location for all
 directory configuration variables that were expressed in terms of
-`${prefix}'.  Any directories that were specified during `configure',
-but not in terms of `${prefix}', must each be overridden at install
-time for the entire installation to be relocated.  The approach of
-makefile variable overrides for each directory variable is required by
-the GNU Coding Standards, and ideally causes no recompilation.
-However, some platforms have known limitations with the semantics of
-shared libraries that end up requiring recompilation when using this
-method, particularly noticeable in packages that use GNU Libtool.
-
-   The second method involves providing the `DESTDIR' variable.  For
-example, `make install DESTDIR=/alternate/directory' will prepend
-`/alternate/directory' before all installation names.  The approach of
-`DESTDIR' overrides is not required by the GNU Coding Standards, and
+'${prefix}'.  Any directories that were specified during 'configure',
+but not in terms of '${prefix}', must each be overridden at install time
+for the entire installation to be relocated.  The approach of makefile
+variable overrides for each directory variable is required by the GNU
+Coding Standards, and ideally causes no recompilation.  However, some
+platforms have known limitations with the semantics of shared libraries
+that end up requiring recompilation when using this method, particularly
+noticeable in packages that use GNU Libtool.
+
+   The second method involves providing the 'DESTDIR' variable.  For
+example, 'make install DESTDIR=/alternate/directory' will prepend
+'/alternate/directory' before all installation names.  The approach of
+'DESTDIR' overrides is not required by the GNU Coding Standards, and
 does not work on platforms that have drive letters.  On the other hand,
 it does better at avoiding recompilation issues, and works well even
-when some directory options were not specified in terms of `${prefix}'
-at `configure' time.
+when some directory options were not specified in terms of '${prefix}'
+at 'configure' time.
 
 Optional Features
 =================
 
    If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-   Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
+with an extra prefix or suffix on their names by giving 'configure' the
+option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
+
+   Some packages pay attention to '--enable-FEATURE' options to
+'configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to '--with-PACKAGE' options, where PACKAGE
+is something like 'gnu-as' or 'x' (for the X Window System).  The
+'README' should mention any '--enable-' and '--with-' options that the
 package recognizes.
 
-   For packages that use the X Window System, `configure' can usually
+   For packages that use the X Window System, 'configure' can usually
 find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
+you can use the 'configure' options '--x-includes=DIR' and
+'--x-libraries=DIR' to specify their locations.
 
    Some packages offer the ability to configure how verbose the
-execution of `make' will be.  For these packages, running `./configure
+execution of 'make' will be.  For these packages, running './configure
 --enable-silent-rules' sets the default to minimal output, which can be
-overridden with `make V=1'; while running `./configure
+overridden with 'make V=1'; while running './configure
 --disable-silent-rules' sets the default to verbose, which can be
-overridden with `make V=0'.
+overridden with 'make V=0'.
 
 Particular systems
 ==================
 
-   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
-CC is not installed, it is recommended to use the following options in
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU CC
+is not installed, it is recommended to use the following options in
 order to use an ANSI C compiler:
 
      ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
 
 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
 
-   HP-UX `make' updates targets which have the same time stamps as
-their prerequisites, which makes it generally unusable when shipped
-generated files such as `configure' are involved.  Use GNU `make'
-instead.
+   HP-UX 'make' updates targets which have the same time stamps as their
+prerequisites, which makes it generally unusable when shipped generated
+files such as 'configure' are involved.  Use GNU 'make' instead.
 
    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
-parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
-a workaround.  If GNU CC is not installed, it is therefore recommended
-to try
+parse its '<wchar.h>' header file.  The option '-nodtk' can be used as a
+workaround.  If GNU CC is not installed, it is therefore recommended to
+try
 
      ./configure CC="cc"
 
@@ -242,26 +240,26 @@ and if that doesn't work, try
 
      ./configure CC="cc -nodtk"
 
-   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+   On Solaris, don't put '/usr/ucb' early in your 'PATH'.  This
 directory contains several dysfunctional programs; working variants of
-these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
-in your `PATH', put it _after_ `/usr/bin'.
+these programs are available in '/usr/bin'.  So, if you need '/usr/ucb'
+in your 'PATH', put it _after_ '/usr/bin'.
 
-   On Haiku, software installed for all users goes in `/boot/common',
-not `/usr/local'.  It is recommended to use the following options:
+   On Haiku, software installed for all users goes in '/boot/common',
+not '/usr/local'.  It is recommended to use the following options:
 
      ./configure --prefix=/boot/common
 
 Specifying the System Type
 ==========================
 
-   There may be some features `configure' cannot figure out
+   There may be some features 'configure' cannot figure out
 automatically, but needs to determine by the type of machine the package
 will run on.  Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
+_same_ architectures, 'configure' can figure that out, but if it prints
 a message saying it cannot guess the machine type, give it the
-`--build=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
+'--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as 'sun4', or a canonical name which has the form:
 
      CPU-COMPANY-SYSTEM
 
@@ -270,101 +268,101 @@ where SYSTEM can have one of these forms:
      OS
      KERNEL-OS
 
-   See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
+   See the file 'config.sub' for the possible values of each field.  If
+'config.sub' isn't included in this package, then this package doesn't
 need to know the machine type.
 
    If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
+use the option '--target=TYPE' to select the type of system they will
 produce code for.
 
    If you want to _use_ a cross compiler, that generates code for a
 platform different from the build platform, you should specify the
 "host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
+eventually be run) with '--host=TYPE'.
 
 Sharing Defaults
 ================
 
-   If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
+   If you want to set default values for 'configure' scripts to share,
+you can create a site shell script called 'config.site' that gives
+default values for variables like 'CC', 'cache_file', and 'prefix'.
+'configure' looks for 'PREFIX/share/config.site' if it exists, then
+'PREFIX/etc/config.site' if it exists.  Or, you can set the
+'CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all 'configure' scripts look for a site script.
 
 Defining Variables
 ==================
 
    Variables not defined in a site shell script can be set in the
-environment passed to `configure'.  However, some packages may run
+environment passed to 'configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'.  For example:
+them in the 'configure' command line, using 'VAR=value'.  For example:
 
      ./configure CC=/usr/local2/bin/gcc
 
-causes the specified `gcc' to be used as the C compiler (unless it is
+causes the specified 'gcc' to be used as the C compiler (unless it is
 overridden in the site shell script).
 
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf limitation.  Until the limitation is lifted, you can use
-this workaround:
+Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
+Autoconf limitation.  Until the limitation is lifted, you can use this
+workaround:
 
      CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
 
-`configure' Invocation
+'configure' Invocation
 ======================
 
-   `configure' recognizes the following options to control how it
+   'configure' recognizes the following options to control how it
 operates.
 
-`--help'
-`-h'
-     Print a summary of all of the options to `configure', and exit.
+'--help'
+'-h'
+     Print a summary of all of the options to 'configure', and exit.
 
-`--help=short'
-`--help=recursive'
+'--help=short'
+'--help=recursive'
      Print a summary of the options unique to this package's
-     `configure', and exit.  The `short' variant lists options used
-     only in the top level, while the `recursive' variant lists options
-     also present in any nested packages.
+     'configure', and exit.  The 'short' variant lists options used only
+     in the top level, while the 'recursive' variant lists options also
+     present in any nested packages.
 
-`--version'
-`-V'
-     Print the version of Autoconf used to generate the `configure'
+'--version'
+'-V'
+     Print the version of Autoconf used to generate the 'configure'
      script, and exit.
 
-`--cache-file=FILE'
+'--cache-file=FILE'
      Enable the cache: use and save the results of the tests in FILE,
-     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     traditionally 'config.cache'.  FILE defaults to '/dev/null' to
      disable caching.
 
-`--config-cache'
-`-C'
-     Alias for `--cache-file=config.cache'.
+'--config-cache'
+'-C'
+     Alias for '--cache-file=config.cache'.
 
-`--quiet'
-`--silent'
-`-q'
+'--quiet'
+'--silent'
+'-q'
      Do not print messages saying which checks are being made.  To
-     suppress all normal output, redirect it to `/dev/null' (any error
+     suppress all normal output, redirect it to '/dev/null' (any error
      messages will still be shown).
 
-`--srcdir=DIR'
+'--srcdir=DIR'
      Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
+     'configure' can determine that directory automatically.
 
-`--prefix=DIR'
-     Use DIR as the installation prefix.  *note Installation Names::
-     for more details, including other options available for fine-tuning
-     the installation locations.
+'--prefix=DIR'
+     Use DIR as the installation prefix.  *note Installation Names:: for
+     more details, including other options available for fine-tuning the
+     installation locations.
 
-`--no-create'
-`-n'
+'--no-create'
+'-n'
      Run the configure checks, but stop before creating any output
      files.
 
-`configure' also accepts some other, not widely useful, options.  Run
-`configure --help' for more details.
+'configure' also accepts some other, not widely useful, options.  Run
+'configure --help' for more details.
diff --git a/Makefile.am b/Makefile.am
index 70b02ce..63baa31 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,12 +1,17 @@
 # This script is in the public domain.
-SUBDIRS = . talerbank
+SUBDIRS = . talerbank doc
 
 EXTRA_DIST = \
  requirements.txt \
  taler-bank-manage.in \
  bank.wsgi.in \
  setup.py \
- contrib/nginx/django_nginx.conf
+ contrib/nginx/django_nginx.conf \
+ bank.conf \
+ bank-check.conf \
+ bank-check-alt-badamount.conf \
+ bank-check-alt-baddb.conf \
+ bank-check-alt-nocurrency.conf
 
 pkgcfgdir= $(prefix)/share/taler/config.d/
 
@@ -23,10 +28,14 @@ install-dev:
 
 check:
        @export DJANGO_SETTINGS_MODULE="talerbank.settings" 
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check.conf" && python3 -m 
django test talerbank.app.tests
-#      @export DJANGO_SETTINGS_MODULE="talerbank.settings" 
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check-alt.conf" && python3 -m 
django test talerbank.app.tests_err
-
-check_with_wrapper:
-       @export DJANGO_SETTINGS_MODULE="talerbank.settings" 
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check.conf" && python3 
run_tests.py
+       @printf -- 
"\n\n----------------------------------------------------------------------\nTesting
 against non existent config file\n\n"
+       @export DJANGO_SETTINGS_MODULE="talerbank.settings" 
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="non-existent.conf" && python3 -m 
django test talerbank.app.tests ; test 3 = $$?
+       @printf -- 
"\n\n----------------------------------------------------------------------\nTesting
 against bad db string\n\n"
+       @export DJANGO_SETTINGS_MODULE="talerbank.settings" 
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check-alt-baddb.conf" && 
python3 -m django test talerbank.app.tests_alt.BadDatabaseStringTestCase ; test 
2 = $$?
+       @printf -- 
"\n\n----------------------------------------------------------------------\nTesting
 against bad amount\n\n"
+       @export DJANGO_SETTINGS_MODULE="talerbank.settings" 
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check-alt-badamount.conf" && 
python3 -m django test talerbank.app.tests_alt.BadMaxDebtOptionTestCase
+       @printf -- 
"\n\n----------------------------------------------------------------------\nTesting
 against no currency in config\n\n"
+       @export TALER_BASE_CONFIG="/tmp" 
DJANGO_SETTINGS_MODULE="talerbank.settings" TALER_PREFIX="@prefix@" 
TALER_CONFIG_FILE="bank-check-alt-nocurrency.conf" && python3 -m django test 
talerbank.app.tests_alt.NoCurrencyOptionTestCase ; test 3 = $$?
 
 # install into prefix
 install-exec-hook:
@@ -34,5 +43,8 @@ install-exec-hook:
        @# force update when sources changed
        @pip3 install . --install-option="address@hidden@" @DEBIAN_PIP3_SYSTEM@ 
--upgrade --no-deps
 
+pylint:
+       @pylint --load-plugins pylint_django talerbank/
+
 app:
        @tar czf taler-bank-$(PACKAGE_VERSION)-app.tgz `cat INCLUDE.APP`
diff --git a/README b/README
index 4ccf8b4..dbf4e8a 100644
--- a/README
+++ b/README
@@ -1,3 +1,4 @@
+
 This code implements a bank Web portal that tightly integrates with
 the GNU Taler payment system.  The bank it primarily meant be used as
 part of a demonstrator for the Taler system.
@@ -30,6 +31,9 @@ The next step is to specify the install prefix, run
 $ export PREFIX=$HOME/local # Adapt to your needs.
 $ ./configure --prefix=$PREFIX
 
+On some Debian systems, the additional flag --enable-debian-system
+might be useful to let the --prefix option be correctly executed.
+
 Then the usual GNU-compatible commands, that are
 
 $ make install
@@ -52,14 +56,7 @@ In order to properly run, the bank needs the following parts 
to be configured
 * Fractional precision: precision of the fractional part of Taler objects.
 * Fractional length: how many digits after the floating point we want to be 
shown
   in HTML pages.
-
-Furthermore, the bank is "split" in two processes: the "normal" and the 
"admin" one.
-The admin one implements the part of REST API used to transfer money from 
account
-x to account y.  The normal one implements all the rest.
-The reason is that the sysadmin may want to enforce special rules to make the 
admin
-process reachable from the external world.
-
-See the configuration file in the example below.
+* Debt thresholds
 
 # Mandatory section name
 [bank]
@@ -97,21 +94,20 @@ FRACTION = 100000000
 # if not given.
 DATABASE = postgres:///talerlocal
 
-# The following sections are to configure the "admin" part of
-# the bank
-
-# Mandatory section name
-[bank-admin]
-
 # See above
 UWSGI_SERVE = unix
 
 # See above
-UWSGI_UNIXPATH = /deployment/sockets/bank-admin.uwsgi
-
-# See above
 UWSGI_UNIXPATH_MODE = 660
 
+# Maximum debt allowed for normal users.  The notation
+# used for amounts is: xy[.uv]:CURRENCY, with '.uv' being
+# optional.  NOTE that an amount of zero means there is no
+# maximum threshold.
+MAX_DEBT = 60:KUDOS
+
+# Maximum debt allowed for the bank itself
+MAX_DEBT_BANK = 0:KUDOS # Infinite debt allowed.
 
 ================== HOW TO LAUNCH THE BANK =================
 
@@ -120,14 +116,10 @@ The bank can accept connections via the UWSGI protocol 
and HTTP.
 To launch it for the UWSGI protocol, issue
 
 $ taler-bank-manage serve-uwsgi
-# The -a option launches the admin part of the bank
-$ taler-bank-manage -a serve-uwsgi
 
 To launch it for HTTP, issue
 
 $ taler-bank-manage serve-http
-# The -a option launches the admin part of the bank
-$ taler-bank-manage -a serve-http
 
 the port the bank will listen to, can be either specified on the
 command line (option -p), or in the configuration file with the
@@ -144,8 +136,8 @@ $ make check
 in order to have test cases run.  A previous 'make install' is
 NOT required.
 
-Test cases' code is hosted in talerbank/app/tests.py and
-talerbank/app/tests_admin.py
+NOTE: as tests do create a database (tipically named test_XYZ), the user
+launching those must have some "write permissions" on the DMBS.
 
 ================= HOW TO FORCE MIGRATIONS =================
 
diff --git a/bank-check-alt.conf b/bank-check-alt-badamount.conf
similarity index 77%
copy from bank-check-alt.conf
copy to bank-check-alt-badamount.conf
index 9c77a2a..757b827 100644
--- a/bank-check-alt.conf
+++ b/bank-check-alt-badamount.conf
@@ -8,10 +8,10 @@ CURRENCY = KUDOS
 [bank]
 
 # Which database should we use?
-DATABASE = postgres:///talerbank
+DATABASE = postgres:///talercheck
 
 # FIXME
-MAX_DEBT = KUDOS:50
+MAX_DEBT = 33 KUDOS
 
 # FIXME
 MAX_DEBT_BANK = KUDOS:0
diff --git a/bank-check-alt.conf b/bank-check-alt-baddb.conf
similarity index 86%
rename from bank-check-alt.conf
rename to bank-check-alt-baddb.conf
index 9c77a2a..6861623 100644
--- a/bank-check-alt.conf
+++ b/bank-check-alt-baddb.conf
@@ -8,7 +8,7 @@ CURRENCY = KUDOS
 [bank]
 
 # Which database should we use?
-DATABASE = postgres:///talerbank
+DATABASE = bad db string
 
 # FIXME
 MAX_DEBT = KUDOS:50
diff --git a/bank.conf b/bank-check-alt-nocurrency.conf
similarity index 82%
copy from bank.conf
copy to bank-check-alt-nocurrency.conf
index c99c2f9..78c95a9 100644
--- a/bank.conf
+++ b/bank-check-alt-nocurrency.conf
@@ -7,4 +7,4 @@ DATABASE = postgres:///talerbank
 MAX_DEBT = KUDOS:50
 
 # FIXME
-MAX_DEBT_BANK = KUDOS:0
\ No newline at end of file
+MAX_DEBT_BANK = KUDOS:0
diff --git a/configure.ac b/configure.ac
index 72c8047..eb50fd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 # This script is in the public domain.
 AC_PREREQ(2.61)
-AC_INIT([taler-bank], [0.2.0], address@hidden)
+AC_INIT([taler-bank], [0.3.0], address@hidden)
 
 AC_CONFIG_MACRO_DIR([m4])
 
@@ -71,20 +71,36 @@ if test x$pyheaders != x1; then
 fi
 
 #
+# Check for pylint
+#
+
+AC_MSG_CHECKING([pip3])
+pylint --version >/dev/null
+if test $? -ne 0;
+  then
+  AC_MSG_NOTICE([WARNING: pylint NOT found.])
+else
+  AC_MSG_NOTICE([NOTICE: pylint found, make sure plugin 'pylint-django' is 
installed.])
+fi
+
+#
 # Finish
 #
 
-AC_CONFIG_FILES([Makefile
- install-dev.py
+AC_CONFIG_FILES([
+ Makefile
  bank.wsgi
+ doc/Makefile
+ install-dev.py
  taler-bank-manage
  talerbank/Makefile
  talerbank/app/Makefile
  talerbank/app/management/Makefile
  talerbank/app/management/commands/Makefile
  talerbank/app/migrations/Makefile
- talerbank/app/templates/Makefile
  talerbank/app/static/Makefile
- talerbank/app/static/web-common/Makefile])
+ talerbank/app/static/web-common/Makefile
+ talerbank/app/templates/Makefile
+])
 
 AC_OUTPUT
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..2a5a5c6
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,27 @@
+# This Makefile.am is in the public domain
+
+SUBDIRS = .
+
+man_MANS = \
+  taler-bank-manage.1 \
+  taler-bank-wsgi.1
+
+AM_MAKEINFOHTMLFLAGS = \
+  --no-split \
+  --css-ref=docstyle.css \
+  --css-ref=brown-paper.css \
+  -c EXTRA_HEAD='<meta name="viewport" content="width=device-width, 
initial-scale=1.0">'
+
+DISTCLEANFILES = \
+  taler-bank.cps \
+  taler-bank.dvi
+
+info_TEXINFOS = \
+  taler-bank.texi
+extra_TEXINFOS = \
+  fdl-1.3.texi \
+  agpl.texi \
+  syntax.texi
+EXTRA_DIST = \
+  $(man_MANS) \
+  $(extra_TEXINFOS)
diff --git a/doc/agpl.texi b/doc/agpl.texi
new file mode 100644
index 0000000..e6ee662
--- /dev/null
+++ b/doc/agpl.texi
@@ -0,0 +1,698 @@
address@hidden The GNU Affero General Public License.
address@hidden Version 3, 19 November 2007
+
address@hidden This file is intended to be included within another document,
address@hidden hence no sectioning command or @node.
+
address@hidden
+Copyright @copyright{} 2007 Free Software Foundation, Inc. 
@url{http://fsf.org/}
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
address@hidden display
+
address@hidden Preamble
+
+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, 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 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
+have the freedom to distribute copies of free software (and charge for
+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.
+
+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.
+
address@hidden TERMS AND CONDITIONS
+
address@hidden 0
address@hidden Definitions.
+
+``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.
+
+``The Program'' refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as ``you''.  ``Licensees'' and
+``recipients'' may be individuals or organizations.
+
+To ``modify'' a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of
+an exact copy.  The resulting work is called a ``modified version'' of
+the earlier work or a work ``based on'' the earlier work.
+
+A ``covered work'' means either the unmodified Program or a work based
+on the Program.
+
+To ``propagate'' a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+To ``convey'' a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user
+through a computer network, with no transfer of a copy, is not
+conveying.
+
+An interactive user interface displays ``Appropriate Legal Notices'' to
+the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
address@hidden Source Code.
+
+The ``source code'' for a work means the preferred form of the work for
+making modifications to it.  ``Object code'' means any non-source form
+of a work.
+
+A ``Standard Interface'' means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+The ``System Libraries'' of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+``Major Component'', in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+The ``Corresponding Source'' for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can
+regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same
+work.
+
address@hidden Basic Permissions.
+
+All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey,
+without conditions so long as your license otherwise remains in force.
+You may convey covered works to others for the sole purpose of having
+them make modifications exclusively for you, or provide you with
+facilities for running those works, provided that you comply with the
+terms of this License in conveying all material for which you do not
+control copyright.  Those thus making or running the covered works for
+you must do so exclusively on your behalf, under your direction and
+control, on terms that prohibit them from making any copies of your
+copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the
+conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
address@hidden Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such
+circumvention is effected by exercising rights under this License with
+respect to the covered work, and you disclaim any intention to limit
+operation or modification of the work as a means of enforcing, against
+the work's users, your or third parties' legal rights to forbid
+circumvention of technological measures.
+
address@hidden Conveying Verbatim Copies.
+
+You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
address@hidden Conveying Modified Source Versions.
+
+You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these
+conditions:
+
address@hidden a
address@hidden
+The work must carry prominent notices stating that you modified it,
+and giving a relevant date.
+
address@hidden
+The work must carry prominent notices stating that it is released
+under this License and any conditions added under section 7.  This
+requirement modifies the requirement in section 4 to ``keep intact all
+notices''.
+
address@hidden
+You must license the entire work, as a whole, under this License to
+anyone who comes into possession of a copy.  This License will
+therefore apply, along with any applicable section 7 additional terms,
+to the whole of the work, and all its parts, regardless of how they
+are packaged.  This License gives no permission to license the work in
+any other way, but it does not invalidate such permission if you have
+separately received it.
+
address@hidden
+If the work has interactive user interfaces, each must display
+Appropriate Legal Notices; however, if the Program has interactive
+interfaces that do not display Appropriate Legal Notices, your work
+need not make them do so.
address@hidden enumerate
+
+A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+``aggregate'' if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
address@hidden  Conveying Non-Source Forms.
+
+You may convey a covered work in object code form under the terms of
+sections 4 and 5, provided that you also convey the machine-readable
+Corresponding Source under the terms of this License, in one of these
+ways:
+
address@hidden a
address@hidden
+Convey the object code in, or embodied in, a physical product
+(including a physical distribution medium), accompanied by the
+Corresponding Source fixed on a durable physical medium customarily
+used for software interchange.
+
address@hidden
+Convey the object code in, or embodied in, a physical product
+(including a physical distribution medium), accompanied by a written
+offer, valid for at least three years and valid for as long as you
+offer spare parts or customer support for that product model, to give
+anyone who possesses the object code either (1) a copy of the
+Corresponding Source for all the software in the product that is
+covered by this License, on a durable physical medium customarily used
+for software interchange, for a price no more than your reasonable
+cost of physically performing this conveying of source, or (2) access
+to copy the Corresponding Source from a network server at no charge.
+
address@hidden
+Convey individual copies of the object code with a copy of the written
+offer to provide the Corresponding Source.  This alternative is
+allowed only occasionally and noncommercially, and only if you
+received the object code with such an offer, in accord with subsection
+6b.
+
address@hidden
+Convey the object code by offering access from a designated place
+(gratis or for a charge), and offer equivalent access to the
+Corresponding Source in the same way through the same place at no
+further charge.  You need not require recipients to copy the
+Corresponding Source along with the object code.  If the place to copy
+the object code is a network server, the Corresponding Source may be
+on a different server (operated by you or a third party) that supports
+equivalent copying facilities, provided you maintain clear directions
+next to the object code saying where to find the Corresponding Source.
+Regardless of what server hosts the Corresponding Source, you remain
+obligated to ensure that it is available for as long as needed to
+satisfy these requirements.
+
address@hidden
+Convey the object code using peer-to-peer transmission, provided you
+inform other peers where the object code and Corresponding Source of
+the work are being offered to the general public at no charge under
+subsection 6d.
+
address@hidden enumerate
+
+A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+A ``User Product'' is either (1) a ``consumer product'', which means any
+tangible personal property which is normally used for personal,
+family, or household purposes, or (2) anything designed or sold for
+incorporation into a dwelling.  In determining whether a product is a
+consumer product, doubtful cases shall be resolved in favor of
+coverage.  For a particular product received by a particular user,
+``normally used'' refers to a typical or common use of that class of
+product, regardless of the status of the particular user or of the way
+in which the particular user actually uses, or expects or is expected
+to use, the product.  A product is a consumer product regardless of
+whether the product has substantial commercial, industrial or
+non-consumer uses, unless such uses represent the only significant
+mode of use of the product.
+
+``Installation Information'' for a User Product means any methods,
+procedures, authorization keys, or other information required to
+install and execute modified versions of a covered work in that User
+Product from a modified version of its Corresponding Source.  The
+information must suffice to ensure that the continued functioning of
+the modified object code is in no case prevented or interfered with
+solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or
+updates for a work that has been modified or installed by the
+recipient, or for the User Product in which it has been modified or
+installed.  Access to a network may be denied when the modification
+itself materially and adversely affects the operation of the network
+or violates the rules and protocols for communication across the
+network.
+
+Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
address@hidden Additional Terms.
+
+``Additional permissions'' are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders
+of that material) supplement the terms of this License with terms:
+
address@hidden a
address@hidden
+Disclaiming warranty or limiting liability differently from the terms
+of sections 15 and 16 of this License; or
+
address@hidden
+Requiring preservation of specified reasonable legal notices or author
+attributions in that material or in the Appropriate Legal Notices
+displayed by works containing it; or
+
address@hidden
+Prohibiting misrepresentation of the origin of that material, or
+requiring that modified versions of such material be marked in
+reasonable ways as different from the original version; or
+
address@hidden
+Limiting the use for publicity purposes of names of licensors or
+authors of the material; or
+
address@hidden
+Declining to grant rights under trademark law for use of some trade
+names, trademarks, or service marks; or
+
address@hidden
+Requiring indemnification of licensors and authors of that material by
+anyone who conveys the material (or modified versions of it) with
+contractual assumptions of liability to the recipient, for any
+liability that these contractual assumptions directly impose on those
+licensors and authors.
address@hidden enumerate
+
+All other non-permissive additional terms are considered ``further
+restrictions'' within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions; the
+above requirements apply either way.
+
address@hidden Termination.
+
+You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
address@hidden Acceptance Not Required for Having Copies.
+
+You are not required to accept this License in order to receive or run
+a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
address@hidden Automatic Licensing of Downstream Recipients.
+
+Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+An ``entity transaction'' is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
address@hidden Patents.
+
+A ``contributor'' is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's ``contributor version''.
+
+A contributor's ``essential patent claims'' are all patent claims owned
+or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, ``control'' includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+In the following three paragraphs, a ``patent license'' is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To ``grant'' such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  ``Knowingly relying'' means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+A patent license is ``discriminatory'' if it does not include within the
+scope of its coverage, prohibits the exercise of, or is conditioned on
+the non-exercise of one or more of the rights that are specifically
+granted under this License.  You may not convey a covered work if you
+are a party to an arrangement with a third party that is in the
+business of distributing software, under which you make payment to the
+third party based on the extent of your activity of conveying the
+work, and under which the third party grants, to any of the parties
+who would receive the covered work from you, a discriminatory patent
+license (a) in connection with copies of the covered work conveyed by
+you (or copies made from those copies), or (b) primarily for and in
+connection with specific products or compilations that contain the
+covered work, unless you entered into that arrangement, or that patent
+license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
address@hidden No Surrender of Others' Freedom.
+
+If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey
+a covered work so as to satisfy simultaneously your obligations under
+this License and any other pertinent obligations, then as a
+consequence you may not convey it at all.  For example, if you agree
+to terms that obligate you 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.
+
address@hidden 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 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, but the work with which it is combined
+will remain governed by version 3 of the GNU General Public License.
+
address@hidden Revised Versions of this License.
+
+The Free Software Foundation may publish revised and/or new versions
+of 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 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 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 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.
+
+Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
address@hidden Disclaimer of Warranty.
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE
+DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
+CORRECTION.
+
address@hidden Limitation of Liability.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
+CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
+NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
+LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
+TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
+PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
address@hidden Interpretation of Sections 15 and 16.
+
+If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+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.
+
address@hidden enumerate
+
address@hidden END OF TERMS AND CONDITIONS
+
address@hidden 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.
+
address@hidden
address@hidden line to give the program's name and a brief idea of what it 
does.}
+Copyright (C) @var{year} @var{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 @url{http://www.gnu.org/licenses/}.
address@hidden smallexample
+
+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
address@hidden://www.gnu.org/licenses/}.
diff --git a/doc/brown-paper.css b/doc/brown-paper.css
new file mode 100644
index 0000000..65e2e79
--- /dev/null
+++ b/doc/brown-paper.css
@@ -0,0 +1,63 @@
+/*
+
+Brown Paper style from goldblog.com.ua (c) Zaripov Yura <address@hidden>
+
+*/
+
+.hljs {
+  display: block;
+  overflow-x: auto;
+  padding: 0.5em;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal {
+  color:#005599;
+  font-weight:bold;
+}
+
+.hljs,
+.hljs-subst {
+  color: #363c69;
+}
+
+.hljs-string,
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-attribute,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-built_in,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-link,
+.hljs-name {
+  color: #2c009f;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-meta,
+.hljs-deletion {
+  color: #802022;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-doctag,
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-name,
+.hljs-strong {
+  font-weight: bold;
+}
+
+.hljs-emphasis {
+  font-style: italic;
+}
diff --git a/doc/docstyle.css b/doc/docstyle.css
new file mode 100644
index 0000000..2d74a7e
--- /dev/null
+++ b/doc/docstyle.css
@@ -0,0 +1,80 @@
+html, body {
+   font-size: 1em;
+   text-align: left;
+   text-decoration: none;
+}
+html { background-color: #e7e7e7; }
+
+body {
+   max-width: 74.92em;
+   margin: 0 auto;
+   padding: .5em 1em 1em 1em;
+   background-color: white;
+   border: .1em solid #c0c0c0;
+}
+
+h1, h2, h3, h4 { color: #333; }
+h5, h6, dt { color: #222; }
+
+
+a h3 {
+  color: #005090;
+}
+
+a[href] { color: #005090; }
+a[href]:visited { color: #100070; }
+a[href]:active, a[href]:hover {
+   color: #100070;
+   text-decoration: none;
+}
+
+.linkrow {
+  margin: 3em 0;
+}
+
+.linkrow {
+  text-align: center;
+}
+
+div.example { padding: .8em 1.2em .4em; }
+pre.example { padding: .8em 1.2em; }
+div.example, pre.example {
+   margin: 1em 0 1em 3% ;
+   -webkit-border-radius: .3em;
+   -moz-border-radius: .3em;
+   border-radius: .3em;
+   border: 1px solid #d4cbb6;
+   background-color: #f2efe4;
+}
+div.example > pre.example {
+   padding: 0 0 .4em;
+   margin: 0;
+   border: none;
+}
+
+
+/* This makes the very long tables of contents in Gnulib and other
+   manuals easier to read. */
+.contents ul, .shortcontents ul { font-weight: bold; }
+.contents ul ul, .shortcontents ul ul { font-weight: normal; }
+.contents ul { list-style: none; }
+
+/* For colored navigation bars (Emacs manual): make the bar extend
+   across the whole width of the page and give it a decent height. */
+.header, .node { margin: 0 -1em; padding: 0 1em; }
+.header p, .node p { line-height: 2em; }
+
+/* For navigation links */
+.node a, .header a { display: inline-block; line-height: 2em; }
+.node a:hover, .header a:hover { background: #f2efe4; }
+
+table.cartouche {
+  border-collapse: collapse;
+  border-color: darkred;
+  border-style: solid;
+  border-width: 3px;
+}
+
+img {
+  max-width: 100%;
+}
diff --git a/doc/fdl-1.3.texi b/doc/fdl-1.3.texi
new file mode 100644
index 0000000..8805f1a
--- /dev/null
+++ b/doc/fdl-1.3.texi
@@ -0,0 +1,506 @@
address@hidden The GNU Free Documentation License.
address@hidden Version 1.3, 3 November 2008
+
address@hidden This file is intended to be included within another document,
address@hidden hence no sectioning command or @node.
+
address@hidden
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, 
Inc.
address@hidden://fsf.org/}
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
address@hidden display
+
address@hidden 0
address@hidden
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document @dfn{free} in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
address@hidden
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The ``Document'', below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as ``you''.  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject.  (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not ``Transparent'' is called ``Opaque''.
+
+Examples of suitable formats for Transparent copies include plain
address@hidden without markup, Texinfo input format, address@hidden input
+format, @acronym{SGML} or @acronym{XML} using a publicly available
address@hidden, and standard-conforming simple @acronym{HTML},
+PostScript or @acronym{PDF} designed for human modification.  Examples
+of transparent image formats include @acronym{PNG}, @acronym{XCF} and
address@hidden  Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, @acronym{SGML} or
address@hidden for which the @acronym{DTD} and/or processing tools are
+not generally available, and the machine-generated @acronym{HTML},
+PostScript or @acronym{PDF} produced by some word processors for
+output purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The ``publisher'' means any person or entity that distributes copies
+of the Document to the public.
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.)  To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
address@hidden
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
address@hidden
+COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
address@hidden
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
address@hidden A
address@hidden
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document).  You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
address@hidden
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has fewer than five),
+unless they release you from this requirement.
+
address@hidden
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
address@hidden
+Preserve all the copyright notices of the Document.
+
address@hidden
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
address@hidden
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
address@hidden
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
address@hidden
+Include an unaltered copy of this License.
+
address@hidden
+Preserve the section Entitled ``History'', Preserve its Title, and add
+to it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page.  If
+there is no section Entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
address@hidden
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on.  These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
address@hidden
+For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
+the Title of the section, and preserve in the section all the
+substance and tone of each of the contributor acknowledgements and/or
+dedications given therein.
+
address@hidden
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles.  Section numbers
+or the equivalent are not considered part of the section titles.
+
address@hidden
+Delete any section Entitled ``Endorsements''.  Such a section
+may not be included in the Modified Version.
+
address@hidden
+Do not retitle any existing section to be Entitled ``Endorsements'' or
+to conflict in title with any Invariant Section.
+
address@hidden
+Preserve any Warranty Disclaimers.
address@hidden enumerate
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties---for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
address@hidden
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications''.  You must delete all
+sections Entitled ``Endorsements.''
+
address@hidden
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
address@hidden
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
address@hidden
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
address@hidden
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
address@hidden
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation 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.  See
address@hidden://www.gnu.org/copyleft/}.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.  If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
address@hidden
+RELICENSING
+
+``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works.  A
+public wiki that anybody can edit is an example of such a server.  A
+``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
+site means any set of copyrightable works thus published on the MMC
+site.
+
+``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+``Incorporate'' means to publish or republish a Document, in whole or
+in part, as part of another Document.
+
+An MMC is ``eligible for relicensing'' if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole
+or in part into the MMC, (1) had no cover texts or invariant sections,
+and (2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
address@hidden enumerate
+
address@hidden
address@hidden ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
address@hidden
address@hidden
+  Copyright (C)  @var{year}  @var{your name}.
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the GNU Free Documentation License, Version 1.3
+  or any later version published by the Free Software Foundation;
+  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+  Texts.  A copy of the license is included in the section entitled ``GNU
+  Free Documentation License''.
address@hidden group
address@hidden smallexample
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the address@hidden'' line with this:
+
address@hidden
address@hidden
+    with the Invariant Sections being @var{list their titles}, with
+    the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
+    being @var{list}.
address@hidden group
address@hidden smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
address@hidden Local Variables:
address@hidden ispell-local-pdict: "ispell-dict"
address@hidden End:
+
diff --git a/doc/syntax.texi b/doc/syntax.texi
new file mode 100644
index 0000000..8bb37b3
--- /dev/null
+++ b/doc/syntax.texi
@@ -0,0 +1,43 @@
address@hidden Syntax highlighting for texinfo's HTML output
+
address@hidden
+<script src="highlight.pack.js"></script>
+<script>
+var hls = [];
+var syntaxAuto = true;
+addEventListener("DOMContentLoaded", function() {
+  // Highlight blocks with fixed language
+  for (let x of hls) {
+    let next = x[0].nextElementSibling;
+    let blocks = next.querySelectorAll("pre.example, pre.smallexample");
+    for (let i = 0; i < blocks.length; i++) {
+      blocks[i].classList.add("language-" + x[1]);
+      hljs.highlightBlock(blocks[i]);
+    }
+  } 
+  // auto-detect other blocks if not disabled
+  if (syntaxAuto) {
+    let blocks = document.querySelectorAll("pre.example, pre.smallexample");
+    for (let i = 0; i < blocks.length; i++) {
+      hljs.highlightBlock(blocks[i]);
+    }
+  }
+});
+</script>
address@hidden html
+
address@hidden setsyntax{lang}
address@hidden
+<script>
+hls.push([document.currentScript, "\lang\"]);
+</script>
address@hidden html
address@hidden macro
+
address@hidden setsyntaxnoauto{}
address@hidden
+<script>
+syntaxAuto = false;
+</script>
address@hidden html
address@hidden macro
diff --git a/doc/taler-bank.texi b/doc/taler-bank.texi
new file mode 100644
index 0000000..fca47b9
--- /dev/null
+++ b/doc/taler-bank.texi
@@ -0,0 +1,313 @@
+\input texinfo @c -*-texinfo-*-
address@hidden %**start of header
address@hidden taler-bank.info
address@hidden version.texi
address@hidden syntax.texi
address@hidden The GNU Taler manual for bank integration @value{VERSION}
+
address@hidden Define a new index for options.
address@hidden op
address@hidden Combine everything into one index (arbitrarily chosen to be the
address@hidden concept index).
address@hidden op cp
address@hidden %**end of header
+
address@hidden
+This manual is about integrating Taler with banking applications
+and operating the demo bank software. (version @value{VERSION}, 
@value{UPDATED}),
+
+Copyright @copyright{} 2017 Inria
+
address@hidden
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts.  A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
address@hidden quotation
address@hidden copying
address@hidden If your tutorial is published on paper by the FSF, it should 
include
address@hidden The standard FSF Front-Cover and Back-Cover Texts, as given in
address@hidden maintain.texi.
address@hidden
address@hidden Titlepage
address@hidden
address@hidden
address@hidden The GNU Taler bank manual
address@hidden Version @value{VERSION}
address@hidden @value{UPDATED}
address@hidden Florian Dold (@email{florian.dold@@inria.fr})
address@hidden Marcello Stanisci (@email{marcello.stanisci@@inria.fr})
address@hidden
address@hidden 0pt plus 1filll
address@hidden
address@hidden titlepage
+
address@hidden
address@hidden
+
address@hidden
address@hidden Top
address@hidden The GNU Taler bank manual
address@hidden
address@hidden ifnottex
+
address@hidden
+* Introduction::                                  What this manual is about
+* Reference::                                     Bank integration reference
+
+
+Appendices
+
+* GNU-AGPL::                     The GNU Lesser General Public License says 
how you
+                                 can use the code of the GNU Taler demo bank 
in your own projects.
+* GNU-FDL::                      The GNU Free Documentation License says how 
you
+                                 can copy and share the documentation of GNU 
Taler.
+
+Indices
+
+* Concept Index::               Index of concepts and programs.
address@hidden menu
+
+
address@hidden Introduction
address@hidden Introduction
+
address@hidden About GNU Taler
+
+GNU Taler is an open protocol for an electronic payment system with a
+free software reference implementation.  GNU Taler offers secure, fast
+and easy payment processing using well understood cryptographic
+techniques.  GNU Taler allows customers to remain anonymous, while
+ensuring that merchants can be held accountable by governments.
+Hence, GNU Taler is compatible with anti-money-laundering (AML) and
+know-your-customer (KYC) regulation, as well as data protection
+regulation (such as GDPR).
+
+
address@hidden About this manual
+
+This manual documents how the demonstrator bank interoperates with the
+other GNU Taler components.  The demonstrator bank implements a simple
+closed banking system for the purpose of illustrating how GNU Taler
+works in the Taler demo. It could also be used as a starting point for
+a local/regional currency.  Finally, ``real'' banks might use it as a
+reference implementation for a tight integration with the GNU Taler
+wallet.
+
+
address@hidden Reference
address@hidden Reference
+
address@hidden
+* Bank-Wallet interaction::              Tight integration with the bank for 
withdrawal
+* Bank-Exchange interaction::            Money flux to and from the Exchange
address@hidden menu
+
address@hidden Bank-Wallet interaction
address@hidden Bank-Wallet interaction
+
+
+The HTTP status code @code{202 Accepted} can be used by the bank website
+to trigger operations in the user agent.  The operation is determined
+by the @code{X-Taler-Operation} header.  The following operations are 
understood:
+
address@hidden maybe not use a table but subsections here?
+
address@hidden @code
address@hidden create-reserve
+Ask the Taler wallet to create a reserve and call back the bank
+with the reserve public key.  The following headers are mandatory:
+
address@hidden
address@hidden
address@hidden:  URL that the wallet will visit when
+the reserve was created and the user has selected an exchange.
+
address@hidden
address@hidden: JSON-encoded array of wire transfer types that this bank 
supports.
+
address@hidden
address@hidden: The amount that will be transferred to the reserve.
+
address@hidden
address@hidden: JSON-encoded wire account details of the sender, that
+is the user that is currently logged in with the bank and creates the reserve.
+
address@hidden itemize
+
+The following header is optional:
+
address@hidden
address@hidden
address@hidden:  Exchange that the bank recommends
+the customer to use.  Note that this is a suggestion and can be ignored
+by the wallet or changed by the user.
address@hidden itemize
+
+On successful reserve creation, the wallet will navigate to the callback URL
+(effectively requesting it with a GET) with the following additional request
+parameters:
+
address@hidden
address@hidden
address@hidden: The URL of the exchange selected by the user
+
address@hidden
address@hidden: The wire details of the exchange.
+
address@hidden
address@hidden: The reserve public key that the bank should transmit to the
+exchange when transmitting the funds.
+
address@hidden itemize
+
+
address@hidden confirm-reserve
+
+To secure the operation, the (demo) bank then shows a "CAPTCHA page"
+-- a real bank would instead show some PIN entry dialog or similar
+security method -- where the customer can finally prove she their
+identity and thereby confirm the withdraw operation to the bank.
+
+Afterwards, the bank needs to confirm to the wallet that the user
+completed the required steps to transfer funds to an exchange to
+establish the reserve identified by the @code{X-Taler-Reserve-Pub}
+header.
+
+This does not guarantee that the reserve is already created at the
+exchange (since the actual money transfer might be executed
+asynchronously), but it informs that wallet that it can start polling
+for the reserve.
+
address@hidden table
+
+
address@hidden Bank-Exchange interaction
address@hidden Bank-Exchange interaction
+
+The interaction between a bank and the exchange happens in two situations:
+when a wallet withdraws coins, and when the exchange pays a merchant.
+
address@hidden Withdraw
+
+Once a withdrawal operation with the wallet has been confirmed, the
+the bank must wire transfer the withdrawn amount from the customer
+account to the exchange's.  After this operation is done, the exchange
+needs to be informed so that it will create the reserve.
+
+For the moment, the bank will use the exchange's @code{/admin/add/incoming}
+API, providing those arguments it got along the @code{X-Taler-Callback-Url} 
URL.
+(In the future, the exchange will poll for this information.)
+However, the bank will define two additional values for this API: 
@code{execution_date}
+(a operation's timestamp), and @code{transfer_details} (just a "seed" to make 
unique the
+operation).  See 
@url{https://docs.taler.net/api/api-exchange.html#administrative-api-bank-transactions}.
+
+The polling mechanism is possbile thanks to the @code{/history} API provided
+by the bank.  The exchange will periodically use this API to see if it has
+received new wire transfers; upon receiving a new wire transfer, the exchange
+will automatically create a reserve and allow the money sender to withdraw.
+
address@hidden @code
+
address@hidden GET /history
+Ask the bank to return a list of money transactions related to a caller's
+bank account.
+
address@hidden
+
address@hidden @code{auth} a string indicating the authentication method to use;
+only @code{"basic"} value is accepted so far. The username and password
+credentials have to be sent along the HTTP request headers.  Namely, the
+bank will look for the following two headers: @code{X-Taler-Bank-Username}
+and @code{X-Taler-Bank-Password}, which will contain those plain text 
credentials.
+
address@hidden @code{delta} returns the first @code{N} records younger (older) 
than @code{start}
+if @code{+N} (@code{-N}) is specified.
+
address@hidden @code{start} according to delta, only those records with row id
+strictly greater (lesser) than start will be returned. This argument is
+optional; if not given, delta youngest records will be returned.
+
address@hidden @code{direction} optional argument taking values debit or credit,
+according to the caller willing to receive both incoming and outgoing,
+only outgoing, or only incoming records
+
address@hidden @code{account_number} optional argument indicating the bank 
account
+number whose history is to be returned. If not given, then the history of
+the calling user will be returned
+
address@hidden itemize
+
address@hidden table
+
+
address@hidden Exchange pays merchant
+
+To allow the exchange to send payments to a merchant, the bank exposes
+the @code{/admin/add/incoming} API to exchanges.
+
address@hidden @code
+
address@hidden POST /admin/add/incoming
+Ask the bank to transfer money from the caller's account to
+the receiver's.
+
address@hidden
+This call accepts a JSON encoded body with the following fields.
+
address@hidden @code{auth} a string indicating the authentication method to use;
+only @code{"basic"} value is accepted so far. The username and password
+credentials have to be sent along the HTTP request headers.  Namely, the
+bank will look for the following two headers: @code{X-Taler-Bank-Username}
+and @code{X-Taler-Bank-Password}, which will contain those plain text 
credentials.
+
address@hidden @code{amount} a JSON object complying to the Taler amounts 
layout.
+Namely, this object must contain the following fields: @code{value} (number),
address@hidden (number), and @code{currency} (string).
+
address@hidden @code{exchange_url} a string indicating the calling exchange base
+URL.  The bank will use this value to define wire transfers subject lines.
+
address@hidden @code{wtid} a alphanumeric string that uniquely identifies this 
transfer
+at the exchange database.  The bank will use this value too to define wire
+transfers subject lines.  Namely, subject lines will have the following format:
address@hidden'wtid exchange_url'}.
+
address@hidden @code{debit_account} number indicating the exchange bank 
account.  NOTE:
+this field is currently ignored, as the bank can retrieve the exchange account
+number from the login credentials.  However, in future release, an exchange 
could
+have multiple account at the same bank, thereby it will have the chance to 
specify
+any of them in this field.
+
address@hidden @code{credit_account} bank account number that will receive the 
transfer.
+Tipically the merchant account number.
+
address@hidden itemize
+
address@hidden table
+
+
address@hidden **********************************************************
address@hidden *******************  Appendices  *************************
address@hidden **********************************************************
+
address@hidden GNU-AGPL
address@hidden GNU-AGPL
address@hidden license
address@hidden AGPL
address@hidden agpl.texi
+
address@hidden GNU-FDL
address@hidden GNU-FDL
address@hidden license
address@hidden GNU Free Documentation License
address@hidden fdl-1.3.texi
+
address@hidden Concept Index
address@hidden Concept Index
+
address@hidden cp
+
address@hidden
diff --git a/run_tests.py b/run_tests.py
deleted file mode 100755
index 1fd4485..0000000
--- a/run_tests.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env python3
-
-from django.core.management import call_command
-from django.db.utils import OperationalError
-import django
-import sys
-
-django.setup()
-try:
-    call_command("test", "talerbank.app.tests")
-except OperationalError:
-    print("Catching DB hard error, skipping the test")
-    sys.exit(0)
diff --git a/setup.py b/setup.py
index fbb8af0..7a2a0f0 100755
--- a/setup.py
+++ b/setup.py
@@ -4,8 +4,8 @@ setup(name='talerbank',
       version='0.0',
       description='Taler friendly bank',
       url='git://taler.net/bank',
-      author='Marcello Stanisci',
-      author_email='address@hidden',
+      author='Marcello Stanisci, Florian Dold',
+      author_email='address@hidden, address@hidden',
       license='GPL',
       packages=find_packages(),
       install_requires=["django>=1.9",
diff --git a/talerbank/Makefile.am b/talerbank/Makefile.am
index 8dd9768..85ea8f7 100644
--- a/talerbank/Makefile.am
+++ b/talerbank/Makefile.am
@@ -1,6 +1,7 @@
 SUBDIRS = . app
 
 EXTRA_DIST = \
+ jinja2.py \
  settings.py \
  talerconfig.py \
  urls.py \
diff --git a/talerbank/app/Makefile.am b/talerbank/app/Makefile.am
index 01543fd..6376a68 100644
--- a/talerbank/app/Makefile.am
+++ b/talerbank/app/Makefile.am
@@ -9,4 +9,5 @@ EXTRA_DIST = \
   checks.py  \
   __init__.py \
   models.py \
-  tests.py
+  tests.py \
+  tests_alt.py
diff --git a/talerbank/app/models.py b/talerbank/app/models.py
index f1c3485..868b0d6 100644
--- a/talerbank/app/models.py
+++ b/talerbank/app/models.py
@@ -22,9 +22,18 @@ from django.db import models
 
 class BankAccount(models.Model):
     is_public = models.BooleanField(default=False)
+    # Handier than keeping the amount signed, for two reasons:
+    # (1) checking if someone is in debt is less verbose: with signed
+    # amounts we have to check if the amount is less than zero; this
+    # way we only check if a boolean is true. (2) The bank logic is
+    # ready to welcome a data type for amounts which doesn't have any
+    # sign notion, like Taler amounts do.
     debit = models.BooleanField(default=False)
     balance_value = models.IntegerField(default=0)
     balance_fraction = models.IntegerField(default=0)
+    # From today's (16/10/2017) Mumble talk, it emerged that bank shouldn't
+    # store amounts as floats, but: normal banks should not care about
+    # Taler when representing values around in their databases..
     balance = models.FloatField(default=0)
     currency = models.CharField(max_length=12, default="")
     account_no = models.AutoField(primary_key=True)
diff --git a/talerbank/app/static/Makefile.am b/talerbank/app/static/Makefile.am
index 2742b65..3b4f1cf 100644
--- a/talerbank/app/static/Makefile.am
+++ b/talerbank/app/static/Makefile.am
@@ -2,4 +2,5 @@ SUBDIRS = . web-common
 
 EXTRA_DIST = \
   favicon.ico \
-  chrome-store-link.js
+  chrome-store-link.js \
+  bank.css
diff --git a/talerbank/app/static/profile-page.js 
b/talerbank/app/static/profile-page.js
index 9839e03..8fb4e6d 100644
--- a/talerbank/app/static/profile-page.js
+++ b/talerbank/app/static/profile-page.js
@@ -87,7 +87,7 @@ function init() {
       currency: bank_currency
     };
     console.log("callback_url", callback_url);
-    taler.createReserve(callback_url, amount, ["TEST"], suggested_exchange);
+    taler.createReserve(callback_url, amount, ["test"], suggested_exchange);
   };
 }
 
diff --git a/talerbank/app/static/pure.css b/talerbank/app/static/pure.css
deleted file mode 100644
index 7391139..0000000
--- a/talerbank/app/static/pure.css
+++ /dev/null
@@ -1,1508 +0,0 @@
-/*!
-Pure v0.6.2
-Copyright 2013 Yahoo!
-Licensed under the BSD License.
-https://github.com/yahoo/pure/blob/master/LICENSE.md
-*/
-/*!
-normalize.css v^3.0 | MIT License | git.io/normalize
-Copyright (c) Nicolas Gallagher and Jonathan Neal
-*/
-/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
-
-/**
- * 1. Set default font family to sans-serif.
- * 2. Prevent iOS and IE text size adjust after device orientation change,
- *    without disabling user zoom.
- */
-
-html {
-  font-family: sans-serif; /* 1 */
-  -ms-text-size-adjust: 100%; /* 2 */
-  -webkit-text-size-adjust: 100%; /* 2 */
-}
-
-/**
- * Remove default margin.
- */
-
-body {
-  margin: 0;
-}
-
-/* HTML5 display definitions
-   ========================================================================== 
*/
-
-/**
- * Correct `block` display not defined for any HTML5 element in IE 8/9.
- * Correct `block` display not defined for `details` or `summary` in IE 10/11
- * and Firefox.
- * Correct `block` display not defined for `main` in IE 11.
- */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-main,
-menu,
-nav,
-section,
-summary {
-  display: block;
-}
-
-/**
- * 1. Correct `inline-block` display not defined in IE 8/9.
- * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
- */
-
-audio,
-canvas,
-progress,
-video {
-  display: inline-block; /* 1 */
-  vertical-align: baseline; /* 2 */
-}
-
-/**
- * Prevent modern browsers from displaying `audio` without controls.
- * Remove excess height in iOS 5 devices.
- */
-
-audio:not([controls]) {
-  display: none;
-  height: 0;
-}
-
-/**
- * Address `[hidden]` styling not present in IE 8/9/10.
- * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
- */
-
-[hidden],
-template {
-  display: none;
-}
-
-/* Links
-   ========================================================================== 
*/
-
-/**
- * Remove the gray background color from active links in IE 10.
- */
-
-a {
-  background-color: transparent;
-}
-
-/**
- * Improve readability of focused elements when they are also in an
- * active/hover state.
- */
-
-a:active,
-a:hover {
-  outline: 0;
-}
-
-/* Text-level semantics
-   ========================================================================== 
*/
-
-/**
- * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
- */
-
-abbr[title] {
-  border-bottom: 1px dotted;
-}
-
-/**
- * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
- */
-
-b,
-strong {
-  font-weight: bold;
-}
-
-/**
- * Address styling not present in Safari and Chrome.
- */
-
-dfn {
-  font-style: italic;
-}
-
-/**
- * Address variable `h1` font-size and margin within `section` and `article`
- * contexts in Firefox 4+, Safari, and Chrome.
- */
-
-h1 {
-  font-size: 2em;
-  margin: 0.67em 0;
-}
-
-/**
- * Address styling not present in IE 8/9.
- */
-
-mark {
-  background: #ff0;
-  color: #000;
-}
-
-/**
- * Address inconsistent and variable font size in all browsers.
- */
-
-small {
-  font-size: 80%;
-}
-
-/**
- * Prevent `sub` and `sup` affecting `line-height` in all browsers.
- */
-
-sub,
-sup {
-  font-size: 75%;
-  line-height: 0;
-  position: relative;
-  vertical-align: baseline;
-}
-
-sup {
-  top: -0.5em;
-}
-
-sub {
-  bottom: -0.25em;
-}
-
-/* Embedded content
-   ========================================================================== 
*/
-
-/**
- * Remove border when inside `a` element in IE 8/9/10.
- */
-
-img {
-  border: 0;
-}
-
-/**
- * Correct overflow not hidden in IE 9/10/11.
- */
-
-svg:not(:root) {
-  overflow: hidden;
-}
-
-/* Grouping content
-   ========================================================================== 
*/
-
-/**
- * Address margin not present in IE 8/9 and Safari.
- */
-
-figure {
-  margin: 1em 40px;
-}
-
-/**
- * Address differences between Firefox and other browsers.
- */
-
-hr {
-  box-sizing: content-box;
-  height: 0;
-}
-
-/**
- * Contain overflow in all browsers.
- */
-
-pre {
-  overflow: auto;
-}
-
-/**
- * Address odd `em`-unit font size rendering in all browsers.
- */
-
-code,
-kbd,
-pre,
-samp {
-  font-family: monospace, monospace;
-  font-size: 1em;
-}
-
-/* Forms
-   ========================================================================== 
*/
-
-/**
- * Known limitation: by default, Chrome and Safari on OS X allow very limited
- * styling of `select`, unless a `border` property is set.
- */
-
-/**
- * 1. Correct color not being inherited.
- *    Known issue: affects color of disabled elements.
- * 2. Correct font properties not being inherited.
- * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
- */
-
-button,
-input,
-optgroup,
-select,
-textarea {
-  color: inherit; /* 1 */
-  font: inherit; /* 2 */
-  margin: 0; /* 3 */
-}
-
-/**
- * Address `overflow` set to `hidden` in IE 8/9/10/11.
- */
-
-button {
-  overflow: visible;
-}
-
-/**
- * Address inconsistent `text-transform` inheritance for `button` and `select`.
- * All other form control elements do not inherit `text-transform` values.
- * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
- * Correct `select` style inheritance in Firefox.
- */
-
-button,
-select {
-  text-transform: none;
-}
-
-/**
- * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
- *    and `video` controls.
- * 2. Correct inability to style clickable `input` types in iOS.
- * 3. Improve usability and consistency of cursor style between image-type
- *    `input` and others.
- */
-
-button,
-html input[type="button"], /* 1 */
-input[type="reset"],
-input[type="submit"] {
-  -webkit-appearance: button; /* 2 */
-  cursor: pointer; /* 3 */
-}
-
-/**
- * Re-set default cursor for disabled elements.
- */
-
-button[disabled],
-html input[disabled] {
-  cursor: default;
-}
-
-/**
- * Remove inner padding and border in Firefox 4+.
- */
-
-button::-moz-focus-inner,
-input::-moz-focus-inner {
-  border: 0;
-  padding: 0;
-}
-
-/**
- * Address Firefox 4+ setting `line-height` on `input` using `!important` in
- * the UA stylesheet.
- */
-
-input {
-  line-height: normal;
-}
-
-/**
- * It's recommended that you don't attempt to style these elements.
- * Firefox's implementation doesn't respect box-sizing, padding, or width.
- *
- * 1. Address box sizing set to `content-box` in IE 8/9/10.
- * 2. Remove excess padding in IE 8/9/10.
- */
-
-input[type="checkbox"],
-input[type="radio"] {
-  box-sizing: border-box; /* 1 */
-  padding: 0; /* 2 */
-}
-
-/**
- * Fix the cursor style for Chrome's increment/decrement buttons. For certain
- * `font-size` values of the `input`, it causes the cursor style of the
- * decrement button to change from `default` to `text`.
- */
-
-input[type="number"]::-webkit-inner-spin-button,
-input[type="number"]::-webkit-outer-spin-button {
-  height: auto;
-}
-
-/**
- * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
- * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.
- */
-
-input[type="search"] {
-  -webkit-appearance: textfield; /* 1 */
-  box-sizing: content-box; /* 2 */
-}
-
-/**
- * Remove inner padding and search cancel button in Safari and Chrome on OS X.
- * Safari (but not Chrome) clips the cancel button when the search input has
- * padding (and `textfield` appearance).
- */
-
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
-  -webkit-appearance: none;
-}
-
-/**
- * Define consistent border, margin, and padding.
- */
-
-fieldset {
-  border: 1px solid #c0c0c0;
-  margin: 0 2px;
-  padding: 0.35em 0.625em 0.75em;
-}
-
-/**
- * 1. Correct `color` not being inherited in IE 8/9/10/11.
- * 2. Remove padding so people aren't caught out if they zero out fieldsets.
- */
-
-legend {
-  border: 0; /* 1 */
-  padding: 0; /* 2 */
-}
-
-/**
- * Remove default vertical scrollbar in IE 8/9/10/11.
- */
-
-textarea {
-  overflow: auto;
-}
-
-/**
- * Don't inherit the `font-weight` (applied by a rule above).
- * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
- */
-
-optgroup {
-  font-weight: bold;
-}
-
-/* Tables
-   ========================================================================== 
*/
-
-/**
- * Remove most spacing between table cells.
- */
-
-table {
-  border-collapse: collapse;
-  border-spacing: 0;
-}
-
-td,
-th {
-  padding: 0;
-}
-
-/*csslint important:false*/
-
-/* ==========================================================================
-   Pure Base Extras
-   ========================================================================== 
*/
-
-/**
- * Extra rules that Pure adds on top of Normalize.css
- */
-
-/**
- * Always hide an element when it has the `hidden` HTML attribute.
- */
-
-.hidden,
-[hidden] {
-    display: none !important;
-}
-
-/**
- * Add this class to an image to make it fit within it's fluid parent wrapper 
while maintaining
- * aspect ratio.
- */
-.pure-img {
-    max-width: 100%;
-    height: auto;
-    display: block;
-}
-
-/*csslint regex-selectors:false, known-properties:false, 
duplicate-properties:false*/
-
-.pure-g {
-    letter-spacing: -0.31em; /* Webkit: collapse white-space between units */
-    *letter-spacing: normal; /* reset IE < 8 */
-    *word-spacing: -0.43em; /* IE < 8: collapse white-space between units */
-    text-rendering: optimizespeed; /* Webkit: fixes text-rendering: 
optimizeLegibility */
-
-    /*
-    Sets the font stack to fonts known to work properly with the above letter
-    and word spacings. See: https://github.com/yahoo/pure/issues/41/
-
-    The following font stack makes Pure Grids work on all known environments.
-
-    * FreeSans: Ships with many Linux distros, including Ubuntu
-
-    * Arimo: Ships with Chrome OS. Arimo has to be defined before Helvetica and
-      Arial to get picked up by the browser, even though neither is available
-      in Chrome OS.
-
-    * Droid Sans: Ships with all versions of Android.
-
-    * Helvetica, Arial, sans-serif: Common font stack on OS X and Windows.
-    */
-    font-family: FreeSans, Arimo, "Droid Sans", Helvetica, Arial, sans-serif;
-
-    /* Use flexbox when possible to avoid `letter-spacing` side-effects. */
-    display: -webkit-box;
-    display: -webkit-flex;
-    display: -ms-flexbox;
-    display: flex;
-    -webkit-flex-flow: row wrap;
-        -ms-flex-flow: row wrap;
-            flex-flow: row wrap;
-
-    /* Prevents distributing space between rows */
-    -webkit-align-content: flex-start;
-        -ms-flex-line-pack: start;
-            align-content: flex-start;
-}
-
-/* IE10 display: -ms-flexbox (and display: flex in IE 11) does not work inside 
a table; fall back to block and rely on font hack */
address@hidden all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
-       table .pure-g {
-               display: block;
-       }
-}
-
-/* Opera as of 12 on Windows needs word-spacing.
-   The ".opera-only" selector is used to prevent actual prefocus styling
-   and is not required in markup.
-*/
-.opera-only :-o-prefocus,
-.pure-g {
-    word-spacing: -0.43em;
-}
-
-.pure-u {
-    display: inline-block;
-    *display: inline; /* IE < 8: fake inline-block */
-    zoom: 1;
-    letter-spacing: normal;
-    word-spacing: normal;
-    vertical-align: top;
-    text-rendering: auto;
-}
-
-/*
-Resets the font family back to the OS/browser's default sans-serif font,
-this the same font stack that Normalize.css sets for the `body`.
-*/
-.pure-g [class *= "pure-u"] {
-    font-family: sans-serif;
-}
-
-.pure-u-1,
-.pure-u-1-1,
-.pure-u-1-2,
-.pure-u-1-3,
-.pure-u-2-3,
-.pure-u-1-4,
-.pure-u-3-4,
-.pure-u-1-5,
-.pure-u-2-5,
-.pure-u-3-5,
-.pure-u-4-5,
-.pure-u-5-5,
-.pure-u-1-6,
-.pure-u-5-6,
-.pure-u-1-8,
-.pure-u-3-8,
-.pure-u-5-8,
-.pure-u-7-8,
-.pure-u-1-12,
-.pure-u-5-12,
-.pure-u-7-12,
-.pure-u-11-12,
-.pure-u-1-24,
-.pure-u-2-24,
-.pure-u-3-24,
-.pure-u-4-24,
-.pure-u-5-24,
-.pure-u-6-24,
-.pure-u-7-24,
-.pure-u-8-24,
-.pure-u-9-24,
-.pure-u-10-24,
-.pure-u-11-24,
-.pure-u-12-24,
-.pure-u-13-24,
-.pure-u-14-24,
-.pure-u-15-24,
-.pure-u-16-24,
-.pure-u-17-24,
-.pure-u-18-24,
-.pure-u-19-24,
-.pure-u-20-24,
-.pure-u-21-24,
-.pure-u-22-24,
-.pure-u-23-24,
-.pure-u-24-24 {
-    display: inline-block;
-    *display: inline;
-    zoom: 1;
-    letter-spacing: normal;
-    word-spacing: normal;
-    vertical-align: top;
-    text-rendering: auto;
-}
-
-.pure-u-1-24 {
-    width: 4.1667%;
-    *width: 4.1357%;
-}
-
-.pure-u-1-12,
-.pure-u-2-24 {
-    width: 8.3333%;
-    *width: 8.3023%;
-}
-
-.pure-u-1-8,
-.pure-u-3-24 {
-    width: 12.5000%;
-    *width: 12.4690%;
-}
-
-.pure-u-1-6,
-.pure-u-4-24 {
-    width: 16.6667%;
-    *width: 16.6357%;
-}
-
-.pure-u-1-5 {
-    width: 20%;
-    *width: 19.9690%;
-}
-
-.pure-u-5-24 {
-    width: 20.8333%;
-    *width: 20.8023%;
-}
-
-.pure-u-1-4,
-.pure-u-6-24 {
-    width: 25%;
-    *width: 24.9690%;
-}
-
-.pure-u-7-24 {
-    width: 29.1667%;
-    *width: 29.1357%;
-}
-
-.pure-u-1-3,
-.pure-u-8-24 {
-    width: 33.3333%;
-    *width: 33.3023%;
-}
-
-.pure-u-3-8,
-.pure-u-9-24 {
-    width: 37.5000%;
-    *width: 37.4690%;
-}
-
-.pure-u-2-5 {
-    width: 40%;
-    *width: 39.9690%;
-}
-
-.pure-u-5-12,
-.pure-u-10-24 {
-    width: 41.6667%;
-    *width: 41.6357%;
-}
-
-.pure-u-11-24 {
-    width: 45.8333%;
-    *width: 45.8023%;
-}
-
-.pure-u-1-2,
-.pure-u-12-24 {
-    width: 50%;
-    *width: 49.9690%;
-}
-
-.pure-u-13-24 {
-    width: 54.1667%;
-    *width: 54.1357%;
-}
-
-.pure-u-7-12,
-.pure-u-14-24 {
-    width: 58.3333%;
-    *width: 58.3023%;
-}
-
-.pure-u-3-5 {
-    width: 60%;
-    *width: 59.9690%;
-}
-
-.pure-u-5-8,
-.pure-u-15-24 {
-    width: 62.5000%;
-    *width: 62.4690%;
-}
-
-.pure-u-2-3,
-.pure-u-16-24 {
-    width: 66.6667%;
-    *width: 66.6357%;
-}
-
-.pure-u-17-24 {
-    width: 70.8333%;
-    *width: 70.8023%;
-}
-
-.pure-u-3-4,
-.pure-u-18-24 {
-    width: 75%;
-    *width: 74.9690%;
-}
-
-.pure-u-19-24 {
-    width: 79.1667%;
-    *width: 79.1357%;
-}
-
-.pure-u-4-5 {
-    width: 80%;
-    *width: 79.9690%;
-}
-
-.pure-u-5-6,
-.pure-u-20-24 {
-    width: 83.3333%;
-    *width: 83.3023%;
-}
-
-.pure-u-7-8,
-.pure-u-21-24 {
-    width: 87.5000%;
-    *width: 87.4690%;
-}
-
-.pure-u-11-12,
-.pure-u-22-24 {
-    width: 91.6667%;
-    *width: 91.6357%;
-}
-
-.pure-u-23-24 {
-    width: 95.8333%;
-    *width: 95.8023%;
-}
-
-.pure-u-1,
-.pure-u-1-1,
-.pure-u-5-5,
-.pure-u-24-24 {
-    width: 100%;
-}
-.pure-button {
-    /* Structure */
-    display: inline-block;
-    zoom: 1;
-    line-height: normal;
-    white-space: nowrap;
-    vertical-align: middle;
-    text-align: center;
-    cursor: pointer;
-    -webkit-user-drag: none;
-    -webkit-user-select: none;
-       -moz-user-select: none;
-        -ms-user-select: none;
-            user-select: none;
-    box-sizing: border-box;
-}
-
-/* Firefox: Get rid of the inner focus border */
-.pure-button::-moz-focus-inner {
-    padding: 0;
-    border: 0;
-}
-
-/* Inherit .pure-g styles */
-.pure-button-group {
-    letter-spacing: -0.31em; /* Webkit: collapse white-space between units */
-    *letter-spacing: normal; /* reset IE < 8 */
-    *word-spacing: -0.43em; /* IE < 8: collapse white-space between units */
-    text-rendering: optimizespeed; /* Webkit: fixes text-rendering: 
optimizeLegibility */
-}
-
-.opera-only :-o-prefocus,
-.pure-button-group {
-    word-spacing: -0.43em;
-}
-
-.pure-button-group .pure-button {
-    letter-spacing: normal;
-    word-spacing: normal;
-    vertical-align: top;
-    text-rendering: auto;
-}
-
-/*csslint outline-none:false*/
-
-.pure-button {
-    font-family: inherit;
-    font-size: 100%;
-    padding: 0.5em 1em;
-    color: #444; /* rgba not supported (IE 8) */
-    color: rgba(0, 0, 0, 0.80); /* rgba supported */
-    border: 1px solid #999;  /*IE 6/7/8*/
-    border: none rgba(0, 0, 0, 0);  /*IE9 + everything else*/
-    background-color: #E6E6E6;
-    text-decoration: none;
-    border-radius: 2px;
-}
-
-.pure-button-hover,
-.pure-button:hover,
-.pure-button:focus {
-    /* csslint ignore:start */
-    filter: alpha(opacity=90);
-    /* csslint ignore:end */
-    background-image: -webkit-linear-gradient(transparent, rgba(0,0,0, 0.05) 
40%, rgba(0,0,0, 0.10));
-    background-image: linear-gradient(transparent, rgba(0,0,0, 0.05) 40%, 
rgba(0,0,0, 0.10));
-}
-.pure-button:focus {
-    outline: 0;
-}
-.pure-button-active,
-.pure-button:active {
-    box-shadow: 0 0 0 1px rgba(0,0,0, 0.15) inset, 0 0 6px rgba(0,0,0, 0.20) 
inset;
-    border-color: #000\9;
-}
-
-.pure-button[disabled],
-.pure-button-disabled,
-.pure-button-disabled:hover,
-.pure-button-disabled:focus,
-.pure-button-disabled:active {
-    border: none;
-    background-image: none;
-    /* csslint ignore:start */
-    filter: alpha(opacity=40);
-    /* csslint ignore:end */
-    opacity: 0.40;
-    cursor: not-allowed;
-    box-shadow: none;
-    pointer-events: none;
-}
-
-.pure-button-hidden {
-    display: none;
-}
-
-.pure-button-primary,
-.pure-button-selected,
-a.pure-button-primary,
-a.pure-button-selected {
-    background-color: rgb(0, 120, 231);
-    color: #fff;
-}
-
-/* Button Groups */
-.pure-button-group .pure-button {
-    margin: 0;
-    border-radius: 0;
-    border-right: 1px solid #111;  /* fallback color for rgba() for IE7/8 */
-    border-right: 1px solid rgba(0, 0, 0, 0.2);
-
-}
-
-.pure-button-group .pure-button:first-child {
-    border-top-left-radius: 2px;
-    border-bottom-left-radius: 2px;
-}
-.pure-button-group .pure-button:last-child {
-    border-top-right-radius: 2px;
-    border-bottom-right-radius: 2px;
-    border-right: none;
-}
-
-/*csslint box-model:false*/
-/*
-Box-model set to false because we're setting a height on select elements, which
-also have border and padding. This is done because some browsers don't render
-the padding. We explicitly set the box-model for select elements to border-box,
-so we can ignore the csslint warning.
-*/
-
-.pure-form input[type="text"],
-.pure-form input[type="password"],
-.pure-form input[type="email"],
-.pure-form input[type="url"],
-.pure-form input[type="date"],
-.pure-form input[type="month"],
-.pure-form input[type="time"],
-.pure-form input[type="datetime"],
-.pure-form input[type="datetime-local"],
-.pure-form input[type="week"],
-.pure-form input[type="number"],
-.pure-form input[type="search"],
-.pure-form input[type="tel"],
-.pure-form input[type="color"],
-.pure-form select,
-.pure-form textarea {
-    padding: 0.5em 0.6em;
-    display: inline-block;
-    border: 1px solid #ccc;
-    box-shadow: inset 0 1px 3px #ddd;
-    border-radius: 4px;
-    vertical-align: middle;
-    box-sizing: border-box;
-}
-
-/*
-Need to separate out the :not() selector from the rest of the CSS 2.1 selectors
-since IE8 won't execute CSS that contains a CSS3 selector.
-*/
-.pure-form input:not([type]) {
-    padding: 0.5em 0.6em;
-    display: inline-block;
-    border: 1px solid #ccc;
-    box-shadow: inset 0 1px 3px #ddd;
-    border-radius: 4px;
-    box-sizing: border-box;
-}
-
-
-/* Chrome (as of v.32/34 on OS X) needs additional room for color to display. 
*/
-/* May be able to remove this tweak as color inputs become more standardized 
across browsers. */
-.pure-form input[type="color"] {
-    padding: 0.2em 0.5em;
-}
-
-
-.pure-form input[type="text"]:focus,
-.pure-form input[type="password"]:focus,
-.pure-form input[type="email"]:focus,
-.pure-form input[type="url"]:focus,
-.pure-form input[type="date"]:focus,
-.pure-form input[type="month"]:focus,
-.pure-form input[type="time"]:focus,
-.pure-form input[type="datetime"]:focus,
-.pure-form input[type="datetime-local"]:focus,
-.pure-form input[type="week"]:focus,
-.pure-form input[type="number"]:focus,
-.pure-form input[type="search"]:focus,
-.pure-form input[type="tel"]:focus,
-.pure-form input[type="color"]:focus,
-.pure-form select:focus,
-.pure-form textarea:focus {
-    outline: 0;
-    border-color: #129FEA;
-}
-
-/*
-Need to separate out the :not() selector from the rest of the CSS 2.1 selectors
-since IE8 won't execute CSS that contains a CSS3 selector.
-*/
-.pure-form input:not([type]):focus {
-    outline: 0;
-    border-color: #129FEA;
-}
-
-.pure-form input[type="file"]:focus,
-.pure-form input[type="radio"]:focus,
-.pure-form input[type="checkbox"]:focus {
-    outline: thin solid #129FEA;
-    outline: 1px auto #129FEA;
-}
-.pure-form .pure-checkbox,
-.pure-form .pure-radio {
-    margin: 0.5em 0;
-    display: block;
-}
-
-.pure-form input[type="text"][disabled],
-.pure-form input[type="password"][disabled],
-.pure-form input[type="email"][disabled],
-.pure-form input[type="url"][disabled],
-.pure-form input[type="date"][disabled],
-.pure-form input[type="month"][disabled],
-.pure-form input[type="time"][disabled],
-.pure-form input[type="datetime"][disabled],
-.pure-form input[type="datetime-local"][disabled],
-.pure-form input[type="week"][disabled],
-.pure-form input[type="number"][disabled],
-.pure-form input[type="search"][disabled],
-.pure-form input[type="tel"][disabled],
-.pure-form input[type="color"][disabled],
-.pure-form select[disabled],
-.pure-form textarea[disabled] {
-    cursor: not-allowed;
-    background-color: #eaeded;
-    color: #cad2d3;
-}
-
-/*
-Need to separate out the :not() selector from the rest of the CSS 2.1 selectors
-since IE8 won't execute CSS that contains a CSS3 selector.
-*/
-.pure-form input:not([type])[disabled] {
-    cursor: not-allowed;
-    background-color: #eaeded;
-    color: #cad2d3;
-}
-.pure-form input[readonly],
-.pure-form select[readonly],
-.pure-form textarea[readonly] {
-    background-color: #eee; /* menu hover bg color */
-    color: #777; /* menu text color */
-    border-color: #ccc;
-}
-
-.pure-form input:focus:invalid,
-.pure-form textarea:focus:invalid,
-.pure-form select:focus:invalid {
-    color: #b94a48;
-    border-color: #e9322d;
-}
-.pure-form input[type="file"]:focus:invalid:focus,
-.pure-form input[type="radio"]:focus:invalid:focus,
-.pure-form input[type="checkbox"]:focus:invalid:focus {
-    outline-color: #e9322d;
-}
-.pure-form select {
-    /* Normalizes the height; padding is not sufficient. */
-    height: 2.25em;
-    border: 1px solid #ccc;
-    background-color: white;
-}
-.pure-form select[multiple] {
-    height: auto;
-}
-.pure-form label {
-    margin: 0.5em 0 0.2em;
-}
-.pure-form fieldset {
-    margin: 0;
-    padding: 0.35em 0 0.75em;
-    border: 0;
-}
-.pure-form legend {
-    display: block;
-    width: 100%;
-    padding: 0.3em 0;
-    margin-bottom: 0.3em;
-    color: #333;
-    border-bottom: 1px solid #e5e5e5;
-}
-
-.pure-form-stacked input[type="text"],
-.pure-form-stacked input[type="password"],
-.pure-form-stacked input[type="email"],
-.pure-form-stacked input[type="url"],
-.pure-form-stacked input[type="date"],
-.pure-form-stacked input[type="month"],
-.pure-form-stacked input[type="time"],
-.pure-form-stacked input[type="datetime"],
-.pure-form-stacked input[type="datetime-local"],
-.pure-form-stacked input[type="week"],
-.pure-form-stacked input[type="number"],
-.pure-form-stacked input[type="search"],
-.pure-form-stacked input[type="tel"],
-.pure-form-stacked input[type="color"],
-.pure-form-stacked input[type="file"],
-.pure-form-stacked select,
-.pure-form-stacked label,
-.pure-form-stacked textarea {
-    display: block;
-    margin: 0.25em 0;
-}
-
-/*
-Need to separate out the :not() selector from the rest of the CSS 2.1 selectors
-since IE8 won't execute CSS that contains a CSS3 selector.
-*/
-.pure-form-stacked input:not([type]) {
-    display: block;
-    margin: 0.25em 0;
-}
-.pure-form-aligned input,
-.pure-form-aligned textarea,
-.pure-form-aligned select,
-/* NOTE: pure-help-inline is deprecated. Use .pure-form-message-inline 
instead. */
-.pure-form-aligned .pure-help-inline,
-.pure-form-message-inline {
-    display: inline-block;
-    *display: inline;
-    *zoom: 1;
-    vertical-align: middle;
-}
-.pure-form-aligned textarea {
-    vertical-align: top;
-}
-
-/* Aligned Forms */
-.pure-form-aligned .pure-control-group {
-    margin-bottom: 0.5em;
-}
-.pure-form-aligned .pure-control-group label {
-    text-align: right;
-    display: inline-block;
-    vertical-align: middle;
-    width: 10em;
-    margin: 0 1em 0 0;
-}
-.pure-form-aligned .pure-controls {
-    margin: 1.5em 0 0 11em;
-}
-
-/* Rounded Inputs */
-.pure-form input.pure-input-rounded,
-.pure-form .pure-input-rounded {
-    border-radius: 2em;
-    padding: 0.5em 1em;
-}
-
-/* Grouped Inputs */
-.pure-form .pure-group fieldset {
-    margin-bottom: 10px;
-}
-.pure-form .pure-group input,
-.pure-form .pure-group textarea {
-    display: block;
-    padding: 10px;
-    margin: 0 0 -1px;
-    border-radius: 0;
-    position: relative;
-    top: -1px;
-}
-.pure-form .pure-group input:focus,
-.pure-form .pure-group textarea:focus {
-    z-index: 3;
-}
-.pure-form .pure-group input:first-child,
-.pure-form .pure-group textarea:first-child {
-    top: 1px;
-    border-radius: 4px 4px 0 0;
-    margin: 0;
-}
-.pure-form .pure-group input:first-child:last-child,
-.pure-form .pure-group textarea:first-child:last-child {
-    top: 1px;
-    border-radius: 4px;
-    margin: 0;
-}
-.pure-form .pure-group input:last-child,
-.pure-form .pure-group textarea:last-child {
-    top: -2px;
-    border-radius: 0 0 4px 4px;
-    margin: 0;
-}
-.pure-form .pure-group button {
-    margin: 0.35em 0;
-}
-
-.pure-form .pure-input-1 {
-    width: 100%;
-}
-.pure-form .pure-input-3-4 {
-    width: 75%;
-}
-.pure-form .pure-input-2-3 {
-    width: 66%;
-}
-.pure-form .pure-input-1-2 {
-    width: 50%;
-}
-.pure-form .pure-input-1-3 {
-    width: 33%;
-}
-.pure-form .pure-input-1-4 {
-    width: 25%;
-}
-
-/* Inline help for forms */
-/* NOTE: pure-help-inline is deprecated. Use .pure-form-message-inline 
instead. */
-.pure-form .pure-help-inline,
-.pure-form-message-inline {
-    display: inline-block;
-    padding-left: 0.3em;
-    color: #666;
-    vertical-align: middle;
-    font-size: 0.875em;
-}
-
-/* Block help for forms */
-.pure-form-message {
-    display: block;
-    color: #666;
-    font-size: 0.875em;
-}
-
address@hidden only screen and (max-width : 480px) {
-    .pure-form button[type="submit"] {
-        margin: 0.7em 0 0;
-    }
-
-    .pure-form input:not([type]),
-    .pure-form input[type="text"],
-    .pure-form input[type="password"],
-    .pure-form input[type="email"],
-    .pure-form input[type="url"],
-    .pure-form input[type="date"],
-    .pure-form input[type="month"],
-    .pure-form input[type="time"],
-    .pure-form input[type="datetime"],
-    .pure-form input[type="datetime-local"],
-    .pure-form input[type="week"],
-    .pure-form input[type="number"],
-    .pure-form input[type="search"],
-    .pure-form input[type="tel"],
-    .pure-form input[type="color"],
-    .pure-form label {
-        margin-bottom: 0.3em;
-        display: block;
-    }
-
-    .pure-group input:not([type]),
-    .pure-group input[type="text"],
-    .pure-group input[type="password"],
-    .pure-group input[type="email"],
-    .pure-group input[type="url"],
-    .pure-group input[type="date"],
-    .pure-group input[type="month"],
-    .pure-group input[type="time"],
-    .pure-group input[type="datetime"],
-    .pure-group input[type="datetime-local"],
-    .pure-group input[type="week"],
-    .pure-group input[type="number"],
-    .pure-group input[type="search"],
-    .pure-group input[type="tel"],
-    .pure-group input[type="color"] {
-        margin-bottom: 0;
-    }
-
-    .pure-form-aligned .pure-control-group label {
-        margin-bottom: 0.3em;
-        text-align: left;
-        display: block;
-        width: 100%;
-    }
-
-    .pure-form-aligned .pure-controls {
-        margin: 1.5em 0 0 0;
-    }
-
-    /* NOTE: pure-help-inline is deprecated. Use .pure-form-message-inline 
instead. */
-    .pure-form .pure-help-inline,
-    .pure-form-message-inline,
-    .pure-form-message {
-        display: block;
-        font-size: 0.75em;
-        /* Increased bottom padding to make it group with its related input 
element. */
-        padding: 0.2em 0 0.8em;
-    }
-}
-
-/*csslint adjoining-classes: false, box-model:false*/
-.pure-menu {
-    box-sizing: border-box;
-}
-
-.pure-menu-fixed {
-    position: fixed;
-    left: 0;
-    top: 0;
-    z-index: 3;
-}
-
-.pure-menu-list,
-.pure-menu-item {
-    position: relative;
-}
-
-.pure-menu-list {
-    list-style: none;
-    margin: 0;
-    padding: 0;
-}
-
-.pure-menu-item {
-    padding: 0;
-    margin: 0;
-    height: 100%;
-}
-
-.pure-menu-link,
-.pure-menu-heading {
-    display: block;
-    text-decoration: none;
-    white-space: nowrap;
-}
-
-/* HORIZONTAL MENU */
-.pure-menu-horizontal {
-    width: 100%;
-    white-space: nowrap;
-}
-
-.pure-menu-horizontal .pure-menu-list {
-    display: inline-block;
-}
-
-/* Initial menus should be inline-block so that they are horizontal */
-.pure-menu-horizontal .pure-menu-item,
-.pure-menu-horizontal .pure-menu-heading,
-.pure-menu-horizontal .pure-menu-separator {
-    display: inline-block;
-    *display: inline;
-    zoom: 1;
-    vertical-align: middle;
-}
-
-/* Submenus should still be display: block; */
-.pure-menu-item .pure-menu-item {
-    display: block;
-}
-
-.pure-menu-children {
-    display: none;
-    position: absolute;
-    left: 100%;
-    top: 0;
-    margin: 0;
-    padding: 0;
-    z-index: 3;
-}
-
-.pure-menu-horizontal .pure-menu-children {
-    left: 0;
-    top: auto;
-    width: inherit;
-}
-
-.pure-menu-allow-hover:hover > .pure-menu-children,
-.pure-menu-active > .pure-menu-children {
-    display: block;
-    position: absolute;
-}
-
-/* Vertical Menus - show the dropdown arrow */
-.pure-menu-has-children > .pure-menu-link:after {
-    padding-left: 0.5em;
-    content: "\25B8";
-    font-size: small;
-}
-
-/* Horizontal Menus - show the dropdown arrow */
-.pure-menu-horizontal .pure-menu-has-children > .pure-menu-link:after {
-    content: "\25BE";
-}
-
-/* scrollable menus */
-.pure-menu-scrollable {
-    overflow-y: scroll;
-    overflow-x: hidden;
-}
-
-.pure-menu-scrollable .pure-menu-list {
-    display: block;
-}
-
-.pure-menu-horizontal.pure-menu-scrollable .pure-menu-list {
-    display: inline-block;
-}
-
-.pure-menu-horizontal.pure-menu-scrollable {
-    white-space: nowrap;
-    overflow-y: hidden;
-    overflow-x: auto;
-    -ms-overflow-style: none;
-    -webkit-overflow-scrolling: touch;
-    /* a little extra padding for this style to allow for scrollbars */
-    padding: .5em 0;
-}
-
-.pure-menu-horizontal.pure-menu-scrollable::-webkit-scrollbar {
-    display: none;
-}
-
-/* misc default styling */
-
-.pure-menu-separator,
-.pure-menu-horizontal .pure-menu-children .pure-menu-separator {
-    background-color: #ccc;
-    height: 1px;
-    margin: .3em 0;
-}
-
-.pure-menu-horizontal .pure-menu-separator {
-    width: 1px;
-    height: 1.3em;
-    margin: 0 .3em ;
-}
-
-/* Need to reset the separator since submenu is vertical */
-.pure-menu-horizontal .pure-menu-children .pure-menu-separator {
-    display: block;
-    width: auto;
-}
-
-.pure-menu-heading {
-    text-transform: uppercase;
-    color: #565d64;
-}
-
-.pure-menu-link {
-    color: #777;
-}
-
-.pure-menu-children {
-    background-color: #fff;
-}
-
-.pure-menu-link,
-.pure-menu-disabled,
-.pure-menu-heading {
-    padding: .5em 1em;
-}
-
-.pure-menu-disabled {
-    opacity: .5;
-}
-
-.pure-menu-disabled .pure-menu-link:hover {
-    background-color: transparent;
-}
-
-.pure-menu-active > .pure-menu-link,
-.pure-menu-link:hover,
-.pure-menu-link:focus {
-    background-color: #eee;
-}
-
-.pure-menu-selected .pure-menu-link,
-.pure-menu-selected .pure-menu-link:visited {
-    color: #000;
-}
-
-.pure-table {
-    /* Remove spacing between table cells (from Normalize.css) */
-    border-collapse: collapse;
-    border-spacing: 0;
-    empty-cells: show;
-    border: 1px solid #cbcbcb;
-}
-
-.pure-table caption {
-    color: #000;
-    font: italic 85%/1 arial, sans-serif;
-    padding: 1em 0;
-    text-align: center;
-}
-
-.pure-table td,
-.pure-table th {
-    border-left: 1px solid #cbcbcb;/*  inner column border */
-    border-width: 0 0 0 1px;
-    font-size: inherit;
-    margin: 0;
-    overflow: visible; /*to make ths where the title is really long work*/
-    padding: 0.5em 1em; /* cell padding */
-}
-
-/* Consider removing this next declaration block, as it causes problems when
-there's a rowspan on the first cell. Case added to the tests. issue#432 */
-.pure-table td:first-child,
-.pure-table th:first-child {
-    border-left-width: 0;
-}
-
-.pure-table thead {
-    background-color: #e0e0e0;
-    color: #000;
-    text-align: left;
-    vertical-align: bottom;
-}
-
-/*
-striping:
-   even - #fff (white)
-   odd  - #f2f2f2 (light gray)
-*/
-.pure-table td {
-    background-color: transparent;
-}
-.pure-table-odd td {
-    background-color: #f2f2f2;
-}
-
-/* nth-child selector for modern browsers */
-.pure-table-striped tr:nth-child(2n-1) td {
-    background-color: #f2f2f2;
-}
-
-/* BORDERED TABLES */
-.pure-table-bordered td {
-    border-bottom: 1px solid #cbcbcb;
-}
-.pure-table-bordered tbody > tr:last-child > td {
-    border-bottom-width: 0;
-}
-
-
-/* HORIZONTAL BORDERED TABLES */
-
-.pure-table-horizontal td,
-.pure-table-horizontal th {
-    border-width: 0 0 1px 0;
-    border-bottom: 1px solid #cbcbcb;
-}
-.pure-table-horizontal tbody > tr:last-child > td {
-    border-bottom-width: 0;
-}
diff --git a/talerbank/app/static/web-common b/talerbank/app/static/web-common
index ebf2b43..489a9e3 160000
--- a/talerbank/app/static/web-common
+++ b/talerbank/app/static/web-common
@@ -1 +1 @@
-Subproject commit ebf2b43fb00f057643d69abf34b54a1b6087dfcd
+Subproject commit 489a9e38e6960fdce309ab8cf5ff66d930ecb3bc
diff --git a/talerbank/app/templates/pin_tan.html 
b/talerbank/app/templates/pin_tan.html
index 166118f..b545524 100644
--- a/talerbank/app/templates/pin_tan.html
+++ b/talerbank/app/templates/pin_tan.html
@@ -39,7 +39,7 @@
   <form method="post" action="{{ url('pin-verify') }}">
     <input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
     {{ form.pin }}
-    <input type="hidden" name="question_url" value="{{ request.get_full_path 
}}"></input>
+    <input type="hidden" name="question_url" value="{{ request.get_full_path() 
}}"></input>
     <input type="submit" value="Ok"></input>
   </form>
   <small style="margin: 40px 0px">(*) A real bank should ask for
diff --git a/talerbank/app/templates/profile_page.html 
b/talerbank/app/templates/profile_page.html
index 9627be8..c64f215 100644
--- a/talerbank/app/templates/profile_page.html
+++ b/talerbank/app/templates/profile_page.html
@@ -39,7 +39,7 @@
 {% block content %}
   <section id="menu">
     <p>Account: # {{ account_no }}</p>
-    <p>Current balance: <b>{{ balance }} {{ currency }}</b></p>
+    <p>Current balance: <b>{{ sign }} {{ balance }} {{ currency }}</b></p>
   </section>
   <section id="main">
     <article>
@@ -89,7 +89,7 @@
           <input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token 
}}">
           Amount to withdraw:
           <select id="reserve-amount" name="kudos_amount" autofocus>
-              <option value="{{ currency }}:1">1.00 {{ currency }}</option>
+              <option value="{{ currency }}:5">5.00 {{ currency }}</option>
               <option value="{{ currency }}:10">10.00 {{ currency }}</option>
               <option value="{{ currency }}:15">15.00 {{ currency }}</option>
               <option value="{{ currency }}:20">20.00 {{ currency }}</option>
diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index 092d21c..feff213 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -57,6 +57,31 @@ class RegisterTestCase(TestCase):
         self.assertEqual(200, response.status_code)
 
 
+class RegisterWrongCurrencyTestCase(TestCase):
+    """User registration"""
+
+    # Activating this user with a faulty currency.
+    def setUp(self):
+        bank = User.objects.create_user(username='Bank')
+        ba = BankAccount(user=bank, currency="XYZ")
+        ba.account_no = 1
+        ba.save() 
+
+    def tearDown(self):
+        clearDb()
+
+    def test_register(self):
+        c = Client()
+        response = c.post(reverse("register", urlconf=urls),
+                          {"username": "test_register",
+                           "password": "test_register"},
+                           follow=True)
+        # A currency mismatch is expected when the 100 KUDOS will be
+        # attempted to be given to the new user.
+        # This scenario expects a 500 Internal server error response to
+        # be returned.
+        self.assertEqual(500, response.status_code)
+
 class LoginTestCase(TestCase):
     """User login"""
 
@@ -78,6 +103,15 @@ class LoginTestCase(TestCase):
                            follow=True)
         self.assertIn(("/profile", 302), response.redirect_chain)
 
+        # Send wrong password
+        response = c.post(reverse("login", urlconf=urls),
+                          {"username": "test_user",
+                           "password": "test_passwordoo"},
+                           follow=True)
+        # The current logic -- django's default -- returns 200 OK
+        # even when the login didn't succeed.
+        # So the test here ensures that the bank just doesn't crash.
+        self.assertEqual(200, response.status_code)
 
 class AmountTestCase(TestCase):
     
@@ -89,6 +123,19 @@ class AmountTestCase(TestCase):
         self.assertEqual(1, amounts.amount_cmp(a2, a1))
         self.assertEqual(0, amounts.amount_cmp(a1, _a1))
 
+    # Trying to compare amount of different currencies
+    def test_cmp_diff_curr(self):
+        a1 = dict(value=1, fraction=0, currency="X")
+        a2 = dict(value=2, fraction=0, currency="Y")
+        try:
+            amounts.amount_cmp(a1, a2)
+        except amounts.CurrencyMismatchException:
+            self.assertTrue(True)
+            return
+        # Should never get here
+        self.assertTrue(False)
+
+
 class AddIncomingTestCase(TestCase):
     """Test money transfer's API"""
 
@@ -138,6 +185,23 @@ class AddIncomingTestCase(TestCase):
                           follow=True, **{"HTTP_X_TALER_BANK_USERNAME": 
"user_user", "HTTP_X_TALER_BANK_PASSWORD": "user_password"})
         self.assertEqual(406, response.status_code)
 
+        # Try to go debit
+        data = '{"auth": {"type": "basic"}, \
+                 "credit_account": 1, \
+                 "wtid": "TESTWTID", \
+                 "exchange_url": "https://exchange.test";, \
+                 "amount": \
+                   {"value": 50, \
+                    "fraction": 1, \
+                    "currency": "%s"}}' \
+               % settings.TALER_CURRENCY
+        response = c.post(reverse("add-incoming", urlconf=urls),
+                          data=data,
+                          content_type="application/json",
+                          follow=True, **{"HTTP_X_TALER_BANK_USERNAME": 
"user_user", "HTTP_X_TALER_BANK_PASSWORD": "user_password"})
+        self.assertEqual(403, response.status_code)
+
+
 class HistoryTestCase(TestCase):
 
     def setUp(self):
@@ -169,7 +233,7 @@ class HistoryTestCase(TestCase):
                          **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
         self.assertEqual(200, response.status_code)
 
-        # Get a delta=+1 record in the middle of the list: FAILS
+        # Get a delta=+1 record in the middle of the list
         response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "+1", "start": "5"},
                          **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
         data = response.content.decode("utf-8")
@@ -204,8 +268,7 @@ class HistoryTestCase(TestCase):
         self.assertEqual(404, response.status_code)
 
 
-# This tests whether a bank account goes red and then
-## goes green again
+# This tests whether a bank account goes debit and then goes >=0  again
 class DebitTestCase(TestCase):
 
     def setUp(self):
@@ -252,7 +315,7 @@ class DebitTestCase(TestCase):
 
         self.assertEqual(0, amounts.amount_cmp(ub0.balance_obj, tmp))
 
-class TestParseAmount(TestCase):
+class ParseAmountTestCase(TestCase):
      def test_parse_amount(self):
          ret = amounts.parse_amount("KUDOS:4")
          self.assertJSONEqual('{"value": 4, "fraction": 0, "currency": 
"KUDOS"}', json.dumps(ret))
diff --git a/talerbank/app/tests_alt.py b/talerbank/app/tests_alt.py
new file mode 100644
index 0000000..cf782d1
--- /dev/null
+++ b/talerbank/app/tests_alt.py
@@ -0,0 +1,51 @@
+#  This file is part of TALER
+#  (C) 2014, 2015, 2016 INRIA
+#
+#  TALER 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, or (at your option) any later version.
+#
+#  TALER 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 General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License along with
+#  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+#
+#  @author Marcello Stanisci
+
+from django.test import TestCase, Client
+from django.core.urlresolvers import reverse
+from django.conf import settings
+from django.contrib.auth.models import User
+from .models import BankAccount, BankTransaction
+from . import urls
+from . import amounts
+from .views import wire_transfer
+import json
+
+import logging
+
+logger = logging.getLogger(__name__)
+
+class BadDatabaseStringTestCase(TestCase):
+    def test_baddbstring(self):
+        pass
+
+class BadMaxDebtOptionTestCase(TestCase):
+    def test_badmaxdebtoption(self):
+        try:
+            amounts.parse_amount(settings.TALER_MAX_DEBT)
+        except amounts.BadFormatAmount:
+            self.assertTrue(True)
+            return
+        try:
+            amounts.parse_amount(settings.TALER_MAX_DEBT_BANK)
+        except amounts.BadFormatAmount:
+            self.assertTrue(True)
+            return
+        # Force to have at least one bad amount in config
+        self.assertTrue(False)
+
+class NoCurrencyOptionTestCase(TestCase):
+    pass
diff --git a/talerbank/app/tests_err.py b/talerbank/app/tests_err.py
deleted file mode 100644
index 26b1ae7..0000000
--- a/talerbank/app/tests_err.py
+++ /dev/null
@@ -1,301 +0,0 @@
-#  This file is part of TALER
-#  (C) 2014, 2015, 2016 INRIA
-#
-#  TALER 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, or (at your option) any later version.
-#
-#  TALER 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 General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License along with
-#  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
-#
-#  @author Marcello Stanisci
-
-from django.test import TestCase, Client
-from django.core.urlresolvers import reverse
-from django.conf import settings
-from django.contrib.auth.models import User
-from .models import BankAccount, BankTransaction
-from . import urls
-from . import amounts
-from .views import wire_transfer
-import json
-
-import logging
-
-logger = logging.getLogger(__name__)
-
-def clearDb():
-    User.objects.all().delete()
-    BankAccount.objects.all().delete()
-    BankTransaction.objects.all().delete()
-
-
-class RegisterTestCase(TestCase):
-    """User registration"""
-
-    def setUp(self):
-        bank = User.objects.create_user(username='Bank')
-        # Activating this user with a faulty currency.
-        ba = BankAccount(user=bank, currency="XYZ")
-        ba.account_no = 1
-        ba.save() 
-
-    def tearDown(self):
-        clearDb()
-
-    def test_register(self):
-        c = Client()
-        response = c.post(reverse("register", urlconf=urls),
-                          {"username": "test_register",
-                           "password": "test_register"},
-                           follow=True)
-        # A currency mismatch is expected when the 100 KUDOS will be
-        # attempted to be given to the new user.
-        # This scenario expects a 500 Internal server error response to
-        # be returned.
-        self.assertEqual(500, response.status_code)
-
-
-class LoginTestCase(TestCase):
-    """User login"""
-
-    def setUp(self):
-        user = User.objects.create_user(username="test_user",
-                                        password="test_password")
-        user_account = BankAccount(user=user,
-                                   currency=settings.TALER_CURRENCY)
-        user_account.save()
-
-    def tearDown(self):
-        clearDb()
-    
-    def test_login(self):
-        c = Client()
-        # Sending non existent credentials.
-        response = c.post(reverse("login", urlconf=urls),
-                          {"username": "test_user",
-                           "password": "test_passwordoo"},
-                           follow=True)
-        # The current logic -- django's default -- returns 200 OK
-        # even when the login didn't succeed.
-        # So the test here ensures that the bank just doesn't crash.
-        self.assertEqual(200, response.status_code)
-
-
-class AmountTestCase(TestCase):
-    
-    # Trying to compare amount of different currencies
-    def test_cmp(self):
-        a1 = dict(value=1, fraction=0, currency="X")
-        a2 = dict(value=2, fraction=0, currency="Y")
-        try:
-            amounts.amount_cmp(a1, a2)
-        except amounts.CurrencyMismatchException:
-            self.assertTrue(True)
-            return
-        # Should never get here
-        self.assertTrue(False)
-
-class AddIncomingTestCase(TestCase):
-    """Test money transfer's API"""
-
-    def setUp(self):
-        bank = User.objects.create_user(username="bank_user",
-                                        password="bank_password")
-        bank_account = BankAccount(user=bank,
-                                   currency=settings.TALER_CURRENCY)
-        user = User.objects.create_user(username="user_user",
-                                        password="user_password")
-        user_account = BankAccount(user=user,
-                                   currency=settings.TALER_CURRENCY)
-        bank_account.save()
-        user_account.save()
-
-        no1 = BankAccount.objects.get(account_no=1)
-        no2 = BankAccount.objects.get(account_no=2)
-        logger.info("1 username: %s" % no1.user.username)
-        logger.info("2 username: %s" % no2.user.username)
-
-    def tearDown(self):
-        clearDb()
-
-    def test_add_incoming(self):
-        c = Client()
-        data = '{"auth": {"type": "basic"}, \
-                 "credit_account": 1, \
-                 "wtid": "TESTWTID", \
-                 "exchange_url": "https://exchange.test";, \
-                 "amount": \
-                   {"value": 1, \
-                    "fraction": 0, \
-                    "currency": "%s"}}' \
-               % settings.TALER_CURRENCY
-        # Trying with wrong credentials
-        response = c.post(reverse("add-incoming", urlconf=urls),
-                          data=data,
-                          content_type="application/json",
-                          follow=True, **{"HTTP_X_TALER_BANK_USERNAME": 
"user_useroo", "HTTP_X_TALER_BANK_PASSWORD": "user_passwordoo"})
-        self.assertEqual(401, response.status_code)
-        data = '{"auth": {"type": "basic"}, \
-                 "credit_account": 1, \
-                 "wtid": "TESTWTID", \
-                 "exchange_url": "https://exchange.test";, \
-                 "amount": \
-                   {"value": 1, \
-                    "fraction": 0, \
-                    "currency": "%s"}}' \
-               % "WRONGCURRENCY"
-        # Trying with wrong currency
-        response = c.post(reverse("add-incoming", urlconf=urls),
-                          data=data,
-                          content_type="application/json",
-                          follow=True, **{"HTTP_X_TALER_BANK_USERNAME": 
"user_user", "HTTP_X_TALER_BANK_PASSWORD": "user_password"})
-        self.assertEqual(406, response.status_code)
-        # Trying to go debit
-        data = '{"auth": {"type": "basic"}, \
-                 "credit_account": 1, \
-                 "wtid": "TESTWTID", \
-                 "exchange_url": "https://exchange.test";, \
-                 "amount": \
-                   {"value": 60, \
-                    "fraction": 0, \
-                    "currency": "%s"}}' \
-               % settings.TALER_CURRENCY
-        response = c.post(reverse("add-incoming", urlconf=urls),
-                          data=data,
-                          content_type="application/json",
-                          follow=True, **{"HTTP_X_TALER_BANK_USERNAME": 
"user_user", "HTTP_X_TALER_BANK_PASSWORD": "user_password"})
-
-
-class HistoryTestCase(TestCase):
-
-    def setUp(self):
-        user = User.objects.create_user(username='User', password="Password")
-        ub = BankAccount(user=user, currency=settings.TALER_CURRENCY)
-        ub.account_no = 1
-        ub.balance_obj = dict(value=100, fraction=0, 
currency=settings.TALER_CURRENCY)
-        ub.save() 
-        user_passive = User.objects.create_user(username='UserP', 
password="PasswordP")
-        ub_p = BankAccount(user=user_passive, currency=settings.TALER_CURRENCY)
-        ub_p.account_no = 2
-        ub_p.save() 
-        wire_transfer(dict(value=1, fraction=0, 
currency=settings.TALER_CURRENCY), ub, ub_p, subject="a")
-        wire_transfer(dict(value=1, fraction=0, 
currency=settings.TALER_CURRENCY), ub, ub_p, subject="b")
-        wire_transfer(dict(value=1, fraction=0, 
currency=settings.TALER_CURRENCY), ub, ub_p, subject="c")
-        wire_transfer(dict(value=1, fraction=0, 
currency=settings.TALER_CURRENCY), ub, ub_p, subject="d")
-        wire_transfer(dict(value=1, fraction=0, 
currency=settings.TALER_CURRENCY), ub, ub_p, subject="e")
-        wire_transfer(dict(value=1, fraction=0, 
currency=settings.TALER_CURRENCY), ub, ub_p, subject="f")
-        wire_transfer(dict(value=1, fraction=0, 
currency=settings.TALER_CURRENCY), ub, ub_p, subject="g")
-        wire_transfer(dict(value=1, fraction=0, 
currency=settings.TALER_CURRENCY), ub, ub_p, subject="h")
-
-    def tearDown(self):
-        clearDb()
-
-    def test_history(self):
-        c = Client()
-
-        response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "+4"},
-                         **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
-        self.assertEqual(200, response.status_code)
-
-        # Get a delta=+1 record in the middle of the list: FAILS
-        response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "+1", "start": "5"},
-                         **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
-        data = response.content.decode("utf-8")
-        data = json.loads(data)
-        self.assertEqual(data["data"][0]["row_id"], 6)
-        # Get latest record
-        response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "-1"},
-                         **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
-        data = response.content.decode("utf-8")
-        data = json.loads(data)
-        self.assertEqual(data["data"][0]["wt_subject"], "h")
-        # Get non-existent record: the latest plus one in the future: 
transaction "h" takes row_id 11
-        response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "1", "start": "11"},
-                         **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
-        response_txt = response.content.decode("utf-8")
-        self.assertEqual(204, response.status_code)
-        # Get credit records
-        response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "+1", "direction": "credit"},
-                         **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
-        self.assertEqual(204, response.status_code)
-        # Get debit records
-        response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "+1", "direction": "debit"},
-                         **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
-        self.assertNotEqual(204, response.status_code)
-        # Query about non-owned account
-        response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "+1", "account_number": 2},
-                         **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
-        self.assertEqual(403, response.status_code)
-        # Query about non-existent account
-        response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "-1", "account_number": 9},
-                         **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
-        self.assertEqual(404, response.status_code)
-
-
-# This tests whether a bank account goes red and then
-## goes green again
-class DebitTestCase(TestCase):
-
-    def setUp(self):
-        u = User.objects.create_user(username='U')
-        u0 = User.objects.create_user(username='U0')
-        ua = BankAccount(user=u, currency=settings.TALER_CURRENCY)
-        u0a = BankAccount(user=u0, currency=settings.TALER_CURRENCY)
-
-        ua.save()
-        u0a.save()
-
-    def test_green(self):
-        u = User.objects.get(username='U')
-        ub = BankAccount.objects.get(user=u)
-        self.assertEqual(False, ub.debit)
-
-    def test_red(self):
-        u = User.objects.get(username='U')
-        u0 = User.objects.get(username='U0')
-
-        ub = BankAccount.objects.get(user=u)
-        ub0 = BankAccount.objects.get(user=u0)
-
-        wire_transfer(dict(value=10, fraction=0, 
currency=settings.TALER_CURRENCY),
-                      ub0,
-                      ub,
-                      "Go green")
-        tmp = amounts.get_zero()
-        tmp["value"] = 10
-
-        self.assertEqual(0, amounts.amount_cmp(ub.balance_obj, tmp))
-        self.assertEqual(False, ub.debit)
-        self.assertEqual(True, ub0.debit)
-
-        wire_transfer(dict(value=11, fraction=0, 
currency=settings.TALER_CURRENCY),
-                      ub,
-                      ub0,
-                      "Go red")
-
-        self.assertEqual(True, ub.debit)
-        self.assertEqual(False, ub0.debit)
-
-        tmp["value"] = 1
-
-        self.assertEqual(0, amounts.amount_cmp(ub0.balance_obj, tmp))
-
-class TestParseAmount(TestCase):
-     def test_parse_amount(self):
-         ret = amounts.parse_amount("KUDOS:4")
-         self.assertJSONEqual('{"value": 4, "fraction": 0, "currency": 
"KUDOS"}', json.dumps(ret))
-         ret = amounts.parse_amount("KUDOS:4.00")
-         self.assertJSONEqual('{"value": 4, "fraction": 0, "currency": 
"KUDOS"}', json.dumps(ret))
-         ret = amounts.parse_amount("KUDOS:4.3")
-         self.assertJSONEqual('{"value": 4, "fraction": 30000000, "currency": 
"KUDOS"}', json.dumps(ret))
-         try:
-             amounts.parse_amount("Buggy")
-         except amounts.BadFormatAmount:
-             return
-         # make sure the control doesn't get here
-         self.assertEqual(True, False)
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 3607de7..45328f8 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -99,6 +99,7 @@ def profile_page(request):
     context = dict(
         name=user_account.user.username,
         balance=amounts.stringify(amounts.floatify(user_account.balance_obj)),
+        sign = "-" if user_account.debit else "",
         currency=user_account.currency,
         precision=settings.TALER_DIGITS,
         account_no=user_account.account_no,
@@ -168,7 +169,7 @@ def pin_tan_question(request):
     request.session["exchange_url"] = request.GET["exchange"]
     request.session["reserve_pub"] = request.GET["reserve_pub"]
     request.session["sender_wiredetails"] = dict(
-        type="TEST",
+        type="test",
         bank_uri=request.build_absolute_uri(reverse("index")),
         account_number=user_account.account_no
     )
@@ -445,8 +446,9 @@ def auth_and_login(request):
 
     username = request.META.get("HTTP_X_TALER_BANK_USERNAME")
     password = request.META.get("HTTP_X_TALER_BANK_PASSWORD")
-    # logger.info("Trying to log '%s/%s' in" % (username, password))
+    logger.info("Trying to log '%s/%s' in" % (username, password))
     if not username or not password:
+        logger.error("user or password not given")
         return False
     return django.contrib.auth.authenticate(username=username,
                                             password=password)
@@ -473,6 +475,7 @@ def add_incoming(request):
     user_account = auth_and_login(request)
 
     if not user_account:
+        logger.error("authentication failed")
         return JsonResponse(dict(error="authentication failed"),
                             status=401)
 
@@ -491,6 +494,7 @@ def add_incoming(request):
     except SameAccountException:
         return JsonResponse(dict(error="debit and credit account are the 
same"), status=422)
     except DebtLimitExceededException:
+        logger.info("Prevenetd transfer, debit account would go beyond debt 
threshold")
         return JsonResponse(dict(error="debit count has reached its debt 
limit", status=403 ),
                              status=403)
     except amounts.CurrencyMismatchException as e:
@@ -506,11 +510,18 @@ def withdraw_nojs(request):
         logger.error("Amount did not pass parsing")
         return HttpResponseBadRequest()
 
+    user_account = BankAccount.objects.get(user=request.user)
+
     response = HttpResponse(status=202)
     response["X-Taler-Operation"] = "create-reserve"
     response["X-Taler-Callback-Url"] = reverse("pin-question")
-    response["X-Taler-Wt-Types"] = '["TEST"]'
+    response["X-Taler-Wt-Types"] = '["test"]'
     response["X-Taler-Amount"] = json.dumps(amount)
+    response["X-Taler-Sender-Wire"] = json.dumps(dict(
+        type="test",
+        bank_uri=request.build_absolute_uri(reverse("index")),
+        account_number=user_account.account_no
+    ))
     if settings.TALER_SUGGESTED_EXCHANGE:
         response["X-Taler-Suggested-Exchange"] = 
settings.TALER_SUGGESTED_EXCHANGE
     return response
@@ -585,7 +596,7 @@ def wire_transfer(amount,
         if 1 == amounts.amount_cmp(debit_account.balance_obj, threshold) \
            and 0 != amounts.amount_cmp(amounts.get_zero(), threshold) \
            and debit_account.debit:
-            logger.error("Negative balance '%s' not allowed." % 
json.dumps(debit_account.balance_obj))
+            logger.info("Negative balance '%s' not allowed." % 
json.dumps(debit_account.balance_obj))
             logger.info("%s's threshold is: '%s'." % 
(debit_account.user.username, json.dumps(threshold)))
             raise DebtLimitExceededException()
     except amounts.CurrencyMismatchException:
diff --git a/talerbank/settings.py b/talerbank/settings.py
index 6bbbc46..b553a3b 100644
--- a/talerbank/settings.py
+++ b/talerbank/settings.py
@@ -11,7 +11,7 @@ https://docs.djangoproject.com/en/1.9/ref/settings/
 import os
 import logging
 import base64
-from .talerconfig import TalerConfig
+from .talerconfig import TalerConfig, ConfigurationError
 import sys
 import urllib.parse
 import re
@@ -103,7 +103,7 @@ logger.info("dbname: %s" % dbname)
 check_dbstring_format = re.search("[a-z]+:///[a-z]+", dbname)
 if not check_dbstring_format:
     logger.error("Bad db string given, respect the format 'dbtype:///dbname'")
-    sys.exit(1)
+    sys.exit(2)
 
 dbconfig = {}
 db_url = urllib.parse.urlparse(dbname)
@@ -170,6 +170,7 @@ STATIC_URL = '/static/'
 
 STATICFILES_DIRS = [
     os.path.join(BASE_DIR, "talerbank/app/static"),
+    os.path.join(BASE_DIR, "talerbank/app/static/web-common"),
 ]
 
 # Currently we don't use "collectstatic", so this value isn't used.
@@ -180,17 +181,16 @@ STATIC_ROOT = '/tmp/talerbankstatic/'
 
 ROOT_URLCONF = "talerbank.app.urls"
 
-TALER_CURRENCY = tc.value_string("taler", "currency", required=True)
-
-TALER_MAX_DEBT = tc.value_string("bank", "MAX_DEBT",
-                                 default="%s:50" % TALER_CURRENCY)
+try:
+    TALER_CURRENCY = tc.value_string("taler", "currency", required=True)
+except ConfigurationError as e:
+    logger.error(e)
+    sys.exit(3)
 
-TALER_MAX_DEBT_BANK = tc.value_string("bank", "MAX_DEBT_BANK",
-                                      default="%s:0" % TALER_CURRENCY)
+TALER_MAX_DEBT = tc.value_string("bank", "MAX_DEBT", default="%s:50" % 
TALER_CURRENCY)
+TALER_MAX_DEBT_BANK = tc.value_string("bank", "MAX_DEBT_BANK", default="%s:0" 
% TALER_CURRENCY)
 
 TALER_DIGITS = 2
 TALER_PREDEFINED_ACCOUNTS = ['Tor', 'GNUnet', 'Taler', 'FSF', 'Tutorial']
 TALER_EXPECTS_DONATIONS = ['Tor', 'GNUnet', 'Taler', 'FSF']
 TALER_SUGGESTED_EXCHANGE = tc.value_string("bank", "suggested_exchange")
-
-logging.info("currency: '%s'", TALER_CURRENCY)
diff --git a/talerbank/talerconfig.py b/talerbank/talerconfig.py
index ba4dfbb..b686240 100644
--- a/talerbank/talerconfig.py
+++ b/talerbank/talerconfig.py
@@ -25,6 +25,7 @@ import logging
 import collections
 import os
 import weakref
+import sys
 
 logger = logging.getLogger(__name__)
 
@@ -136,7 +137,7 @@ class Entry:
     def __str__(self):
         return self.value
 
-    def value_string(self, default=None, warn=False, required=False):
+    def value_string(self, default=None, required=False, warn=False):
         if required and self.value is None:
             raise ConfigurationError("Missing required option '%s' in section 
'%s'" % (self.option.upper(), self.section.upper()))
         if self.value is None:
@@ -145,11 +146,11 @@ class Entry:
                     logger.warn("Configuration is missing option '%s' in 
section '%s', falling back to '%s'",
                             self.option, self.section, default)
                 else:
-                    logger.warn("Configuration is missing option '%s' in 
section '%s'", self.option.upper(), self.section.upper())
+                    logger.warn("Configuration ** is missing option '%s' in 
section '%s'", self.option.upper(), self.section.upper())
             return default
         return self.value
 
-    def value_int(self, default=None, warn=False, required=False):
+    def value_int(self, default=None, required=False, warn=False):
         v = self.value_string(default, warn, required)
         if v is None:
             return None
@@ -167,7 +168,7 @@ class Entry:
             return x
         return None
 
-    def value_filename(self, default=None, warn=False, required=False):
+    def value_filename(self, default=None, required=False, warn=False):
         v = self.value_string(default, warn, required)
         if v is None:
             return None
@@ -249,40 +250,44 @@ class TalerConfig:
 
     def load_file(self, filename):
         sections = self.sections
-        with open(filename, "r") as file:
-            lineno = 0
-            current_section = None
-            for line in file:
-                lineno += 1
-                line = line.strip()
-                if len(line) == 0:
-                    # empty line
-                    continue
-                if line.startswith("#"):
-                    # comment
-                    continue
-                if line.startswith("["):
-                    if not line.endswith("]"):
-                        logger.error("invalid section header in line %s: %s", 
lineno, repr(line))
-                    section_name = line.strip("[]").strip().strip('"')
-                    current_section = section_name
-                    continue
-                if current_section is None:
-                    logger.error("option outside of section in line %s: %s", 
lineno, repr(line))
-                    continue
-                kv = line.split("=", 1)
-                if len(kv) != 2:
-                    logger.error("invalid option in line %s: %s", lineno, 
repr(line))
-                key = kv[0].strip()
-                value = kv[1].strip()
-                if value.startswith('"'):
-                    value = value[1:]
-                    if not value.endswith('"'):
-                        logger.error("mismatched quotes in line %s: %s", 
lineno, repr(line))
-                    else:
-                        value = value[:-1]
-                e = Entry(self.sections, current_section, key, value, 
filename, lineno)
-                sections[current_section][key] = e
+        try:
+            with open(filename, "r") as file:
+                lineno = 0
+                current_section = None
+                for line in file:
+                    lineno += 1
+                    line = line.strip()
+                    if len(line) == 0:
+                        # empty line
+                        continue
+                    if line.startswith("#"):
+                        # comment
+                        continue
+                    if line.startswith("["):
+                        if not line.endswith("]"):
+                            logger.error("invalid section header in line %s: 
%s", lineno, repr(line))
+                        section_name = line.strip("[]").strip().strip('"')
+                        current_section = section_name
+                        continue
+                    if current_section is None:
+                        logger.error("option outside of section in line %s: 
%s", lineno, repr(line))
+                        continue
+                    kv = line.split("=", 1)
+                    if len(kv) != 2:
+                        logger.error("invalid option in line %s: %s", lineno, 
repr(line))
+                    key = kv[0].strip()
+                    value = kv[1].strip()
+                    if value.startswith('"'):
+                        value = value[1:]
+                        if not value.endswith('"'):
+                            logger.error("mismatched quotes in line %s: %s", 
lineno, repr(line))
+                        else:
+                            value = value[:-1]
+                    e = Entry(self.sections, current_section, key, value, 
filename, lineno)
+                    sections[current_section][key] = e
+        except FileNotFoundError:
+            logger.error("Configuration file (%s) not found", filename)
+            sys.exit(3)
 
 
     def dump(self):

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]