Skip to content

Commit

Permalink
Merge pull request #77 from pkrll/dev/0.3.2
Browse files Browse the repository at this point in the history
Dev/0.3.2
  • Loading branch information
pkrll authored Jul 4, 2018
2 parents 9ec365d + b330fe8 commit 4a2639b
Show file tree
Hide file tree
Showing 36 changed files with 333 additions and 184 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@ system_reboot:

major:
ifeq ($(SERVICE), $(filter $(SERVICE),raspbot))
node .scripts/increment-version.js --version=major --skip-build --reset-minor --reset-patch --file=$(SERVICE)/package.json
node .assets/increment-version.js --version=major --skip-build --reset-minor --reset-patch --file=$(SERVICE)/package.json
else
@echo "ERROR:\tCould not increment major version."
@echo "USAGE:\tmake SERVICE=[raspbot] major"
endif

minor:
ifeq ($(SERVICE), $(filter $(SERVICE),raspbot))
node .scripts/increment-version.js --version=minor --skip-build --reset-patch --file=$(SERVICE)/package.json
node .assets/increment-version.js --version=minor --skip-build --reset-patch --file=$(SERVICE)/package.json
else
@echo "ERROR:\tCould not increment minor version."
@echo "USAGE:\tmake SERVICE=[raspbot] minor"
endif

patch:
ifeq ($(SERVICE), $(filter $(SERVICE),raspbot))
node .scripts/increment-version.js --version=patch --skip-build --file=$(SERVICE)/package.json
node .assets/increment-version.js --version=patch --skip-build --file=$(SERVICE)/package.json
else
@echo "ERROR:\tCould not increment patch version."
@echo "USAGE:\tmake SERVICE=[raspbot] patch"
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="docs/logo.png" data-canonical-src="docs/logo.png" width="65%"/>
<img src=".assets/logo.png" data-canonical-src=".assets/logo.png" width="65%"/>
</p>
<p align="center">
<a href="https://github.com/pkrll/Raspy/releases"><img src="https://img.shields.io/github/release/pkrll/raspy/all.svg?style=for-the-badge"></a>
Expand All @@ -8,11 +8,11 @@
<a href="https://github.com/pkrll/Raspy/search?l=javascript"><img src="https://img.shields.io/github/languages/top/pkrll/Raspy.svg?style=for-the-badge"></a>
</p>

<img src="docs/screenshot.png" data-canonical-src="docs/screenshot.png" align="right" width="350px"/>
<img src=".assets/screenshot.png" data-canonical-src=".assets/screenshot.png" align="right" width="350px"/>

Raspbot is a lightweight REST API server, designed for the **Raspberry Pi**, as well as a client web application that let's you control your device with ease.

