aboutsummaryrefslogtreecommitdiffstats
mga-treasurer
-------------

mga-treasurer is a script that is used to generate a website showing
informations about latest donations received and expenses for Mageia.Org
association.


Configuration file
------------------

The default configuration is stored in the file config_default installed
as /usr/share/mga-treasurer/config. Default configuration values can be
overrided using file /etc/mga-treasurer.conf.


Sources tree
------------

The following files and directories exist in the source tree :
 - mktreasurer: main program, installed in /usr/bin. When run generate
   all the pages.
 - tmpl/: directory containing template for all the pages. Installed as
   /usr/share/mga-treasurer/tmpl.
 - static/: directory containing static files. Installed as
   /usr/share/mga-treasurer/static. The web server should be configured to
   make the files from this directory available at some URL. With apache
   you can use something like this in your vhost configuration :
      Alias /static /usr/share/mga-treasurer/static
   The URL where it is available should be set in the configuration in the
   staticdir_url variable.
 - config_default: default configuration file, installed as
   /usr/share/mga-treasurer/config.
 - mga-treasurer.conf: example configuration file, installed as
   /etc/mga-treasurer.conf.


Testing
-------

For testing, you can set the environement variable MGATRES_CONF to the
path of a default configuration file that will be used instead of
/usr/share/mga-treasurer/config.


JSON files and http headers
---------------------------

So that the json files can be used from pages on other domains with
XMLHttpRequest, the http header Access-Control-Allow-Origin needs to be
set. See this page for details :
https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS

To add the header for .json files, you can use something like this in
apache configuration, inside the VirtualHost definition :

        <FilesMatch "\.json$">
                Header set Access-Control-Allow-Origin "*"
        </FilesMatch>