subspacecommunity / subspace

A fork of the simple WireGuard VPN server GUI community maintained
MIT License
1.8k stars 131 forks source link

Possibility to set client config filename to download #198

Open rkul opened 3 years ago

rkul commented 3 years ago

to: @subspacecommunity/subspace-maintainers resolves: https://github.com/subspacecommunity/subspace/issues/118

Background

There is no way to change config filename, which clients download from UI

Changes

Testing

  1. Login to the subspace
  2. Add new device
  3. Download config for the newly created device
  4. Download config for the previously created device (before upgrade)
sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

gchamon commented 3 years ago

@rkul can't you just move the file, changing the name? or changing the name when downloading the file? ex: sudo mv ~/Downloads/wg0.conf /etc/wireguard/wg_example.conf

rkul commented 3 years ago

@gchamon for sure I can do that, but when I have multiple WG setups for different environments it is a little bit easier to [re]import a config with appropriate name

gchamon commented 3 years ago

I understand. Do you think it would be better to customize the connect message using the filename config? Strip the .conf from the filename var and put it in the message.

Another issue, is that it opens for misconfiguration. Filename must abide to linux naming rules. Do you think we should check that?

rkul commented 3 years ago

@gchamon it would be nice to have customized connect message. As for second point, please check my comment here https://github.com/subspacecommunity/subspace/issues/118#issuecomment-868344105 Actually there is no strict rules, user is able to rename the network device https://systemd.io/PREDICTABLE_INTERFACE_NAMES/ There is always a possibility for misconfiguration, but the default value wg0.conf should help to avoid most of the issues.

rkul commented 3 years ago

^[a-zA-Z0-9_=+.-]{1,15}$ should be enough to check interface name

mrnonz commented 3 years ago

I think this feature so useful.

Can't wait to new release!