This is the welcome page and dashboard for PeoplesOpen.net home node owners. People can use this web app to check in on and configure their home nodes.
The Home page lets you set how much bandwidth you want to share on your public wifi network.
The Wifi Settings page lets you set the name and password for your private wifi network.
The Connections page shows you what computers are currently connected to your public and private networks. It also shows you if your node is connected to an exitnode (TODO: link to exitnode documentation).
This web app runs on home nodes. It uses OpenWRT's ubus interface to write to config files on the node. It also uses a script in
/cgi-bin to gather information about the node.
Clone the repo
npm installthe dependencies
Developing without a node
npm build-dev to build the web app in "development" mode. This configures the app to use stubbed API responses so that you can develop on your local machine (instead of on a home node).
npm start to start serving the app.
Writing new API calls
When adding a new ubus API call to the app (woo! you rock!), be sure to add a stubbed reply. This allows people to continue developing without having a home node on-hand.
Testing with a node
This is important if you are adding new pages that interface with ubus or cgi-bin.
Acquire a home node (see the walkthrough)
Connect to your home node's private network, either via the private SSID or by plugging directly into the private ethernet port
./publish-to-node.sh. This will build the app in production mode (i.e. stop using stubbed API replies) and copy the build directory to your node's
www/folder. It will ask for confirmation. You may want to
sshin and backup the existing
www/directory before doing this.
http://172.30.0.1and voila! Now you can test the real calls to ubus.
Developing with and without a node (kind of hacky)
If you want to serve the web app from your computer, but still point the app to a real home node, you can do this by disabling your browser's CORS checks.
npm build-prod to build the app for production.
npm start, but this time open Chrome with the --disable-web-security and --user-data-dir flags. You should be able to log into the control panel (you'll need the admin password of course) at localhost:3000 and see it live-update as you edit the code.
NOTE: "Developing with and without a node" does not reflect the real environment in which the app will be running (notably, your browser is running with non-standard security settings). Your ultimate test should involve copying the build/ directory over to your node as described above in "Testing with a node".
This is meant to be a pretty typical React-Redux application. You should be able to read about all the concepts used in the documentation for these libraries: