diff --git a/README.org b/README.org index 2252479f8f8cdea23b8b428fbd2fecb9a3d84ef1..d7c71dd8deb2495d6f48e672b52751310c4db14a 100644 --- a/README.org +++ b/README.org @@ -1,8 +1,42 @@ #+title: events wrangler the event wrangler wrangles and fuse all your remote logs into one place. * installation +This program creates an html file, but it needs to be delivered somehow. You should install a web server like apache or nginx to access the file from a distance. after that you can download the packaged python app from the releases. +Be sure to have the correct owner and permissions: +#+begin_example +aggreg:/home/aggreg# chown aggreg:aggreg eventswrangler +aggreg:/home/aggreg# chmod 774 eventswrangler +aggreg:/home/aggreg# ls -l +total 3252 +-rwxrwxr-- 1 aggreg aggreg 3328757 May 25 14:31 eventswrangler +#+end_example +In this case, the program will be run on the ~aggreg~ user and ~aggreg~ group. +Grab the config from the *configuration* section or from the ~conf.yml~ file and put it in ~/etc/eventswrangler.yml~ or somewhere else if you use the ~--config~ command line switch. +This program is not a daemon and will terminate when it's done, so put it in the user's crontab: +#+begin_example +0-59/5 * * * * /home/aggreg/eventswrangler +#+end_example +This will run the program every 5 minutes. +There is a CSS style cheets in the repo that can be used by simply copying the ~css~ folder to your website's root. +* invocation +#+begin_example +usage: eventswrangler [-h] [-c CONFIG] + +obtain events feeds from RSS and compile them into a nice webpage + +options: + -h, --help show this help message and exit + -c CONFIG, --config CONFIG + specifies a config path instead of the default config path + /etc/eventswrangler.yml +#+end_example * configuration -** exemple de fichier de configuration +The configuration is a yaml file with the following keys: +- sources :: is a list containing each RSS feed's website base domain (with http or https prepended) +- rss-name :: the path of the rss file to looks for +- destination :: where to write the resulting html file +- tri-chrono :: whether to sort by time, more recent up and older down. +** configuration file example #+begin_example sources: - http://serveur1 @@ -12,3 +46,29 @@ rss-name: flux.rss destination: /var/www/localhost/htdocs/index.html tri-chrono: true #+end_example +* building +There are many ways in which you can package this applications to someone else. Here I will describe a way to create a self-contained build (to the exception of the python interpreter itself) using ~zipapp~: +clone the repository and ~cd~ into it: +#+begin_example +$ git clone https://etulab.univ-amu.fr/v23004467/events-wrangler.git +$ cd events-wrangler +#+end_example +create a 'build' directory where the main python script and it's dependencies will be: +#+begin_example +$ mkidr build +#+end_example +install the dependencies into it: +#+begin_example +$ pip install -r requirements.txt --target build +#+end_example +then either copy and link the ~aggreg.py~ file: +#+begin_example +$ cp aggreg.py build/ +# OR +$ ln -s $REPODIR/aggreg.py build/aggreg.py +#+end_example +then you can create the self packaged app with this command: +#+begin_example +$ python -m zipapp -m aggreg:main -o eventswrangler -p "/usr/bin/env python" ./build +#+end_example +this will produce an executable named ~eventswrangler~. diff --git a/conf.yml b/conf.yml new file mode 100644 index 0000000000000000000000000000000000000000..b9588e413cbada4152ff2bf45577c7c502dd811b --- /dev/null +++ b/conf.yml @@ -0,0 +1,9 @@ +sources: + - http://serveur1 + - http://serveur2 + - http://serveur3 + - http://serveur4 + - http://serveur5 +rss-name: rss.xml +destination: /var/www/localhost/htdocs/index.html +tri-chrono: true