Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flags and logos are not displayed #287

Open
Jayky opened this issue Oct 13, 2024 · 4 comments
Open

Flags and logos are not displayed #287

Jayky opened this issue Oct 13, 2024 · 4 comments

Comments

@Jayky
Copy link

Jayky commented Oct 13, 2024

Hi,

first of all: Thanks a lot for this great tool. I*m using it on an armbian with apache2 installed. The openvpn-monitor works but no logos nor flags are displayed. I've read about those issues (like #36) and non of the mentioned fixes worked for me.

I used for installation /var/www/html/openvpn-monitor, my logo is in the subdir images. I even tried to understand how the paths for the images are set in the .py script but my skills were not good enough.... What settings/configs or else should I send you, so that you could analyse what is not working?

@ynad
Copy link

ynad commented Nov 19, 2024

Hi,

first of all: Thanks a lot for this great tool. I*m using it on an armbian with apache2 installed. The openvpn-monitor works but no logos nor flags are displayed. I've read about those issues (like #36) and non of the mentioned fixes worked for me.

I used for installation /var/www/html/openvpn-monitor, my logo is in the subdir images. I even tried to understand how the paths for the images are set in the .py script but my skills were not good enough.... What settings/configs or else should I send you, so that you could analyse what is not working?

Logo img can either be a direct http link to an image, or a file located in images subdir. In this case, the config directive logo=logo.jpg must include only the filename, or an eventual sub-path under images folder.

See code around this line:

output('src="images/{0!s}"></a>'.format(self.logo))

Flags aswell are stored locally under images/flags/ subdir, but no config is needed AFAIK. Check if you have them. For me they are displayed correctly.

Of course you need to have a working geoip db, but you see that if locations are determined for the connected IPs.

@Jayky
Copy link
Author

Jayky commented Nov 20, 2024

Hi,

yes and that is the reason why I am looking for help here. I have my logo in images subdir. Also I checked images/flags/ subdir and it is filled with *.png files. My geoip DB works AFAIK due to a position is shown on the map, when a device is connected. Any further ideas? Just it case it could help, here are some system information:
grafik

@ynad
Copy link

ynad commented Nov 21, 2024

Hi,

yes and that is the reason why I am looking for help here. I have my logo in images subdir. Also I checked images/flags/ subdir and it is filled with *.png files. My geoip DB works AFAIK due to a position is shown on the map, when a device is connected. Any further ideas? Just it case it could help, here are some system information: grafik

Do files under images dir have correct file permissions? If it can't read them, you should see a warning log message on syslog or apache server logs.

I would try to manually run openvpn-monitor.py script in debug mode (if you use venv source it before):
python3 openvpn-monitor.py -d

It should print on stdout the HTML code result. Look for <img tags, check if src is pointing to the correct path. For instance mine is like this:
<img alt="Logo" style="max-height:46px; padding-top:3px;" src="images/logo.png">
Also note that logo should have have max-height:46px

Manually browse to the logo img, to see if you can see it in a browser:
http://myvpnserver/images/logo.png

The same for flags, in a browser navigate for example to:
http://myvpnserver/images/flags/gb.png

@Jayky
Copy link
Author

Jayky commented Nov 22, 2024

Hi,

so here are my results:
python3 /var/www/html/openvpn-monitor/openvpn-monitor.py -d

WARNING: Config file does not exist or is unreadable: ./openvpn-monitor.conf
INFO: Using config file: /etc/openvpn-monitor.conf
DEBUG: === begin section {'site': 'Wolken-VPN', 'logo': 'grey.png', 'latitude': '50.367', 'longitude': '8.75', 'maps': 'True', 'maps_height': '500', 'geoip_data': '/mnt/intern/files/GeoLite2-City_20241008/GeoLite2-City.mmdb', 'datetime_format': '%d/%m/%Y %H:%M:%S'} === end section
[...]
<a class="navbar-brand" href="#">
Wolken-VPN OpenVPN Status Monitor</a>
</div><div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav"><li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">VPN
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#wolken_vpn">Wolken VPN</a></li>
</ul></li>
<li><a href="#map_canvas">Map View</a></li>
</ul>
<a href="#" class="pull-right"><img alt="Logo"
style="max-height:46px; padding-top:3px;"
src="images/grey.png"></a>
</div></div></nav>
[...]

So yes, I've got a problem that is stated in the initial WARNING. What is mentioned there is strange, due to I have a config file in that directory. I had to solve that by creating a link in /etc that is pointing to that config file. But till now I have not found the reason for that.
Furthermore the image is not visible by a browser when I tried http://192.168.2.10/images/grey.png. The whole directory is owned by user www-data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants