Tuesday, January 17. 2017
Runalyze installation
Finally everything clumped together and your own server repository (runalyze) can be used to store your running activities (tracked by runnerup). If you have been involved in FOSS projects you already know that the pace is sometimes slow and maybe you have to push at several levels, but, finally, you always get the prize. Of course, you have to know how to develop, but dude, you are not a computering guy if you do not develop (you can read as many books as you want but you are not a writer if you do not try to write one). I learned that long time ago and, since then, I try to collaborate with the projects I use or like.
If you remember first the synchronizer for runalyze was developed and integrated in runnerup. This way the android application can upload your activities to the server backend. Then a painful wait for getting a new version of runnerup with that feature. Obviously in the meantime runalyze evolved and a new fix was necessary for the integration with the newer versions (but this is opensource and another guy did it, thanks a lot!). Then, as a f-droid user, another wait for the runnerup application to be updated in the repository. As it did not come I had to advise them about the new versions. (Another annoying account necessary, why is a fucking user always needed for everything? Only God knows.) Finally some days ago the runnerup 1.56 dropped into f-droid and all the pieces finally fit together. As a side effect I have been involved in the investigation of a proprietary library used in runnerup and I am trying to get rid of it to avoid its exclusion from the free repo. But you know, FOSS is a quid pro quo, a symbiosis, you have to give to be given. I never complain for that.
As I said now the pieces fit and this is my little how-to about installing runalyze in my server. Remember I already have a nextcloud server installed in the same desktop, so, several previous steps are missing. I followed the documentation given by the project. You have to be root for the whole procedure.
As you now I use debian testing as my linux default system (maybe I have to change that, but this is another story) and, first, you have to install several system packages (mainly php modules). The complete list in the runalyze documentation but in my case I only needed one missing package:
apt-get install php-gettext
Then download and uncompress the runalyze application itself. I installed it in the default debian directory for web apps (/var/www) and I created a link to make later upgrades easier.
cd /var/www wget https://github.com/Runalyze/Runalyze/releases/download/v3.1.0/runalyze-v3.1.0.zip unzip runalyze-v3.1.0.zip mv runalyze runalyze-v3.1.0 ln -s runalyze-v3.1.0 runalyze cd runalyze chown -R www-data:www-data *
Create the user and the database for the application. As I said I am going to re-use previous mariadb and apache2 already installed in the system.
create database runalyze; create user 'runalyze'@'localhost' IDENTIFIED BY 'XXXXXX'; grant all on runalyze.* to 'runalyze'@'localhost';
Configure the database access in the config.yml file. Just the username and the password are needed because all the other information is the same (localhost, database name and so on, take care if you change the default values).
Now you need to configure the directory inside the apache2 server. Remember I already have an ssl virtual host and the certificate perfectly configured in my phone to accept that web server. So I just needed to add the following lines to my secure site (/etc/apache2/sites-enabled/default-ssl.conf):
# runalyze Alias /runalyze/ "/var/www/runalyze/web/" <Directory /var/www/runalyze/web> AllowOverride None Require all granted <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L] </IfModule> </Directory>
At this point I needed to enable the rewrite module (as you see in the previous configuration it is needed for runalyze) and restart the apache server.
a2enmod rewrite systemctl restart apache2
Now you have to access to the install page (https://venom.local/runalyze/install in my case) and execute the process that populates the database.
After the population you are requested to create the first user.
In my case the creation failed because I have no email server configured (and I am not going to have one). The server tries to send an activation code to your mail (like if it was a real internet account). Just remove the activation directly in the database and enable the user (take care, this command activates all the users in the ddbb, but in this step there should be only one):
update runalyze_account set activation_hash=null;
Finally you have a running runalyze server in your own PC. You can access to your empty account to test it.
The last step is configuring your runnerup account and upload all your activities to the server. This process is the same that was explained when I presented the integration. And remember I have an https web server, which means I have to install my certificate in the phone. As I said this procedure is not absolutely complete because part of the steps were already done in the installation of nextcloud.
cp app/config/default_config.yml data/config.yml
And modify the options for the user and password to use:
database_user: runalyze database_password: XXXXXX
And that is all. It is really nice when you see everything comes together. I do not know if I said this before in the blog but it is a thought that came to me several years ago. Every computering dude should dedicate a few hours per week helping in some FOSS projects. Just the one you are comfortable working to, you like to work on or you use everyday. It is not an obligation. It should be intended more like a hobby. The number of hours is not important. Some weeks you can work a lot, and others you can contribute nothing. Think that working in real projects give you experience and visibility to companies too. It is another way of making your curriculum more interesting. Besides you are freeing yourself and, in the way a lot of people, from the dictatorship of googles, facebooks, apples,... I know they are smarter than us and they have always a plan but remember we are legion. Obviously check permanently the trust of the projects you are contributing to and, at the slightest doubt, stop and reconsider it again.
Regards!
Comments