gluon-remote-node

Node Version of gluon remote
git clone git://archive.git.mtrnord.blog/MTRNord/gluon-remote-node.git
Log | Files | Refs | README | LICENSE

commit 717a665e06a601acd668bd4a3d6f8e140606f54e
parent 35bb15c369ced1952e1ff75f793cbce98a641248
Author: MTRNord <mtrnord1@gmail.com>
Date:   Fri, 17 Jun 2016 23:37:22 +0200

Add REAME.md and some small fixes

Diffstat:
RLICENSE -> LICENSE.md | 0
AREADME.md | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mbackend/commands.js | 1+
Mgluon_web_remote-MOL.js | 2++
Mgluon_web_remote-MOW.js | 2++
Mgluon_web_remote-changeContact.js | 2++
Mgluon_web_remote-changeGeo.js | 2++
Mgluon_web_remote-changeName.js | 2++
8 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/LICENSE b/LICENSE.md diff --git a/README.md b/README.md @@ -0,0 +1,77 @@ +# Gluon Web Remote + +An Tool to easily manage Freifunk Gluon Routers. (WIP) + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. + +### Prerequisities + +What things you need to install the software and how to install them + +``` +1. Install the Linux Package 'ssh-keygen' +2. clone the repository to anywhere you want +3. Edit the config/config.json file as your needs +``` + +### Running + +A step by step series of how to run the App + +Web: + +``` +Web isn't implemented yet. +``` + +Commandline: + +``` +Usage: npm start [options] [command] + + +Commands: + + changeName <ip> <ssh> [token] <newname> Change the Hostname of the router (no Formular support yet!) + changeContact <ip> <ssh> [token] <name> <email> Change the Contact of the router (no Formular support yet!) + MOL <ip> <ssh> <on/off> Activate or deactivate Mesh on Lan + MOW <ip> <ssh> <on/off> Activate or deactivate Mesh on Wan + changeGeo <ip> <ssh> [token] <lat> <long> <altitude> Change the Router Position (no Formular support yet!) + help [cmd] display help for [cmd] + +Options: + + -h, --help output usage information + +``` + +## Running the tests + +Test's not implemented yet + +## Built With + +* Commander - Commandline commands +* Expressjs - Web Server +* ssh-keygen - Genearating SSH-keys if needed +* sshclient - Libary for connecting Router over SSH + +//## Contributing + +//Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. + +## Versioning + +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). + +## Authors + +* **MTRNord** - *Initial work* - [MTRNord](https://github.com/MTRNord) + +See also the list of [contributors](https://github.com/MTRNord/gluon_web_remote_node/contributors) who participated in this project. + +## License + +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details diff --git a/backend/commands.js b/backend/commands.js @@ -124,6 +124,7 @@ var deactivateMOW = function (ip, key, cb) { })); } var changeGeo = function (ip, key, lat, long, alt, token, cb) { + var ccode = "placeholder" if (ccode === "ffnord" || ccode === "ffhh" || ccode === "ffhl") { //TODÃ’ Add formAPI } else { diff --git a/gluon_web_remote-MOL.js b/gluon_web_remote-MOL.js @@ -18,8 +18,10 @@ if (args.length === 3) { var switchPosition = args[3] if (switchPosition === "on") { backend.activateMOL(ip, key) + console.log("Mesh on Lan activated successfully!"); }else if (switchPosition === "off") { backend.deactivateMOL(ip, key) + console.log("Mesh on Lan deactivated successfully!"); } } diff --git a/gluon_web_remote-MOW.js b/gluon_web_remote-MOW.js @@ -18,8 +18,10 @@ if (args.length === 3) { var switchPosition = args[3] if (switchPosition === "on") { backend.activateMOW(ip, key) + console.log("Mesh on Wan activated successfully!"); }else if (switchPosition === "off") { backend.deactivateMOW(ip, key) + console.log("Mesh on Wan deactivated successfully!"); } } diff --git a/gluon_web_remote-changeContact.js b/gluon_web_remote-changeContact.js @@ -18,6 +18,7 @@ if (args.length === 4) { var name = args[3] var email = args[4] backend.changeContact(ip, key, name, email, "") + console.log("Contact changed successfully!"); } if (args.length === 5) { var ip = args[1] @@ -26,5 +27,6 @@ if (args.length === 5) { var name = args[4] var email = args[5] backend.changeContact(ip, key, name, email, token) + console.log("Contact changed successfully!"); } console.log(); diff --git a/gluon_web_remote-changeGeo.js b/gluon_web_remote-changeGeo.js @@ -19,6 +19,7 @@ if (args.length === 5) { var long = args[4] var alt = args[5] backend.changeGeo(ip, key, lat, long, alt, "") + console.log("Geolocation changed successfully!"); } if (args.length === 6) { var ip = args[1] @@ -28,6 +29,7 @@ if (args.length === 6) { var long = args[5] var alt = args[6] backend.changeGeo(ip, key, lat, long, alt, token) + console.log("Geolocation changed successfully!"); } console.log(); diff --git a/gluon_web_remote-changeName.js b/gluon_web_remote-changeName.js @@ -17,6 +17,7 @@ if (args.length === 3) { var key = args[2] var newname = args[3] backend.changeName(ip, key, newname, "") + console.log("Hostname changed successfully!"); } if (args.length === 4) { var ip = args[1] @@ -24,6 +25,7 @@ if (args.length === 4) { var token = args[3] var newname = args[4] backend.changeName(ip, key, newname, token) + console.log("Hostname changed successfully!"); } console.log();