donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python & Vue.js
https://donaldzou.github.io/WGDashboard-Documentation/
Apache License 2.0
1.63k stars 252 forks source link

Wireguard client config filename restrictions should be respected #446

Open tobox opened 3 weeks ago

tobox commented 3 weeks ago

I evaluated WGDashboard with a simple config and some test peers and everything worked properly. Then I created many users for my company with the naming scheme "Firstname Lastname Machinename" and distributed the config files.

It turned out that many people had problems importing the config files, because they need to match the regex ^[a-zA-Z0-9_=+. -]{1,15}$

It would be good to make sure that WGDashboard does not create invalid files that cannot be imported.

tobox commented 3 weeks ago

Strange. Now that I tried to reproduce the issue, the filenames do not contain spaces anymore after downloading the config file.

But there seems to be a limit of total filename length that sometimes causes problems, but not at 15 caracters on windows... There are different limits for different operating systems. So I guess that WGDashboard cannot do a lot more to fix this.

donaldzou commented 3 weeks ago

Hi! I'm sorry that encountered this issue. The logic of downloading the config file WGDashboard will replace all spaces and special characters with underscore, so theoretically it could go beyond 15 characters.

I would suggest just to include machine name as peer's name to save some spaces :)