sudomesh / makenode

Configures new sudo mesh nodes
8 stars 8 forks source link

new makenode for sudowrt v0.3.0 (dispossessed) #30

Open paidforby opened 6 years ago

paidforby commented 6 years ago

Proposing to replace the makenode.js node script with a shell script, makenode.sh, based on the work done in https://github.com/sudomesh/sudowrt-firmware/pull/132 (dispossessed). It is essentially /opt/mesh/retrieve_ip rewritten to run on your local machine instead on the home node (i.e. use jq instead of jshn).

Pros: Fewer dependencies (curl and jq) that are easier to install.

Cons: Currently, does not send any info back to meshnode databse and only works with latest firmware build (http://builds.sudomesh.org/builds/sudowrt/dispossessed/0.3.0/) which still in unstable/testing. Could be adapted to work with v0.2.x, but that seems unnecessary and would just put us back into the situation of maintaining OpenWrt configs in two separate repos.

Suggestion: Any further configuration options (i.e. hostname, private SSID, passwords) should be added directly to /opt/mesh/autoconf NOT to makenode.sh, since any improvements made to autoconf could be utilized by makenode or peoplesopen-dash

paidforby commented 6 years ago

Actually, nevermind, not gonna merge because I would rather place this script in sudowrt-firmware. Otherwise this is a repo just for a shell script, not sure that makes sense.

bennlich commented 6 years ago

@paidforby this looks great! I can see how this would be useful for configuring a node in the case that you are unable to directly connect the node to a WAN connection with a LAN cable

Cons: Currently, does not send any info back to meshnode databse

Are you referring to the node operator name / address? To clarify, autoconfiguring nodes running 0.3.0 also do not send this info, correct?

I think this is probably okay. I imagine a future where such info (and more, like antenna type and direction) is sent to a database during install instead of during flash.


I wonder if it still needs to be called makenode, or if there is a better name for it now that it does less.


I am imagining a situation where you run this script, successfully fetch a mesh IP, but the ssh step at the end fails. I wonder if you should be able to run it again without accidentally requesting another ip from the database.

Maybe if the script detects that the node data json file already exists, it should prompt you to see if you want to use the existing mesh ip instead of fetching a new one?

Overall sweet deal!

bennlich commented 6 years ago

Actually, nevermind, not gonna merge because I would rather place this script in sudowrt-firmware. Otherwise this is a repo just for a shell script, not sure that makes sense.

I was wondering about that too. It's a weird situation because this script kind of lives between sudowrt-firmware and meshnode-db.