vortex-5 / ddwrt-bwmon

An Individual Bandwidth Monitor For DD-WRT
171 stars 37 forks source link

Feature: Direct Mac Address Add #2

Closed vortex-5 closed 8 years ago

vortex-5 commented 9 years ago

Allow the user to directly assign a friendly mac address without needing to edit the mac-names.js file.

To do this we need to store an alternative name set in the active browser's cookies and then overwrite the MAC_NAMES dictionary.

As for the UI we will place an edit button that will inline change the MAC address field into a Text Box where the user will get a Ok and Cancel edit buttons. This is for users that need to frequently change the mac names.

fbakhashwain commented 8 years ago

wonderfull

fbakhashwain commented 8 years ago

What about having historical data about the usage and presenting it on graphs?

vortex-5 commented 8 years ago

It was a conscious decision not to include historical data. Router memory is limited and historical data would need to be loaded into ram to be presented and sendable.

There is another competing tool that may work better for you if you want historical data I believe it's called YAMon

Skrallexxx commented 8 years ago

Can't wait for direct mac address additions! Will be great. I'm about to try getting a newer ddwrt version with lighttpd installed on my router :)

EDIT: Okay, I installed DD-WRT build 28942, however I do not have a Web Server option under Services? How can I enable lighttpd another way?

vortex-5 commented 8 years ago

It depends on your firmware. DDWRT doesn't put this on their site but it seems the Lighttpd servers are only avalable on routers that have 32mb of flash.

I have a TPLink WR841N as well and that router lacks an Lighttpd option.

The script works fine without lighttpd I tried to make it so you won't be missing out on a lot as I got a lot of feedback with people that didn't have access to lighttpd.

On the Mac address editor in the page side there are some issues and descisions to be made I'll cover this in the next post so it's easier to reference.

vortex-5 commented 8 years ago

Mac Address inline editor considerations:

Right now the router is capable of automatically using your statically assigned DHCP to place names in the table. An addition check can be made to automatically resolve the dhcp hostname and assign that dnsmasq name for auto resolution. Note the intention is to only do this to the lighttpd version since the extra text processing if done by the router is more expensive and it would be nice to offload that to the web browser instead.

There is a fork by another user where they added this DHCP hostname resolution already and it doesn't require lighttpd so if you wish to incorporate it into a non lighttpd version I encourage you to consider forking this repository and patching in the changes.

Now for the decisions still being made

Option 1:

Option 2

Discussion

Option 1 Has the benefit of being more secure because we don't touch the router storage. I prefer this option but it odes mean that the configured mac addresses will become per router and per devices and they will not be synced.

Option 2 The benefit here is convenience since you are saving to the router's local file system any changes will persist to all browsers even after reboot so it's synced. Generally speaking because the way this script works there is no security on it it's not a good idea to let people write to the file system on the router it would be too easy to do a DOS attack and take down the router by just filling up the router's file system. Worse if the file system where the mac addresses are stored is placed in the router firmware and not the USB (some users have opted to do this) a malicious hacker may choose to wear out the epprom flash and brick your router. Additionally only people with lighttpd will have access to this and from the comments there are enough people without lighttpd builds that they would miss out on this feature.

For the time being the plan is to move forward with the first option of using only browser storage understanding the compromises of that decision however the implementation would be a bit more complex since I'll be merging the full list of available mac addresses to names with overrides in memory vs just add entries to the mac-names.js when using lighttpd.

BTW I don't have an ETA on this so I apologize if people are finding the development process slow. My main concern is I don't brick that fancy router that you bought so I tend to sit on a version test it for a month before I publish it for public use.

vortex-5 commented 8 years ago

So another user mentioned a better way of doing this and I think for the time being that would be a better solution than this way.

in issue #19 we discussed that it may be better to have mac-names.js just be a user override file.

and have all other names come from the static leases and dynamic leases instead with any values found there being overridden by the mac-names file.

After working on that version I don't see much need to do manual mac name entry so for the time being I'm going to consider this bug closed. I'll leave this bug open for a week in case other participants would like to suggest reasons this version is superior.

vortex-5 commented 8 years ago

No longer required there are a few other options such as addressing live dnsmasq reading and showing ip addresses that makes this no longer a desired feature.