rostegg / public-ip-gnome-extension

Tiny extension for gnome shell, which show public IP and nothing more
https://extensions.gnome.org/extension/1677/public-ip/
GNU General Public License v3.0
19 stars 8 forks source link

Custom domain to get IP information #20

Open mirabellette opened 4 years ago

mirabellette commented 4 years ago

Hello,

First of all, thank you very much for your extension, it works very well.

Is it possible to add an option to set a custom domain name to get the IP information ?

It should be very useful and helps to be more autonomous to tier services.

Best regards, Mirabellette

aminvakil commented 4 years ago

I'm not sure if it can be implemented as every ip information website uses its specific format to return ip and flag.

For example: https://ipapi.co/json/ & https://api.myip.com/

Unless the extension tries it best guessing normal responses and user verifies if it works correctly and use the ip provider.

rostegg commented 4 years ago

Hi, I already thought about adding customization (like custom services, icons, etc), even implemented a couple of functions.

There will be no problems with implementations, for example, let the list of services be in the yaml file, like this:

ip-service:
   endpoint: site.com
    type:http-get
    fields:
        country-code: "country-code-name2"
        ip: "another-service-ip-field-name"
    payload:
        ....

ip-service-2:
    endpoint: site2.com
    type:http-get
    fields:
        country-code: "country-code-name"
        ip: "ip-field-name"
    payload:
        ....

So it's easy to bind response fields.

But for now I want to wait for at least a little stable release of 3.38 shell version. With each minor version, they make changes that often break extensions and they have to be fixed. So, this update will be released only when I check it at 3.38 and make it compatible with previous versions.

When I make an acceptable working prototype, I'll drop a link to the branch here.

mirabellette commented 4 years ago

Thank you for your answers.

To be more precise, I don't really need the country information, I just need to know with which IP the default route of my computer is linked to.

For example, a website which returns the host IP is enough from the server side for me and if the extension is able to read it it is perfect.

From what I understand of your answer, it is scheduled so I have to wait.