markeclaudio / mikrotik-wireguard-config-generator

This allow to quick deploy wireguard configuration to mikrotik routerboards. You can create your own config visiting the website: https://markeclaudio.github.io/mikrotik-wireguard-config-generator/
https://markeclaudio.github.io/mikrotik-wireguard-config-generator/
Apache License 2.0
24 stars 7 forks source link

#3: appended PreSharedKey to client download config files #6

Closed mustaphazorgati closed 10 months ago

mustaphazorgati commented 10 months ago

@markeclaudio here you go. Refactored the blob generation for the config files and appended the PreSharedKey there aswell. Hopefully this is every spot :)

mustaphazorgati commented 10 months ago

I could refactor this further by using the variable interpolation. But this would limit the compatibility of this little script to ES6 compatible browsers. Since this is your repository I didn't want to do this without asking you first. What do you think? This would limit browser compatibility a little bit. See: https://caniuse.com/?search=es6

markeclaudio commented 10 months ago

Can we add a check before the code execution? If the browser doesn't support ES6 we execute the old code, else we will use variable interpolation

mustaphazorgati commented 10 months ago

Can we add a check before the code execution? If the browser doesn't support ES6 we execute the old code, else we will use variable interpolation

This polymorphism only adds complexity to the code, since we have to maintain both versions. In my opinion, the cost is too high for a small sugar sintax. I'd leave it as is. :)