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

Suggestions about the project #101

Closed
heiye1024 opened this issue Nov 15, 2021 · 9 comments
Closed

Suggestions about the project #101

heiye1024 opened this issue Nov 15, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@heiye1024
Copy link

I like this project very much, and I suggest adding the following features:

  1. Traffic statistics function
  2. api interface
  3. Transactional database
@heiye1024 heiye1024 added the enhancement New feature or request label Nov 15, 2021
@donaldzou
Copy link
Owner

Hi @heiye1024 , thank you very much for your suggestions! I will definitely look into a better solution on the database, and I do have thoughts on creating an api interface ;) Could you elaborate on what you mean of Traffic statistics function? Cheers!!

@heiye1024
Copy link
Author

@donaldzou I am happy to wait for your return, the database can be recommended to use mongodb, about the traffic statistics, my advice is to periodical traffic statistics, such as is the day, month。

@donaldzou
Copy link
Owner

Hi! At the early stage of this project, I actually included all the traffic data inside the database. But then I figured out it might be using too much CPU for some system that have limited CPU. I'll consider reimplementing this functionality!

@heiye1024
Copy link
Author

In previous tests, it was found that there is a high probability of causing read and write exceptions when there are many clients, so it is highly recommended to deploy a separate database。

@donaldzou
Copy link
Owner

Yes I do notice this problem, I will fix this problem either using MongoDB or switching to a newer version of TinyDB (the current database). I believe the newer version do have caching for the database, so it reduced the number of disk IO.

@heiye1024
Copy link
Author

I would like to make a few more suggestions。

  1. bulk export and import of configuration files。
  2. automatic generation of client ip。

@ikidd
Copy link
Contributor

ikidd commented Nov 26, 2021

1: agree, this wouldn't be too hard to implement though you would want some safeguards to make sure you're importing the correct peer list to a server as the IP range would need to match.

Frankly on #2, I'd be happy to just have a pop up list of peer-name - IP of all current peers available when I'm setting up a new peer, or sidebar with all the currently used IPs. Though a DHCP service would be glorious, I haven't seen anyone integrate that into WG yet.

  1. I'd love to be able to build top level servers in the dashboard instead of having to drop to CLI.

@donaldzou
Copy link
Owner

1: agree, this wouldn't be too hard to implement though you would want some safeguards to make sure you're importing the correct peer list to a server as the IP range would need to match.

Frankly on #2, I'd be happy to just have a pop up list of peer-name - IP of all current peers available when I'm setting up a new peer, or sidebar with all the currently used IPs. Though a DHCP service would be glorious, I haven't seen anyone integrate that into WG yet.

  1. I'd love to be able to build top level servers in the dashboard instead of having to drop to CLI.

For building top level servers, I'm still considering would it be a good idea to implement this into the dashboard, since there will be writing configuration file directly into /etc/wireguard. Trying to figure a way to add a server thru the wireguard CLI. And for showing a list for available IP when adding is the next thing to implement ;)

@ikidd
Copy link
Contributor

ikidd commented Dec 29, 2021

I'd just write the /etc/wireguard/<new.tunnel>.conf file in plain text like you append peers currently. wg-quick start it like any other tunnel when you hit the slider button on the dashboard. Maybe add a button to every tunnel so you can choose whether it comes up on boot or not by executing a systemctl enable/disable wg-quick@<tunnelname>.

You'd want to validate the subnet used for the new tunnel against RFC private networks, and existing tunnel subnets. That could get a little involved. It would be similiar to the selection of a new address in a peer, where you'd want to suggest the next address available in that tunnel's subnet, and exclude existing ones. https://stackoverflow.com/questions/65351652/how-to-use-pythons-ipaddress-module-to-find-if-subnet-ip-is-within-a-bigger-sub. This could also be used to validate if a manually added peer IP is in the tunnel's address space.

Again, I know it's easy for me to armchair quarterback like this, wish I had the time to learn enough python to help.

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

No branches or pull requests

3 participants