📜 ⬆️ ⬇️

VPS search - whois service and inside view

Today the service is one year old . The launch took place a couple of days after the date of registration of the domain, but today's date can be considered the first birthday.

Whois service


A new feature has appeared on VPS Search - viewing whois information on a domain. The service supports 529 domain zones (including New gTLDs), and for some of them the whois is parsed and the registration date, the expiry date of the domain registration and the registrar are determined and the DNS of the server is displayed. Unfortunately, there are a lot of domain zones, and there are few workers, therefore the definition of these parameters is currently available only for the most popular zones, but in the very near future the number of such zones will be expanded. Also, in the near future there is writing "Domain Notebook" and "Server Notebook".


')

VPS Search - Inside View


When I see some unusual project, I have an overwhelming desire to find out what it is written on, what the admin panel looks like, what server it uses and other information that is hidden from prying eyes.

Most often, such a desire remains only a desire, since there is nowhere to go further to view the page’s html code. However, today I decided to tell you what VPS Search works on and show admin screenshots.



The site is written in php and runs on the phpbb3 forum engine. This engine was chosen for several reasons: firstly, I worked a lot with this system and I can write any code with my eyes closed, and secondly, using this engine saved a lot of time, and I did not have to write modules for registering users, recovery of passwords, logins, captcha, etc. Well, in the end, the site has a well-functioning forum.

On the server side, the site runs on a DigitalOcean virtual server and is used by the Debian OS. This service was chosen so that before publishing articles on Habré it is easy to increase the server’s capacity and not to fall from the habra effect. The server is also equipped with an ISPmanager control panel. Requests are handled by nginx and apache. The database server is mysql.

From the libraries jquery and jqueryui are used. This combination allowed to make the interface very convenient and functional. For example, sliders and drop-down lists, tooltips, etc., are the merit of the aforementioned libraries.



Some of the functions of the site works without reloading the page on AJAX. It is very convenient when the user moves the slider or makes a selection in the drop-down menu: after changing the search parameters, the page does not reload, and the user can quickly select the necessary parameters. From the technical side, a POST request is sent to the server and a response is expected in the form of a JSON array. If the response did not come with a JSON array, it means that some error occurred on the server, and you need to show a notification about it. In case a JSON array arrives, one of the keys of this array will be “Error”. Each time there is a check of this value, and if it is not zero, an error message is displayed to the user, otherwise this array contains the result of the user’s query (usually part of the template for updating information on the page).

function PostAction(URL, PostArray, SuccessFunction, ErrorFunction) { $.ajax({ type: 'POST', url: URL, data: PostArray, success: function(data) { try { Data = eval('(' + data + ')'); if ('Error' in Data) { if (Data['Error'] == 0) { SuccessFunction(); } else { ErrorFunction(Data['Error']); } } else { ErrorFunction('   '); } } catch(error) { ErrorFunction('   '); } }, error: function(AjaxRequest, Status) { switch (Status) { case 'timeout': ErrorFunction('   '); break; case 'error': ErrorFunction('   '); break; default: ErrorFunction('   '); break; } } }); } 


Admin panel


To be honest, I really don't like admin pages writing. The logic is simple: why write admin panel when you can edit data through phpmyadmin. At the initial stage, this can still work, but when the project is gaining momentum, the admin panel becomes very necessary. True, some functions in the admin panel are always lacking, since writing them is rather lazy :-)

I thought for a long time that I could put on the main admin page, but, apart from a small statistical information and a couple of buttons, I did not invent anything. Although, as practice shows, almost no attention is paid to this data.



On the “Companies” page you can find a list of all hosters and a button to add a new company. At each hoster, you can quickly add a tariff to a virtual server, a dedicated server or a discount, as well as edit or delete a company. Also, those hosters who have affiliate programs, you can see a link to go to billing.



To add a company a lot of time is not needed, the date of registration of the domain is determined automatically, the screenshot “pulls up” from a specialized service, or it can be downloaded from a file. From routine tasks - search for payment methods on the host site and register in billing to connect affiliate program.



Also, on the host page you can find all its tariffs for virtual and dedicated servers and quickly edit them.

The page with tariffs is completely similar to the lower block of tariffs on the host page, so I will not put a screenshot of this page, but I will tell you more about the page for adding a tariff.



This version of the tariff page is already the third one, the first two contained a much smaller number of parameters. At the moment, there are quite a few parameters, and adding tariffs is rather difficult. However, when adding tariffs of one hoster, the “Duplicate” function of Google Chrome browser helps a lot. Different tariffs quite often coincide with several parameters. For example, virtualization, country and possible OS are most often the same for a single group of tariffs. Therefore, the easiest way to add such tariffs is to fill in the same parameters for all tariffs and duplicate tabs in the browser.

I will not tell about the section with discounts and news, everything is pretty banal, I’ll show screenshots:



Next is the section for Looging Glass points.


Initially, the Looking Glass service I planned to do only to be able to check the speed of downloading files from virtual servers of hosters and executing ping, tracert and mtr commands. Now these points also serve to check whois to bypass the limit on the number of requests from a single IP address.



At any Looking Glass point, you need to specify the address, coordinates, IP addresses and specify which services this point provides.

The domain zone section is the longest of all. To compile such a list, iana was sparsen, and for each domain its whois server address was obtained.



After that, the solution to a complex problem began: for each zone, it was necessary to do a whois parsing. The difficulty lies in the fact that whois for each zone is different, so for each zone you need to determine which line is responsible for what. The php function strtotime comes to the rescue, which turns almost any string date into a unixtimestamp. It remains only to indicate in which line the registration date and the end date of the domain registration are written.



Unfortunately, the auction section was closed a couple of months after the opening due to low demand, so I will show only a screenshot.


That's all! Are you ready to show your admins?



PS Thank you andorro for help with preparing the text.

PPS I thank the hosting company VDSina.ru for supporting the project.

Source: https://habr.com/ru/post/239655/


All Articles