How to randomly write a web GUI for Haproxy

The modern world of system administrators lined us up with beautiful web-facees, that we don’t even want to install software without this “gui” (I feel that stones from faithful streamers will now fly), well, not through the line to constantly go there, right? It would be ok if you put the software, set it up and forget, and what to do if you have to constantly climb, edit, and of course there is no log of all actions, do not write cp cfg cfg_back every time, you will get confused over time and forget about it .

Many years ago I became acquainted with such a wonderful balancer as Haproxy. Everything is wonderful and beautiful. I got a lot of them and I thought about finding a GUI for it, but it was surprisingly not. Very popular software, besides old enough, but oh well, I thought and continued to edit the handles in my favorite vi from time to time and have a bunch of open tabs with statistics of all active servers. But the time has come and I had to satisfy the "Wishlist" of people who wrote software to work through http, and here the interesting began ...

The hands were combed, my eyes lit up and I started. More precisely, I began to think on what to write, to remember the long-forgotten PHP, I somehow did not want to, and it seemed that it was not quite suitable for this business. As a result, the choice fell on Python, in the future I thought it would be useful, and I started absorbing the information.

At the beginning of the task were not so difficult: the ability to edit configs from the web interface from one entry point, save previous versions of configs. This, not very big functionality, turned out to be implemented quickly enough, but here I was leaped into either admin laziness, or notorious perfectionism, and this of course seemed to me a little. And here began to appear such features as: a comparison of two configs, logging of all actions related to configs, the Runtime API and the addition of sections, via the web.

And how a decent UNIX administrator living with free software, I decided to share with the world, but would someone come in handy with one another? But for this, it was necessary to do everything so that I did not have to climb into the code, but the maximum in the config butts (Now most of the settings have moved to the database. As for me, it has become more convenient to edit and there will be no errors due to the lack of or parameter).

A month later, I laid out my craft on Github with nothing to count on. And in vain, the software turned out to be slightly in demand, and then the most interesting began ... Active “dopilka” has been going on for almost a year. Sometimes there is a desire to quit it all, because My needs have been covered for a long time. Well, why should I be able to deploy a “cluster” with keepalived and HAProxy through the web muzzle, if it takes me a couple of minutes at most? But it turns out that people need it, and I find it interesting, and there is something to do. Although of course there are functions I need, for example, like monitoring backend servers, are they available for Haproxy. Of course, we have corporate monitoring, but there are people there who can react for a long time, + because My department is engaged in development and software appears and disappears long enough to make its way through the bureaucracy.

In general, I decided to share, because it turns out that this is the only free GUI. And what if someone come in handy? Link to github .

Also popular now: