Closed 0xAnon0602 closed 8 months ago
I think this is similar to the issue https://github.com/InternetHealthReport/ihr-website/issues/446.
Yeah seems similar So this is not planned for the website ?
it could be a nice feature to have but it is not completely straight forward to implement. If you already have something in mind please explain how you would implement that.
@romain-fontugne As I said we might need to use external API for collecting this data of user visiting the site, I've a great API in mind for it which is IP-API which has been in market for over 12 years and provides reliable data.
What's your view on it ?
Please provide a plan with details about the additions, including the APIs you will use, potential issues from the APIs (such as rate limits), and how you plan to implement the UI changes.
Using IP-API for Data
Reliable Service: IP-API has been a trusted provider of IP geolocation services since 2012, offering reliable and accurate data.
Rate Limit: The API provides a rate limit of 45 requests per minute from a single IP, which is more than sufficient for our needs as we only need to call it once from the client side.
UI Enhancements
What's your view on this ?
From the IP-API documentation, I want to emphasize the following points:
Got it I will try to check if there is any better solution for this :)
Hi @dpgiakatos ,
I'm trying to figure out how to use the Internet Yellow Pages (IYP) to find the Autonomous System Number (ASN) of an IP address. Is there a way to do this with just the IP address.
I was able do it with prefix of a IP address but I'm not sure how can I convert IP address to it's prefix. Any advice on the CYPHER Query or any guidance would be appreciated Thanks
With the following query you can obtain the corresponding AS number from an IP address:
MATCH (i:IP {ip: 'your ip'})-[:PART_OF]->(:Prefix)<-[:ORIGINATE]-(a:AS)
RETURN DISTINCT i.ip AS ip, a.asn AS asn
I was querying some IPs with the above CYPHER Query For some IPs it was able to return the ASN and for some IPs it said no record found.
What could be the reason behind it ?
We don't have all IP addresses in IYP, so it is not that easy to find the prefix that correspond to an IP. I don't know if neo4j/cypher has a mechanism to find the most specific prefix for a given IP (https://networklessons.com/cisco/ccna-200-301/longest-prefix-match-routing).
I see two options:
A hack would be to get from IYP a set of prefixes that starts with the same octets of the IP address and use something like this to find the exact prefix: https://www.npmjs.com/package/longest-prefix-match
Use RIPE's API: https://stat.ripe.net/data/network-info/data.json?resource=140.78.90.50
I don't mind using IP-API. Another way to get the public IP is again with RIPE: https://stat.ripe.net/data/whats-my-ip/data.json
So I can think of the following way to get the required data
To get the user IP we can use any of the 2 methods
Use the RIPE API
To get the ASN with IP address
Use RIPE API
To get the ASN info and other thing related to ASN
Use the Cypher Query with our IYP to retrieve the ASN info we received from the RIPE API.
What do you think of this approach ?
@romain-fontugne
Sounds good to me, let's use RIPE for both of the two first steps.
Can you please assign this issue to me so I can start working on it.
@dpgiakatos @romain-fontugne
As I've suggested 2 places above where we can add that User info on the homepage What do you think will be perfect place for it or you can suggest some better place for it ?
Actually, I think is better to create a new layout which will combine the title, the global report button and this new feature, than having a card in the landing page. For example, we can have the title and bellow, we can have a container with a vertical line separator. On the left we can have the global report button and on the right we can have this new feature.
I was able to add the RIPE API + IYP query to retrieve this data and display it on the landing page like this.
@dpgiakatos I'm not actually sure what do you mean by creating new layout. Can you please explain me more about it ? Thanks
By new layout, I mean a card/div something that can combine the information between title, global report and connection information. Also, a horizontal separator between global report and connection information should be better than a vertical one.
I'm not sure how that would be different from the layout I sent with the image above The Connection information is on right side and Global report button is on left side (
Thanks, that looks promising. have you tried to show the information below the main image and before the text 'The Internet Health Report monitors...'? maybe if we make it more horizontal with the information spanning two or three columns
and for the AS name I would prefer: AS123 - Name rather than: AS123 (Name)
Yeah I tried that but there was a lot of empty spaces So I tried it placing on the top and it looked perfect there for desktop view
For the mobile view I've added below the main image
Another way would be to blend it with the line: 'See latest alarms in the global report and network metrics in network reports.'
It would be nice if you send different examples, so we can decide what we prefer. I feel that the one you sent is a bit too intrusive
Sure I'll go through it and see if I can come up with any new idea
Meanwhile I've linked the UI changes I showed above in the #765 Let me know what you think of it
I have an idea to implement a feature on the main page of our website that will show details of the users accessing the website, such as ASN, country, and other information. From there, users can navigate directly to that ASN without searching for it.
This feature might help new users initially understand ASNs and other aspects without having to search for them. We might need to use some external APIs to obtain this information.
What are your thoughts on this?