H
Homarr10mo ago
Enric

VPN Status

Hi, is there a way to show what is my current VPN status in homarr? I would like to see what is the current external IP and country I'm connected to if possible. I'm using OpenVPN in my host machine.
Solution:
I was able to change the colors to match homarr's color theme using this specific src: https://geo.myip.ms/?colorBG=25262B&colorBorder=25262B&colorText=999999&colorLink=EEEEEE&width=452 you can change the colors and width to match your system (the infos shown here are through a vpn and it matches my vpn's address)...
No description
Jump to solution
26 Replies
Tag
Tag10mo ago
You could integrate an iframe to a website with an ip checker
Enric
Enric10mo ago
Hi Tag, I've tried that but it reports the external IP of the machine I'm using to browse Homarr, not the host running the container. I added an iframe pointing to http://ifconfig.me Maybe I should clarify my setup. I have a mini pc running multiple docker containers: homarr, jellyfin, qbittorrent, ... this mini pc uses OpenVPN. I connect to this mini pc from my desktop in another room through the browser and SSH. I can see that the VPN is running if I SSH and run curl ifconfig.me, but I'm looking for something more convenient so I don't have to SSH every time.
FatBiscuits
FatBiscuits10mo ago
Make script to run the commands and output to a web page. Add page to homarr.
Tag
Tag10mo ago
That's interesting, normally iframes should connect to your browser directly, not through the server. I'll try it on my end and get back to you :)
Enric
Enric10mo ago
Do you have some link/tutorial that explains how to do that sort of setup?
explosive parrot
SomeCommand > SomeFile.txt
Make a cronjob to repeat the command. Option 1 : put text file into website. Option 2 : print txt file into image with imagemagick
Tag
Tag9mo ago
Hi, I've checked and I can confirm that the IP you see is the ip from your browser and not the server. I suggest you use the following iframe: https://geo.myip.ms/?icon=small It is very nice, shows even the city you are in.
Tag
Tag9mo ago
You may find different stlyes here : https://myip.ms/info/freebox/Free_GEO_Information_Box_for_Your_Site.html including a dark mode iframe which is nice
Geo IP Adress Information Box for Your Site - User Location, Countr...
Add free ip address box on your website - show details on user ip address, geo ip, country, city, browser, os. Display it on interactive map. Absolutely Free
Solution
Tag
Tag9mo ago
I was able to change the colors to match homarr's color theme using this specific src: https://geo.myip.ms/?colorBG=25262B&colorBorder=25262B&colorText=999999&colorLink=EEEEEE&width=452 you can change the colors and width to match your system (the infos shown here are through a vpn and it matches my vpn's address)
No description
Enric
Enric9mo ago
Thanks a lot for the help! I managed to get it working 🙂
wein3967
wein39679mo ago
@Enric Did you manage to get this to show the VPN IP/country vs. the IP of the local machine you were accessing Homarr on? I am trying to do the same thing one widget showing my actual IP and one showing the VPN IP. I can't figure out how to have the iFrame show the VPN container IP (docker on a Synology).
Enric
Enric9mo ago
Hi! I used both advices. In one hand I used Tag's trick to see my PC's location with geo.myip.ms. And FatBiscuits tip to get the VPN IP by running a script into a web page. This one is quite a bit more involved if you are not used to that sort of set up (like me). ChatGPT gave me some tips on how to set it up, this link was also useful: https://medium.com/swlh/mini-project-deploying-python-application-with-nginx-30f9b25b195 I set up Nginx that serves a web page that executes a script to check the IP. I'm sure there must be a simpler way, but I'm a newbie 😅
Medium
Mini-Project: Deploying Python Application With Nginx
Deploying a clean and simple “Hello World” Python application with Nginx.
FatBiscuits
FatBiscuits9mo ago
That's awesome. You could also alert on that page being unavailable with some other tool, if that is a thing you care about.
pattagobi
pattagobi8mo ago
For me this just shows "page couldn't be reached, try again"
Tag
Tag8mo ago
Then it means that the page is blocked somehow. From what I see, the page is up and running and it's not part of any blocklist for dns-holes so I'm not sure why it would be.
pattagobi
pattagobi8mo ago
Geo.myip.ms But i can surf the site normally Although i will double check with pihole
Tag
Tag8mo ago
That's even weirder, can you access the link directly? Not in the iframe
pattagobi
pattagobi8mo ago
Yes i can Before that i tried with ipify.org, but couldn't manage to make it work. It just shows a blank white panel.
Tag
Tag8mo ago
That's weird, but I don't really know how to help you there.
pattagobi
pattagobi8mo ago
i restarted the container and it worked https://ipv4.wtfismyip.com/text -- this works
Tag
Tag8mo ago
Yeah, The point of the one I linked is that it displays a bit more info like the country and a bit more nicely presented. If that works for you then it's great
Tag
Tag8mo ago
Well, yeah, IPv6 isn't forced onto everyone yet so it's kinda hard to get it for now
ykg
ykg7mo ago
Do you mind showing what the end result looks like? Obviously obfuscating any personal info I too am looking for a VPN status indicator, but I only need tile for it that will constantly ping. The problem I'm running into is the VPN server is just an IP address, so while it is pingable, it's not an actual hosted URL so there's no URL to input into a tile for it to ping. I tried iFraming DNSChecker.org as a clunky workaround, but that site won't load via iFrame @Tag Is what I'm attempting possible?
No description
Enric
Enric7mo ago
Sure, here is a screenshot. The top iFrame points to the server I set up. In there I use ipgeolocation.io to have more info on the IP the VPN is connected to. The Flask script I'm using is something like this:
from flask import Flask, request
from datetime import datetime
import requests

app = Flask(__name__)

@app.route("/")
def main():
# API key for ipgeolocation redacted
geo = requests.get('https://api.ipgeolocation.io/ipgeo?apiKey=00000000000000').json()
current_time = datetime.now()
formatted_time = current_time.strftime('%H:%M:%S')
return "<body style='font-family: Verdana, Arial, Helvetica, sans-serif;background-color: #25262B; color: rgb(193, 194, 197); font-size: 18px;'> "<b>" + geo["ip"] + "</b> (" + geo["country_code2"] + " - " + geo["city"] + ") " + formatted_time + \
"</body>"

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0")
from flask import Flask, request
from datetime import datetime
import requests

app = Flask(__name__)

@app.route("/")
def main():
# API key for ipgeolocation redacted
geo = requests.get('https://api.ipgeolocation.io/ipgeo?apiKey=00000000000000').json()
current_time = datetime.now()
formatted_time = current_time.strftime('%H:%M:%S')
return "<body style='font-family: Verdana, Arial, Helvetica, sans-serif;background-color: #25262B; color: rgb(193, 194, 197); font-size: 18px;'> "<b>" + geo["ip"] + "</b> (" + geo["country_code2"] + " - " + geo["city"] + ") " + formatted_time + \
"</body>"

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0")
The other iFrame points to Myip.ms
No description
ykg
ykg7mo ago
Great! Thanks for the info
Want results from more Discord servers?
Add your server