Built with NodeJS & Express 4 and Vue 2 & Webpack.
Built with [NodeJS](https://github.com/nodejs/node) & [Express 4](https://github.com/expressjs/express/) and [Vue 2](https://github.com/vuejs/vue) & [Webpack](https://github.com/webpack/webpack).

**Raspbot is still a work in progress**.

Expand Down Expand Up @@ -48,6 +48,8 @@ Built with NodeJS & Express 4 and Vue 2 & Webpack.
* NodeJS (__recommended version 10.4.1+__)
* Python (__developed for version 2.7.10__)
* psutil library (__developed using version 5.4.3__)

**Optional(-ish):**
* PM2 (__required to update, restart or stop Raspbot remotely__)

## Installation
Expand Down Expand Up @@ -96,7 +98,7 @@ $ make start
┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬───────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼───────┼──────────┤
│ Raspbot │ 0 │ fork │ 13141 │ online │ 0 │ 0s │ 66% │ 13.9 MB │ pkrll │ disabled │
│ Raspbot │ 0 │ fork │ 13141 │ online │ 0 │ 0s │ 66% │ 13.9 MB │ pkrll │ disabled │
└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴───────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app

Expand Down Expand Up @@ -131,7 +133,7 @@ sudo env PATH=$PATH:[...] startup systemd -u USER --hp /home/USER
$ sudo env PATH=$PATH:[...] startup systemd -u USER --hp /home/USER
```

For more information on how to use PM2, check out **[the official documentation](http://pm2.keymetrics.io/docs/usage/cluster-mode/)** or **[this quickstart guide](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#manage-application-with-pm2)**.
For more information on how to use PM2, check out **[the official documentation](http://pm2.keymetrics.io/.assets/usage/cluster-mode/)** or **[this quickstart guide](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#manage-application-with-pm2)**.

## Usage

Expand Down
13 changes: 0 additions & 13 deletions raspbot/application/controllers/SystemController.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ exports.checkForUpdate = (req, res) => {
});
};

exports.launchBootstrapper = (req, res) => {
system.launchBootstrapper().then(response => {
const waitForLocalhost = require('wait-for-localhost');
(async () => {
await waitForLocalhost(5001);
res.json({success: true, result: response});
})();
}).catch(error => {
console.error(error);
res.status(500).json({success: false, error: {message: "Could not launch bootstrapper."}});
});
};

exports.reboot = (req, res) => {
console.log("Reboot requested.");
system.reboot().then(response => {
Expand Down
4 changes: 4 additions & 0 deletions raspbot/application/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ module.exports = app => {
res.status(404).send({ success: false, error: { message: "Not found." } });
});

router.get('/health', function(req, res) {
res.json({ success: true });
});

router.post('/login', (req, res) => {
auther.authenticate(req).then(token => {
res.json({ success: true, result: { token: token } });
Expand Down
2 changes: 1 addition & 1 deletion raspbot/dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name=apple-mobile-web-app-capable content=yes><link rel=apple-touch-icon sizes=120x120 href=/static/touch-icon-iphone-retina.png><link rel=apple-touch-icon sizes=180x180 href=/static/touch-icon-iphone-6-plus.png><link rel="shortcut icon" type=image/png href=/static/touch-icon-iphone-retina.png><title>Raspbot</title><link href=/static/css/app.f826d88ff0f388725e9c46d102d21756.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.1a94527dd96a4b6f8678.js></script><script type=text/javascript src=/static/js/app.9f83146faaf6331f5ff7.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name=apple-mobile-web-app-capable content=yes><link rel=apple-touch-icon sizes=120x120 href=/static/touch-icon-iphone-retina.png><link rel=apple-touch-icon sizes=180x180 href=/static/touch-icon-iphone-6-plus.png><link rel="shortcut icon" type=image/png href=/static/touch-icon-iphone-retina.png><title>Raspbot</title><link href=/static/css/app.4579c406da2f87b41b1470d519c65d0d.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.1a94527dd96a4b6f8678.js></script><script type=text/javascript src=/static/js/app.3afd866c91e8003c1caa.js></script></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions raspbot/dist/static/js/app.3afd866c91e8003c1caa.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions raspbot/dist/static/js/app.3afd866c91e8003c1caa.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions raspbot/dist/static/js/app.9f83146faaf6331f5ff7.js

This file was deleted.

1 change: 0 additions & 1 deletion raspbot/dist/static/js/app.9f83146faaf6331f5ff7.js.map

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions raspbot/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions raspbot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "raspbot",
"main": "server.js",
"version": "0.3.2",
"build": "14",
"build": "18",
"description": "Raspbot lets you control your Raspberry Pi.",
"author": "Ardalan Samimi <[email protected]>",
"license": "AGPL-3.0",
Expand All @@ -16,10 +16,10 @@
"dev:server": "nodemon",
"dev:client": "cd web && npm run dev",
"setup": "npm install && node .build/setup.js",
"build": "node ../.scripts/increment-version.js --file=package.json && cd web && npm install && npm run build",
"patch": "node ../.scripts/increment-version.js --file=package.json --version=patch --skip-build",
"minor": "node ../.scripts/increment-version.js --file=package.json --version=minor --skip-build --reset-patch",
"major": "node ../.scripts/increment-version.js --file=package.json --version=major --skip-build --reset-minor --reset-patch"
"build": "node ../.assets/increment-version.js --file=package.json && cd web && npm install && npm run build",
"patch": "node ../.assets/increment-version.js --file=package.json --version=patch --skip-build",
"minor": "node ../.assets/increment-version.js --file=package.json --version=minor --skip-build --reset-patch",
"major": "node ../.assets/increment-version.js --file=package.json --version=major --skip-build --reset-minor --reset-patch"
},
"dependencies": {
"bcrypt": "^2.0.1",
Expand All @@ -31,7 +31,6 @@
"lowdb": "^1.0.0",
"python-shell": "^0.5.0",
"remote-json": "^4.1.3",
"rimraf": "^2.6.2",
"wait-for-localhost": "^2.0.1"
"rimraf": "^2.6.2"
}
}
}
Loading

0 comments on commit 4a2639b

Please sign in to comment.